createOrder

Create an order

​

Creates an order for a customer with one or more lines. Each line is priced by the charges you list in its attributes, else by the plan you name in planId, else by the product's default plan. The order is a draft unless creationState is active, in which case it is activated straight away (see Activate an order). Seat-based charges get one seat per unit, at most 10,000 per charge. Answers 400 for invalid fields, a planId that isn't a plan of the line's product, or a billingContactIds entry that isn't a contact of the customer or of billingCustomerId; 404 for an unknown customer, product or billingCustomerId; 409 DUPLICATE_EXTERNAL_ID when another order has your externalId; and, for an order created active, 409 CUSTOMER_HAS_ACTIVE_ORDER or ORDER_BILLED_IN_STRIPE as Activate an order does, in which case nothing is created.

Body·

required
application/json

Billing terms you can set on an order.

Responses

  • application/json
  • application/json
  • application/json
  • application/json
Request Example for post/orders
curl https://billing.getspondo.com/api/v1/orders \
  --request POST \
  --header "Authorization: Bearer $SPONDO_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{
    "customerId": "cus_Q2x9vB7mK4pT1sLw",
    "name": "DocuMind Growth",
    "externalId": "acme-legal-2026",
    "startDate": "2026-10-01",
    "creationState": "active",
    "paymentTerms": "Net30",
    "billingAnchor": 1,
    "purchaseOrderReference": "PO-2026-0187",
    "lines": [
      {
        "productId": "prod_7Hk2LmQ9xR4tVb1N",
        "planId": "plan_4Fd8sK1mW9qZ2xCv",
        "attributes": [
          { "name": "Platform fee" },
          { "name": "Document uploads" },
          { "name": "Seats", "quantity": 10 }
        ]
      }
    ]
  }'

{
  "id": "ord_8Jt3Vw0Ym5Ln2Qp7",
  "customerId": "cus_Q2x9vB7mK4pT1sLw",
  "billingCustomerId": null,
  "billingContactIds": [],
  "createdAt": "2026-10-01T09:30:12.000Z",
  "updatedAt": "2026-10-01T09:30:12.000Z",
  "endDate": null,
  "name": "DocuMind Growth",
  "startDate": "2026-10-01T00:00:00.000Z",
  "subscriptionTerms": null,
  "billedAmountNoTax": 0,
  "billedTax": 0,
  "estimatedTax": 0,
  "orderAmount": 749,
  "pendingBillingAmount": 749,
  "totalAmount": 749,
  "totalBilledAmount": 0,
  "creationState": "active",
  "paymentTerms": "Net30",
  "number": 42,
  "metadata": null,
  "showPaymentLink": null,
  "showBankDetails": null,
  "autoPostInvoices": null,
  "autoSendBillingEmails": null,
  "autoSendPaymentEmails": null,
  "version": 1,
  "billingFrequencyOverridden": false,
  "billingFrequencyCustomMonths": null,
  "purchaseOrderReference": "PO-2026-0187",
  "status": "active",
  "billingAnchor": 1,
  "currency": "USD",
  "billedThrough": null
}