Refund

Creates a refund for the specified invoice. When creating the request, you can specify the refund fee calculation mode using the fee_mode parameter.

POST

https://api.fps.pro/invoices/refund/{id}

Request formatapplication/json

fee_mode

number

Fee charging mode. If deduct is specified, the fee is deducted from the payment amount and the client receives the invoice amount minus the fee. If add is specified, you pay the refund fee from the merchant account and the client receives the full payment amount.

Default: deduct

Request examples

curl --request POST 'https://api.fps.pro/invoices/refund/0a718b02-138d-495a-9661-39ca52139c07' \
  --header 'Content-Type: application/json' \
  --header 'X-Client-Id: YOUR_CLIENT_ID' \
  --header 'X-Timestamp: 1720000000' \
  --header 'X-Signature: YOUR_HMAC_SHA256_SIGNATURE' \
  --data '{
  "fee_mode": "deduct"
}'

Successful response

{
  "status": 200,
  "message": "success refund"
}

Errors

Detailed authorization errors are listed in Authorization - Errors

{
  "status": 400,
  "message": "There is no balance available for refund"
}
{
  "status": 404,
  "message": "The invoice is not found"
}
{
  "status": 422,
  "message": "Validation Error",
  "errors": [
    {
      "field": "fee_mode",
      "message": "invalid value"
    }
  ]
}
{
  "status": 500,
  "message": "Internal Server Error"
}