Transend Pay Mock Server
This mock server provides predefined responses for testing Transend Pay API integration. Use specific request parameters to trigger different response scenarios for comprehensive testing of your application's error handling and success flows.
Getting Started
The mock server accepts the same request format as the production API. Different responses are triggered by using specific values in your request parameters.
This server exists such that you can test different scenarios without affecting a live environment. You can build your own application with template data, test how your system handles specific errors, and validate your integration flows.
clientId in the Basic authorization header. For testing purposes, the mock server decodes the authorization header to determine which scenario to simulate. In an actual implementation, this value would never change.Persisted Data
Requests and transaction models are persisted in simple mock states. You can access these persisted states by using a consistent clientId throughout the flow. For example, you can reference requests created with getModal from the requests/supplier endpoint by using the same clientId in both calls.
Changing Request Statuses
You can change request statuses and obtain accepted transaction ids by opening the sandbox modal with your mock session id. More implementation details will be provided here soon.
Why would I want to emulate unauthorized or server errors?
You may want to design how your system handles error states in advance before they happen.
For example, in the getModal endpoint, you could define a flow where the plan id results in a server error (planId of 3). So, if the user tries to pay with this plan, the server throws an error. This emulates a scenario where the server would be failing unexpectedly in a production environment. From here, you can define a logical flow that informs the user of an error, gracefully navigates them back to the payment screen, or etc.
POST /api/v1/transendpay/getModal
Test different modal scenarios by varying the planId parameter. All requests use the same base format with different planId values. You can customize the amount attribute, but it will not persist. Authentication is provided via the Authorization: Basic header with base64-encoded credentials.
Request Format
{
"amount": 100.00,
"planId": <PLAN_ID>
}
Test Scenarios
| planId | Scenario | Description |
|---|---|---|
| 1 | Normal path | New session id returned successfully |
| 2 | Invalid Credit Plan | Force invalid credit plan error |
| 3 | Unexpected Error | Force generic server error |
Example Request
curl --location $HOST"/api/v1/transendpay/getModal" \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic '$(echo -n "client_id:client_secret" | base64) \
--data '{
"amount": 100.00,
"planId": 1
}'
Example Response
{
"sessionId": "mock-req-216b25f0-8229-4524-b4cd-782b4a82ae04"
}
POST /api/v1/transendpay/status
Test different session status scenarios by using specific sessionId values. You can either use the previously obtained sessionId from the getModal call, or you can explicitly set sessionId to force an error state. Statuses are set in the sandbox modal environment. Authentication is provided via the Authorization: Basic header with base64-encoded credentials.
Request Format
{
"sessionId": "<SESSION_ID>"
}
Test Scenarios
| sessionId | Scenario | Description |
|---|---|---|
| <SESSION_ID> | Normal Path | Returns status based on session id from getModal or set in sandbox modal |
| UNAUTHORIZED | Unauthorized | Force unauthorized error |
| UNEXPECTED_ERROR | Unexpected Server Error | Force generic server error |
Example Request
curl --location $HOST"/api/v1/transendpay/status" \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic '$(echo -n "client_id:client_secret" | base64) \
--data '{
"sessionId": "mock-req-216b25f0-8229-4524-b4cd-782b4a82ae04"
}'
Example Response
{
"sessionId": "mock-req-216b25f0-8229-4524-b4cd-782b4a82ae04",
"status": "ACCEPTED",
"acceptedTxId": "mock-atx-3a3fdcff-c619-41d9-a2d1-fffbdc1dc414"
}
POST /api/v1/transendpay/decision
Set a mock session’s status to PENDING, APPROVED (alias: ACCEPTED), or CLOSED. This endpoint is intentionally open in the mock environment (no authorization required) and updates persisted mock state used by other endpoints.
Request Format
{
"sessionId": "<SESSION_ID>",
"status": "PENDING | APPROVED | CLOSED"
}
Behavior
PENDING: Sets status to PENDING and clears anyacceptedTransactionId.APPROVED(orACCEPTED): Sets status to ACCEPTED and assigns anacceptedTransactionIdif one doesn’t exist.CLOSED: Sets status to CLOSED (does not changeacceptedTransactionId).
Example Requests
curl --location $HOST"/api/v1/transendpay/decision" \
--header 'Content-Type: application/json' \
--data '{
"sessionId": "mock-req-216b25f0-8229-4524-b4cd-782b4a82ae04",
"status": "APPROVED"
}'
curl --location $HOST"/api/v1/transendpay/decision" \
--header 'Content-Type: application/json' \
--data '{
"sessionId": "mock-req-216b25f0-8229-4524-b4cd-782b4a82ae04",
"status": "PENDING"
}'
Example Responses
{
"sessionId": "mock-req-216b25f0-8229-4524-b4cd-782b4a82ae04",
"status": "ACCEPTED",
"acceptedTxId": "mock-acc-5b4a7a61-3d4f-4a2d-8a0a-0e6c9b7f1c21"
}
{
"sessionId": "mock-req-216b25f0-8229-4524-b4cd-782b4a82ae04",
"status": "PENDING",
"acceptedTxId": null
}
GET /api/v1/transendpay/requests/supplier
Test fetching supplier requests by varying the clientId in the Authorization header. For testing purposes, use different clientId values in the base64-encoded credentials to simulate different scenarios.
Requests previously made with getModal are collected and returned here with template data.
Test Scenarios
| clientId (in Auth Header) | Scenario | Description |
|---|---|---|
| <CLIENT_ID> | Normal Path | Returns list of supplier requests based on provided client id |
| UNAUTHORIZED | Unauthorized | Force unauthorized error |
| UNEXPECTED_ERROR | Server Error | Force generic server error |
Example Request
curl --location $HOST"/api/v1/transendpay/requests/supplier" \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic '$(echo -n "client_id:client_secret" | base64)
Example Response
[
{
"txRequestId": "mock-req-216b25f0-8229-4524-b4cd-782b4a82ae04",
"amount": 10000,
"status": "ACCEPTED",
"createdAt": "2025-10-28T15:30:59.776538300Z",
"expiresAt": "2025-10-28T15:30:59.776538300Z"
}
]
GET /api/v1/transendpay/preauths/supplier
Test fetching supplier preauths (accepted transactions) by varying the clientId in the Authorization header. For testing purposes, use different clientId values in the base64-encoded credentials to simulate different scenarios.
Accepted transactions created in the sandbox modal are collected and returned here with template data.
Test Scenarios
| clientId (in Auth Header) | Scenario | Description |
|---|---|---|
| <CLIENT_ID> | Normal Path | Returns list of accepted transactions based on provided client id |
| UNAUTHORIZED | Unauthorized | Force unauthorized error |
| UNEXPECTED_ERROR | Server Error | Force generic server error |
Example Request
curl --location $HOST"/api/v1/transendpay/preauths/supplier" \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic '$(echo -n "client_id:client_secret" | base64)
Example Response
[
{
"id": "mock-atx-3a3fdcff-c619-41d9-a2d1-fffbdc1dc414",
"txRequestId": "mock-req-216b25f0-8229-4524-b4cd-782b4a82ae04",
"capturedAmount": 2000,
"voidedAmount": 1000,
"totalAmount": 10000,
"createdAt": "2025-10-28T15:10:03.748819500Z",
"lastUpdatedAt": "2025-10-28T15:10:03.748819500Z"
}
]
POST /api/v1/transendpay/transactions/supplier
Test fetching supplier transactions by varying the clientId in the Authorization header. For testing purposes, use different clientId values in the base64-encoded credentials to simulate different scenarios.
This endpoint returns template data.
Request Format
{}
Test Scenarios
| clientId (in Auth Header) | Scenario | Description |
|---|---|---|
| <CLIENT_ID> | Normal Path | Returns list of transactions based on provided client id |
| UNAUTHORIZED | Unauthorized | Force unauthorized error |
| UNEXPECTED_ERROR | Server Error | Force generic server error |
Example Request
curl --location $HOST"/api/v1/transendpay/transactions/supplier" \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic '$(echo -n "client_id:client_secret" | base64)
Example Response
[
{
"transactionId": "mock-tx-fd116daa-41de-4ee7-b79d-88a46b0be16e",
"amount": 1500,
"status": "0",
"lastUpdateDate": "2025-10-28",
"currentBalance": 1000,
"loanNumber": "mock-ln-1000"
},
{
"transactionId": "mock-tx-eaf3a2d6-705d-4146-a4a9-d4fb68de1384",
"amount": 2500,
"status": "0",
"lastUpdateDate": "2025-10-27",
"currentBalance": 2000,
"loanNumber": "mock-ln-1001"
},
{
"transactionId": "mock-tx-b5ecaabb-5402-4158-9df9-598994f84a01",
"amount": 3500,
"status": "0",
"lastUpdateDate": "2025-10-26",
"currentBalance": 3000,
"loanNumber": "mock-ln-1002"
}
]
POST /api/v1/transendpay/capture/:acceptedTxId
Test capture transaction scenarios by varying the clientId in the Authorization header. This endpoint captures funds from an accepted transaction. For testing purposes, use different clientId values in the base64-encoded credentials to simulate different scenarios.
The maximum amount that can be captured is set to a constant value of $10,000.00. Exceeding this amount will return an error.
Request Format
{
"amount": 10000,
"memo": ""
}
Path Parameters
| Parameter | Description |
|---|---|
| acceptedTxId | The ID of the accepted transaction to capture |
Test Scenarios
| clientId (in Auth Header) | Scenario | Description |
|---|---|---|
| <CLIENT_ID> | Normal Path | Returns a successful capture event (does not persist capture state) |
| NO_CAPTURES | No captures available to refund | Force no captures error |
| UNAUTHORIZED | Unauthorized | Force unauthorized error |
| UNEXPECTED_ERROR | Server Error | Force generic server error |
Example Request
curl --location $HOST"/api/v1/transendpay/capture/ACCEPTED_TRANSACTION_ID" \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic '$(echo -n "client_id:client_secret" | base64) \
--data '{
"amount": 10000,
"memo": "Example capture memo"
}'
Example Response
{
"id": "mock-evt-b7cab8e3-233c-4f43-b7cb-ac59a95a05d2",
"acceptedTxId": "mock-atx-3a3fdcff-c619-41d9-a2d1-fffbdc1dc414",
"amount": 10000,
"status": "CAPTURED",
"txRequestId": "mock-req-216b25f0-8229-4524-b4cd-782b4a82ae04",
"createdAt": "2025-10-28T15:07:31.054817600Z",
"lastUpdatedAt": "2025-10-28T15:07:31.054817600Z"
}
POST /api/v1/transendpay/refund/:acceptedTxId
Test refund transaction scenarios by varying the clientId in the Authorization header. This endpoint adds a refunded amount to an accepted transaction. For testing purposes, use different clientId values in the base64-encoded credentials to simulate different scenarios.
The maximum amount that can be refunded is set to a constant value of $2,000.00. Exceeding this amount will return an error.
Request Format
{
"amount": 2000
}
Path Parameters
| Parameter | Description |
|---|---|
| acceptedTxId | The ID of the accepted transaction to refund |
Test Scenarios
| clientId (in Auth Header) | Scenario | Description |
|---|---|---|
| <CLIENT_ID> | Normal Path | Returns a successful refund event (does not persist refunded state) |
| UNAUTHORIZED | Unauthorized | Force unauthorized error |
| UNEXPECTED_ERROR | Server Error | Force generic server error |
Example Request
curl --location $HOST"/api/v1/transendpay/refund/ACCEPTED_TRANSACTION_ID" \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic '$(echo -n "client_id:client_secret" | base64) \
--data '{
"amount": 2000
}'
Example Response
{
"id": "mock-evt-ca42659f-b2a3-438b-b5cf-5f32c6c15264",
"acceptedTxId": "mock-atx-3a3fdcff-c619-41d9-a2d1-fffbdc1dc414",
"amount": 2000,
"status": "REFUNDED",
"txRequestId": "mock-req-216b25f0-8229-4524-b4cd-782b4a82ae04",
"createdAt": "2025-10-28T15:31:14.971366400Z",
"lastUpdatedAt": "2025-10-28T15:31:14.971366400Z"
}
POST /api/v1/transendpay/void/:acceptedTxId
Test void transaction scenarios by varying the clientId in the Authorization header. This endpoint voids an accepted transaction. For testing purposes, use different clientId values in the base64-encoded credentials to simulate different scenarios.
The maximum amount that can be voided is set to a constant value of $10,000.00. Exceeding this amount will return an error.
Request Format
{
"amount": 10000
}
Path Parameters
| Parameter | Description |
|---|---|
| acceptedTxId | The ID of the accepted transaction to void |
Test Scenarios
| clientId (in Auth Header) | Scenario | Description |
|---|---|---|
| <CLIENT_ID> | Normal Path | Returns a successful void event (does not persist voided state) |
| UNAUTHORIZED | Unauthorized | Force unauthorized error |
| UNEXPECTED_ERROR | Server Error | Force generic server error |
Example Request
curl --location $HOST"/api/v1/transendpay/void/ACCEPTED_TRANSACTION_ID" \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic '$(echo -n "client_id:client_secret" | base64) \
--data '{
"amount": 10000
}'
Example Response
{
"id": "mock-evt-8486fead-2a07-44d3-8d5a-05e0fc0688f5",
"acceptedTxId": "mock-atx-3a3fdcff-c619-41d9-a2d1-fffbdc1dc414",
"amount": 10000,
"status": "VOIDED",
"txRequestId": "mock-req-216b25f0-8229-4524-b4cd-782b4a82ae04",
"createdAt": "2025-10-28T15:31:28.035102500Z",
"lastUpdatedAt": "2025-10-28T15:31:28.035102500Z"
}