Create invoice

Creates an invoice, records it as an unpaid payment and emails it to the customer with a link to pay. A retry with the same clientId returns the existing invoice and sends nothing. Requires a live API key and a connected Stripe account.

POST/v1/invoices/

Authorization

api_key_auth
AuthorizationBearer <token>

API key authentication. Use "Bearer YOUR_API_KEY" format.

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

  • Either { id } for an existing customer or { email, name } for a new one, optionally with a company name, billing address and tax ID. A new email that already belongs to a customer of this seller reuses that customer and only fills in the details it lacks.

  • currencystringrequired

    Three-letter ISO 4217 code, case-insensitive. One of: usd, aed, aud, brl, cad, chf, clp, czk, dkk, eur, gbp, hkd, inr, jpy, mxn, myr, nok, nzd, php, pln, ron, sek, sgd, zar, thb.

    exactly 3 characters

  • taxRateIdstring

    A fixed merchant tax rate to apply to the whole invoice. Omit for no tax.

    ^[0-9a-fA-F]{24}$

  • couponIdstring

    One of the seller's coupons, discounting the whole invoice. A coupon limited to pages or ticket types is refused: an invoice has no page. Sending the invoice counts a redemption, voiding it gives the redemption back.

    ^[0-9a-fA-F]{24}$

  • Fees added after any discount and before tax, in the order they should print.

    max 100 items

  • Line items in the order they should print.

    1 to 100 items

  • dueDatestringrequired

    date

  • timeZonestring

    IANA timezone the invoice is dated in: it sets which day the invoice is issued on and when it becomes overdue. Omit for UTC.

  • poNumberstring

    The customer's purchase order number, printed in the Bill to block.

    max 50 characters

  • notesstring

    Free text printed on the invoice PDF only.

    max 2000 characters

  • bankDetailsstring

    Bank details printed on this invoice's PDF in place of the store's. Omit to use the store's, copied onto the invoice when it is sent.

    max 2000 characters

  • internalMemostring

    A private note for the seller. Never printed on the invoice, emailed or shown to the customer.

    max 2000 characters

  • ccstring

    Up to 49 addresses, separated by commas, copied on every email about the invoice: the invoice email and its resends, the overdue reminder, and the payment, cancellation and refund emails. Stored lowercased, without repeats. Not saved as customers.

  • emailSubjectstring

    Subject of the invoice email. Omit for the default, Invoice {number} from {store}.

    max 200 characters

  • emailMessagestring

    The note at the top of the invoice email. Plain text, line breaks kept. Omit for no note.

    max 10000 characters

  • includePayLinkboolean

    Whether the invoice email and PDF link to the hosted payment page. Defaults to true. Set false when the customer pays by bank transfer and you record the payment yourself.

  • clientIdstring

    Retry key: a 24-character hex id (an ObjectId) you generate, which becomes the payment id. A retry with the same id returns the existing invoice and sends nothing, or finishes and sends one that stopped partway. Omit it and every call creates and sends a new invoice.

    ^[0-9a-fA-F]{24}$

Returns

Invoice created and sent

  • Invoice for a payment (Charge) on the Checkout Page account.

    • idstring

      Unique identifier for the invoice.

    • sellerIdstring

      Seller account that owns this invoice.

    • customerId?string, nullable

      Customer record this invoice belongs to. For full customer profile fields (company, phone, tax ID), call get_customer with this id.

    • chargeId?string, nullable

      Originating payment (Charge) that generated this invoice. Refund details beyond amountRefunded, such as lastRefundAt and lastRefundReason, are on that payment or booking (see chargeType).

    • chargeType?string, nullable

      Whether chargeId is a payment (from a checkout page) or a booking (from an event page). Absent when the invoice has no charge.

      paymentbooking
    • livemodeboolean

      True for live-mode invoices; false for test-mode invoices. Test- and live-mode data are isolated.

    • currencystring

      ISO 4217 currency code (lowercase, e.g. "usd", "gbp", "eur").

    • amountnumber

      Total invoice amount in the smallest currency unit (e.g. 10661 USD = $106.61, 500 JPY = ¥500). Divide by 100 before displaying, except for zero-decimal currencies like JPY.

    • amountRefunded?number, nullable

      Total refunded against this invoice, in the smallest currency unit. A refund updates this invoice in place and is documented on a credit note numbered after it (e.g. "2026-000010-CN-01"). Refund details such as the reason live on the originating payment or booking (chargeId).

    • amountUsd?number, nullable

      Total amount converted to USD at the time of the invoice, in the smallest currency unit (cents).

    • amountPaid?number, nullable

      Amount paid in the smallest currency unit. Equal to amount when status is "paid".

    • amountDue?number, nullable

      The outstanding balance, in the smallest currency unit. A voided or partially refunded invoice can keep one too, so use status to tell whether it is still being collected.

    • amountExcludingTax?number, nullable

      Subtotal of the invoice excluding tax, in the smallest currency unit.

    • taxAmount?number, nullable

      Total tax amount on the invoice in the smallest currency unit.

    • Per-line-item tax breakdown. Use this when a customer asks how tax was calculated.

    • taxSource?string, nullable

      How tax was calculated: "stripe_tax" (Stripe Tax service) or "fixed_tax_rate" (merchant-defined rates). Null when the invoice has no tax.

      fixed_tax_ratestripe_tax
    • Historical snapshot of the merchant tax rates that applied at the time of the invoice. Preserved even if the merchant later edits or deletes the rate.

    • statusstring

      Invoice status. "paid": payment was collected. "open": outstanding. "uncollectible": the seller has written it off as a bill the customer is not expected to pay; the customer can still pay it, and it can still be voided. "refunded": fully refunded. "partially_refunded": partly refunded. "void": cancelled. "draft": not yet finalised. A payment or refund after the invoice was issued updates its status and amounts in place, so a payment keeps one invoice; each refund is also documented on a credit note numbered after the invoice (e.g. "2026-000010-CN-01").

      draftopenpaiduncollectiblerefundedpartially_refundedvoid
    • source?string, nullable

      invoice when the merchant created and sent it by hand, from the dashboard or the API. Absent for invoices generated for a checkout payment.

      checkoutinvoice
    • Itemised list of products, variants, setup fees, and tickets on the invoice. Use when a customer asks what they were charged for.

    • subtotal?number, nullable

      Sum of line items before discount and tax, in the smallest currency unit.

    • subtotalAfterDiscount?number, nullable

      Subtotal after bulk, coupon and complimentary discounts, before tax, in the smallest currency unit.

    • Quantity-based discount applied to the invoice, when one was in effect.

    • complimentaryDiscountAmount?number, nullable

      Discount that brought a complimentary booking's total to 0, in the smallest currency unit. Absent otherwise.

    • Additional fees on the invoice (e.g. shipping, processing).

    • What the customer chose to add to cover the processing fee, added after tax and never taxed. Not one of fees.

    • Coupon applied to the invoice. Use when a customer asks about a discount on their invoice — code and label identify it; amountOff or percentOff describe the discount.

    • poNumber?string, nullable

      Customer-supplied purchase-order number. Filterable via the poNumber query param.

    • poNumberLabel?string, nullable

      Merchant-defined label for the PO number field (e.g. "Purchase Order", "Reference").

    • dueDate?string, nullable

      ISO-8601 UTC due date. Set on invoices the merchant created by hand; checkout-generated invoices derive theirs from the invoice settings and leave this unset.

      date-time

    • notes?string, nullable

      Free text the merchant added to a hand-created invoice, printed on the PDF.

    • timeZone?string, nullable

      IANA timezone a hand-created invoice is dated in, which set its day of issue and sets when it becomes overdue. Unset means UTC.

    • invoiceUuid?string, nullable

      Stable UUID for the invoice, used in invoice URLs.

    • invoiceNumber?string, nullable

      Human-readable invoice number (e.g. "2026-000010"). Use when a customer asks for their invoice number.

    • invoiceUrl?string, nullable

      Presigned hosted URL for the invoice PDF, safe to share with the buyer. Expires 1 hour after the response is generated — re-list or re-fetch the invoice to obtain a fresh URL. Absent for invoices that have no generated PDF (e.g. drafts).

    • Buyer billing details captured at checkout (name, email, phone, address, tax ID). May be empty for digital products.

    • Seller registration details on the invoice (name, email, tax ID, address). Use when a customer asks about the seller's tax registration.

    • customerName?string, nullable

      Customer name on the invoice. Denormalised from the Charge (preferred) or Customer record. Filterable via the customerName or search query params.

    • customerEmail?string, nullable

      Customer email on the invoice. Denormalised from the Charge (preferred) or Customer record. Filterable via the customerEmail or search query params.

    • productTitle?string, nullable

      Title of the first product line item on the invoice. Denormalised for search and filtering.

    • createdAtstring

      ISO-8601 UTC timestamp the invoice was created.

      date-time

    • updatedAtstring

      ISO-8601 UTC timestamp the invoice was last updated.

      date-time

Bad request - Invalid request parameters, a test-mode API key (invoices need a live key), an unknown tax rate, a coupon that cannot be used on an invoice, a total below the smallest amount Stripe can charge, or no connected Stripe account

  • statusstring

    Indicates the request failed.

    error
  • typestring

    Machine-readable error category.

  • messagestring

    Human-readable error message.

  • Optional validation details for invalid requests.

Unauthorized - Missing or invalid API key

  • statusstring

    Indicates the request failed.

    error
  • typestring

    Machine-readable error category.

  • messagestring

    Human-readable error message.

  • Optional validation details for invalid requests.

The account is disabled or over its plan limit; the customer is blocked; or the API key lacks the required permission

  • statusstring

    Indicates the request failed.

    error
  • typestring

    Machine-readable error category.

  • messagestring

    Human-readable error message.

  • Optional validation details for invalid requests.

Customer or coupon not found

  • statusstring

    Indicates the request failed.

    error
  • typestring

    Machine-readable error category.

  • messagestring

    Human-readable error message.

  • Optional validation details for invalid requests.

The clientId already belongs to another payment, or an earlier request with it is still creating the invoice

  • statusstring

    Indicates the request failed.

    error
  • typestring

    Machine-readable error category.

  • messagestring

    Human-readable error message.

  • Optional validation details for invalid requests.

An account without a paid plan can email invoices to 25 addresses in 24 hours, CC included, and this invoice does not fit in what is left

  • statusstring

    Indicates the request failed.

    error
  • typestring

    Machine-readable error category.

  • messagestring

    Human-readable error message.

  • Optional validation details for invalid requests.

Internal server error

  • statusstring

    Indicates the request failed.

    error
  • typestring

    Machine-readable error category.

  • messagestring

    Human-readable error message.

  • Optional validation details for invalid requests.

// The SDK has no method for this endpoint yet. Use the cURL tab.
{
  "data": {
    "id": "65f4a1c2e4a9f3d2b1c0a9e8",
    "sellerId": "65f4a1c2e4a9f3d2b1c0a9e8",
    "customerId": "65f4a1c2e4a9f3d2b1c0a9e8",
    "chargeId": "65f4a1c2e4a9f3d2b1c0a9e8",
    "chargeType": "payment",
    "livemode": true,
    "currency": "string",
    "amount": 0,
    "amountRefunded": 0,
    "amountUsd": 0,
    "amountPaid": 0,
    "amountDue": 0,
    "amountExcludingTax": 0,
    "taxAmount": 0,
    "taxBreakdown": [
      {
        "taxType": "string",
        "taxabilityReason": "string",
        "taxableAmount": 0,
        "taxAmount": 0,
        "taxRateDetails": {
          "country": "string",
          "percentageDecimal": 0,
          "state": "string",
          "taxType": "string"
        }
      }
    ],
    "taxSource": "fixed_tax_rate",
    "taxRates": [
      {
        "taxRate": "65f4a1c2e4a9f3d2b1c0a9e8",
        "stripeId": "string",
        "displayName": "VAT",
        "default": true,
        "active": true,
        "inclusive": true,
        "percentage": 0,
        "createdAt": "2019-08-24T14:15:22Z",
        "updatedAt": "2019-08-24T14:15:22Z"
      }
    ],
    "status": "draft",
    "source": "checkout",
    "lineItems": [
      {
        "type": "product",
        "name": "string",
        "quantity": 0,
        "unitPrice": 0,
        "amount": 0,
        "bulkDiscountAmount": 0,
        "couponDiscountAmount": 0,
        "couponCode": "string"
      }
    ],
    "subtotal": 0,
    "subtotalAfterDiscount": 0,
    "bulkDiscount": {
      "minQuantity": 0,
      "maxQuantity": 0,
      "percentOff": 0,
      "amountOff": 0,
      "amount": 0
    },
    "complimentaryDiscountAmount": 0,
    "fees": [
      {
        "name": "string",
        "amount": 0,
        "percentage": 0,
        "percentageAmount": 0,
        "fixedAmount": 0
      }
    ],
    "processingFeeContribution": {
      "name": "string",
      "amount": 0
    },
    "coupon": {
      "id": "65f4a1c2e4a9f3d2b1c0a9e8",
      "label": "string",
      "code": "string",
      "amountOff": 0,
      "percentOff": 0,
      "discount": 0
    },
    "poNumber": "string",
    "poNumberLabel": "string",
    "dueDate": "2019-08-24T14:15:22Z",
    "notes": "string",
    "timeZone": "America/Los_Angeles",
    "invoiceUuid": "string",
    "invoiceNumber": "string",
    "invoiceUrl": "string",
    "billing": {
      "name": "string",
      "email": "string",
      "phone": "string",
      "address": {
        "line1": "string",
        "line2": "string",
        "city": "string",
        "state": "string",
        "postalCode": "string",
        "country": "string"
      },
      "taxId": "string",
      "taxIdType": "string"
    },
    "sellerBilling": {
      "name": "string",
      "email": "string",
      "taxId": "string",
      "address": {
        "line1": "string",
        "line2": "string",
        "city": "string",
        "state": "string",
        "postalCode": "string",
        "country": "string"
      }
    },
    "customerName": "string",
    "customerEmail": "string",
    "productTitle": "string",
    "createdAt": "2019-08-24T14:15:22Z",
    "updatedAt": "2019-08-24T14:15:22Z"
  }
}
{
  "status": "error",
  "type": "error",
  "message": "The due date must not be before the day of issue."
}
{
  "status": "error",
  "type": "error",
  "message": "Missing or invalid API key"
}
{
  "status": "error",
  "type": "error",
  "message": "This account has reached its plan limit and cannot send invoices."
}
{
  "status": "error",
  "type": "error",
  "message": "Customer not found"
}
{
  "status": "error",
  "type": "error",
  "message": "This clientId belongs to an invoice with a different total. Send the invoice with a new clientId."
}
{
  "status": "error",
  "type": "error",
  "message": "On the Free plan you can email invoices to 25 addresses in 24 hours. Upgrade to send more, or try again later."
}
{
  "status": "error",
  "type": "error",
  "message": "Internal server error"
}