Card Payment

Tokenization

Tokenization is a service used to make automatic (auto-debit) payments without re-entering credit card information for each transaction. Through tokenization, sensitive credit card data, such as the card number, is converted into a unique, secure token that can only be used within a specific system. This token is generated when the customer pays using a credit card. Once the credit token is stored, it can be used for recurring transactions without storing or processing the credit card data directly, thereby enhancing security and efficiency in the payment process.

Flow

You send the required parameters to make a request, and Espay Payment Gateway will respond in JSON format.

Headers

Key Value
Method
HTTP Post
Connection
keep-alive
Content-Length
250
Content-Type
application/x-www-form-urlencoded
Accept
*/*

API URL

Environment URL
Sandbox
https://sandbox-api.espay.id/rest/creditcard/tokenpayment
Production
https://api.espay.id/rest/creditcard/tokenpayment

Request Parameters

Parameter Type Mandatory Description
rq_uuid
String (64)
Y
Request identifier. A unique ID used to identify messages.
rq_datetime
String (19)
Y
Date and time of the transaction request from the merchant's server.

Format:
yyyy-MM-dd hh:mi:ss

Example:
2024-03-14 07:49:28
comm_code
String (32)
Y
Merchant code from Espay team.

Example:
SGWYESSISHOP
masked_card_no
String (20)
Y
Masked credit card number.
store_card_number
String (20)
Y
Token given by Espay.
trx_id
String (32)
Y
Transaction ID from Espay.
description
String (19)
Y
Description.
cardname
String (32)
Y
Name of the credit card holder
email
String (32)
Y
Transaction ID from Espay.
ccy
String (5)
Y
Transaction currency code.

Format:
  • Rupiah: IDR
amount
String (20)
Y
Total amount.

Example:
150000
call_back_url
String (32)
O
Callback URL.
signature
String (64)
Y
Code used to validate transactions. Learn Signature.
Y: Yes, O: Optional, C: Conditional

Response Parameters

Parameter Type Mandatory Description
rq_uuid
String (4)
Y
Request identifier. A unique ID used to identify messages.
rs_datetime
String (32)
Y
Date and time of the transaction response from the Espay server.
trx_id
String (32)
Y
Transaction ID from Espay.
error_code
String (4)
Y
Response code.

Format:
  • Success: 0000
  • Failed: 9999
error_message
String (32)
Y
Response description.
Y: Yes, O: Optional, C: Conditional




































Sample Request


POST /rest/creditcard/tokenpayment HTTP/1.1
Host: sandbox-api.espay.id
Connection: keep-alive
Content-Length: 250
Content-Type: application/x-www-form-urlencoded
Accept: */*

rq_uuid=SGWHMSAMPOERNAfcf63291-9681-4934-8103-fe9598b5fddd
&rq_datetime=2021-10-12 15:17:00
&comm_code=SGWHMSAMPOERNA03
&masked_card_no=411111XXXXXX1111
&store_card_number=13051910361234614100
&trx_id=ESP1580208016A0VT
&description=Pembelian Iqos
&cardname=test&email=test@sgo.co.id
&ccy=IDR
&amount=10000
&signature=d59c9333f478457a357bdf1fd12ce07cbf0ec9ed29c18b521f5f37f4327879d3
  
             































Sample Response

{
  "rq_uuid":"SGWHMSAMPOERNAfcf63291-9681-4934-8103-fe9598b5fddd",
  "rs_datetime":"2021-10-12 15:17:16",
  "trx_id":"MOV12102111506156",
  "error_code":"0000",
  "error_message":"Success"
}
              




CURL PHP
Scroll to Top