Purchase using token
POST
api/payment-gateway/v1/payments/purchase
Request
Header Params
Content-Type
string
required
Example:
application/json
Body Params application/json
req_time
string
required
merchant_id
string
required
<= 20 characters
tran_id
string
required
<= 20 characters
ctid
string | null
required
<= 255 characters
pwt
string | null
required
<= 255 characters
firstname
string
optional
<= 20 characters
lastname
string
optional
<= 20 characters
email
string
optional
<= 50 characters
phone
string
optional
<= 20 characters
type
string
optional
pre-auth
: Pre-authorization (for pre-purchase).purchase
: Full purchase transaction.<= 20 characters
items
string
optional
<= 500 characters
shipping
number
optional
amount
number
required
return_url
string
optional
custom_fields
string
optional
return_params
string
optional
payout
string
optional
hash
string
required
req_time
, merchant_id
, tran_id
, amount
, items
, shipping
, ctid
, pwt
, firstname
, lastname
, email
, phone
, type
, return_url
, currency
, custom_fields
, return_params
, and payout
, using public_key
.
Example
{
"req_time": "20250312075529",
"merchant_id": "xxxxx",
"type": "pre-auth",
"items": "Nlx1MTc5NFx1MTdiY...MDAwLjAwIn1d",
"amount": 60000,
"tran_id": "17417661239",
"continue_success_url": "demo-payway-uat.ababank.com",
"return_url": "aHR0cHM6Ly9kZW1vLXBheXdhe..NzY2MTIzOQ==",
"return_param": "OTg0OQ==",
"hash": "QRzyIlknvaVA..jXvkA==",
"custom_fields": "eyJteV9jdXN0bMSI6I..lfY3VzdG9tX2ZpZWDE3NjYxMjl9",
"firstname": "QA",
"lastname": "Sakada",
"phone": "017582717",
"email": "sakadaqa@gmail.com"
}
Request samples
Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'api/payment-gateway/v1/payments/purchase' \
--header 'Content-Type: application/json' \
--data-raw '{
"req_time": "20250312075529",
"merchant_id": "xxxxx",
"type": "pre-auth",
"items": "Nlx1MTc5NFx1MTdiY...MDAwLjAwIn1d",
"amount": 60000,
"tran_id": "17417661239",
"continue_success_url": "demo-payway-uat.ababank.com",
"return_url": "aHR0cHM6Ly9kZW1vLXBheXdhe..NzY2MTIzOQ==",
"return_param": "OTg0OQ==",
"hash": "QRzyIlknvaVA..jXvkA==",
"custom_fields": "eyJteV9jdXN0bMSI6I..lfY3VzdG9tX2ZpZWDE3NjYxMjl9",
"firstname": "QA",
"lastname": "Sakada",
"phone": "017582717",
"email": "sakadaqa@gmail.com"
}'
Responses
🟢200Success
application/json
Body
tran_id
string
required
payment_status
object
required
status
string
required
0
represent success paymentcode
string
required
CDA00
for success payment, other case pelase check response 403.description
string
required
code
for the details.pw_tran_id
string
required
Examples
{
"tran_id": "trx-20201019130949",
"payment_status": {
"status": "0",
"code": "CDA00",
"description": "OK",
"pw_tran_id": "trx-20201019130949"
}
}
🟠403Forbidden