Skip to content

Make an invoice

POST
/api/v1/invoices
curl --request POST \
--url https://digize.com/api/v1/invoices \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: 5f1c2a8e-3b7d-4c55-9a0e-1f2d3c4b5a69' \
--header 'x-api-key: <x-api-key>' \
--data '{ "contactId": "ct_01JF3Z8Q4R6M2W9T5V7X1Y3B4C", "lines": [ { "description": "Ethiopia Guji, 5 lb bag", "quantity": 4, "unitPrice": 6500 } ], "notes": "Thanks for your order.", "send": true }'

Drafts an invoice for a contact with the next number. Tax rate and due date default to the CRM settings’. With send, it’s sent straight away.

Needs the crm:write permission.

Idempotency-Key
string
>= 1 characters <= 255 characters

Makes the request safe to send again: for 24 hours the same key and request answer the first response without repeating the change.

Example

5f1c2a8e-3b7d-4c55-9a0e-1f2d3c4b5a69
Media typeapplication/json
object
contactId
required
string
>= 1 characters <= 64 characters
company
Any of:
string
<= 120 characters
lines
required
Array<object>
>= 1 items <= 100 items
object
id
string
<= 64 characters
description
required
string
<= 500 characters
quantity
required
number
> 0 <= 100000
unitPrice
required

In the workspace currency’s minor unit: 2000 is $20.00.

integer
<= 100000000
discount

In the workspace currency’s minor unit: 2000 is $20.00.

integer
<= 100000000
taxRate
number
<= 100
notes
Any of:
string
<= 2000 characters
issuedAt
string format: date-time
dueAt
string format: date-time
send
boolean

Example

{
"contactId": "ct_01JF3Z8Q4R6M2W9T5V7X1Y3B4C",
"lines": [
{
"description": "Ethiopia Guji, 5 lb bag",
"quantity": 4,
"unitPrice": 6500
}
],
"notes": "Thanks for your order.",
"send": true
}

Done

Media typeapplication/json
object
id
required
string
number
required
string
contact
required
object
id
required

The contact’s id.

string
name
required
string
email
required
string
company
required
string | null
lines
required
Array<object>
object
id
required
string
description
required
string
quantity
required
number
unitPrice
required

In the workspace currency’s minor unit: 2000 is $20.00.

integer
<= 100000000
discount
required

Taken off the subtotal before tax.

integer
<= 100000000
taxRate
required

Percent: 8.25 is 8.25%.

number
notes
required
string | null
status
required
string
Allowed values: draft sent viewed paid overdue void
issuedAt
required
string format: date-time
dueAt
required
string format: date-time
sentAt
required
Any of:
string format: date-time
viewedAt
required
Any of:
string format: date-time
paidAt
required
Any of:
string format: date-time
paymentUrl
required

Where the customer pays it online.

string
emailed
required

Whether it went by email; false without a sending domain.

boolean

Example

{
"status": "draft"
}

What was sent isn’t valid (invalid).

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid unauthorized forbidden not_found conflict too_large rate_limited unavailable internal
message
required
string
details
object
key
additional properties
any

Example

{
"error": {
"code": "invalid"
}
}

No key, or one that’s unknown, off or expired.

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid unauthorized forbidden not_found conflict too_large rate_limited unavailable internal
message
required
string
details
object
key
additional properties
any

Example

{
"error": {
"code": "invalid"
}
}

The key doesn’t have the permission this needs.

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid unauthorized forbidden not_found conflict too_large rate_limited unavailable internal
message
required
string
details
object
key
additional properties
any

Example

{
"error": {
"code": "invalid"
}
}

Nothing has that id (not_found).

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid unauthorized forbidden not_found conflict too_large rate_limited unavailable internal
message
required
string
details
object
key
additional properties
any

Example

{
"error": {
"code": "invalid"
}
}

A request with the same Idempotency-Key is still running (conflict).

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid unauthorized forbidden not_found conflict too_large rate_limited unavailable internal
message
required
string
details
object
key
additional properties
any

Example

{
"error": {
"code": "invalid"
}
}

The Idempotency-Key was used with a different request.

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid unauthorized forbidden not_found conflict too_large rate_limited unavailable internal
message
required
string
details
object
key
additional properties
any

Example

{
"error": {
"code": "invalid"
}
}

Over the rate limit; see retry-after.

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid unauthorized forbidden not_found conflict too_large rate_limited unavailable internal
message
required
string
details
object
key
additional properties
any

Example

{
"error": {
"code": "invalid"
}
}