PaybytokenDocs
Payment Requests
API reference · Payment Requests

Create a Payment Request

Create an editable customer receivable draft with server-owned line items.

POST /api/v1/payment_requests

Create drafts from trusted server data. Do not accept price or quantity directly from browser input.

const request = await paybytoken.paymentRequests.create(
  {
    title: 'August services',
    customer_name: 'Alex Morgan',
    customer_email: 'alex@example.com',
    merchant_reference: 'PO-1042',
    currency: 'usd',
    line_items: [
      { name: 'Consulting', quantity: 2, unit_amount: '25.00' },
    ],
    supported_tokens: [
      { currency: 'USDC', chain: 'base' },
      { currency: 'USDC', chain: 'ethereum' },
    ],
    due_at: '2026-09-15T23:59:59.000Z',
    metadata: { customer_id: 'cus_1042' },
  },
  { idempotencyKey: 'payment-request:PO-1042' },
)

The response has status: "draft", url: null, and server-calculated subtotal, total, and remaining amount. A duplicate request with the same idempotency key and body returns the same resource; reusing the key with different input is rejected.

Parameters

ParameterRequiredDescription
titleyesCustomer-facing purpose, up to 160 characters.
currencyyesCurrently usd.
line_itemsyes1–100 items with name, quantity and decimal unit_amount.
supported_tokensyesOne or more enabled { currency, chain } pairs.
customer_emailnoDefault email recipient for sending the request.
due_atnoISO timestamp; finalization defaults it to 30 days ahead.
memo, footernoCustomer-facing supporting text.
merchant_reference, metadatanoMerchant-owned reconciliation fields.

On this page

API Workbench

Full Explorer

Open in new tab