Skip to main content

Tenant API reference

Routes under /api/tenant, for scripts that run a tenant's console. Authenticate with a developer key: Authorization: Bearer tdk_…; each route needs the capability shown. Choose test or live data with ?livemode=true|false (default false). A platform key with Act for tenants can call every route for a tenant with PayLink-Tenant: {slug}. Guide: automation API.

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

/overview​

GET /api/tenant/overview​

What the console's overview shows: the last 7 days, what is waiting, and how far set-up has got.

Needs a developer key with the payments.read capability.

ParameterInType
livemodequeryboolean

/payments​

POST /api/tenant/payments​

Creates a payment (as "New payment" in the console does) and returns its checkout_url to share. Amounts in paise.

Needs a developer key with the payments.write capability.

ParameterInType
livemodequeryboolean

Body (JSON):

FieldType
amountinteger int64
currencystring
referencestring
descriptionstring
return_urlstring
customer_namestring
customer_emailstring
customer_phonestring
customer_idstring
metadatamap of string
expires_in_secondsinteger int32

GET /api/tenant/payments​

Payments, newest first, with the console's filters. Dates are UTC days (yyyy-MM-dd); amounts in paise. Answers total and total_amount for the filter.

Needs a developer key with the payments.read capability.

ParameterInType
livemodequeryboolean
statusquerystring
qquerystring
methodquerystring
fromquerystring
toquerystring
min_amountqueryinteger int64
max_amountqueryinteger int64
referencequerystring
limitqueryinteger int32
offsetqueryinteger int32

POST /api/tenant/payments/{id}/release​

Releases a payment a risk rule put on hold, so the payer can pay.

Needs a developer key with the payments.write capability.

ParameterInType
idpathstringrequired

Body (JSON):

FieldType
notestring

GET /api/tenant/payments/export​

The payments list as CSV (up to 50,000 rows), with the same filters as GET /payments.

Needs a developer key with the payments.read capability.

ParameterInType
livemodequeryboolean
statusquerystring
qquerystring
methodquerystring
fromquerystring
toquerystring
min_amountqueryinteger int64
max_amountqueryinteger int64
referencequerystring

GET /api/tenant/payments/{id}/attempts/{attemptId}/proof​

The payer's UPI screenshot for an attempt. Every view is audited.

Needs a developer key with the upi.verify capability.

ParameterInType
idpathstringrequired
attemptIdpathstringrequired

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

A payment with its attempts, refunds and full journey (every event, with who did it).

Needs a developer key with the payments.read capability.

ParameterInType
idpathstringrequired

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

Cancels an open payment.

Needs a developer key with the payments.write capability.

ParameterInType
idpathstringrequired

Body (JSON):

FieldType
notestring

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

A refund through the gateway, or (manual = true, reason required) a refund the merchant made outside PayLink.

Needs a developer key with the refunds capability.

ParameterInType
idpathstringrequired

Body (JSON):

FieldType
amountinteger int64
reasonstring
manualboolean

Payment links, newest first; q searches title and code, state is on or off.

Needs a developer key with the links capability.

ParameterInType
livemodequeryboolean
qquerystring
statequerystring
limitqueryinteger int32
offsetqueryinteger int32

POST /api/tenant/links​

Creates a payment link. Amounts in paise; leave amount out to let the payer choose.

Needs a developer key with the links capability.

ParameterInType
livemodequeryboolean

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

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

One payment link.

Needs a developer key with the links capability.

ParameterInType
idpathstringrequired

PATCH /api/tenant/links/{id}​

Turns a link on or off. A link that's off tells payers it's no longer taking payments.

Needs a developer key with the links capability.

ParameterInType
idpathstringrequired

Body (JSON):

FieldType
activeboolean

GET /api/tenant/links/{id}/qr​

The link's QR code as SVG, for printing.

Needs a developer key with the links capability.

ParameterInType
idpathstringrequired

/reports​

GET /api/tenant/reports​

The Reports page as JSON: funnel, methods, failure reasons and daily volume. A range is at most 366 days.

Needs a developer key with the reports capability.

ParameterInType
livemodequeryboolean
rangequerystring
fromquerystring
toquerystring

/settlements​

POST /api/tenant/settlements​

Imports a gateway's settlement report (CSV, multipart field "report" or a text/csv body). Without a mapping PayLink uses the columns it recognises (the same guess the console shows); pass column numbers (0-based) to override.

Needs a developer key with the reconciliation capability.

ParameterInType
connectorquerystring
referencequeryinteger int32
grossqueryinteger int32
feequeryinteger int32
taxqueryinteger int32
netqueryinteger int32
datequeryinteger int32
settlement_refqueryinteger int32
paisequeryboolean

GET /api/tenant/settlements​

Imported reports, lines that need a look, the daily close and paid gateway payments not yet settled.

Needs a developer key with the reconciliation capability.

/disputes​

GET /api/tenant/disputes​

Disputes reported by gateways.

Needs a developer key with the disputes capability.

ParameterInType
livemodequeryboolean

POST /api/tenant/disputes/{id}/note​

Saves your note on a dispute (what evidence you sent).

Needs a developer key with the disputes capability.

ParameterInType
idpathstringrequired

Body (JSON):

FieldType
notestring

/routing​

GET /api/tenant/routing​

The checkout order and amount ranges of the methods that are on, which are resting after errors, and failover.

Needs a developer key with the methods capability.

ParameterInType
livemodequeryboolean

PUT /api/tenant/routing​

Sets the checkout order and amount ranges of methods that are on, and whether failed starts move to the next gateway.

Needs a developer key with the methods capability.

ParameterInType
livemodequeryboolean

Body (JSON):

FieldType
methodsarray of object
methods[].connectorstring
methods[].orderinteger int32
methods[].min_amountinteger int64
methods[].max_amountinteger int64
failoverboolean

/account-requests​

GET /api/tenant/account-requests​

Gateways the platform helps tenants get an account with, and this tenant's requests.

Needs a developer key with the methods capability.

POST /api/tenant/account-requests​

"Get an account": records the request. For a partner-link programme the response carries the link to open.

Needs a developer key with the methods capability.

Body (JSON):

FieldType
connectorstring
namestring
emailstring
phonestring
answersmap of string

/webhooks​

POST /api/tenant/webhooks/{id}/test​

Sends a webhook.test event to an endpoint.

Needs a developer key with the webhooks capability.

ParameterInType
idpathinteger int64required

GET /api/tenant/webhooks​

Webhook endpoints.

Needs a developer key with the webhooks capability.

POST /api/tenant/webhooks​

Adds a webhook endpoint. The signing secret (whsec_) is returned once.

Needs a developer key with the webhooks capability.

Body (JSON):

FieldType
urlstring
livemodeboolean
eventsarray of string
descriptionstring

DELETE /api/tenant/webhooks/{id}​

Removes a webhook endpoint.

Needs a developer key with the webhooks capability.

ParameterInType
idpathinteger int64required

GET /api/tenant/webhooks/deliveries​

Recent webhook deliveries, optionally for one payment.

Needs a developer key with the webhooks capability.

ParameterInType
paymentIdquerystring

POST /api/tenant/webhooks/deliveries/{id}/redeliver​

Sends a delivery again.

Needs a developer key with the webhooks capability.

ParameterInType
idpathinteger int64required

/alerts​

GET /api/tenant/alerts​

Alert kinds, this tenant's alerts and recently sent ones.

Needs a developer key with the alerts capability.

POST /api/tenant/alerts​

Adds an alert: kind, threshold, window in minutes, channel (both, webhook or email).

Needs a developer key with the alerts capability.

Body (JSON):

FieldType
kindstring
thresholdstring
window_minutesinteger int32
channelstring

DELETE /api/tenant/alerts/{id}​

Removes an alert.

Needs a developer key with the alerts capability.

ParameterInType
idpathinteger int64required

/team​

GET /api/tenant/team​

Who may sign in, the members with their roles, and the role map.

Needs a developer key with the team capability.

PUT /api/tenant/team/admission​

Who may sign in to the console: approve_only, auto_tenant_admins, role or anyone.

Needs a developer key with the team capability.

Body (JSON):

FieldType
modestring

POST /api/tenant/team/members/{id}​

Approves a person with a role, changes their role, or removes them. Keys can't make owners or remove the last owner; owners are made by an owner in the console.

Needs a developer key with the team capability.

ParameterInType
idpathinteger int64required

Body (JSON):

FieldType
decisionstring
rolestring

PUT /api/tenant/team/role-map​

Maps a LoginLink role to a PayLink role (used by the "role" admission mode). An empty paylink_role removes the mapping.

Needs a developer key with the team capability.

Body (JSON):

FieldType
loginlink_rolestring
paylink_rolestring

/domain​

GET /api/tenant/domain​

The tenant's own domain, its DNS records and verification state.

Needs a developer key with the domain capability.

PUT /api/tenant/domain​

Adds a domain. Add the TXT record returned, point the domain at PayLink, then verify.

Needs a developer key with the domain capability.

Body (JSON):

FieldType
domainstring

DELETE /api/tenant/domain​

Removes the domain; the platform's address is used again.

Needs a developer key with the domain capability.

POST /api/tenant/domain/verify​

Checks the TXT record. Answers 422 while it isn't found.

Needs a developer key with the domain capability.

/data-access​

GET /api/tenant/data-access​

The CrudApi connection, the platform's CrudApi address, and the reporting API path.

Needs a developer key with the data_access capability.

DELETE /api/tenant/data-access​

Unregisters the database from CrudApi and removes the read-only user PayLink made.

Needs a developer key with the data_access capability.

PUT /api/tenant/data-access/reader​

Step 1: a read-only database user (PayLink creates one when it can; otherwise send yours, which is checked to be SELECT-only).

Needs a developer key with the data_access capability.

Body (JSON):

FieldType
userstring
passwordstring
hoststring

POST /api/tenant/data-access/register​

Step 2: registers the database in a CrudApi workspace and creates a Reader client. Its secret is returned once.

Needs a developer key with the data_access capability.

Body (JSON):

FieldType
serverstring
workspacestring
keystring

/keys​

GET /api/tenant/keys​

The tenant's keys (secrets never returned).

Needs a developer key with the keys capability.

POST /api/tenant/keys​

Creates a secret key (kind "secret", for /api/v1) or a developer key (kind "developer", for /api/tenant). A developer key can only be given capabilities the calling key has. The key is returned once.

Needs a developer key with the keys capability.

Body (JSON):

FieldType
namestring
kindstring
livemodeboolean
capabilitiesarray of string
expires_atstring

DELETE /api/tenant/keys/{id}​

Revokes a key. Calls with it answer 401 from then on.

Needs a developer key with the keys capability.

ParameterInType
idpathinteger int64required

/requests​

GET /api/tenant/requests​

The API request log: the last calls made with this tenant's keys (no bodies).

Needs a developer key with the keys capability.

ParameterInType
limitqueryinteger int32

/audit​

GET /api/tenant/audit​

The tenant's audit log, newest first. verify=true also checks the hash chain.

Needs a developer key with the audit capability.

ParameterInType
limitqueryinteger int32
verifyqueryboolean

/upi​

GET /api/tenant/upi/pending​

PayLink UPI payments waiting for a decision: the UTR the payer entered, and whether there's a screenshot.

Needs a developer key with the upi.verify capability.

ParameterInType
livemodequeryboolean

POST /api/tenant/upi/{attemptId}/approve​

Approves a UPI payment: the money arrived. The note is kept on the journey.

Needs a developer key with the upi.verify capability.

ParameterInType
attemptIdpathstringrequired

Body (JSON):

FieldType
notestring

POST /api/tenant/upi/{attemptId}/reject​

Rejects a UPI payment: no such credit. The note is kept on the journey.

Needs a developer key with the upi.verify capability.

ParameterInType
attemptIdpathstringrequired

Body (JSON):

FieldType
notestring

GET /api/tenant/upi/decided​

UPI payments already approved or rejected (newest first): who decided, when, and the note.

Needs a developer key with the upi.verify capability.

ParameterInType
livemodequeryboolean
decisionquerystring
qquerystring
fromquerystring
toquerystring
limitqueryinteger int32
offsetqueryinteger int32

POST /api/tenant/upi/statements​

Matches a bank statement (CSV) against UPI payments waiting for a check: credits whose UTR and amount match are approved. Send the file as multipart/form-data (field "statement") or as the raw body with Content-Type text/csv.

Needs a developer key with the upi.verify capability.

ParameterInType
livemodequeryboolean

Body (text/csv or multipart/form-data):

The file itself.

/methods​

GET /api/tenant/methods​

Every payment method with its fields and this tenant's Test and Live settings (secrets never returned).

Needs a developer key with the methods capability.

PUT /api/tenant/methods/{connectorId}/{mode}​

Saves a method's settings for test or live and, with enabled true, checks them and turns it on. A failed check answers 422.

Needs a developer key with the methods capability.

ParameterInType
connectorIdpathstringrequired
modepathstringrequired

Body (JSON):

FieldType
enabledboolean
settingsmap of string

/risk-rules​

GET /api/tenant/risk-rules​

Risk rules.

Needs a developer key with the risk capability.

POST /api/tenant/risk-rules​

Adds a risk rule: kind, value, action (block or review) and a note.

Needs a developer key with the risk capability.

Body (JSON):

FieldType
kindstring
valuestring
actionstring
notestring

DELETE /api/tenant/risk-rules/{id}​

Removes a risk rule.

Needs a developer key with the risk capability.

ParameterInType
idpathinteger int64required