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.
| Parameter | In | Type | |
|---|---|---|---|
livemode | query | boolean |
/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.
| Parameter | In | Type | |
|---|---|---|---|
livemode | query | boolean |
Body (JSON):
| Field | Type | |
|---|---|---|
amount | integer int64 | |
currency | string | |
reference | string | |
description | string | |
return_url | string | |
customer_name | string | |
customer_email | string | |
customer_phone | string | |
customer_id | string | |
metadata | map of string | |
expires_in_seconds | integer 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.
| Parameter | In | Type | |
|---|---|---|---|
livemode | query | boolean | |
status | query | string | |
q | query | string | |
method | query | string | |
from | query | string | |
to | query | string | |
min_amount | query | integer int64 | |
max_amount | query | integer int64 | |
reference | query | string | |
limit | query | integer int32 | |
offset | query | integer 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.
| Parameter | In | Type | |
|---|---|---|---|
id | path | string | required |
Body (JSON):
| Field | Type | |
|---|---|---|
note | string |
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.
| Parameter | In | Type | |
|---|---|---|---|
livemode | query | boolean | |
status | query | string | |
q | query | string | |
method | query | string | |
from | query | string | |
to | query | string | |
min_amount | query | integer int64 | |
max_amount | query | integer int64 | |
reference | query | string |
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.
| Parameter | In | Type | |
|---|---|---|---|
id | path | string | required |
attemptId | path | string | required |
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.
| Parameter | In | Type | |
|---|---|---|---|
id | path | string | required |
POST /api/tenant/payments/{id}/cancel
Cancels an open payment.
Needs a developer key with the payments.write capability.
| Parameter | In | Type | |
|---|---|---|---|
id | path | string | required |
Body (JSON):
| Field | Type | |
|---|---|---|
note | string |
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.
| Parameter | In | Type | |
|---|---|---|---|
id | path | string | required |
Body (JSON):
| Field | Type | |
|---|---|---|
amount | integer int64 | |
reason | string | |
manual | boolean |
/links
GET /api/tenant/links
Payment links, newest first; q searches title and code, state is on or off.
Needs a developer key with the links capability.
| Parameter | In | Type | |
|---|---|---|---|
livemode | query | boolean | |
q | query | string | |
state | query | string | |
limit | query | integer int32 | |
offset | query | integer 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.
| Parameter | In | Type | |
|---|---|---|---|
livemode | query | boolean |
Body (JSON):
| Field | Type | |
|---|---|---|
title | string | |
description | string | |
amount | integer int64 | |
min_amount | integer int64 | |
max_amount | integer int64 | |
currency | string | |
ask_email | boolean | |
ask_phone | boolean | |
return_url | string | |
max_payments | integer int32 | |
expires_at | string | |
code | string |
GET /api/tenant/links/{id}
One payment link.
Needs a developer key with the links capability.
| Parameter | In | Type | |
|---|---|---|---|
id | path | string | required |
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.
| Parameter | In | Type | |
|---|---|---|---|
id | path | string | required |
Body (JSON):
| Field | Type | |
|---|---|---|
active | boolean |
GET /api/tenant/links/{id}/qr
The link's QR code as SVG, for printing.
Needs a developer key with the links capability.
| Parameter | In | Type | |
|---|---|---|---|
id | path | string | required |
/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.
| Parameter | In | Type | |
|---|---|---|---|
livemode | query | boolean | |
range | query | string | |
from | query | string | |
to | query | string |
/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.
| Parameter | In | Type | |
|---|---|---|---|
connector | query | string | |
reference | query | integer int32 | |
gross | query | integer int32 | |
fee | query | integer int32 | |
tax | query | integer int32 | |
net | query | integer int32 | |
date | query | integer int32 | |
settlement_ref | query | integer int32 | |
paise | query | boolean |
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.
| Parameter | In | Type | |
|---|---|---|---|
livemode | query | boolean |
POST /api/tenant/disputes/{id}/note
Saves your note on a dispute (what evidence you sent).
Needs a developer key with the disputes capability.
| Parameter | In | Type | |
|---|---|---|---|
id | path | string | required |
Body (JSON):
| Field | Type | |
|---|---|---|
note | string |
/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.
| Parameter | In | Type | |
|---|---|---|---|
livemode | query | boolean |
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.
| Parameter | In | Type | |
|---|---|---|---|
livemode | query | boolean |
Body (JSON):
| Field | Type | |
|---|---|---|
methods | array of object | |
methods[].connector | string | |
methods[].order | integer int32 | |
methods[].min_amount | integer int64 | |
methods[].max_amount | integer int64 | |
failover | boolean |
/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):
| Field | Type | |
|---|---|---|
connector | string | |
name | string | |
email | string | |
phone | string | |
answers | map 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.
| Parameter | In | Type | |
|---|---|---|---|
id | path | integer int64 | required |
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):
| Field | Type | |
|---|---|---|
url | string | |
livemode | boolean | |
events | array of string | |
description | string |
DELETE /api/tenant/webhooks/{id}
Removes a webhook endpoint.
Needs a developer key with the webhooks capability.
| Parameter | In | Type | |
|---|---|---|---|
id | path | integer int64 | required |
GET /api/tenant/webhooks/deliveries
Recent webhook deliveries, optionally for one payment.
Needs a developer key with the webhooks capability.
| Parameter | In | Type | |
|---|---|---|---|
paymentId | query | string |
POST /api/tenant/webhooks/deliveries/{id}/redeliver
Sends a delivery again.
Needs a developer key with the webhooks capability.
| Parameter | In | Type | |
|---|---|---|---|
id | path | integer int64 | required |
/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):
| Field | Type | |
|---|---|---|
kind | string | |
threshold | string | |
window_minutes | integer int32 | |
channel | string |
DELETE /api/tenant/alerts/{id}
Removes an alert.
Needs a developer key with the alerts capability.
| Parameter | In | Type | |
|---|---|---|---|
id | path | integer int64 | required |
/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):
| Field | Type | |
|---|---|---|
mode | string |
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.
| Parameter | In | Type | |
|---|---|---|---|
id | path | integer int64 | required |
Body (JSON):
| Field | Type | |
|---|---|---|
decision | string | |
role | string |
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):
| Field | Type | |
|---|---|---|
loginlink_role | string | |
paylink_role | string |
/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):
| Field | Type | |
|---|---|---|
domain | string |
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):
| Field | Type | |
|---|---|---|
user | string | |
password | string | |
host | string |
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):
| Field | Type | |
|---|---|---|
server | string | |
workspace | string | |
key | string |
/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):
| Field | Type | |
|---|---|---|
name | string | |
kind | string | |
livemode | boolean | |
capabilities | array of string | |
expires_at | string |
DELETE /api/tenant/keys/{id}
Revokes a key. Calls with it answer 401 from then on.
Needs a developer key with the keys capability.
| Parameter | In | Type | |
|---|---|---|---|
id | path | integer int64 | required |
/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.
| Parameter | In | Type | |
|---|---|---|---|
limit | query | integer 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.
| Parameter | In | Type | |
|---|---|---|---|
limit | query | integer int32 | |
verify | query | boolean |
/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.
| Parameter | In | Type | |
|---|---|---|---|
livemode | query | boolean |
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.
| Parameter | In | Type | |
|---|---|---|---|
attemptId | path | string | required |
Body (JSON):
| Field | Type | |
|---|---|---|
note | string |
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.
| Parameter | In | Type | |
|---|---|---|---|
attemptId | path | string | required |
Body (JSON):
| Field | Type | |
|---|---|---|
note | string |
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.
| Parameter | In | Type | |
|---|---|---|---|
livemode | query | boolean | |
decision | query | string | |
q | query | string | |
from | query | string | |
to | query | string | |
limit | query | integer int32 | |
offset | query | integer 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.
| Parameter | In | Type | |
|---|---|---|---|
livemode | query | boolean |
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.
| Parameter | In | Type | |
|---|---|---|---|
connectorId | path | string | required |
mode | path | string | required |
Body (JSON):
| Field | Type | |
|---|---|---|
enabled | boolean | |
settings | map 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):
| Field | Type | |
|---|---|---|
kind | string | |
value | string | |
action | string | |
note | string |
DELETE /api/tenant/risk-rules/{id}
Removes a risk rule.
Needs a developer key with the risk capability.
| Parameter | In | Type | |
|---|---|---|---|
id | path | integer int64 | required |