The Create Invoice endpoint enables you to generate professional invoices for customers with products, payment terms, and delivery options. Invoices support multiple payment methods, automatic numbering, tax calculations, and optional payment link generation for seamless customer payment processing.

Endpoint Details

  • Method: POST
  • URL: /api/v0/invoices
  • Content-Type: application/json
  • Authentication: Required (API Key & Secret)
  • Rate Limiting: 100 requests per minute
  • Idempotency: Supported (recommended for invoice creation)

Authentication

This endpoint requires API key authentication using:
  • x-client-key: Your API client key
  • x-client-secret: Your API client secret

Request Parameters

Required Fields

FieldTypeDescriptionExample
namestringInvoice name/title”Website Development Services”
emailstringCustomer email addresscustomer@example.com
customer_idstring (UUID)Existing customer identifier”550e8400-e29b-41d4-a716-446655440000”
walletIdstring (UUID)Wallet for payment processing”abcd1234-5678-90ef-ghij-klmnopqrstuv”
itemsarrayProducts/services on the invoiceSee item structure below
due_datestring (date)Payment due date (YYYY-MM-DD)“2024-02-15”
deliveryenumDelivery method”EMAIL” or “MANUALLY”
payment_linkbooleanGenerate payment linktrue
payment_methodsarrayAccepted payment methods[“CRYPTO”, “BANK_TRANSFER”]
statusenumInvoice status”DRAFT” or “OPEN”
partial_paymentbooleanAllow partial paymentsfalse

Optional Fields

FieldTypeDescriptionExample
addressstringCustomer address”123 Business St, City, State”
phone_numberstringCustomer phone number”+1-555-123-4567”
send_datestring (date)Invoice send date (YYYY-MM-DD)“2024-01-15”
logostring (URL)Company logo URLhttps://example.com/logo.png
taxIdstring (UUID)Tax configuration ID”tax_550e8400-e29b-41d4”
currencyenumInvoice currency”USDC” (default)

Item Structure

Each item in the items array requires:
FieldTypeDescriptionExample
product_idstring (UUID)Product identifier”prod_550e8400-e29b-41d4”
quantitynumberQuantity of the product2

Enums

  • DRAFT - Invoice is being prepared
  • OPEN - Invoice sent and awaiting payment
  • PAID - Invoice has been paid
  • PASTDUE - Invoice is overdue
  • PARTIALLYPAID - Partial payment received
  • EMAIL - Send via email automatically
  • MANUALLY - Manual delivery/pickup
  • CRYPTO - Cryptocurrency payments
  • BANK_TRANSFER - Bank transfer/ACH
  • CREDIT_CARD - Credit card payments
  • CASH - Cash payments
  • MOBILE_MONEY - Mobile payment methods
  • ACH - ACH transfers
  • USDC - USD Coin (default)
  • EURC - Euro Coin

Request Examples

curl -X POST "https://api.devdraft.ai/api/v0/invoices" \
  -H "x-client-key: YOUR_CLIENT_KEY" \
  -H "x-client-secret: YOUR_CLIENT_SECRET" \
  -H "x-idempotency-key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Website Development Services",
    "email": "client@example.com",
    "customer_id": "550e8400-e29b-41d4-a716-446655440000",
    "walletId": "abcd1234-5678-90ef-ghij-klmnopqrstuv",
    "items": [
      {
        "product_id": "prod_123456789",
        "quantity": 1
      }
    ],
    "due_date": "2024-02-15",
    "delivery": "EMAIL",
    "payment_link": true,
    "payment_methods": ["CRYPTO", "BANK_TRANSFER"],
    "status": "OPEN",
    "partial_payment": false
  }'