Skip to main content

Payments API reference

Routes under /api/v1, for a merchant's server. Authenticate with a secret key: Authorization: Bearer sk_test_… or sk_live_…. A platform key with Act for tenants can call them for a tenant with PayLink-Tenant: {slug} and PayLink-Mode: test|live. Guide: Payments API.

OpenAPI document: payments.json. Every PayLink also serves it at /docs/api/payments/openapi.json, with Swagger UI at /docs/api.

POST /api/v1/links​

Creates a payment link (a reusable page at /l/{code}). Test keys make test links, live keys live ones.

Body (JSON):

FieldType
titlestring
descriptionstring
amountinteger int64
min_amountinteger int64
max_amountinteger int64
currencystring
ask_emailboolean
ask_phoneboolean
return_urlstring
max_paymentsinteger int32
expires_atstring
codestring

All links for this key's mode.

GET /api/v1/links/{id}​

One link, by id or code.

ParameterInType
idpathstringrequired

POST /api/v1/links/{id}/deactivate​

Stops the link taking payments.

ParameterInType
idpathstringrequired

POST /api/v1/links/{id}/activate​

Lets the link take payments again.

ParameterInType
idpathstringrequired

/payments​

POST /api/v1/payments​

Creates a payment and returns its checkout_url. Send an Idempotency-Key. Amounts in minor units (paise).

Body (JSON):

FieldType
amountinteger int64
currencystring
referencestring
descriptionstring
customerobject
customer.namestring
customer.emailstring
customer.phonestring
customer.idstring
return_urlstring
metadatamap of string
expires_ininteger int32

GET /api/v1/payments​

Payments for this key's mode, newest first.

ParameterInType
statusquerystring
referencequerystring
link_idquerystring
limitqueryinteger int32
offsetqueryinteger int32

GET /api/v1/payments/{id}​

A payment: status, attempts, how it was paid (paid_with) or why it failed (failure), refunds.

ParameterInType
idpathstringrequired

POST /api/v1/payments/{id}/cancel​

Cancels an open payment. A processing payment can't be cancelled: the payer may already have paid.

ParameterInType
idpathstringrequired

POST /api/v1/payments/{id}/refunds​

Refunds all (no amount) or part of a succeeded payment through its gateway.

ParameterInType
idpathstringrequired

GET /api/v1/payments/{id}/refunds​

The payment's refunds.

ParameterInType
idpathstringrequired

/disputes​

GET /api/v1/disputes​

Disputes reported by gateways (Razorpay, Stripe, PayPal); payment_id narrows to one payment.

ParameterInType
payment_idquerystring

/reporting​

GET /api/v1/reporting​

The datasets (payments, attempts, refunds, disputes, links, events) and their columns.

GET /api/v1/reporting/{dataset}​

Rows of a dataset, with CrudApi's list parameters: filter, orderBy, display, limit, offset, groupBy, count.

ParameterInType
datasetpathstringrequired
filterquerystring
orderByquerystring
displayquerystring
limitqueryinteger int32
offsetqueryinteger int32
groupByquerystring
countqueryboolean