purchase
POST/v1/orders/purchase
purchase
Request
- application/json
Body
uuid
required | integer | min:100
required | string | in:USD,EUR,GBP,AUD,CAD,JPY,BYR,SGD,SHP,SKK,SLL,SOS,SRD,SSP,STD,SVC,SYP,SZL,THB,TJS,TMT,TND,TOP,TRY,TTD,TWD,TZS,UAH,AED,NAD,NGN,NIO,NOK,NPR,NZD,OMR,PAB,PEN,PGK,PHP,PKR,PLN,PYG,QAR,RON,RSD,RUB,RWF,SAR,SBD,SCR,SDG,SEK,ZMK,ZMW,BCH,BTC,JEP,GGP,IMP,XFU,GBX,CNH,EEK,GHS,LTL,LVL,MRO,MTL,TMM,JPY,ZWD,ZWL,ZWN,ZWR,VEF,UGX,UYU,UZS,VES,VND,VUV,WST,XAF,XAG,XAU,XBA,XBB,XBC,XBD,XCD,XDR,XOF,XPD,XPF,XPT,XTS,YER,ZAR,CDF,CHF,CLF,CLP,CNY,COP,CRC,CUC,CUP,CVE,CZK,DJF,DKK,DOP,DZD,EGP,ERN,ETB,FJD,FKP,GEL,GHS,GIP,AFN,ALL,AMD,ANG,AOA,ARS,AWG,AZN,BAM,BBD,BDT,BGN,BHD,BIF,BMD,BND,BOB,BRL,BSD,BTN,BWP,BYN,BZD,KWD,KYD,KZT,LAK,LBP,LKR,LRD,LSL,LYD,MAD,MDL,MGA,MKD,MMK,MNT,MOP,MRU,MUR,MVR,MWK,MXN,MYR,MZN,GMD,GNF,GTQ,GYD,HKD,HNL,HRK,HTG,HUF,IDR,ILS,INR,IQD,IRR,ISK,JMD,JOD,KES,KGS,KHR,KMF,KPW,KRW
required | string | max:1024
required | string | default:internet | in:internet,merchant,moto
source
object
required | hash
required | string | in:card,apple_pay,google_pay,samsung_pay
required | string | credit_card
required | integer | min:1 | max:12
required | integer | min:2000
required | digits:3,4
string | min:1 | max:255
auth
object
required | hash
device
object
required | hash
required | string | max:1024
required | string | ip
airline
object
hash
required_with:airline | alpha_num | min:6 | max:15
new_agreement
object
hash
required_with:new_agreement | string | in:unscheduled,recurring,registered,installment
required_with:new_agreement | alpha_num_dash | min:1 | max:36
date
integer | min:1 | max:999
string | in:fixed,variable | default:variable
excluded_with:new_agreement | string | max:64
additional_data
object
hash
visa
object
hash
mastercard
object
hash
sub_merchant
object
hash
required_with:sub_merchant | string | alpha_num_dash | min:1 | max:15
required_with:sub_merchant | string | min:1 | max:100
required_with:sub_merchant | string | min:1 | max:100
required_with:sub_merchant | email
Responses
- 201
- 401
- 403
- 422
creates a new purchase order
- application/json
- Schema
- Example (from schema)
- Example
Schema
Array [
]
merchant
object
source
object
airline
object
sub_merchant
object
agreement
object
transactions
object[]
{
"id": "string",
"merchant": {
"id": "string",
"name": "string",
"arabic_name": "string",
"merchant_id": "string"
},
"currency": "string",
"amount": 0,
"captured_amount": 0,
"refunded_amount": 0,
"voided_amount": 0,
"description": "string",
"created_at": "string",
"updated_at": "string",
"source": {
"type": "string",
"scheme": "string",
"first_digits": "string",
"last_digits": "string",
"month": 0,
"year": 0
},
"airline": {
"reference": "string"
},
"sub_merchant": {
"id": "string",
"registered_name": "string",
"trading_name": "string",
"email": "string"
},
"agreement": {
"id": "string",
"agreement_id": "string",
"type": "string",
"first_order_id": "string",
"max_use": 0,
"variability": "string",
"expiry": "string",
"created_at": "string",
"updated_at": "string"
},
"transactions": [
{
"id": "string",
"status": "string",
"type": "string",
"source_type": "string",
"message": "string",
"response_code": "string",
"retrieval_reference": "string",
"stan": "string",
"created_at": "string"
}
]
}
{
"reauthorized_order_id": null,
"id": "b658e6b8-26bd-4243-87d5-cb16997d213d",
"merchant": {
"id": "01904432-1c03-7efb-9f5b-e1d804150d4b",
"name": "Merchant 3",
"arabic_name": "الإسم العربي",
"merchant_id": "6003"
},
"currency": "SAR",
"amount": 1000,
"captured_amount": 0,
"refunded_amount": 0,
"voided_amount": 0,
"description": "Test Order",
"created_at": "2024-06-23T08:24:13Z",
"updated_at": "2024-06-23T08:24:13Z",
"source": {
"type": "card",
"scheme": "visa",
"first_digits": "41111111",
"last_digits": "1111",
"month": 12,
"year": 2024
},
"airline": {
"reference": "ABC123"
},
"sub_merchant": {
"id": "sub123",
"registered_name": "Sub Merchant",
"trading_name": "Sub",
"email": "sub@merchant.com"
},
"agreement": {
"id": "01904432-1c60-748d-a440-4ecb11780131",
"agreement_id": "rec123",
"type": "recurring",
"first_order_id": "b658e6b8-26bd-4243-87d5-cb16997d213d",
"max_use": 12,
"variability": "fixed",
"expiry": "2025-12-30T21:00:00Z",
"created_at": "2024-06-23T08:24:13Z",
"updated_at": "2024-06-23T08:24:13Z"
},
"transactions": [
{
"id": "01904432-1c63-71c4-b5c8-70b2e04ee20a",
"status": "failed",
"type": "purchase",
"source_type": "internet",
"reverse_reason": null,
"justification": null,
"reversed_transaction_id": null,
"message": "The city has invalid length. Length is 1-10.",
"response_code": "101",
"retrieval_reference": "241750000001",
"stan": "000001",
"auth_code": null,
"created_at": "2024-06-23T08:24:13Z"
}
]
}
returns unauthorized
- application/json
- Schema
- Example (from schema)
- Example
Schema
{
"message": "string"
}
{
"message": "Missing authentication information"
}
returns forbidden
- application/json
- Schema
- Example (from schema)
- Example
Schema
{
"message": "string"
}
{
"message": "Unauthorized"
}
returns unprocessable_entity
- application/json
- Schema
- Example (from schema)
- Example
Schema
errors
object
{
"message": "string",
"errors": {
"amount": [
"string"
],
"currency": [
"string"
],
"description": [
"string"
],
"source": [
"string"
],
"source.type": [
"string"
],
"device": [
"string"
],
"device.user_agent": [
"string"
],
"device.ip_address": [
"string"
]
}
}
{
"message": "Data validation failed",
"errors": {
"amount": [
"The value must be greater than or equal to 100."
],
"currency": [
"This field is missing."
],
"description": [
"This field is missing."
],
"source": [
"This field is missing."
],
"source.type": [
"This field is missing."
],
"device": [
"This field is missing."
],
"device.user_agent": [
"This field is missing."
],
"device.ip_address": [
"This field is missing."
]
}
}