Payload Validation
|
:
|
'type' => 'required|string|in:regular,invoiced,reservation',
'grandTotal' => 'required|numeric',
'message' => 'required|string',
'products' => 'required|array',
'products.*.id' => 'required|numeric',
'products.*.amount' => 'required|numeric',
'source' => 'nullable|string|in:captured",charged|requiredIf('type') === reservation',
'reference' => 'nullable|string|requiredIf('type') === reservation
|
Example Payload
|
:
|
{
"type": "reservation",
"grandTotal": 55,
"message": "refundRejectionForWeeklyThresholdExceed",
"products": [
{
"id": 451,
"amount": 30
},
{
"id": 452,
"amount": 25
}
],
"source": "charged",
"reference": "CHA3852658817"
}
|
Response Structure
|
:
|
// Success
{
"status_code": 201,
"status_message": "OK",
"message": "requestedOrderRefundSuccessfully",
"is_data": false,
"data": null
}
// Errors
{
"status_code": 417,
"status_message": "Client Error",
"message": "payloadValidationErrors",
"is_error": true,
"errors": "Array"
}
{
"status_code": 404,
"status_message": "Not Found",
"message": "orderNotFound",
"is_data": false,
"data": null
}
{
"status_code": 400,
"status_message": "Conflict of Business Logic",
"message": "refundRejectionForRefundedCancelledInvoicedOrderParamRefunded",
"is_data": false,
"data": null
}
{
"status_code": 400,
"status_message": "Conflict of Business Logic",
"message": "requestProductIdNotAvailable",
"is_data": false,
"data": null
}
{
"status_code": 400,
"status_message": "Conflict of Business Logic",
"message": "refundRejectionForRefundedCancelledInvoicedOrderParamCancelled",
"is_data": false,
"data": null
}
{
"status_code": 400,
"status_message": "Conflict of Business Logic",
"message": "refundRejectionForRefundedCancelledInvoicedOrderParamInvoiced",
"is_data": false,
"data": null
}
{
"status_code": 400,
"status_message": "Conflict of Business Logic",
"message": "orderRefundRequestAlreadySubmitted",
"is_data": false,
"data": null
}
{
"status_code": 510,
"status_message": "Execution Exception Occurred",
"message": "somethingWentWrong",
"is_error": true,
"errors": "Array"
}
|