⚡️ Quickstart: create your first invoice
Create an invoice for a customer.
Prerequisites
- You have obtained a user access token by following the steps in the Authorization flow guide.
- You have created a customer with which to associate the invoice.
Create an invoice
curl 'https://staging.adfin.com/api/invoices' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {YOUR_USER_ACCESS_TOKEN}' \
--data '{
"invoiceNo": "INV-6666",
"customer":
{
"id": "{YOUR_CUSTOMER_ID}",
"externalId": ""
},
"description":"A Great Invoice",
"dueDate":"2024-12-04T00:00:00.000Z",
"issueDate":"2024-11-04T00:00:00.000Z",
"items": [
{
"description": "1st Line Item",
"quantity": "1",
"unitAmount": "2",
"taxRate": "10.0"
}
]
}'
Example response:
{
"id": "0d2616e5-5e38-4e23-9755-ab37d30dae08",
"invoiceNo": "INV-6666",
"description": "A Great Invoice",
"totalAmount": "2.2",
"taxAmount": "0.2",
"dueAmount": "2.2",
"dueDate": "2024-12-04T00:00:00.000UTC",
"issueDate": "2024-11-04T00:00:00.000UTC",
"creationTime": "2024-11-14T12:05:51.966UTC",
"lastUpdatedTime": "2024-11-14T12:05:51.966UTC",
"status": "DRAFT",
"statusReasonCode": "PENDING_ACTIVATION",
"customer": {
"id": "5874f3a4-2125-4c1c-bb5f-950955250121",
"name": "Chris Carty",
"creationTime": "2024-11-14T11:52:50.517UTC",
"people": [
{
"firstName": "Chris",
"lastName": "Carty",
"email": "chris@adfin.com",
"phoneNo": "+447654432234"
}
],
"addresses": [
{
"city": "London",
"postalCode": "12456",
"country": "UK",
"addressLine1": "8 Street"
}
],
"directDebitMandate": {
"status": "CREATED"
},
"timezone": "Europe/London"
},
"items": [
{
"description": "1st Line Item",
"quantity": 1,
"unitAmount": 2,
"taxRate": 10,
"taxAmount": 0.2,
"totalAmount": 2.2,
"externalData": []
}
],
"paymentRequests": [
{
"description": "A Great Invoice",
"amount": 2.2,
"payByDate": "2024-12-04T00:00:00.000UTC",
"creationTime": "2024-11-14T12:05:51.966UTC",
"lastUpdatedTime": "2024-11-14T12:05:51.966UTC",
"statusReasonCode": "PENDING_ACTIVATION",
"paymentLink": {
"url": "https://app.staging.adfin.com/pay/hHFo0nlT8Aev9kp2u0"
}
}
],
"creditNotes": []
}
Updated 29 days ago