API Overview


Base URLs

URL
https://pgapi-sandbox.sepay.vn

API Authentication

All SePay APIs use Basic Authentication.

Headers
Authorization: Basic base64(merchant_id:secret_key) 
Content-Type: application/json

Common Error Codes

CodeDescriptionSolution
200
Success
The request was processed successfully
400
Bad Request
Invalid request payload
Review your parameters
401
Unauthorized
Authentication failed
Check your merchant_id and secret_key
403
Forbidden
You are not allowed to access this API
Confirm access rights/whitelist if needed
404
Not Found
Requested resource not found
Verify URL/path or id
422
Unprocessable Entity
Data is valid but cannot be processed (validation errors)
Fix the validation errors as indicated
429
Too Many Requests
Rate limit exceeded
Reduce frequency; apply retry/backoff
500
Internal Server Error
Server error
Try again later; contact SePay for support

Pagination

List endpoints support pagination:

NameTypeRequiredDescription
per_page
integerNot required

Items per page (default: 20, max: 100)

page
integerNot required

Current page (default: 1)


Response format

RESPONSE
{
  "data": "[...]",
  "meta": {
    "per_page": 20,
    "total": 100,
    "has_more": false,
    "current_page": 1,
    "page_count": 5
  }
}