CreddotDocsCreddot Docs

Create an invoice draft

POST
/api/v1/invoices

Authorization

api-key
headerx-api-key<token>

Your API key: ck_test_... for test mode, ck_live_... for live. Send it with x-api-secret (or Authorization: Bearer ).

Header Parameters

x-api-secret?string

Recommended: API secret sent over HTTPS. You may send it as Authorization: Bearer instead. If supplied, x-timestamp and x-signature are not required.

x-timestamp?string

Legacy signed mode: Unix time in milliseconds; maximum clock skew five minutes.

x-signature?string

Legacy signed mode: HMAC-SHA256(secret, timestamp.METHOD.url.idempotencyKey.bodyHash).

x-idempotency-key*string

1–128 letters/digits or ._:-. Same key and payload replay for 24 hours; conflicting, in-flight, or expired keys return 409. Never change a key to retry an uncertain payment.

Request Body

application/json
  1. body
invoiceNumber*string

Unique within this business and environment.

Lengthlength <= 80
customerName*string
Lengthlength <= 120
customerEmail*string
Formatemail
customerPhoneNumber?|

Customer phone number in international E.164 format.

billingAddress?|null

Optional customer billing address printed on the invoice.

currency?string
Default"NGN"
items*array<>
Items1 <= items <= 100
taxMinor?string

Non-negative integer minor units.

Default"0"
discountMinor?string

Non-negative integer minor units. Cannot exceed subtotal plus tax.

Default"0"
dueAt?string

Optional payment due date. It must be in the future.

Formatdate-time
description?string
Lengthlength <= 5000

Response Body

application/json
  1. response
id*string
environment*string
Value in"SANDBOX""LIVE"
invoiceNumber*string
status*string
Value in"DRAFT""SENT""VIEWED""PAID""OVERDUE"
customerName*string
customerEmail*string
Formatemail
customerPhoneNumber*string|null
billingAddress*|null
issuer*

Immutable business identity and address captured when the invoice was created.

currency*string
subtotalMinor*string
taxMinor*string
discountMinor*string
totalMinor*string
description*string|null
dueAt*|
Formatdate-time
sentAt*|
Formatdate-time
paidAt*|
Formatdate-time
paymentLink*|null
items*array<>
createdAt*string
Formatdate-time
updatedAt*string
Formatdate-time
Example Request
curl -X POST 'https://api.creddot.com/api/v1/invoices' \  -H 'x-idempotency-key: string' \  -H 'Content-Type: application/json' \  -d '{  "invoiceNumber": "INV-2026-001",  "customerName": "Ada Okafor",  "customerEmail": "ada@example.com",  "items": [    {      "description": "Product design retainer",      "quantity": 2,      "unitAmountMinor": "250000"    }  ]}'
Example Response
{  "id": "string",  "environment": "SANDBOX",  "invoiceNumber": "string",  "status": "DRAFT",  "customerName": "string",  "customerEmail": "user@example.com",  "customerPhoneNumber": "+2348012345678",  "billingAddress": {    "addressLine1": "string",    "addressLine2": "string",    "city": "string",    "state": "string",    "postalCode": "string",    "countryCode": "NG"  },  "issuer": {    "name": "string",    "email": "user@example.com",    "address": {      "addressLine1": "string",      "addressLine2": "string",      "city": "string",      "state": "string",      "postalCode": "string",      "countryCode": "NG"    }  },  "currency": "string",  "subtotalMinor": "500000",  "taxMinor": "37500",  "discountMinor": "0",  "totalMinor": "537500",  "description": "string",  "dueAt": "2019-08-24T14:15:22Z",  "sentAt": "2019-08-24T14:15:22Z",  "paidAt": "2019-08-24T14:15:22Z",  "paymentLink": {    "id": "string",    "slug": "string",    "status": "ACTIVE",    "checkoutPath": "string"  },  "items": [    {      "id": "string",      "description": "string",      "quantity": 0,      "unitAmountMinor": "250000",      "totalAmountMinor": "500000"    }  ],  "createdAt": "2019-08-24T14:15:22Z",  "updatedAt": "2019-08-24T14:15:22Z"}