SmartCore API
Authorization
For authentication every merchant has MerchantKey and Secret.
We use Basic auth: with every request you must send header:
Authorization: Basic base64(${merchantKey}:${secret})
Content-Type: application/json
API
API URLs
PCI DSS requests: https://chd-api.smartcore.pro
Other requests: https://api-gateway.smartcore.pro
Test cards
Before a production account is issued, you will have a test account, use the following cards to test integration.
Payment transaction
Card | Result |
---|---|
4012000000003010 | Frictionless Flow, Success |
4003830171874018 | Challenge Flow, Success or Fail |
All Others | Fail |
Withdrawal transaction
Card | Result |
---|---|
4012000000003010 | Success |
All Others | Fail |
Create payment form
Generate link to a payment form. PCI DSS compliance from your side is not required. Customer inputs card details into our payment form.
Card Payment Form
Create payment form for card payments.
Google Pay transactions will be processed using Hosted Checkout.
HTTP Request
POST https://api-gateway.smartcore.pro/initPayment
curl --location 'https://api-gateway.smartcore.pro/initPayment' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic dGVzdDpxd2VydHk=' \
--data-raw '{
"account": "EUR-sandbox",
"amount": 1000,
"currency": "EUR",
"order_id": "sandboxFormId_1015",
"merchant_site": "https://merchant.site",
"recurrent": false,
"purpose": "description",
"customer_first_name": "John",
"customer_last_name": "Doe",
"customer_address": "10 Downing Street",
"customer_city": "London",
"customer_zip_code": 121165,
"customer_country": "GB",
"customer_phone": "+442079460612",
"customer_email": "[email protected]",
"customer_ip_address": "127.0.0.1",
"success_url": "https://site.com/success",
"fail_url": "https://site.com/fail",
"callback_url": "https://site.com/callback",
"status_url": "https://site.com/redir"
}'
The above command returns JSON structured like this:
{
"ACSUrl": null,
"MD": null,
"TermUrl": null,
"description": "",
"status": 1,
"form_url": "https://payment.smartcore.pro/64a7e106d46c5db10d082b13",
"order_id": "sandboxFormId_1015",
"responseType": "REDIRECT"
}
Request parameters
Parameter | Required | Type | Description |
---|---|---|---|
account | true | String | Merchant Account Name |
amount | true | Long | Amount in Cents |
currency | true | String | Currency Alpha3 Code |
order_id | true | String | Merchant Order ID |
merchant_site | false | String | Merchant Site URL |
recurrent | false | Boolean | Is Recurrent Payment |
purpose | false | String | Order Description |
customer_first_name | true | String | Customer First Name |
customer_last_name | true | String | Customer Last Name |
customer_address | true | String | Customer Address |
customer_city | true | String | Customer city |
customer_zip_code | true | String | Customer Zip Code |
customer_country | true | String | Customer Country Code |
customer_phone | true | String | Customer Phone |
customer_email | true | String | Customer Email |
customer_ip_address | true | String | Customer IP Address |
callback_url | false | String | Callback URL which receives notifications when transaction status changes |
success_url | false | String | Redirect URL for successful transaction |
fail_url | false | String | Redirect URL for failed transaction |
status_url | false | String | Status URL |
Response parameters
Parameter | Required | Type | Description |
---|---|---|---|
status | true | Int | Transaction status |
form_url | false | String | Redirect url |
order_id | false | String | Processing Order ID in our system |
err | false | String | Error reason |
Mobile Commerce
Create payment form for mobile payments with prefilled phone number.
HTTP Request
POST https://api-gateway.smartcore.pro/initPayment
curl --location 'https://api-gateway.smartcore.pro/initPayment' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic dGVzdDpxd2VydHk=' \
--data-raw '{
"account": "EUR-sandbox",
"amount": 1000,
"currency": "EUR",
"order_id": "sandboxFormId_1015",
"merchant_site": "https://merchant.site",
"recurrent": false,
"purpose": "description",
"customer_first_name": "John",
"customer_last_name": "Doe",
"customer_address": "10 Downing Street",
"customer_city": "London",
"customer_zip_code": 121165,
"customer_country": "GB",
"customer_phone": "+442079460612",
"customer_email": "[email protected]",
"customer_ip_address": "127.0.0.1",
"success_url": "https://site.com/success",
"fail_url": "https://site.com/fail",
"callback_url": "https://site.com/callback",
"status_url": "https://site.com/redir",
"form_prefilled_phone": "7122321576"
}'
The above command returns JSON structured like this:
{
"ACSUrl": null,
"MD": null,
"TermUrl": null,
"description": "",
"status": 1,
"form_url": "https://payment.smartcore.pro/64a7e106d46c5db10d082b13",
"order_id": "sandboxFormId_1015",
"responseType": "REDIRECT"
}
Request parameters
Parameter | Required | Type | Description |
---|---|---|---|
account | true | String | Merchant Account Name |
amount | true | Long | Amount in Cents |
currency | true | String | Currency Alpha3 Code |
order_id | true | String | Merchant Order ID |
merchant_site | false | String | Merchant Site URL |
recurrent | false | Boolean | Is Recurrent Payment |
purpose | false | String | Order Description |
customer_first_name | true | String | Customer First Name |
customer_last_name | true | String | Customer Last Name |
customer_address | true | String | Customer Address |
customer_city | true | String | Customer city |
customer_zip_code | true | String | Customer Zip Code |
customer_country | true | String | Customer Country Code |
customer_phone | true | String | Customer Phone |
customer_email | true | String | Customer Email |
customer_ip_address | true | String | Customer IP Address |
callback_url | false | String | Callback URL which receives notifications when transaction status changes |
success_url | false | String | Redirect URL for successful transaction |
fail_url | false | String | Redirect URL for failed transaction |
status_url | false | String | Status URL |
form_prefilled_phone | false | String | Phone number to be prefilled on payment form (example: 7122321576) |
Response parameters
Parameter | Required | Type | Description |
---|---|---|---|
status | true | Int | Transaction status |
form_url | false | String | Redirect url |
order_id | false | String | Processing Order ID in our system |
err | false | String | Error reason |
Create direct payment
Customer payment details are transferred from merchant to our server. PCI DSS compliance from your side is required.
Direct card payment
Process card payments directly without payment form.
HTTP Request
POST https://chd-api.smartcore.pro/initPaymentHost2Host
curl --location 'https://chd-api.smartcore.pro/initPaymentHost2Host' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic dGVzdDpxd2VydHk=' \
--data-raw '{
"payment_method": "card",
"account": "EUR-sandbox",
"amount": 1000,
"currency": "EUR",
"order_id": "sandboxId_1015",
"merchant_site": "https://merchant.site",
"recurrent": false,
"purpose": "description",
"customer_first_name": "John",
"customer_last_name": "Doe",
"customer_address": "10 Downing Street",
"customer_city": "London",
"customer_zip_code": 121165,
"customer_country": "GB",
"customer_phone": "+442079460612",
"customer_email": "[email protected]",
"customer_ip_address": "127.0.0.1",
"success_url": "https://site.com/success",
"fail_url": "https://site.com/fail",
"callback_url": "https://site.com/callback",
"status_url": "https://site.com/redir",
"card_holder": "John Doe",
"card_number": "4012000000003010",
"card_exp_month": "02",
"card_exp_year": "25",
"card_cvv": "123"
}'
The above command returns JSON structured like this:
{
"form_url": "https://payment.smartcore.pro/64a7eec2d46c5db10d082b3d",
"threeDSMethodData": null,
"order_id": "sandboxId_1015",
"status": 1,
"stage": null,
"description": "",
"endDate": null,
"responseType": "REDIRECT",
"err": null,
"msg": null,
"paReq": null,
"creq": null,
"md": null,
"termUrl": null,
"acsurl": null
}
Request parameters
Parameter | Required | Type | Description |
---|---|---|---|
account | true | String | Merchant Account Name |
amount | true | Long | Amount in Cents |
currency | true | String | Currency Alpha3 Code |
order_id | true | String | Merchant Order ID |
merchant_site | true | String | Merchant Site URL |
recurrent | false | Boolean | Is Recurrent Payment |
purpose | false | String | Order Description |
customer_first_name | true | String | Customer First Name |
customer_last_name | true | String | Customer Last Name |
customer_address | true | String | Customer Address |
customer_city | true | String | Customer City |
customer_zip_code | true | String | Customer Zip Code |
customer_country | true | String | Customer Country Code |
customer_phone | true | String | Customer Phone |
customer_email | true | String | Customer Email |
customer_ip_address | true | String | Customer IP Address |
callback_url | false | String | Callback URL which receives notifications when transaction status changes |
success_url | false | String | Redirect URL for successful transaction |
fail_url | false | String | Redirect URL for failed transaction |
status_url | false | String | Status URL |
payment_method | false | String | Payment method (use "card" for card payments) |
card_holder | true | String | Customer Card holder |
card_number | true | String | Customer Card number |
card_exp_month | true | String | Customer Card expiration month |
card_exp_year | true | String | Customer Card expiration year |
card_cvv | true | String | Customer Card cvv |
recur_freq | false | Long | Payment frequency specifies the minimum number of days between authorizations |
recur_exp | false | Long | Duration of periodic payments. After this date no authorization will be serviced. Should be specified according to ISO 8601, example: "2023-12-13T14:00:53.421Z" |
browser_accept_header | false | String | Browser Accept Header |
browser_user_agent | false | String | Browser User Agent |
browser_java_enabled | false | Boolean | Is Java Enabled |
browser_js_enabled | false | Boolean | Is Javascript Enabled |
browser_color_depth | false | String | Browser Color Depth |
browser_screen_height | false | String | Browser Screen Height |
browser_screen_width | false | String | Browser Screen Width |
browser_language | false | String | Browser Language |
browser_time_zone | false | String | Browser Time Zone |
Response parameters
Parameter | Required | Type | Description |
---|---|---|---|
status | true | Int | Transaction status |
form_url | false | String | Redirect url |
order_id | false | String | Processing Order ID in our system |
err | false | String | Error reason |
Direct ApplePay DPan payment
Process ApplePay DPan payments directly.
HTTP Request
POST https://chd-api.smartcore.pro/initPaymentHost2Host
curl --location 'https://chd-api.smartcore.pro/initPaymentHost2Host' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic dGVzdDpxd2VydHk=' \
--data-raw '{
"payment_method": "applePayDPan",
"account": "EUR-sandbox",
"amount": 1000,
"currency": "EUR",
"order_id": "sandboxId_1015",
"merchant_site": "https://merchant.site",
"recurrent": false,
"purpose": "description",
"customer_first_name": "John",
"customer_last_name": "Doe",
"customer_address": "10 Downing Street",
"customer_city": "London",
"customer_zip_code": 121165,
"customer_country": "GB",
"customer_phone": "+442079460612",
"customer_email": "[email protected]",
"customer_ip_address": "127.0.0.1",
"success_url": "https://site.com/success",
"fail_url": "https://site.com/fail",
"callback_url": "https://site.com/callback",
"status_url": "https://site.com/redir",
"apple_pay_dpan": "eyJhcHBsaWNhdGlvblByaW1hcnlBY2NvdW50TnVtYmVyIjoiKioqIiwiYXBwbGljYXRpb25FeHBpcmF0aW9uRGF0ZSI6IioqKiIsImN1cnJlbmN5Q29kZSI6Ijk3OCIsInRyYW5zYWN0aW9uQW1vdW50IjoxMDAsImRldmljZU1hbnVmYWN0dXJlcklkZW50aWZpZXIiOiIqKioiLCJwYXltZW50RGF0YVR5cGUiOiIzRFNlY3VyZSIsInBheW1lbnREYXRhIjp7Im9ubGluZVBheW1lbnRDcnlwdG9ncmFtIjoiKioqIiwiZWNpSW5kaWNhdG9yIjoiNyJ9fQ==",
"apple_pay_payment_method_network": "Visa"
}'
The above command returns JSON structured like this:
{
"form_url": "https://payment.smartcore.pro/64a7eec2d46c5db10d082b3d",
"threeDSMethodData": null,
"order_id": "64a7eec2d46c5db10d082b3d",
"status": 1,
"stage": null,
"description": "",
"endDate": null,
"responseType": "REDIRECT",
"err": null,
"msg": null,
"paReq": null,
"creq": null,
"md": null,
"termUrl": null,
"acsurl": null
}
Request parameters
Parameter | Required | Type | Description |
---|---|---|---|
account | true | String | Merchant Account Name |
amount | true | Long | Amount in Cents |
currency | true | String | Currency Alpha3 Code |
order_id | true | String | Merchant Order ID |
merchant_site | true | String | Merchant Site URL |
recurrent | false | Boolean | Is Recurrent Payment |
purpose | false | String | Order Description |
customer_first_name | true | String | Customer First Name |
customer_last_name | true | String | Customer Last Name |
customer_address | true | String | Customer Address |
customer_city | true | String | Customer City |
customer_zip_code | true | String | Customer Zip Code |
customer_country | true | String | Customer Country Code |
customer_phone | true | String | Customer Phone |
customer_email | true | String | Customer Email |
customer_ip_address | true | String | Customer IP Address |
callback_url | false | String | Callback URL which receives notifications when transaction status changes |
success_url | false | String | Redirect URL for successful transaction |
fail_url | false | String | Redirect URL for failed transaction |
status_url | false | String | Status URL |
payment_method | true | String | Payment method (use "applePayDPan" for ApplePay DPan payments) |
apple_pay_dpan | true | String | Base64 of decoded value of paymentData.data token field |
apple_pay_payment_method_network | true | String | Value of paymentMethod.network token field |
recur_freq | false | Long | Payment frequency specifies the minimum number of days between authorizations |
recur_exp | false | Long | Duration of periodic payments. After this date no authorization will be serviced. Should be specified according to ISO 8601, example: "2023-12-13T14:00:53.421Z" |
browser_accept_header | false | String | Browser Accept Header |
browser_user_agent | false | String | Browser User Agent |
browser_java_enabled | false | Boolean | Is Java Enabled |
browser_js_enabled | false | Boolean | Is Javascript Enabled |
browser_color_depth | false | String | Browser Color Depth |
browser_screen_height | false | String | Browser Screen Height |
browser_screen_width | false | String | Browser Screen Width |
browser_language | false | String | Browser Language |
browser_time_zone | false | String | Browser Time Zone |
Response parameters
Parameter | Required | Type | Description |
---|---|---|---|
status | true | Int | Transaction status |
form_url | false | String | Redirect url |
order_id | false | String | Processing Order ID in our system |
err | false | String | Error reason |
Direct GooglePay DPan payment
Process GooglePay DPan payments directly.
To process a payment by directly receiving a Google Pay token involves two steps. First, you need to integrate with Google Pay™ API. Second, you need to use our API to process the payment. The process of the integration is described below.
Google Pay™ API Integration
The process of integration with Google Pay™ API for web payments is fully described in Google Pay Web developer documentation, Google Pay Web integration checklist and Google Pay Web Brand Guidelines.
To integrate with Google Pay™, you need to implement PAYMENT_GATEWAY integration type.
If you are using Google Pay™ API for Android follow Google Pay Android developer documentation, Google Pay Android integration checklist and Google Pay Android brand guidelines.
Processing of the Google Pay™ is held in cooperation with PrimePay LLP.
Pass the following tokenizationSpecification to the PaymentDataRequest object:
const tokenizationSpecification = {
type: 'PAYMENT_GATEWAY',
parameters: {
'gateway': 'primepay',
'gatewayMerchantId': '<provided by PrimePay>'
}
};
To get your integration approved by Google Pay™, ensure that you follow brand guidelines and fulfilled all the requirements.
3DS Authentication
There are two card authentication methods for Google Pay™:
- PAN_ONLY - This authentication method is associated with payment cards stored on file with the user's Google Account. Returned payment data includes personal account number (PAN) with the expiration month and the expiration year.
- CRYPTOGRAM_3DS - This authentication method is associated with cards stored as Android device tokens. Returned payment data includes a 3-D Secure (3DS) cryptogram generated on the device.
Processing forces all Google Pay™ transactions using the PAN_ONLY data type undergo 3D Secure authentication. No additional parameters are required for this process. Enabling 3D Secure ensures a liability shift and reduces payment risks for PAN_ONLY transactions.
API Integration
HTTP Request
POST https://chd-api.smartcore.pro/initPaymentHost2Host
curl --location 'https://chd-api.smartcore.pro/initPaymentHost2Host' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic dGVzdDpxd2VydHk=' \
--data-raw '{
"payment_method": "googlePayDPan",
"account": "EUR-sandbox",
"amount": 1000,
"currency": "EUR",
"order_id": "sandboxId_1015",
"merchant_site": "https://merchant.site",
"recurrent": false,
"purpose": "description",
"customer_first_name": "John",
"customer_last_name": "Doe",
"customer_address": "10 Downing Street",
"customer_city": "London",
"customer_zip_code": 121165,
"customer_country": "GB",
"customer_phone": "+442079460612",
"customer_email": "[email protected]",
"customer_ip_address": "127.0.0.1",
"success_url": "https://site.com/success",
"fail_url": "https://site.com/fail",
"callback_url": "https://site.com/callback",
"status_url": "https://site.com/redir",
"google_pay_dpan": "eyJzaWduYXR1cmUiOiIqKioiLCJpbnRlcm1lZGlhdGVTaWduaW5nS2V5Ijp7InNpZ25lZEtleSI6Insia2V5VmFsdWUiOiIqKioiLCJrZXlFeHBpcmF0aW9uIjoiMTcxMTQzNDQ1MjgzNiJ9Iiwic2lnbmF0dXJlcyI6WyIqKioiXX0sInByb3RvY29sVmVyc2lvbiI6IkVDdjIiLCJzaWduZWRNZXNzYWdlIjoieyJlbmNyeXB0ZWRNZXNzYWdlIjoiKioqIiwiZXBoZW1lcmFsUHVibGljS2V5IjoiKioqIiwidGFnIjoiKioqIn0ifQ",
"google_pay_payment_method_network": "Visa"
}'
The above command returns JSON structured like this:
{
"form_url": "https://payment.smartcore.pro/64a7eec2d46c5db10d082b3d",
"threeDSMethodData": null,
"order_id": "64a7eec2d46c5db10d082b3d",
"status": 1,
"stage": null,
"description": "",
"endDate": null,
"responseType": "REDIRECT",
"err": null,
"msg": null,
"paReq": null,
"creq": null,
"md": null,
"termUrl": null,
"acsurl": null
}
Request parameters
Parameter | Required | Type | Description |
---|---|---|---|
account | true | String | Merchant Account Name |
amount | true | Long | Amount in Cents |
currency | true | String | Currency Alpha3 Code |
order_id | true | String | Merchant Order ID |
merchant_site | true | String | Merchant Site URL |
recurrent | false | Boolean | Is Recurrent Payment |
purpose | false | String | Order Description |
customer_first_name | true | String | Customer First Name |
customer_last_name | true | String | Customer Last Name |
customer_address | true | String | Customer Address |
customer_city | true | String | Customer City |
customer_zip_code | true | String | Customer Zip Code |
customer_country | true | String | Customer Country Code |
customer_phone | true | String | Customer Phone |
customer_email | true | String | Customer Email |
customer_ip_address | true | String | Customer IP Address |
callback_url | false | String | Callback URL which receives notifications when transaction status changes |
success_url | false | String | Redirect URL for successful transaction |
fail_url | false | String | Redirect URL for failed transaction |
status_url | false | String | Status URL |
payment_method | true | String | Payment method (use "googlePayDPan" for GooglePay DPan payments) |
google_pay_dpan | true | String | Base64 of decoded value of paymentMethodData.tokenizationData.token paymentMethodData field |
google_pay_payment_method_network | true | String | Value of paymentMethodData.info.cardNetwork paymentMethodData field |
recur_freq | false | Long | Payment frequency specifies the minimum number of days between authorizations |
recur_exp | false | Long | Duration of periodic payments. After this date no authorization will be serviced. Should be specified according to ISO 8601, example: "2023-12-13T14:00:53.421Z" |
browser_accept_header | false | String | Browser Accept Header |
browser_user_agent | false | String | Browser User Agent |
browser_java_enabled | false | Boolean | Is Java Enabled |
browser_js_enabled | false | Boolean | Is Javascript Enabled |
browser_color_depth | false | String | Browser Color Depth |
browser_screen_height | false | String | Browser Screen Height |
browser_screen_width | false | String | Browser Screen Width |
browser_language | false | String | Browser Language |
browser_time_zone | false | String | Browser Time Zone |
Response parameters
Parameter | Required | Type | Description |
---|---|---|---|
status | true | Int | Transaction status |
form_url | false | String | Redirect url |
order_id | false | String | Processing Order ID in our system |
err | false | String | Error reason |
Check transaction status
HTTP Request
POST https://api-gateway.smartcore.pro/check
curl --location 'https://api-gateway.smartcore.pro/check' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic dGVzdDpxd2VydHk=' \
--data '{
"order_id": "sandboxId_1015"
}'
The above command returns JSON structured like this:
{
"order_id": "sandboxFormId_1015",
"status": 2,
"amount": 1000,
"finalAmount": 900,
"card": {
"number": "401200******3010",
"bin": "401200",
"country": "Spain",
"iso": "ESP",
"type": "VISA"
},
"errorMessage": null,
"cascadeErrors": null,
"endDate": "2023-07-04T13:22:07.087Z",
"authorize_status": null,
"type": "Payment",
"firstName": "John",
"lastName": "Doe"
}
In case of an error the response will be:
{
"order_id": "sandboxFormId_1016",
"status": -1,
"amount": 1000,
"finalAmount": 900,
"card": {
"number": "401200******3010",
"bin": "401200",
"country": "Spain",
"iso": "ESP",
"type": "VISA"
},
"errorMessage": "PLATFORM_ERROR_GATE_NOT_FOUND",
"cascadeErrors": [
{
"gatePriority": 0,
"errorCategory": "PLATFORM_ERROR_ANTIFRAUD_RULES"
},
{
"gatePriority": 1,
"errorCategory": "PLATFORM_ERROR_GATE_SKIPPED"
},
{
"gatePriority": 2,
"errorCategory": "PLATFORM_ERROR_CARD_BRAND_UNAVAILABLE"
}
],
"endDate": "2024-01-12T11:18:26.678Z",
"authorize_status": null,
"type": "Payment",
"firstName": "John",
"lastName": "Doe"
}
Request parameters
Parameter | Required | Type | Description |
---|---|---|---|
order_id | true | String | Merchant Order ID |
Response parameters
Parameter | Required | Type | Description |
---|---|---|---|
status | false | Int | Transaction status |
amount | false | Long | Amount |
order_id | false | String | Merchant Order ID |
err | false | String | Request Error reason |
errorMessage | false | String | Transaction error reason |
card.number | false | String | Card number |
card.card_holder | false | String | Card holder |
card.card_exp_month | false | String | Card expiration month (two digits) |
card.card_exp_year | false | String | Card expiration year (two digits) |
card.bin | false | String | Card first 6 or 8 digits |
card.country | false | String | Card issuer country name |
card.iso | false | String | Card issuer country alpha3 code |
card.type | false | String | Card brand |
cascadeErrors | false | String | Transaction error reasons for cascade |
rrn | false | String | Transaction RRN |
eci | false | String | Transaction ECI |
lastName | false | String | Customer last name |
firstName | false | String | Customer first name |
type | false | String | Transaction type |
parentTransaction | false | String | Payment transaction processing Order ID in our system (for Refund) |
Transaction statuses
Status | Description |
---|---|
1 | Processing |
2 | Success |
-1 | Fail |
0 | Waiting for redirect |
Refund
Refund existing transaction.
HTTP Request
POST https://api-gateway.smartcore.pro/refund
curl --location 'https://api-gateway.smartcore.pro/refund' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic dGVzdDpxd2VydHk=' \
--data '{
"order_id": "sandboxId_1015",
"amount": 1000,
"reason": "refund"
}'
The above command returns JSON structured like this:
{
"success": false,
"message": "",
"refund_id": "0719e590-1cda-11ee-82d1-a58ec416e4a2",
"parentTransaction": "64a40ee3c4125fdb1d5cf635"
}
Parameter | Required | Type | Description |
---|---|---|---|
order_id | true | String | Merchant Order ID |
amount | true | Long | Amount in Cents |
reason | true | String | Refund Reason |
callback_url | false | String | Callback URL which receives notifications when transaction status changes |
Recurrent
Create recurrent payment from existing transaction.
HTTP Request
POST https://api-gateway.smartcore.pro/recurrent
curl --location 'https://api-gateway.smartcore.pro/recurrent' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic dGVzdDpxd2VydHk=' \
--data '{
"order_id": "sandboxRecurId_1015",
"parent_order_id": "sandboxId_1015",
"amount": 1000,
"purpose": "test recurrent"
}'
The above command returns JSON structured like this:
{
"success": true,
"message": "",
"form_url": "https://example.com/12345",
"payment_id": "0719e590-1cda-11ee-82d1-a58ec416e4a2",
"err": null
}
Parameter | Required | Type | Description |
---|---|---|---|
order_id | true | String | Merchant Order ID |
parent_order_id | true | String | Merchant Order ID of Parent Transaction |
amount | true | Long | Amount in Cents |
purpose | true | String | Order Description |
callback_url | false | String | Callback URL which receives notifications when transaction status changes |
recur_period | false | String | Periodicity of subsequent recurring payments (possible values: 01 (daily), 03 (weekly), 06 (monthly), 09 (quarterly), 11 (annually)) |
Response parameters
Parameter | Required | Type | Description |
---|---|---|---|
success | false | Boolean | if false, use check status request to get final status |
message | false | String | message |
order_id | true | String | order_id from request |
payment_id | false | String | internal recurrent id |
err | false | String | Error message |
form_url | false | String | URL link to 3DS |
Callback
When transaction status changes, the system sends a POST request to the specified callback_url
.
The request body will be sent as application/x-www-form-urlencoded
:
Parameter | Required | Type | Description |
---|---|---|---|
orderId | true | String | Merchant Order ID |
status | true | Int | Transaction status |
amount | true | Long | Transaction amount in cents |
finalAmount | false | Long | Final processed amount |
currency | false | String | Currency (Alpha-3 code) |
type | false | String | Transaction type (Payment, Refund, Withdrawal, etc.) |
message | false | String | Status message |
errorCategory | false | String | Error category if transaction failed |
cascadeErrors | false | String | Cascade processing errors |
isTrustedTransaction | false | String | Indicates trusted transaction |
authorize_status | false | String | Authorization status |
paymentPhoneNumber | false | String | Payment phone number |
paymentPhoneOperator | false | String | Payment phone operator |
eci | false | String | Electronic Commerce Indicator |
firstName | false | String | Customer first name |
lastName | false | String | Customer last name |
rrn | false | String | Retrieval Reference Number |
sign | true | String | Signature for validation |
Transaction statuses:
Status | Description |
---|---|
2 | Success |
-1 | Fail |
Callback service logic
Your server must respond with:HTTP/1.1 200 OK
Signature generation (sign
)
Example of signature generation in JavaScript:
const { createHmac } = require("crypto");
function getSign(body, secret) {
let params = [];
Object.keys(body).sort().forEach(function(key) {
params.push(body[key]);
});
return createHmac('sha256', secret).update(params.join('|')).digest('hex');
}
const body = {
"orderId": "200004",
"status": 2,
"type": "Withdrawal",
"message": "null",
"cascadeErrors": "null",
"isTrustedTransaction": "false",
"amount": 10000,
"finalAmount": 10000,
"currency": "EUR",
"authorize_status": "null",
"eci": "null",
"firstName": "null",
"lastName": "null",
"rrn": "null",
"card_holder": "N/A",
"card_number": "401200******3010",
"card_exp_month": "N/A",
"card_exp_year": "N/A",
}
const sign = getSign(body, process.env.MERCHANT_SECRET);
console.log(sign);
The signature is calculated using the HMAC-SHA256 algorithm.
- All callback parameters are sorted by key in ascending order.
- The parameter values are concatenated into a string, separated by
|
. - The resulting string is hashed using HMAC-SHA256 with the merchant's secret key.
Create withdrawal tokenization form
Create withdrawal tokenization form.
HTTP Request
POST https://api-gateway.smartcore.pro/withdrawal/tokenize-form
curl --location 'https://api-gateway.smartcore.pro/withdrawal/tokenize-form' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic dGVzdDpxd2VydHk=' \
--data '{
"account": "EUR-sandbox-payout",
"order_id": "tokenizeOrderId_1050",
"callback_url": "https://site.com/callback",
"success_url": "https://site.com/success",
"fail_url": "https://site.com/fail"
}'
The above command returns JSON structured like this:
{
"form_url": "https://payment.smartcore.pro/64a7eec2d46c5db10d082b3d",
"threeDSMethodData": null,
"order_id": "64a7eec2d46c5db10d082b3d",
"status": 1,
"stage": null,
"description": "",
"endDate": null,
"responseType": "REDIRECT",
"err": null,
"msg": null
}
Parameter | Required | Type | Description |
---|---|---|---|
account | true | String | Merchant Account Name |
order_id | true | String | Merchant Order ID |
callback_url | false | String | Callback URL |
success_url | false | String | Success Redirect URL |
fail_url | false | String | Fail Redirect URL |
Create withdrawal transaction
Create money withdrawal to card, phone number or account.
Card withdrawal
Create withdrawal to card.
HTTP Request
POST https://chd-api.smartcore.pro/withdrawal/init
curl --location 'https://chd-api.smartcore.pro/withdrawal/init' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic dGVzdDpxd2VydHk=' \
--data '{
"account": "EUR-sandbox-payout",
"order_id": "testPayout_1050",
"amount": 10000,
"payment_method": "card",
"customer_card_number": "4123540003981114",
"merchant_site": "https://merchant.site",
"customer_first_name": "John",
"customer_middle_name": "Jerom",
"customer_last_name": "Doe",
"customer_phone": "+442079460612",
"customer_birthdate": "06.06.1997",
"customer_zip_code": "121165",
"callback_url": "https://site.com/callback"
}'
The above command returns JSON structured like this:
{
"order_id": "testPayout_1050",
"status": 1,
"card": {
"number": "401200******3010",
"bin": "401200",
"country": "Spain",
"iso": "ESP",
"type": "VISA"
},
"err": null,
"msg": null
}
Request parameters
Parameter | Required | Type | Description |
---|---|---|---|
account | true | String | Merchant Account Name |
amount | true | Long | Amount in Cents |
order_id | true | String | Merchant Order ID |
purpose | false | String | Order description |
merchant_site | false | String | Merchant Site URL |
customer_card_number | true | String | Customer card number |
customer_card_exp_month | false | String | Customer Card Expiration Month |
customer_card_exp_year | false | String | Customer Card Expiration Year |
customer_first_name | false | String | Customer First Name |
customer_last_name | false | String | Customer Last Name |
customer_middle_name | false | String | Customer Middle Name |
customer_phone | false | String | Customer Phone |
customer_birthdate | false | String | Customer Birthdate |
customer_country | false | String | Customer Country Code |
customer_zip_code | false | String | Customer Zip Code |
callback_url | false | String | Callback URL which receives notifications when transaction status changes |
payment_method | true | String | Payment method (use "card" for card withdrawals) |
customer_ip_address | false | String | Customer IP Address |
Mobile phone withdrawal
Create withdrawal to mobile phone balance.
HTTP Request
POST https://api-gateway.smartcore.pro/withdrawal/init
curl --location 'https://api-gateway.smartcore.pro/withdrawal/init' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic dGVzdDpxd2VydHk=' \
--data '{
"account": "EUR-sandbox-payout",
"order_id": "testPayout_1050",
"amount": 10000,
"payment_method": "phoneBalance",
"phone_withdrawal": "79123456789",
"customer_first_name": "John",
"customer_middle_name": "Jerom",
"customer_last_name": "Doe",
"customer_phone": "+442079460612",
"customer_birthdate": "06.06.1997",
"customer_zip_code": "121165",
"callback_url": "https://site.com/callback"
}'
The above command returns JSON structured like this:
{
"order_id": "testPayout_1050",
"status": 1,
"err": null,
"msg": null
}
Request parameters
Parameter | Required | Type | Description |
---|---|---|---|
account | true | String | Merchant Account Name |
amount | true | Long | Amount in Cents |
order_id | true | String | Merchant Order ID |
purpose | false | String | Order description |
customer_first_name | false | String | Customer First Name |
customer_last_name | false | String | Customer Last Name |
customer_middle_name | false | String | Customer Middle Name |
customer_phone | false | String | Customer Phone |
customer_birthdate | false | String | Customer Birthdate |
customer_country | false | String | Customer Country Code |
customer_zip_code | false | String | Customer Zip Code |
callback_url | false | String | Callback URL which receives notifications when transaction status changes |
payment_method | true | String | Payment method (use "phoneBalance" for mobile phone withdrawals) |
phone_withdrawal | true | String | Phone number for withdrawal |
customer_ip_address | false | String | Customer IP Address |
Token withdrawal
Create withdrawal using previously tokenized card.
HTTP Request
POST https://api-gateway.smartcore.pro/withdrawal/init
curl --location 'https://api-gateway.smartcore.pro/withdrawal/init' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic dGVzdDpxd2VydHk=' \
--data '{
"account": "EUR-sandbox-payout",
"order_id": "testPayout_1050",
"amount": 10000,
"payment_method": "token",
"tokenize_transaction_order_id": "tokenizeOrderId_1050",
"customer_first_name": "John",
"customer_middle_name": "Jerom",
"customer_last_name": "Doe",
"customer_phone": "+442079460612",
"customer_birthdate": "06.06.1997",
"customer_zip_code": "121165",
"callback_url": "https://site.com/callback"
}'
The above command returns JSON structured like this:
{
"order_id": "testPayout_1050",
"status": 1,
"err": null,
"msg": null
}
Request parameters
Parameter | Required | Type | Description |
---|---|---|---|
account | true | String | Merchant Account Name |
amount | true | Long | Amount in Cents |
order_id | true | String | Merchant Order ID |
purpose | false | String | Order description |
tokenize_transaction_order_id | true | String | order_id, passed when creating the form for card tokenization |
customer_first_name | false | String | Customer First Name |
customer_last_name | false | String | Customer Last Name |
customer_middle_name | false | String | Customer Middle Name |
customer_phone | false | String | Customer Phone |
customer_birthdate | false | String | Customer Birthdate |
customer_country | false | String | Customer Country Code |
customer_zip_code | false | String | Customer Zip Code |
callback_url | false | String | Callback URL which receives notifications when transaction status changes |
payment_method | true | String | Payment method (use "token" for token withdrawals) |
customer_ip_address | false | String | Customer IP Address |
Response parameters
Parameter | Required | Type | Description |
---|---|---|---|
status | true | Int | Transaction status |
processing_order_id | false | String | Processing Order ID in our system |
order_id | false | String | Merchant Order ID |
err | false | String | Error reason |
card.number | false | String | Card number |
card.bin | false | String | Card first 6 or 8 digits |
card.country | false | String | Card issuer country name |
card.iso | false | String | Card issuer country alpha3 code |
card.type | false | String | Card brand |
Get withdrawal balance
Get available withdrawal balance.
HTTP Request
POST https://api-gateway.smartcore.pro/withdrawal/balance/get
curl --location 'https://api-gateway.smartcore.pro/withdrawal/balance/get' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic dGVzdDpxd2VydHk=' \
--data '{
"account": "EUR-sandbox-payout"
}'
The above command returns JSON structured like this:
{
"balance": 10000,
"holdBalance": 0,
"rollingBalance": 0
}
Parameter | Required | Type | Description |
---|---|---|---|
account | true | String | Merchant Account Name |
Create authorize-capture payment
Create two-step payment with authorization and capture.
HTTP Request
POST https://chd-api.smartcore.pro/authorize
curl --location 'https://chd-api.smartcore.pro/authorize' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic dGVzdDpxd2VydHk=' \
--data-raw '{
"account": "EUR-sandbox",
"amount": 1000,
"currency": "EUR",
"order_id": "sandboxId_1016",
"merchant_site": "https://merchant.site",
"recurrent": false,
"purpose": "description",
"customer_first_name": "John",
"customer_last_name": "Doe",
"customer_address": "10 Downing Street",
"customer_city": "London",
"customer_zip_code": 121165,
"customer_country": "GB",
"customer_phone": "+442079460612",
"customer_email": "[email protected]",
"success_url": "https://site.com/success",
"fail_url": "https://site.com/fail",
"callback_url": "https://site.com/callback",
"status_url": "https://site.com/redir",
"card_holder": "John Doe",
"card_number": "4012000000003010",
"card_exp_month": "02",
"card_exp_year": "25",
"card_cvv": "123"
}'
The above command returns JSON structured like this:
{
"form_url": "https://payment.smartcore.pro/64a7eec2d46c5db10d082b3d",
"threeDSMethodData": null,
"order_id": "64a7eec2d46c5db10d082b3d",
"status": 1,
"stage": null,
"description": "",
"endDate": null,
"responseType": "REDIRECT",
"err": null,
"msg": null,
"paReq": null,
"creq": null,
"md": null,
"termUrl": null,
"acsurl": null
}
Parameter | Required | Type | Description |
---|---|---|---|
account | true | String | Merchant Account Name |
amount | true | Long | Amount in Cents |
currency | true | String | Currency Alpha3 Code |
order_id | true | String | Merchant Order ID |
merchant_site | true | String | Merchant Site URL |
recurrent | false | Boolean | Is Recurrent Payment |
purpose | false | String | Order Description |
customer_first_name | true | String | Customer First Name |
customer_last_name | true | String | Customer Last Name |
customer_address | true | String | Customer Address |
customer_city | true | String | Customer City |
customer_zip_code | true | String | Customer Zip Code |
customer_country | true | String | Customer Country Code |
customer_phone | true | String | Customer Phone |
customer_email | true | String | Customer Email |
success_url | false | String | Redirect URL for Successful Transaction |
fail_url | false | String | Redirect URL for Failed Transaction |
callback_url | false | String | Callback URL which receives notifications when transaction status changes |
status_url | false | String | Status URL |
card_holder | true | String | Customer Card Holder |
card_number | true | String | Customer Card Number |
card_exp_month | true | String | Customer Card Expiration Month |
card_exp_year | true | String | Customer Card Expiration Year |
card_cvv | true | String | Customer Card CVV |
Capture authorize-capture payment
Capture authorized payment. Capture operation can return a pending status for the transaction. In such cases, you can
wait for callback or use the /check
endpoint to obtain the current status of the transaction.
HTTP Request
POST https://api-gateway.smartcore.pro/capture
curl --location 'https://api-gateway.smartcore.pro/capture' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic dGVzdDpxd2VydHk=' \
--data '{
"order_id": "sandboxId_1016"
}'
The above command returns JSON structured like this:
{
"order_id": "66f55a03b2eb068a084168c2",
"status": 2
}
Parameter | Required | Type | Description |
---|---|---|---|
order_id | true | String | Merchant Order ID |
amount | false | String | Capture Amount in Cents |
Cancel authorize-capture payment
Cancel authorized payment. Cancel operation can return a pending status for the transaction. In such cases, you can wait
for callback or use the /check
endpoint to obtain the current status of the transaction.
HTTP Request
POST https://api-gateway.smartcore.pro/cancel
curl --location 'https://api-gateway.smartcore.pro/cancel' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic dGVzdDpxd2VydHk=' \
--data '{
"order_id": "sandboxId_1016"
}'
The above command returns JSON structured like this:
{
"order_id": "66f40c8fb6ff9364083fc9a5",
"status": -1
}
Parameter | Required | Type | Description |
---|---|---|---|
order_id | true | String | Merchant Order ID |
Dictionary
Transaction Error codes
code | Description |
---|---|
PROCESSING_ERROR | An error that has not fallen under any of the categories |
AUTHENTICATION_PROCESSING_ERROR | Authentication error during processing 3DS level |
DO_NOT_HONOUR_PROCESSING_ERROR | Rejection by anti fraud system |
EMITTER_DENIAL_PROCESSING_ERROR | Rejection by the issuer |
FORM_TIMEOUT_PROCESSING_ERROR | The buyer has not passed the card data entry form |
INSUFFICIENT_FUNDS_PROCESSING_ERROR | Insufficient funds on the card |
LIMIT_PROCESSING_ERROR | limits validating error on the bank side |
PROCESSOR_DENIAL_PROCESSING_ERROR | Processing error on the payment gateway side |
3DS_REDIRECT_TIMEOUT_PROCESSING_ERROR | The customer has not visited the 3DS page |
3DS_TIMEOUT_PROCESSING_ERROR | The customer has not returned from the 3DS processing |
TECHNICAL_PROCESSING_ERROR | Technical error on the side of the payment gateway |
VALIDATION_PROCESSING_ERROR | Data validating error at the gateway level |
PLATFORM_ERROR_DUPLICATED_ORDER_ID | error related to the fact that the ID that is sent is already in the system. |
PLATFORM_ERROR_ERROR_GATE_EXCHANGE_NOT_ALLOWED | error related to the amount of conversion to another currency, error on our side |
PLATFORM_ERROR_GATE_NOT_FOUND | operation could not find a gate to pass the operation |
PLATFORM_ORDER_BILLING_ERROR | errors not falling under internal categories |
CARD_TIME_LIMIT_PROCESSING_ERROR | Limit on Minimum time between card transactions 60 seconds |
3DS Redirect Timeout | inactivity on payment, or the client did not click on the link or the bank did not respond to us. |
3DS_CANCEL_PROCESSING_ERROR | User clicked "Cancel" button on 3DS page |
Transaction statuses
Status | Description |
---|---|
1 | Processing |
2 | Success |
-1 | Fail |
0 | Waiting for redirect |