Refund

Membuat refund untuk invoice yang ditentukan. Saat membuat request, Anda dapat menentukan mode perhitungan biaya refund menggunakan parameter fee_mode.

POST

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

Format requestapplication/json

fee_mode

number

Mode pembebanan biaya. Jika deduct ditentukan, biaya akan dipotong dari jumlah pembayaran dan client menerima jumlah invoice setelah biaya dipotong. Jika add ditentukan, Anda membayar biaya refund dari akun merchant dan client menerima jumlah pembayaran penuh.

Default: deduct

Contoh permintaan

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"
}'

Respons berhasil

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

Error

Daftar detail error otorisasi ada di Otorisasi - Error

{
  "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"
}