Skip to main content

Refund or Reverse Payment

This API allows your application to refund payment from your order

Endpoint : https://demo-api.frontpayment.no/api/v1/connect/terminal/orders/refund/{{ORDER_UUID}}
Method : POST
Authorization : Bearer
Payload Validations :

 

'type' => 'required|string',
'grandTotal'=> 'required|numeric',
'products' => 'required|array',
'products.*.id' => 'required|numeric',
'products.*.amount' => 'required|numeric',
'isReversal' => 'required|Boolean'

 



If you want to Reverse the payment then set 'isReversal' = true 

Example Payload :

 

{
    "type": "regular",
    "grandTotal": 42,
    "products": [
        {
            "id": 12,
            "amount": 42
        }
    ],
    "isReversal": false
}

 

Response Structure :

 


{
  "status_code": 202,
  "status_message": "OK",
  "message": "terminalOrderRefundRequestSuccessfully",
  "is_data": false,
  "data": null
}

{ "status_code": 200, "status_message": "OK", "message": "terminalOrderReversalSuccessfully", "is_data": false, "data": null }

{ "status_code": 417, "status_message": "Client Error", "message": "payloadValidationErrors", "is_error": true, "errors": "Array" }

{ "status_code": 404, "status_message": "Not Found", "message": "orderNotFound", "is_error": false, "errors": 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": "orderProductsNotFound", "is_error": false, "errors": null }

{ "status_code": 400, "status_message": "Conflict of Business Logic", "message": "refundRejectionForProductAmountExceed", "is_error": true, "errors": "Array" }

{ "status_code": 510, "status_message": "Execution Exception Occurred", "message": "somethingWentWrong", "is_error": true, "errors": "Array" }

 

Example Response :

 

{
    "status_code": 202,
    "status_message": "OK",
    "message": "terminalOrderRefundRequestSuccessfully",
    "is_data": false,
    "data": null
}