Payment

Payment is a service Espay Payment Gateway uses to notify you that your customer’s payment has been successfully made. You are asked to respond according to the format provided and register your Payment URL on the Espay Sandbox Portal.

Type Value
Service Code
25
Name
Payment
HTTP Method
POST

Flow

Every time your customer completes a payment, the Espay Payment Gateway sends a request to your server via the Payment URL registered on the Espay Sandbox Portal. You are required to respond in JSON using the provided format.

API URL

Merchant URL Endpoint Description
https://yourdomain.com
.../v1.0/transfer-va/payment
Merchant domain URL.
Port of HTTPS (443).
TLS 1.2
Name Type Mandatory Description
Content-Type
String
Y
Content of your request body.

Example:
application/json
X-TIMESTAMP
String (25)
Y
Customer's current local date and time.

Format:
yyyy-MM-ddThh:mi:ssTZD (ISO 8601)

Example:
2024-03-14T07:49:28+07:00
X-SIGNATURE
String (255)
Y
Code used to validate transactions. Learn Signatures Asymmetric
X-EXTERNAL-ID
String (32)
Y
Numeric String. Reference number that should be unique on the same day.
X-PARTNER-ID
String (50)
Y
Merchant Code from Espay team.

Example:
SGWYESSISHOP
CHANNEL-ID
String (5)
Y
Channel id.

Value:
Espay
Authorization-Customer
String (150)
C
Access Token B2B2C. Espay -> Bank
Y: Yes, O: Optional, C: Conditional

Request Parameters

Parameter Type Mandatory Description
partnerServiceId
String (8)
Y
Partner service Id.

Format:
padding space + ESPAY

Value:
" ESPAY"
customerNo
String (20)
Y
Merchant code from Espay team.

Example:
SGWYESSISHOP
virtualAccountNo
String (28)
Y
Unique code to identify the order/billing/invoice.

Example:
Transaction number, invoice ID, etc.
trxId
String (18)
Y
Transaction ID from Espay.
paymentRequestId
String (128)
Y
Unique ID for payment from Espay
paidAmount
Object
Y
  value
String (16.2)
Y
Paid amount.

Format:
Desimal .00 (ISO 4217)

Example:
150000.00
  currency
String(3)
Y
Transaction currency code.

Format:
  • Rupiah: IDR
totalAmount
Object
Y
  value
String (16.2)
Y
Original amount is the same as Inquiry.

Format:
Desimal .00 (ISO 4217)

Example:
150000.00
  currency
String(3)
Y
Transaction currency code.

Format:
  • Rupiah: IDR
trxDateTime
String(25)
Y
Date and time of the Espay system.

Format:
yyyy-MM-ddThh:mi:ssTZD (ISO 8601)

Example:
2024-03-14T07:49:28+07:00
additionalInfo
Object
C
  transactionStatus
String(2)
Y
Payment Status.

Format:
  • Success: S
  • Failed: F
  • Suspect: SP
  • In Process: IP
  memberCode
String(50)
O
Member code.

Format:
  • Virtual Account Static: Merchant Code
  • Virtual Account Dynamic: Virtual Account Number
  • E-Money: Merchant Code
  debitFrom
String(19)
O
Source account (debited account).
  debitFromName
String (64)
O
Source account name.
  debitFromBank
String (5)
O
Source account bank code.

Example:
008, 016, 002, etc.
  creditTo
String (19)
O
Destination account (credited account).
  creditToName
String (64)
O
Destination account name.
  creditToBank
String (5)
O
Destination account bank code.

Example:
008, 016, 002, etc.
  productCode
String (50)
O
Product code. Click here
  productValue
String (128)
O
Product value / payer phone number / payer masking card number / payer card type credi
  message
Object
Additional information from bank.
  feeType
String (5)
O
Fee type.

Format:
  • Seller Fee: S
  • Buyer Fee: B
  txFee
String (16.2)
O
Transaction fee.

Format:
Desimal .00 (ISO 4217)

Example:
4400.00
  paymentRef
String (18)
O
Transaction ID from Espay.
  paymentRemark
String (18)
O
Transaction description from Inquiry.
  rrn
String (12)
O
Unique code from QRIS payment.
  approvalCode
String (6)
O
Credit card payment approval code.
  token
String (128)
O
Token credit card from bank.
  userId
String (128)
O
User ID.
  traceNumber
String (32)
C
Trace number from Payment. Conditional only for EDC or Offline Payment.
  terminalId
String (32)
C
Terminal machine id. Conditional only for EDC or Offline Payment.
  cardType
String (10)
C
Card type.

Format:
  • credit
  • debit
billDetails
Object
C
  billNo
String (32)
C
Billing number for the static virtual account from the virtual account service (remark4).
Y: Yes, O: Optional, C: Conditional

Response Parameters

Parameter Type Mandatory Description
responseCode
String (7)
Y
Response Code.

Format:
HTTP Code + Service Code + Error Code

Example:
200+25+00 = 2002500
responseMessage
String (150)
Y
Response description.
virtualAccountData
Object
  partnerServiceId
String (8)
Y
Partner service Id.

Format:
padding space + ESPAY

Value:
" ESPAY"
  customerNo
String (20)
Y
Merchant code from Espay team.

Example:
SGWYESSISHOP
  virtualAccountNo
String (28)
Y
Unique code to identify the order/billing/invoice.

Example:
Transaction number, invoice ID, etc.
  virtualAccountName
String (255)
Y
Customer name.
  paymentRequestId
String (128)
Y
Unique ID for payment from Espay.
  totalAmount
Object
Y
    value
String (16.2)
Y
Total amount.

Format:
Decimal .00 ((ISO 4217)

Example:
150000.00
    currency
String (3)
Y
Transaction currency code.

Format:
  • Rupiah: IDR
  billDetails
Array of Objects
Y
    billDescription
Object
Y
      english
String (18)
Y
Transaction description (English version).
      indonesia
String (18)
Y
Transaction description (Indonesian version).
additionalInfo
Object
  reconcileId
String (128)
Y
Reconciliation ID.
  reconcileDatetime
String (25)
Y
Reconciliation date and time.

Format:
yyyy-MM- ddThh:mi:ssTZD (ISO 8601).

Example:
2022-08-21T14:56:11+07:00
Y: Yes, O: Optional, C: Conditional

URL Registration

Ensure your URL format and response comply with this documentation guidelines. Next, immediately register your Payment URL via the Espay Sandbox portal. Read how to add a URL here.































Sample Header

Content-Type:application/json
X-TIMESTAMP:2024-03-14T07:49:28+07:00
X-SIGNATURE:e4G1zJpQGKRc6VjeIgEt914/S4JLCi8/JeTpqY/3zL+m/yye8uXtiF1uBztkJOGM3eotMOLlAswDbqOAYgCowmX2PjLF8fT9AcyhI4uFVMo+MbB4kwXKWi+xNxFJVk5SvMJJ6JOeItNw/NWHbwPEahXlPZdTVj1isc148H39aiT+FPRS3ezufgyOo4/TYWAelp2W32rZrrM3VZx2pkZO0rcxi4IvW3OJvKZrWXFKJ9+z55PZ0LHdn7j/+RYIv5ARjfo2Tga1HvBPIUZ7173KsnPgcH6bONGb7g5uszP23S2huGOlMPcUS6fc4Cuag8jFNTiRSMh+Iy3ikW2KWFSLxw==
X-EXTERNAL-ID:6a40adae-0850-494d-8173-22354a776175
X-PARTNER-ID:SGWYESSISHOP
CHANNEL-ID:ESPAY
         





























Sample Request

  {
      "partnerServiceId": " ESPAY", 
      "customerNo": "SGWDIGALLERY", 
      "virtualAccountNo": "ORDER0001",
      "trxId": "ESP1661161958ZQEG", 
      "paymentRequestId": "abcdef-123456-abcdef", 
      "paidAmount": {
            "value": "12345678.00",
            "currency": "IDR"
      },
      "totalAmount": {
            "value": "12345678.00",
            "currency": "IDR"
      },
      "trxDateTime": "2022-08-21T14:56:11+07:00", 
      "additionalInfo": {
            "transactionStatus": "S",
            "memberCode": "SGWYESSISHOP",
            "debitFrom": "16095902XXXX",
            "debitFromName": "BRI",
            "debitFromBank": "002",
            "creditTo": "665050XXXX",
            "creditToName": "BRI",
            "creditToBank": "002",
            "productCode": "BRIATM",
            "productValue": "16095902XXXX",
            "message": {
                  "CHANNEL_FLAG": "W"
            },
            "feeType": "S",
            "txFee": "4400",
            "paymentRef": "ESP1661161958ZQEG",
            "paymentRemark": "Bayar",
            "rrn": "220822000288",
            "approvalCode": "220822000288",
            "token": "2023011167618274122",
            "userId": "2306291049P89VWB",
            "traceNumber": "7999999901",
            "terminalId": "10380579",
            "cardType": "credit"
      },
      "billDetails": [{
            "billNo": "invoiceid0001"
      }]
  }
               













































































































Sample Response

  {
    "responseCode": "2002500",
    "responseMessage": "Success",
    "virtualAccountData": {
        "partnerServiceId": " ESPAY",
        "customerNo": "SGWYESSISHOP",
        "virtualAccountNo": "DIGOERDER00001",
        "virtualAccountName": "Jokul Doe",
        "paymentRequestId": "abcdef-123456-abcdef",
        "totalAmount": {
            "value": "890000.00",
            "currency": "IDR"
        },
        "billDetails": [
            {
                "billDescription": {
                    "english": "Tagihan No 123456",
                    "indonesia": "Invoice 22123"
                }
            }
        ]
    },
    "additionalInfo": {
        "reconcileId": "2020100121183111",
        "reconcileDatetime": "2022-08-21T14:56:11+07:00"
    }
  }
  
                


Sample Response Negative

{
    "responseCode": "4012500",
    "responseMessage": "Unauthorized Signature"
}
            


CURL

  
  curl --location 'https://digallery-me.xyz/api/v1.0/transfer-va/payment' \
  --header 'X-TIMESTAMP: 2024-03-14T07:49:28+07:00' \
  --header 'X-SIGNATURE: SGWYESSISHOP' \
  --header 'X-EXTERNAL-ID: 6a40adae-0850-494d-8173-22354a776175' \
  --header 'X-PARTNER-ID: SGWYESSISHOP' \
  --header 'CHANNEL-ID: ESPAY' \
  --header 'Content-Type: application/json' \
  --data '{
      "partnerServiceId": " ESPAY", 
      "customerNo": "SGWYESSISHOP", 
      "virtualAccountNo": "ORDER0001",
      "trxId": "ESP1661161958ZQEG", 
      "paymentRequestId": "abcdef-123456-abcdef", 
      "paidAmount": {
            "value": "12345678.00",
            "currency": "IDR"
      },
      "totalAmount": {
            "value": "12345678.00",
            "currency": "IDR"
      },
      "trxDateTime": "2022-08-21T14:56:11+07:00", 
      "additionalInfo": {
            "transactionStatus": "S",
            "memberCode": "SGWYESSISHOP",
            "debitFrom": "16095902XXXX",
            "debitFromName": "BRI",
            "debitFromBank": "002",
            "creditTo": "665050XXXX",
            "creditToName": "BRI",
            "creditToBank": "002",
            "productCode": "BRIATM",
            "productValue": "16095902XXXX",
            "message": {
                  "CHANNEL_FLAG": "W"
            },
            "feeType": "S",
            "txFee": "4400",
            "paymentRef": "ESP1661161958ZQEG",
            "paymentRemark": "Bayar",
            "rrn": "220822000288",
            "approvalCode": "220822000288",
            "token": "2023011167618274122",
            "userId": "2306291049P89VWB"
      },
      "billDetails": [{
    "billNo": "invoiceid0001"
      }]
  }
  '
  
  
             
Scroll to Top