Skip to content
v0.1.0

API Reference

The API provides endpoints for merchants to authenticate, create and manage payment intents, tokenize card data, retrieve transactions, and handle refunds. This documentation describes each endpoint, its request/response parameters, and how to integrate from various merchant systems.

Servers

https://test.api.us.payapex.com
https://api.us.payapex.com

Auth


Obtain a New Authentication Token

POST
/auth/token

Use this endpoint to generate a new JWT (JSON Web Token) by providing valid client credentials (client_id and client_secret). The returned token must be included in the Authorization header as Bearer <token> for subsequent calls to authenticate and authorize access to the API.

Request Body

JSON
{
"client_id": "string",
"client_secret": "string"
}

Responses

A successfully generated access token.
application/json
JSON
{
"access_token": "string",
"expiry": 0
}

Samples


Intents


Create a Card Tokenization Intent

POST
/intents/card

Creates a new intent for card tokenization. This process securely collects card details that can later be used for transactions without needing to store raw card data on your systems.

Authorizations

BearerAuth
TypeHTTP (bearer)

Request Body

JSON
{
"external_id": "496de72d-d4a4-45eb-b426-3d04d2078a85"
}

Responses

New card tokenization intent created.
application/json
JSON
{
"intent_id": "int_01J5XCMDXCFXCAQ1BV8HVG6644",
"reference_id": "496de72d-d4a4-45eb-b426-3d04d2078a85",
"valid_for": 60000
}

Samples


Create a Payment Transaction Intent

POST
/intents/payment

Creates a new intent for a payment authorization. An intent helps prepare and track the details required before finalizing a transaction (capture).

Authorizations

BearerAuth
TypeHTTP (bearer)

Request Body

JSON
{
"external_id": "496de72d-d4a4-45eb-b426-3d04d2078a85",
"redirect_urls": {
"success": "https://www.example.com/success?trx_id=XYZ&order_id=ZYX",
"failure": "https://www.example.com/failure?trx_id=XYZ&order_id=ZYX"
},
"order": {
"order_id": "496de72d-d4a4-45eb-b426-3d04d2078a85",
"order_amount": 10000,
"order_currency": "string",
"order_items": [
{
"item_title": "Lorem ipsum donet",
"item_id": "string",
"item_qty": 2,
"item_price": 0
}
],
"card_holder": {
"first_name": "string",
"middle_name": "string",
"last_name": "string",
"dob": "string",
"email": "string",
"phone": "string",
"address_1": "string",
"address_2": "string",
"postal_code": "string",
"city": "string",
"state": "string",
"country": "string"
}
}
}

Responses

New payment intent created.
application/json
JSON
{
"intent_id": "int_01J5XCMDXCFXCAQ1BV8HVG6644",
"reference_id": "496de72d-d4a4-45eb-b426-3d04d2078a85"
}

Samples


Get Transaction Details by Either order_id or external_id

GET
/transaction

Retrieves the details of a specific transaction by using either the external_id or the order_id. You must indicate which identifier type you are passing.

Authorizations

BearerAuth
TypeHTTP (bearer)

Parameters

Query Parameters

type*

Indicates whether the provided id is the external_id or the order_id.

Required
Enum
external_idorder_id
id*

The value of the external_id or the order_id being used.

Typestring
Required

Responses

The requested transaction details.
application/json
JSON
{
"id": "trx_01J5XCMDXCFXCAQ1BV8HVG6644",
"type": "string",
"status": "string",
"order_amount": 10000,
"order_currency": "string",
"amount_authorized": 10000,
"amount_captured": 0,
"amount_voided": 0,
"amount_refunded": 0,
"external_id": "496de72d-d4a4-45eb-b426-3d04d2078a85",
"updated_at": "2024-09-05T05:05:25Z"
}

Samples


List Transactions

GET
/transactions

Retrieves a paginated list of transactions filtered by date range and optional criteria such as type and status. Sorting options are also available.

Authorizations

BearerAuth
TypeHTTP (bearer)

Parameters

Query Parameters

from_date*

The start date for transaction records (DD/MM/YYYY). The time is assumed to be 00:00:00 on the given date.

Typestring
Required
Example01/01/2024
to_date*

The end date for transaction records (DD/MM/YYYY). The time is assumed to be 00:00:00 on the given date.

Typestring
Required
Example31/12/2024
offset*

The pagination offset (zero-based). Determines the starting point of returned records. If negative number is provided, zero is assumed.

Typeinteger
Required
Example0
limit*

The maximum number of records to return in one request. If value provided is equal or lower that 10, then 10 is assumed. If value provided is higher than 100, then 100 is assumed.

Typeinteger
Required
Example10
order_by

The field by which to sort the results (e.g., created_at, updated_at). Defaults to updated_at.

Typestring
Enum
typestatusorder_amountcreated_atupdated_at
defaultupdated_at
order_dir

The sorting direction, either ascending (ASC) or descending (DESC). Defaults to ASC.

Typestring
Enum
ASCDESC
defaultASC
filter_type

Filter the result by transaction type (PAYMENT, REFUND, or CHARGEBACK).

Typestring
Enum
PAYMENTREFUNDCHARGEBACK
filter_status

Filter the result by transaction status (AUTHORIZED, DECLINED, VOIDED, EXPIRED, CAPTURED, etc.).

Typestring
Enum
AUTHORIZEDDECLINEDVOIDEDEXPIREDPARTIAL_CAPTUREDCAPTUREDPARTIAL_SETTLEDSETTLED

Responses

A paginated list of transactions matching the provided criteria.
application/json
JSON
{
"offset": 0,
"limit": 10,
"amount": 1,
"result": [
{
"id": "trx_01J5XCMDXCFXCAQ1BV8HVG6644",
"type": "string",
"status": "string",
"order_amount": 10000,
"order_currency": "string",
"amount_authorized": 10000,
"amount_captured": 0,
"amount_voided": 0,
"amount_refunded": 0,
"external_id": "496de72d-d4a4-45eb-b426-3d04d2078a85",
"updated_at": "2024-09-05T05:05:25Z"
}
]
}

Samples


Create a Transaction

POST
/transactions

Initiates a new transaction authorization (authorize) or an authorization with immediate capture (authcap). The operation type determines how the transaction will be processed.

Authorizations

BearerAuth
TypeHTTP (bearer)

Request Body

JSON
{
"operation": "string",
"external_id": "496de72d-d4a4-45eb-b426-3d04d2078a85",
"order": {
"order_id": "496de72d-d4a4-45eb-b426-3d04d2078a85",
"order_amount": 10000,
"order_currency": "string",
"order_items": [
{
"item_title": "Lorem ipsum donet",
"item_id": "string",
"item_qty": 2,
"item_price": 0
}
],
"card_holder": {
"first_name": "string",
"middle_name": "string",
"last_name": "string",
"dob": "string",
"email": "string",
"phone": "string",
"address_1": "string",
"address_2": "string",
"postal_code": "string",
"city": "string",
"state": "string",
"country": "string"
}
},
"token": "tkn_01J5XCMDXCFXCAQ1BV8HVG6644_215626ca92fcc591fd2491b483c9d496",
"card": {
"pan": "string",
"code": "012",
"expiry": "122030",
"name": "John Doe",
"country": "string",
"zip": "string"
}
}

Responses

Details of the newly created transaction.
application/json
JSON
{
"id": "trx_01J5XCMDXCFXCAQ1BV8HVG6644",
"type": "string",
"status": "string",
"order_amount": 10000,
"order_currency": "string",
"amount_authorized": 10000,
"amount_captured": 0,
"amount_voided": 0,
"amount_refunded": 0,
"external_id": "496de72d-d4a4-45eb-b426-3d04d2078a85",
"updated_at": "2024-09-05T05:05:25Z"
}

Samples


Retrieve a Transaction by Transaction ID

GET
/transactions/{trx_id}

Fetch the details of a specific transaction using its unique trx_id.

Authorizations

BearerAuth
TypeHTTP (bearer)

Parameters

Path Parameters

trx_id*

The unique transaction ID to be retrieved.

Typestring
Required
Exampletrx_01J5XCMDXCFXCAQ1BV8HVG6644

Responses

The details of the requested transaction.
application/json
JSON
{
"id": "trx_01J5XCMDXCFXCAQ1BV8HVG6644",
"type": "string",
"status": "string",
"order_amount": 10000,
"order_currency": "string",
"amount_authorized": 10000,
"amount_captured": 0,
"amount_voided": 0,
"amount_refunded": 0,
"external_id": "496de72d-d4a4-45eb-b426-3d04d2078a85",
"updated_at": "2024-09-05T05:05:25Z"
}

Samples


Capture or Void a Transaction

POST
/transactions/{trx_id}

Perform a capture or void operation on a previously authorized transaction. Specify an amount to partially capture or void. Full captures/voids will use the entire authorized amount.

Authorizations

BearerAuth
TypeHTTP (bearer)

Parameters

Path Parameters

trx_id*

The unique ID of the transaction to capture or void.

Typestring
Required
Exampletrx_01J5XCMDXCFXCAQ1BV8HVG6644

Request Body

JSON
{
"external_id": "496de72d-d4a4-45eb-b426-3d04d2078a85",
"operation": "string",
"amount": 5000
}

Responses

The transaction details after the capture or void operation.
application/json
JSON
{
"id": "trx_01J5XCMDXCFXCAQ1BV8HVG6644",
"type": "string",
"status": "string",
"order_amount": 10000,
"order_currency": "string",
"amount_authorized": 10000,
"amount_captured": 0,
"amount_voided": 0,
"amount_refunded": 0,
"external_id": "496de72d-d4a4-45eb-b426-3d04d2078a85",
"updated_at": "2024-09-05T05:05:25Z"
}

Samples


Refunds

Operations


Refund a Transaction

POST
/refunds

Initiates a refund for an already captured or settled transaction. Each refund is treated as a new transaction of type REFUND. Use GET /transactions to retrieve its details.

Authorizations

BearerAuth
TypeHTTP (bearer)

Request Body

JSON
{
"external_id": "496de72d-d4a4-45eb-b426-3d04d2078a85",
"trx_id": "trx_01J5XCMDXCFXCAQ1BV8HVG6644",
"amount": 5000
}

Responses

Details of the new refund transaction.
application/json
JSON
{
"id": "trx_01J5XCMDXCFXCAQ1BV8HVG6644",
"type": "string",
"status": "string",
"order_amount": 10000,
"order_currency": "string",
"amount_authorized": 10000,
"amount_captured": 0,
"amount_voided": 0,
"amount_refunded": 0,
"external_id": "496de72d-d4a4-45eb-b426-3d04d2078a85",
"updated_at": "2024-09-05T05:05:25Z"
}

Samples


Powered by VitePress OpenAPI