Early access: these pages are being written and reviewed. Facts in the header boxes come straight from the product.
Create an invoice from a project's time entries
POST
/api/v1/projects/{id}/convert-time-to-invoice
const url = 'https://api.pitch2sale.com/api/v1/projects/example/convert-time-to-invoice';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"time_entry_ids":["example"],"invoice_metadata":{"additionalProperty":"example"},"force":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/projects/example/convert-time-to-invoice \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "time_entry_ids": [ "example" ], "invoice_metadata": { "additionalProperty": "example" }, "force": true }'Bills the given approved time_entry_ids on a new draft invoice. force skips the approval check and is reserved for admins and holders of the global timesheet permission.
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
time_entry_ids
required
Array<string>
invoice_metadata
object
key
additional properties
force
boolean
Examplegenerated
{ "time_entry_ids": [ "example" ], "invoice_metadata": { "additionalProperty": "example" }, "force": true}Responses
Section titled “Responses”The new invoice and the entries billed
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" } ]}Feature not available on the organization plan
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" } ]}