Skip to content

Invoices

Invoices are drafted, sent to customers, and paid via a checkout link. An invoice goes through a defined lifecycle: draft → sent → paid | cancelled.

Object

json
{
  "id": "uuid",
  "merchant_id": "uuid",
  "customer_id": "uuid",
  "invoice_number": "INV-000042",
  "title": "March Consulting Invoice",
  "description": null,
  "status": "draft",
  "amount": 200000000,
  "currency": "USDC",
  "due_date": "2026-04-15",
  "line_items": [
    { "description": "Consulting — March", "quantity": 1, "unit_price": 200000000, "total": 200000000 }
  ],
  "subtotal": 200000000,
  "tax_rate": 0,
  "tax_amount": 0,
  "recipient_note": null,
  "checkout_id": null,
  "paid_at": null,
  "paid_amount": null,
  "created_at": "2026-03-16T10:00:00Z",
  "updated_at": "2026-03-16T10:00:00Z"
}

Status values: draft | sent | paid | cancelled


Create Invoice

http
POST /v1/invoices

Body

FieldTypeRequiredDescription
titlestringInvoice title
customer_iduuidAttach existing customer
customer_namestringInline customer name (required if no customer_id)
customer_emailstring
customer_countrystringISO 3166-1 alpha-3 (e.g. SGP, USA)
descriptionstringExtended description
currencystringDefault: USDC
line_itemsarrayLine items array. See below
amountintegerTotal amount in 6dp. Use instead of line_items for a simple fixed amount
due_datestringISO 8601 date YYYY-MM-DD
recipient_notestringNote shown to the customer on the invoice
subtotalintegerPre-tax amount in 6dp. Triggers tax calculation
tax_rateintegerManual tax rate in basis points (0–10000). e.g. 1000 for 10%. Used with subtotal
merchant_iduuidReseller only. Create this invoice on behalf of another merchant. See Reseller

Line item fields:

FieldTypeRequired
descriptionstring
quantityinteger
unit_priceinteger

Example

bash
curl -X POST https://api-test.dpt.xyz/v1/invoices \
  -H "Authorization: Bearer dptb_..." \
  -H "Content-Type: application/json" \
  -d '{
    "title": "March Consulting Invoice",
    "customer_email": "[email protected]",
    "customer_name": "Acme Corp",
    "currency": "USDC",
    "due_date": "2026-04-15",
    "line_items": [
      { "description": "Consulting — March", "quantity": 1, "unit_price": 200000000 }
    ]
  }'

List Invoices

http
GET /v1/invoices

Get Invoice

http
GET /v1/invoices/{id}

Activate Invoice (Send to Customer)

Transitions from draft to sent and generates a hosted checkout link.

http
POST /v1/invoices/{id}/activate

Body (optional)

FieldTypeDescription
success_urlstringRedirect URL after successful payment
cancel_urlstringRedirect URL on cancellation

Response 200

json
{
  "invoice": { /* Invoice object */ },
  "checkout": { /* Checkout object with hosted_url */ }
}

Cancel Invoice

http
DELETE /v1/invoices/{id}

Only draft or sent invoices can be cancelled. Returns 204 No Content.

DPT Merchant API