Base URLs
SePay Payment Gateway provides two environments for integration, Sandbox for testing and Production for live transactions:
| Environment | Base URL |
|---|---|
| Production | https://pgapi.sepay.vn |
| Sandbox | https://pgapi-sandbox.sepay.vn |
API Authentication
All SePay APIs use Basic Authentication for authentication.
Authorization: Basic base64(merchant_id:secret_key) Content-Type: application/json
The new key works immediately and the old key stops working at the same moment; there is no transition period. Any request still using the old key returns 401. See how to regenerate the key.
Common Error Codes
200SuccessRequest processed successfully
400Bad RequestInvalid request data
401UnauthorizedAuthentication failed
403ForbiddenNo access to this API
404Not FoundRequested resource not found
422Unprocessable EntityValid data but cannot be processed (validation errors)
429Too Many RequestsRate limit exceeded
500Internal Server ErrorServer error
Pagination
APIs returning lists support pagination:
Response Format
{
"data": "[...]",
"meta": {
"per_page": 20,
"total": 100,
"has_more": false,
"current_page": 1,
"page_count": 5
}
}