Debit Refund

Debit Refund is an optional service for those who wish to process a refund for a completed transaction. This service can be used for refund through Debit payment method.

Type Value
Service Code
58
Name
API Direct Debit Payment Refund
HTTP Method
POST

Flow

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

API URL

Environment URL
Sandbox
Port of HTTPS (443)
https://sandbox-api.espay.id/apimerchant/v1.0/debit/refund
Production
Port of HTTPS (443)
https://api.espay.id/apimerchant/v1.0/debit/refund

Headers

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
originalPartnerReferenceNo
String (64)
Y
Unique reference code from merchant.
originalReferenceNo
String (64)
Y
Reference no from Espay.
partnerRefundNo
String (64)
Y
Unique id for every request refund.
refundAmount
Object
  value
String (16.2)
Y
Refund amount.

Format:
Decimal .00 (ISO 4217)

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

Format:
  • Rupiah: IDR
reason
String (64)
Y
Reason for refund.
additionalInfo
Object
  productCode
String (16)
Y
Product code. Click here
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+58+00 = 2005800
responseMessage
String (150)
Y
Response description.
referenceNo
String (64)
Y
Reference code from Espay.
partnerRefundNo
String (64)
Y
Unique id for every request refund.
refundTime
String (25)
Y
Refund date and time.

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

Example:
2024-03-14T07:49:28+07
refundAmount
Object
  value
Srting (16.2)
Y
Refund amount.

Format:
Decimal .00 (ISO 4217)

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

Format:
  • Rupiah: IDR
addtionalInfo
Object
O
Y: Yes, O: Optional, C: Conditional

Try It!

Anda bisa coba masukkan data sesuai dengan input yang telah disediakan. Setelah itu Anda submit dan lihat hasilnya!

































Sample Headers

content-type: application/jsonn
X-TIMESTAMP:2024-03-14T07:49:28+07:00
X-SIGNATURE:jaCUbDOSIjFcDaZ1rO0aCczJrWSfV0wAXVi/zOLlOLOIVH00gucOSOnHpKTARwpnn6qB08Vi8VJviNhIQh1q6zVJAwdhxnHRlwNFa28IVFTtSmD4nXPWT3LsuYuFPNDGJ59/MgKMVjwIofYvq2dwOHoDi9rnyT3nPl7N2bRdIQceQlD6sITcqdEbRUlm+zTFB2MxNy4vFaEZz1LU8fsENp+giMNqxR26DsNcRj1K8JBXO6nY8q2m3jmTmiduXK5VZXxt/5v6bp+OlYCwJhn3hmdZD1zwC3Hu6qZcCIhO6IVe0ThSCfsaCdye9o/Ew6VdMWbTtQUoR983mq6MubLmzg==
X-EXTERNAL-ID:d3be5aec-155b-4b46-bfee-3fd55363d0f4
X-PARTNER-ID:SGWYESSISHOP
CHANNEL-ID:ESPAY
             




























Sample Request

{
    "originalPartnerReferenceNo": "20221011000086",
    "originalReferenceNo": "ESP1667981349ZVAM",
    "partnerRefundNo": "RFIDESP1667981349ZVAM",
    "refundAmount": {
        "value": "10001.00",
        "currency": "IDR"
    },
    "reason": "Customer complain",
    "additionalInfo": {
        "productCode": "SHOPEEQRPAY"
    }
}
             





















Sample Positive Response

{
    "responseCode": "2005800",
    "responseMessage": "Successful",
    "referenceNo": "ESP1667981349ZVAM",
    "partnerRefundNo": "RFIDESP1667981349ZVAM",
    "refundTime": "2022-11-09T15:10:21+07:00",
    "refundAmount": {
        "value": "10001.00",
        "currency": "IDR"
    },
    "additionalInfo": {} 
}
              


Sample Negative Response

    
{
  "responseCode": "4015800",
  "responseMessage": "Unauthorized. Invalid Signature from Client"
}

              





CURL


curl --location --request DELETE 'https://sandbox-api.espay.id/apimerchant/v1.0/transfer-va/delete-va' \
--header 'X-TIMESTAMP: 2024-03-14T07:49:28+07:00' \
--header 'X-SIGNATURE: jaCUbDOSIjFcDaZ1rO0aCczJrWSfV0wAXVi/zOLlOLOIVH00gucOSOnHpKTARwpnn6qB08Vi8VJviNhIQh1q6zVJAwdhxnHRlwNFa28IVFTtSmD4nXPWT3LsuYuFPNDGJ59/MgKMVjwIofYvq2dwOHoDi9rnyT3nPl7N2bRdIQceQlD6sITcqdEbRUlm+zTFB2MxNy4vFaEZz1LU8fsENp+giMNqxR26DsNcRj1K8JBXO6nY8q2m3jmTmiduXK5VZXxt/5v6bp+OlYCwJhn3hmdZD1zwC3Hu6qZcCIhO6IVe0ThSCfsaCdye9o/Ew6VdMWbTtQUoR983mq6MubLmzg==' \
--header 'X-EXTERNAL-ID: a9555192-2fcc-4003-93dd-714715cdd0dd' \
--header 'X-PARTNER-ID: SGWYESSISHOP' \
--header 'CHANNEL-ID: ESPAY' \
--header 'Content-Type: application/json' \
--data '{
    "partnerServiceId": " ESPAY", 
    "customerNo": "SGWYESSISHOP", 
    "virtualAccountNo": "DIGORDER000001"
}'     





Scroll to Top