Early access: these pages are being written and reviewed. Facts in the header boxes come straight from the product.
Attach a file to an invoice
POST
/api/v1/invoices/{id}/attachments
const url = 'https://api.pitch2sale.com/api/v1/invoices/example/attachments';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"file_name":"example","file_url":"https://example.com","file_size":1,"mime_type":"example","is_visible_to_client":true}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.pitch2sale.com/api/v1/invoices/example/attachments \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "file_name": "example", "file_url": "https://example.com", "file_size": 1, "mime_type": "example", "is_visible_to_client": true }'Registers an already uploaded file by URL; visible to the client by default.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”id
required
string
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
file_name
required
string
file_url
required
string format: uri
file_size
required
number
mime_type
required
string
is_visible_to_client
boolean
Responses
Section titled “Responses”The new attachment
Media typeapplication/json
object
attachment
required
object
_id
required
string
key
additional properties
any
Examplegenerated
{ "attachment": { "_id": "example" }}Validation failed
Media typeapplication/json
object
error
required
string
code
string
message
string
details
Array<object>
object
field
required
string
message
required
string
code
required
string
Examplegenerated
{ "error": "example", "code": "example", "message": "example", "details": [ { "field": "example", "message": "example", "code": "example" } ]}Authentication required or token invalid
Media typeapplication/json
object
error
required
string
code
string
message
string
details
Array<object>
object
field
required
string
message
required
string
code
required
string
Examplegenerated
{ "error": "example", "code": "example", "message": "example", "details": [ { "field": "example", "message": "example", "code": "example" } ]}Role permission or token scope missing
Media typeapplication/json
object
error
required
string
code
string
message
string
details
Array<object>
object
field
required
string
message
required
string
code
required
string
Examplegenerated
{ "error": "example", "code": "example", "message": "example", "details": [ { "field": "example", "message": "example", "code": "example" } ]}Rate limit exceeded
Media typeapplication/json
object
error
required
string
code
string
message
string
details
Array<object>
object
field
required
string
message
required
string
code
required
string
Examplegenerated
{ "error": "example", "code": "example", "message": "example", "details": [ { "field": "example", "message": "example", "code": "example" } ]}