Create an invoice
Changed onCreate an invoice and email it to the customer, or schedule it with scheduledSendDate. See Create an invoice.
post/v2/invoices
Request
- Base URLhttps://api.slash.com
- URLhttps://api.slash.com/v2/invoices
- AuthAPI key in header X-API-Key
Headers
X-Idempotency-Keystring required
Unique caller-generated key for one create request. Once an authenticated, schema-valid request reaches the operation, the key is permanently consumed for that operation and legal entity whether the operation succeeds or fails. Reusing it in that scope returns 409 and never replays a response, unlike API v1, which replays the original response for a matching key.
Request body
Example request
{
"number": "INV-1042",
"timezone": "America/New_York",
"lineItems": [
{
"name": "Robot arm maintenance",
"quantity": 2,
"unitAmount": {
"amount": 45000
}
}
],
"discount": {
"percent": 10
}
}Response
The created invoice.
Example response
{
"id": "inv_2rj4l7hmrrrcv",
"number": "INV-1042",
"customerId": "le_cus_2rj4l7hmrrrcv",
"accountId": "sa_group_2rj4l7hmrrrcv",
"timezone": "America/New_York",
"lineItems": [
{
"name": "Robot arm maintenance",
"quantity": 2
}
],
"discount": {
"percent": 10
},
"taxRate": 8.5,
"payments": [
{
"id": "inv_tr_link_2rj4l7hmrrrcv",
"transactionId": "agg_tx_2rj4l7hmrrrcv"
}
],
"documentId": "st_2rj4l7hmrrrcv"
}Changes
- info
endpoint added
- info