Create refund

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…

The response is a HTTP 200 if the request is understood and processed by Frisbii Billing and Pay, but not necessarily with success. The HTTP status code relates to the communication with Frisbii Billing and Pay and Frisbii Billing and Pays ability to process the request, not the result of the refund. The result of the refund operation should be determined from the state parameter which will be refunded, failed or processing (only asynchronous payment methods). The error state and error reason can be found in error_state and error parameters.

Error handling if a refund operation fails is important, as this is a money carrying operation. We recommend using an idempotency key for retrying the same refund operation. This is especially important for partial refunds so a retry does not result in additional partial refund. Our recommendations for error handling is given in the tables below.

ErrorHandling
Communication error (no HTTP respoonse)
or HTTP server error 5xx
Retry operation immediately or later, preferably with an idempotency key to avoid multiple refunds if a partial refund is performed. Retry is important as the refund operation can actually have gone through so money has been moved.
HTTP client error 4xxCheck your implementation. One error that can be expected for full refunds, and if an idempotency key is not used is “Refund amount too high”, as described below. For a retry it can be interpreted as success if the idempotency key is not used.
Other non 200 HTTP responseSomething is wrong. Handle as for communication error and contact Frisbii Billing and Pay if the problem persists.
state = refundedSuccess
state = processingSuccess - The payment type has asynchronous refunds (e.g. MobilePay Subscriptions). The result of the refund will be deliverd in webhook.
error_state = hard_declinedThe refund operation has been declined by acquirer or issuer. No further attempts with same arguments will succeed.
error_state = processing_errorA processing error can happen if something goes wrong at, or in between, any of the parties involved in a transaction. A processing error can potentially have resulted in an approved refund, but the result never reaches Frisbii Billing and Pay. E.g. a timeout somewhere in the chain. Processing errors leading to transactions actually having been completed without knowing the result is frustrating, but luckily quite rare.

We recommend to retry later on a processing error, but only a few times.

Errors

The operation can generate the following errors beside the generic HTTP error codes described here.

Error code HTTP codeDescription
31404Invoice not found
64400Invoice not settled
65400The refund amount exceeds settled amount minus already refunded or credited amounts
80400Invoice has processing transactions - an asynchronous refund is in progress - result will be reported in webhook
Body Params
string
required
length ≥ 1

Handle or id for invoice/charge to refund

string

Optional idempotency key. Only one refund can be performed for the same key. An idempotency key identifies uniquely the request and multiple requests with the same key and invoice will yield the same result. In case of networking errors the same request with same key can safely be retried.

int32
≥ 1

Optional amount in the smallest unit for the account currency. Either amount or note_lines can be provided, if neither is provided the full refundable amount is refunded.

float

Optional vat for this refund.

string

Optional refund text to use on credit note. Used in conjunction with amount. Ignored if note_lines is provided.

boolean

Whether the amount is including VAT. Default true.

note_lines
array of objects
length between 1 and 2147483647

Refund credit note lines to give detailed information for credit note. Alternative to amount.

note_lines
manual_transfer
object

Optional manual transfer. If given no refund will be performed on potential online settled transaction like card transaction.

string

Optional reference for the transaction at the acquirer. Notice the following about this argument:

  1. It only works for some acquirers.
  2. Acquirers may have rigid rules on the content of the acquirer reference.
    Not complying to these rules can result in declined payments.
  3. It is already possible to define custom acquirer reference using templating in the Frisbii Administration.
    Contact support for help. We highly recommend to only supply this argument if absolutely necessary,
    and the templated default acquirer reference is not sufficient. Maximum length is 128,
    but most acquirers require a maximum length of 22 characters.
    Truncating will be applied if too long for specific acquirer.
    Characters must match regex [\x20-\x7F]
Responses

Language
Credentials
Basic
base64
:
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json