A Payment Link Generator is a service provided by Espay Payment Gateway that allows you to send payment links to customers. You can generate payment links, making the online payment process simpler and more convenient for your customers.

Before Integration
Make sure you have received the credentials from the Espay team.
Integration Steps

You can use the following steps to integrate with Payment Link Generator.

1. Membuat Inquiry dan Payment

You are required to provide a callback that the Espay Payment Gateway can access. Learn more about Inquiry dan Payment.

Flow

You generate the link using the parameters and URL provided by ESPAY. Then, you can give the generated link to your customer.

API URL

Environment URL
Sandbox
https://sandbox-api.espay.id/paylink/paylink/generateurl
Production
https:///api-merchant.espay.id/paylink/paylink/generateurl

Headers

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

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
merchant_key
String
Y
API Key from Espay team.
user_id
String
Y
User ID.
user_name
String
Y
User name.
user_email
String
Y
User email.
user_phone
String
Y
User phone number.
order_id
String (32)
Y
Unique code to identify the order/billing/invoice.

Format:
Alphanumeric (A-Z dan 0-9)

Example:
Transaction number, invoice ID, etc.
amount
String (17)
Y
Paid amount.

Example:
150000
expired
String(19)
Y
The transaction expiration date and time.

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

Example:
2026-08-30 13:21:02
return_uri
String (255)
Y
Callback URL to merchant page (Thank you page).
device_id
String
O
Device ID.
description
String
Y
Description.
signature
String
Y
Code used to validate transactions.

Format:
$plain = uppercase(#signkey##rq_datetime##comm_code##user_id##PAYURL##) $signature = sha256 ($plain);
Y: Yes, O: Optional, C: Conditional

Response Parameters

Parameter Type Mandatory Description
rq_uuid
String (64)
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.

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

Example:
2024-03-14 07:49:28
error_code
String (4)
Y
Response Code.
error_desc
String (32)
Y
Response description.
comm_code
String(32)
Y
Merchant code from Espay team.

Example:
SGWYESSISHOP
user_id
String
Y
User ID.
order_id
String(32)
Y
Unique code to identify the order/billing/invoice.

Format:
Alphanumeric (A-Z dan 0-9)

Example:
Transaction number, invoice ID, etc.
description
String (32)
Y
Transaction description.
expired
String (19)
Y
The transaction expiration date and time.

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

Example:
2026-08-30 13:21:02
device_id
String
O
Device ID.
payment_url
String
Y
URL to redirect to the payment page.
Y: Yes, O: Optional, C: Conditional
3. After Payment
Espay Payment Gateway provides an optional API that you can use to support other payment needs.






























Sample Headers

POST /paylink/paylink/generateurl HTTP/1.1
Host: sandbox-api.espay.id
Content-Type: application/x-www-form-urlencoded
Cookie: sl-session=PPombr8NZGqv2bKh7TT9Bg==
Content-Length: 369
               






Sample Request

https://sandbox-api.espay.id/paylink/paylink/generateurl
rq_uuid:321312312
rq_datetime:2024-01-01 15:21:02
comm_code:SGWYESSISHOP
merchant_key:1edf391a59acb5ac8851db39d1e4f5bc
user_id:123
user_name:GILANG
user_email:[email protected]
user_phone:628855222389
order_id:12345
amount:15000
expired:2024-12-30 13:21:02
return_uri:https://google.com
device_id:123123
description:pembayaran belanja
signature:d4787b96b6ee30036e42cf54bbf346559a8200feb0ce81a1df74231759990e31
               


















































Sample Response

{
    "rq_uuid": "O20260724001",
    "rs_datetime": "2026-07-24 10:37:40",
    "error_code": "0000",
    "error_desc": "Success",
    "comm_code": "SGWYESSISHOP",
    "user_id": "123",
    "order_id": "20260724001",
    "description": "pembayaran belanja",
    "expired": "2026-12-30 13:21:02",
    "payment_url": "https://sandbox-kit.espay.id/paylink/index/pay/?token=MDZmODJjZjEzMmIyYjFmMDAwZTEwN2EwZDk4MmEyYTEyZDE4ZjJhYTAxNjA3ZmIzMDhhODAyZTNlMmNkMTI2NA=="
}
                


HTTP

POST /paylink/paylink/generateurl HTTP/1.1
Host: sandbox-api.espay.id
Content-Type: application/x-www-form-urlencoded
Cookie: sl-session=PPombr8NZGqv2bKh7TT9Bg==
Content-Length: 369

rq_uuid=321312312&rq_datetime=2024-01-01%2015%3A21%3A02&comm_code=SGWYESSISHOP&merchant_key=1edf391a59acb5ac8851db39d1e4f5bc&user_id=123&user_name=GILANG&user_email=uatbca3%40skybr.id&user_phone=628855222389&order_id=12345&amount=15000&expired=2024-12-30%2013%3A21%3A02&return_uri=https%3A%2F%2Fgoogle.com&device_id=123123&description=pembayaran%20belanja&signature=d4787b96b6ee30036e42cf54bbf346559a8200feb0ce81a1df74231759990e31
               


CURL

curl --location 'https://sandbox-api.espay.id/paylink/paylink/generateurl' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Cookie: sl-session=PPombr8NZGqv2bKh7TT9Bg==' \
--data-urlencode 'rq_uuid=321312312' \
--data-urlencode 'rq_datetime=2024-01-01 15:21:02' \
--data-urlencode 'comm_code=SGWYESSISHOP' \
--data-urlencode 'merchant_key=1edf391a59acb5ac8851db39d1e4f5bc' \
--data-urlencode 'user_id=123' \
--data-urlencode 'user_name=GILANG' \
--data-urlencode '[email protected]' \
--data-urlencode 'user_phone=628855222389' \
--data-urlencode 'order_id=12345' \
--data-urlencode 'amount=15000' \
--data-urlencode 'expired=2024-12-30 13:21:02' \
--data-urlencode 'return_uri=https://google.com' \
--data-urlencode 'device_id=123123' \
--data-urlencode 'description=pembayaran belanja' \
--data-urlencode 'signature=d4787b96b6ee30036e42cf54bbf346559a8200feb0ce81a1df74231759990e31'
               
Scroll to Top