All API requests must be authenticated using API Key and API Secret headers.
| Header Name | Description |
|---|---|
| X-API-KEY | Your API Key |
| X-API-SECRET | Your API Secret |
These credentials are unique to each merchant and must be included in every API request. Requests without valid credentials will receive a 401 Unauthorized response. You can get credentials from Settings page in our dashboard.
curl -X POST https://api.example.com/api/payment \
-H "Content-Type: application/json" \
-H "X-API-KEY: your_api_key_here" \
-H "X-API-SECRET: your_api_secret_here" \
-d '{"orderId": "ORD-12345", ...}'
Ensure that your API Key and API Secret are kept secure and not shared publicly.
Endpoint: POST /api/payment
Description: Process a payment transaction
{
"orderId": "string",
"amount": "number",
"currency": "string",
"cardHolderName": "string",
"pan": "string",
"expiryMonth": "string",
"expiryYear": "string",
"cvv": "string",
"requestIp": "string",
"requestPort": "number",
"customerId": "string"
}
| Field | Description | Example |
|---|---|---|
| orderId | Client's tracking number for the order | ORD-12345 |
| amount | Transaction amount | 100.50 |
| currency | Currency code | TRY |
| cardHolderName | Name of the card holder | John Doe |
| pan | Primary Account Number (card number) | 5421190122090656 |
| expiryMonth | Card expiry month (2 digits) | 04 |
| expiryYear | Card expiry year (2 digits) | 28 |
| cvv | Card Verification Value | 916 |
| requestIp | IP address of the client making the request | 192.168.1.1 |
| requestPort | Port number of the client making the request | 8080 |
| customerId | Optional unique identifier for the customer | CUST-12345 |
Returns an ApiPaymentResponse object with payment details.
{
"paymentId": "UUID",
"orderId": "string",
"amount": "number",
"installmentCount": "number",
"currency": "string",
"merchantCommission": "number",
"status": "string",
"paymentDate": "date",
"cardHolderName": "string",
"pan": "string",
"domInt": "string",
"cardScheme": "string",
"cardType": "string",
"loyaltyCode": "string",
"externalTransactionId": "string",
"authCode": "string",
"resultCode": "string",
"resultMessage": "string",
"customerId": "string"
}
| Field | Description | Example |
|---|---|---|
| paymentId | Unique identifier for the payment | 123e4567-e89b-12d3-a456-426614174000 |
| orderId | Client's tracking number for the order | ORD-12345 |
| amount | Transaction amount | 100.50 |
| installmentCount | Number of installments | 3 |
| currency | Currency code | TRY |
| merchantCommission | Commission charged to the merchant | 2.50 |
| status | Payment status (SUCCESS, FAILED, ENROLLED) | SUCCESS |
| paymentDate | Date and time of the payment | 2023-05-01T14:30:00Z |
| cardHolderName | Name of the card holder | John Doe |
| pan | Masked Primary Account Number | 411111******1111 |
| domInt | Domestic or International transaction | DOM |
| cardScheme | Card scheme (e.g., VISA, MASTERCARD) | VISA |
| cardType | Type of card (e.g., CREDIT, DEBIT) | CREDIT |
| loyaltyCode | Loyalty program code (if applicable) | GOLD123 |
| externalTransactionId | Transaction ID from the payment provider | EXT123456789 |
| authCode | Authorization code from the payment provider | AUTH987654 |
| resultCode | Result code from the payment provider | SUCCESS |
| resultMessage | Result message from the payment provider | Successful |
| customerId | Unique identifier for the customer (if provided) | CUST-12345 |
Endpoint: POST /api/pre-authorization
Description: Process a pre-authorization transaction
{
"orderId": "string",
"amount": "number",
"currency": "string",
"cardHolderName": "string",
"pan": "string",
"expiryMonth": "string",
"expiryYear": "string",
"cvv": "string",
"requestIp": "string",
"requestPort": "number",
"customerId": "string"
}
| Field | Description | Example |
|---|---|---|
| orderId | Client's tracking number for the order | ORD-12345 |
| amount | Transaction amount | 100.50 |
| currency | Currency code | TRY |
| cardHolderName | Name of the card holder | John Doe |
| pan | Primary Account Number (card number) | 5421190122090656 |
| expiryMonth | Card expiry month (2 digits) | 04 |
| expiryYear | Card expiry year (2 digits) | 28 |
| cvv | Card Verification Value | 916 |
| requestIp | IP address of the client making the request | 192.168.1.1 |
| requestPort | Port number of the client making the request | 8080 |
| customerId | Optional unique identifier for the customer | CUST-12345 |
Returns an ApiPaymentResponse object with pre-authorization details (same as Payment response).
Endpoint: POST /api/pre-authorization/{paymentId}/capture
Description: Capture a previously authorized payment
{
"amount": "number",
"currency": "string"
}
| Field | Description | Example |
|---|---|---|
| amount | Amount to capture (can be less than or equal to the pre-authorized amount) | 90.00 |
| currency | Currency code | TRY |
Returns an ApiPaymentResponse object with capture details (same as Payment response).
Description: Process a 3D Secure payment
Endpoint: POST /api/3ds
{
"orderId": "string",
"amount": "number",
"currency": "string",
"installmentCount": "number",
"interestPaidByCustomer": "boolean",
"cardHolderName": "string",
"pan": "string",
"expiryMonth": "string",
"expiryYear": "string",
"cvv": "string",
"successUrl": "string",
"failureUrl": "string",
"requestIp": "string",
"requestPort": "number",
"customerId": "string"
}
| Field | Description | Example |
|---|---|---|
| orderId | Client's tracking number for the order | ORD-12345 |
| amount | Transaction amount | 100.50 |
| currency | Currency code | TRY |
| installmentCount | Number of installments (optional, default 1). You should check available installment options via Installment Options API before setting this value. | 3 |
| interestPaidByCustomer | Whether interest is paid by customer (optional) | true |
| cardHolderName | Name of the card holder | John Doe |
| pan | Primary Account Number (card number) | 5421190122090656 |
| expiryMonth | Card expiry month (2 digits) | 04 |
| expiryYear | Card expiry year (2 digits) | 28 |
| cvv | Card Verification Value | 916 |
| successUrl | URL to redirect after successful 3D Secure authentication | https://example.com/3ds/success |
| failureUrl | URL to redirect after failed 3D Secure authentication | https://example.com/3ds/failure |
| requestIp | IP address of the client making the request | 192.168.1.1 |
| requestPort | Port number of the client making the request | 8080 |
| customerId | Optional unique identifier for the customer | CUST-12345 |
{
"paymentId": "UUID",
"success": "boolean",
"resultCode": "string",
"resultMessage": "string",
"htmlContent": "string"
}
| Field | Description | Example |
|---|---|---|
| paymentId | Unique identifier for the payment | 123e4567-e89b-12d3-a456-426614174000 |
| success | Indicates if the enrollment was successful | true |
| resultCode | Result code from the 3D Secure enrollment | SUCCESS |
| resultMessage | Result message from the 3D Secure enrollment | Successful |
| htmlContent | HTML content to be presented to the end user for 3D Secure authentication | <form action="https://3ds.example.com" method="POST">...</form> |
Present the returned htmlContent to the end user. This typically involves rendering an iframe or
redirecting the user to complete the 3D Secure authentication.
After the authentication process, the payment provider will call the provided callback URLs (success or failure) with relevant parameters posted as form data.
| Field | Description | Example |
|---|---|---|
| paymentId | Unique identifier for the payment | 123e4567-e89b-12d3-a456-426614174000 |
| securityKey | Security key received from the 3D Secure authentication process | 3DS_AUTH_KEY_123456 |
Endpoint: POST /api/3ds/{paymentId}/complete
{
"securityKey": "string"
}
| Field | Description | Example |
|---|---|---|
| securityKey | Security key received from the 3D Secure authentication process | 3DS_AUTH_KEY_123456 |
Returns an ApiPaymentResponse object with completed 3D Secure payment details (same as Payment response).
htmlContent to the end user for 3D Secure authentication.paymentId and securityKey from the
form data.paymentId and
securityKey.
Endpoint: POST /api/installment-options
Description: Get available installment options for a card
{
"amount": "number",
"currency": "string",
"pan": "string",
"maxInstallmentCount": "number",
"interestPaidByCustomer": "boolean"
}
| Field | Description | Example |
|---|---|---|
| amount | Transaction amount | 1000.00 |
| currency | Currency code | TRY |
| pan | Primary Account Number (card number) | 5421190122090656 |
| maxInstallmentCount | Maximum number of installments to retrieve (optional) | 12 |
| interestPaidByCustomer | Whether interest is paid by customer (optional) | true |
{
"options": [
{
"installmentCount": 2,
"installmentAmount": 510.00,
"currency": "TRY",
"interestAmount": 20.00,
"totalAmount": 1020.00
},
{
"installmentCount": 3,
"installmentAmount": 345.00,
"currency": "TRY",
"interestAmount": 35.00,
"totalAmount": 1035.00
}
]
}
| Field | Description | Example |
|---|---|---|
| installmentCount | Number of installments | 3 |
| installmentAmount | Amount per installment | 345.00 |
| currency | Currency code | TRY |
| interestAmount | Total interest amount | 35.00 |
| totalAmount | Total amount to be paid | 1035.00 |
Description: Create a checkout link and process payment
Endpoint: POST /api/checkout
{
"orderId": "string",
"amount": "number",
"currency": "string",
"description": "string",
"callback": "string",
"customerId": "string",
"maxInstallmentCount": "number",
"interestPaidByCustomer": "boolean"
}
| Field | Description | Example |
|---|---|---|
| orderId | Client's tracking number for the order | ORD-12345 |
| amount | Transaction amount | 100.50 |
| currency | Currency code | TRY |
| description | Description of the checkout | Product purchase |
| callback | URL to be called after payment processing | https://example.com/payment-callback |
| customerId | Optional unique identifier for the customer | CUST-12345 |
| maxInstallmentCount | Maximum number of installments allowed on the checkout page (optional, defaults to 1 — single payment). Installment options will be available based on the card type and merchant configuration. | 6 |
| interestPaidByCustomer | Whether installment interest is paid by the customer (optional, defaults to false) | true |
{
"checkoutId": "UUID",
"redirectUrl": "string"
}
| Field | Description | Example |
|---|---|---|
| checkoutId | Unique identifier for the checkout | 123e4567-e89b-12d3-a456-426614174000 |
| redirectUrl | URL to redirect the user for payment | https://api.example.com/checkout-link/123e4567-e89b-12d3-a456-426614174000 |
After receiving the response, redirect the user to the redirectUrl to complete the payment.
After the payment is processed, the callback URL provided in the checkout creation request will be called
with the checkoutId as form data.
Endpoint: GET /api/checkout/{checkoutId}
Returns an ApiPaymentResponse object with payment details (same as Payment response).
redirectUrl.checkoutId from the form data.checkoutId.
// Create checkout link
const createCheckout = async (orderDetails) => {
const response = await fetch('https://api.example.com/api/checkout', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-API-KEY': 'your_api_key_here',
'X-API-SECRET': 'your_api_secret_here'
},
body: JSON.stringify(orderDetails)
});
const data = await response.json();
return data.redirectUrl;
};
// Callback handler
app.post('/payment-callback', async (req, res) => {
const checkoutId = req.body.checkoutId;
const checkoutStatus = await getCheckoutStatus(checkoutId);
if (checkoutStatus.status === 'SUCCESS') {
// Process successful payment
console.log('Payment successful');
} else {
// Handle failed payment
console.log('Payment failed');
}
res.sendStatus(200);
});
// Get checkout status
const getCheckoutStatus = async (checkoutId) => {
const response = await fetch(`https://api.example.com/api/checkout/${checkoutId}`, {
method: 'GET',
headers: {
'X-API-KEY': 'your_api_key_here',
'X-API-SECRET': 'your_api_secret_here'
}
});
return await response.json();
};