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",
  "number": "INV-0042",
  "status": "draft",
  "customer_id": "uuid",
  "customer_name": "Acme Corp",
  "customer_email": "billing@acme.com",
  "line_items": [
    { "description": "Consulting — March", "quantity": 1, "unit_price": 200000000, "total": 200000000 }
  ],
  "subtotal": 200000000,
  "tax_rate": 0,
  "tax_amount": 0,
  "total": 200000000,
  "currency": "USDC",
  "due_date": "2026-04-15",
  "created_at": "2026-03-16T10:00:00Z"
}

Status values: draft | sent | paid | cancelled


Create Invoice

http
POST /v1/invoices

Body

FieldTypeRequiredDescription
customer_iduuidAttach existing customer
customer_namestringInline customer name
customer_emailstring
customer_countrystring
currencystringDefault: USDC
line_itemsarraySee below
due_datestringISO 8601 date YYYY-MM-DD
tax_ratenumberApplied to subtotal, e.g. 0.1 for 10%

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 '{
    "customer_email": "billing@acme.com",
    "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
methodstringcrypto (default) or fiat
send_emailboolSend email to customer. Default: true

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