The five endpoints
All five share the same base URL, the same authentication model, and the same response envelope. Every request is a POST with a JSON body.
| Endpoint | Purpose |
|---|---|
POST /api/payment_taken | Payment transaction history — filter, paginate, search |
POST /api/manage_cdr_logs | Call Detail Record logs — filter and paginate |
POST /api/view_cdr_log | CDR detail for a single call (by cdr_id) |
POST /api/view_api_details_cdr | API call trace (request/response pair) for a CDR |
POST /api/webhook_request_data | Webhook delivery logs for a given CDR |
Environments
| Environment | Base URL |
|---|---|
| Sandbox | https://accounts.pay729.guru/ |
| Production | https://accounts.pay729.net/ or https://accounts.paytia.com/ |
Authentication
There are two ways to authenticate. Both keys are configured under Account Security → API secret key in the SecureFlow merchant portal.
X-API-KEYheader — a static key. Simple to set up, no rotation required. Fine for internal scripts and server-to-server integrations where you control the environment.ACCESS-TOKENheader — a short-lived token issued via the Enhanced API Security licence. Expires after one hour; you rotate it with a refresh token. Use this if you need stricter key hygiene or regular rotation.
Getting an access token (Enhanced API Security)
Three steps:
- In the merchant portal, go to API secret key → Generate Tokens. This issues a
client_id,client_secret, and arefresh_token. - Exchange them at
POST /api/authorizeby sendingclient_idandclient_secretas form fields. The response includes anaccess_token(valid for one hour) and a newrefresh_token. - Before the token expires, call
POST /api/refresh_tokenwith the same fields plusrefresh_token. You'll get a fresh pair back.
// POST /api/authorize — response
{
"httpStatus": true,
"refresh_token": "M+ixxr3jST3uPlVFQmbCpiDr+ea12WLyQvRQUjSEK1w=",
"access_token": "kQ3bwoO+k2ol6YL9dcD9QSON2GhrMuGSjf8OigtY3jo=",
"expire_time": "2024-03-15 14:05:57",
"status": { "statusCode": 200, "statusDescription": "success" }
}jsonTreat access_token as ephemeral and rotate it before expire_time. A 400 with the message "Access token expired, please generate again using refresh token" means you left it too late.
Response envelope
Every endpoint wraps its result in the same shape:
{
"httpStatus": true,
"reference_id": "your-echoed-ref",
"status": {
"statusCode": 200,
"statusDescription": "success"
},
"data": [ ... ]
}jsonhttpStatus is true on success, false on error. reference_id echoes whatever you sent in the request, so you can correlate calls in your own logs. data is always an array — empty on no results.
Error codes
All five endpoints return the same error shapes. The most common ones you'll see:
| Error | Code | Response description |
|---|---|---|
| API key missing | 400 | API key is required. |
| Invalid API key | 401 | Invalid API key. |
| Access token missing | 400 | Access token is required. |
| Invalid access token | 400 | Invalid access token. |
| Access token expired | 400 | Access token expired, please generate again using refresh token. |
| CDR ID missing | 400 | Cdr id is Required |
| No data found | 400 | No Data Found — data is an empty array |
Payment history — POST /api/payment_taken
Returns paginated payment transaction records. All parameters are optional — call with none to get the most recent transactions.
| Field | Type | Description |
|---|---|---|
reference_id | string | Your request reference, echoed back in the response. |
page | integer | Pagination page number (1-based). |
limit_per_page | integer | Records per page. Allowed values: 10, 25, 50, 100. |
start_date / end_date | YYYY-MM-DD | Date range filter. |
status | string | success, failed, or pending. |
search_transaction_id | string | Search by Paytia transaction ID. |
search_ref_brn | string | Search by BRN reference. |
search_amount | string | Search by transaction amount. |
search_first_name / search_last_name | string | Search by customer name. |
search_acquirer_message | string | Search by acquirer message text. |
search_nickname | string | Search by payment gateway nickname. |
search_gateway_code | string | Search by gateway code. |
Each record in the data array includes:
unique_id— Paytia transaction identifiercdr_id— linked call record (if the payment came from a phone call)txn_type— transaction type, e.g.Charge immediatelyfirst_name,last_name,company_nameagent_name— the agent who handled the callcard_last_four_digit,card_brandreference_no,account_numberdatetime— inDD-MM-YYYY HH:MM:SSformatcurrency,net,tax,total_sell_pricetransaction_charge,processing_charge,paytia_brand_feestatus—success,failed, orpendingacquirer_message— the gateway's response messagegateway_nickname— which gateway processed itmetadata,custom_metadata_fields
// Sample request
{
"reference_id": "ref-recon-001",
"start_date": "2026-06-01",
"end_date": "2026-06-30",
"status": "success",
"limit_per_page": 100,
"page": 1
}jsonCDR logs — POST /api/manage_cdr_logs
Returns Call Detail Record logs. If you don't supply date parameters, the default window is the last seven days to today.
| Field | Type | Description |
|---|---|---|
reference_id | string | Your request reference. |
page | integer | Pagination page number. |
limit_per_page | integer | Allowed values: 10, 25, 50, 100. |
start_date | YYYY-MM-DD | Start of date range. Defaults to 7 days ago. |
end_date | YYYY-MM-DD | End of date range. Defaults to today. |
search_number | string | Filter by phone number. |
search_cdr_id | string | Filter by CDR ID. |
originator_type | string | Filter by originator — e.g. customer. |
search_agent_id | string | Filter by agent ID. |
Each CDR record includes:
cdr_id— unique call identifier (used by the three detail endpoints below)agent_idoriginator—customeror agent-sidemerchant_emailcall_from,call_to_paytia,call_to— E.164 numbersstart_time,end_timeringing,answer_talking,total_duration— inHH:MM:SS
CDR detail — POST /api/view_cdr_log
Fetches the full leg-level detail for a single call, identified by cdr_id. You'll typically call this after finding the record you want via /api/manage_cdr_logs.
| Field | Required | Description |
|---|---|---|
cdr_id | Yes | The CDR identifier. |
reference_id | No | Your request reference. |
The response data contains inbound and outbound leg fields. Fields prefixed in* describe the inbound leg — DDI (inddi), CLI (incli), state (instate), and timestamps (intimes, intimee, intimea). Fields prefixed out* describe the outbound leg. The state and hang* fields describe call-setup progress and hang-up cause.
// Sample request
{
"reference_id": "ref-debug-001",
"cdr_id": "i-0b943301f1597b410-49662"
}jsonAPI trace — POST /api/view_api_details_cdr
Returns the exact request/response pair that Paytia exchanged with the merchant endpoint during a call. Useful for debugging unexpected IVR behaviour or replaying a scenario to understand what was sent and received.
| Field | Required | Description |
|---|---|---|
cdr_id | Yes | The CDR identifier. |
reference_id | No | Your request reference. |
The response includes:
uri— the merchant endpoint Paytia calledmethod— HTTP method usedrequest_params— the serialised request Paytia sentresponse— what the merchant endpoint returnedactual_response— the final response valuetime— timestamp of the API call
Pair this with /api/view_cdr_log to get the full picture: the call legs plus the API exchange that drove the payment decision.
Webhook delivery logs — POST /api/webhook_request_data
Shows exactly what Paytia posted to your webhook_url for a given call, and how your endpoint responded. If a webhook is showing as failed in your logs, this is the first place to look.
| Field | Required | Description |
|---|---|---|
cdr_id | Yes | The CDR identifier. |
reference_id | No | Your request reference. |
The response data shows:
webhook_response— the full JSON payload Paytia sent to your endpointhttp_code— the HTTP status your endpoint returned (0means no response received)description— brief and tooltip descriptions of the outcomestatus—successorfaileddate_time— when the delivery was attempted
Pair this with /api/payment_taken when you need an end-to-end audit: pull the transaction record to confirm what was charged, then pull the webhook log to confirm what your system was told.
For general webhook integration — subscribing, payload format, retry behaviour — see the Webhooks reference.
Support
Postman collections for all five endpoints are available on request. Write to techsupport@paytia.com.