Request Details
Method |
Controller |
Resource |
Parameters |
POST |
card |
payment |
outlet_id -cashier_id / card_no -pin_code / amount / receipt |
Parameters Guide
Parameter |
Accepts |
payment |
default value - must be payment
|
outlet_id |
int outlet id as supplied from BeepXtra |
cashier_id |
int id of current user acting as cashier (Can be dynamically changed or use outlet owner id as default |
card_no |
bigint card number or string valid email of the member receiving the cashback |
pin_code |
int 4-digit pin code of card holder |
receipt |
string receipt number (optional) or 0 for default. NOTE: No spaces allowed in receipt (e.g. res1233) |
Example Request Format
Direct Url |
https://api.beepxtra.com/card/payment/123-50/1-1234/0.01/receipt |
Curl |
CURL -A "YOURUSERAGENT|1.0|YOURAPPID|YOURAPPKEY|card" -X POST https://api.beepxtra.com/card/payment/123-50/1-1234/0.01/receipt |
PHP SDK |
$beepapi->request('post', 'card', 'payment/123-50/1-1234/0.01/receipt'); |
Sample Response
Success
{
"success":true,
"request":{
"method":"POST",
"controller":"card",
"resource":"payment",
"parameters":{
"\/card\/payment\/123-50\/4-1234\/0_01\/receipt":""
},
"url_elements":[
"card",
"payment",
"123-50",
"4-1234",
"0.01",
"receipt"
]
},
"error":{
"errorid":0,
"message":0
},
"data":{
"success":"true"
}
}
Error
{
"error":{
"errorid":1,
"message":"Incorrect PIN. Please try again"
},
"success":false,
"request":{
"method":"POST",
"controller":"card",
"resource":"payment",
"parameters":{
"\/card\/payment\/123-50\/4-1234\/0_01\/receipt":""
},
"url_elements":[
"card",
"payment",
"123-50",
"4-1234",
"0.01",
"receipt"
]
},
"data":{
"error":"Incorrect PIN. Please try again"
}
}
Response Guide
Parameter |
Type |
Details |
error |
String |
Contains the error message returned |
success |
boolean |
Returns true if successful |