PaybytokenDocs
Payment Requests
API reference · Payment Requests

Update, finalize or cancel a Payment Request

Edit a draft, lock collection terms, or stop a request without losing its audit history.

Update a draft

PATCH /api/v1/payment_requests/:id

Only drafts are editable. Every mutation uses a stable server-owned idempotency key.

await paybytoken.paymentRequests.update(
  request.id,
  { due_at: '2026-09-20T23:59:59.000Z' },
  { idempotencyKey: 'payment-request:PO-1042:update:1' },
)

Finalize

POST /api/v1/payment_requests/:id/finalize

const finalized = await paybytoken.paymentRequests.finalize(request.id, {
  idempotencyKey: 'payment-request:PO-1042:finalize',
})

Finalization changes the request to open, snapshots branding, locks financial terms, and returns the public url. Corrections require a replacement request; do not mutate an open receivable.

Cancel

POST /api/v1/payment_requests/:id/cancel

Cancellation is rejected after funds are detected or an allocation is processing. It stops new attempts but monitoring continues for late deposits already sent to an issued address.

On this page

API Workbench

Full Explorer

Open in new tab