PaybytokenDocs
Payment Requests
Guide · Payment Requests

Request a payment

Choose Payment Requests for one customer receivable with a durable balance and audit trail.

Use a Payment Request when a known customer owes one amount and may pay later, retry from another device, make a partial payment, or need a reminder. Use a reusable Payment Link for campaigns and repeatable products, and a direct Checkout Session for one immediate checkout interaction.

ResourceOwns
Payment RequestCustomer, due date, exact balance and collection history.
Checkout SessionOne hosted customer interaction.
PaymentIntentOne token/network transfer execution.
Payment Request paymentImmutable allocation of confirmed funds to the receivable.

The recommended workflow is:

  1. create a draft from server-owned customer and order data;
  2. review and finalize it to lock terms;
  3. share the returned URL or schedule email delivery;
  4. process verified payment_request.* webhooks exactly once; and
  5. monitor unapplied payments and reconciliation reports.

Lifecycle

Receivable lifecycle
EditableDraftReview terms
CollectibleOpenShare or deliver
Per attemptCheckout + IntentMay repeat
Covered in fullPaidTerminal
A failed or expired Checkout Session creates another attempt; it does not rewrite the receivable.
StatusMeaningMerchant action
draftTerms can still be edited.Review customer, line items, due date and token choices.
openTerms are locked and the request can collect payment.Share the URL or schedule delivery.
paidAllocated confirmed funds reduced the remaining amount to zero.Fulfill exactly once.
canceledNew collection attempts are stopped by the merchant.Preserve history; create a new request for new terms.
expiredThe collection window ended.Review late or unapplied funds before replacement.

Finalization is a business boundary. Do not finalize until the amount, customer identity and due date are correct. Updating a draft increments its version; existing financial allocations are not rewritten.

Create and finalize from your server

const request = await paybytoken.paymentRequests.create(
  {
    title: 'August services',
    customer_name: 'Alex Morgan',
    customer_email: 'alex@example.com',
    merchant_reference: 'AR-1042',
    currency: 'usd',
    line_items: [
      {
        name: 'Consulting',
        description: 'August delivery milestone',
        quantity: 1,
        unit_amount: '750.00',
      },
    ],
    supported_tokens: [{ chain: 'base', currency: 'USDC' }],
    due_at: '2030-08-31T23:59:59.000Z',
    metadata: { account_receivable_id: 'AR-1042' },
  },
  { idempotencyKey: 'payment-request:AR-1042:v1' },
)

const openRequest = await paybytoken.paymentRequests.finalize(request.id, {
  idempotencyKey: `payment-request:${request.id}:finalize:v${request.version}`,
})

Keep both your receivable ID and the Paybytoken Payment Request ID. Metadata helps correlation but does not replace that relationship.

Understand partial and unapplied funds

Each confirmed transfer creates an immutable Payment Request payment allocation. amount_paid is the sum applied to the receivable; amount_remaining is what another Checkout Session should collect. A Payment Request can therefore have several Checkout Sessions and Payment Intents without losing one durable balance.

Funds become unapplied when Paybytoken cannot safely assign them—for example, a late or excess payment conflicts with current request state. Do not silently credit or refund those funds from a browser action. Review the payment record, request timeline and reconciliation report through an authorized operations workflow.

Start with Create a Payment Request, then collect payment.

On this page

API Workbench

Full Explorer

Open in new tab