INTEGRATION

Getting Started

CHARGES

Cancel, Refund or Reverse Charges

INTEGRATION

Cancel, Refund or Reverse Charges

There are four different endpoints that can be used to cancel or refund a charge. It depends on the use case and the clearingMode of the charge to determine which endpoint should be used: Cancel, Refund, Cancel or Refund or Reverse.

Auto Clearing Mode

When the clearingMode is set to auto the following endpoints can be used:

Cancelling a Charge

The Cancel Charge endpoint will cancel the referenced charge. This means the clearing of the referenced charge will be cancelled and a reversal request for the original authorization will be sent. If the charge is already cleared, this endpoint will return an HTTP 409 error with type set to /silverflow/problems/charge/clearing-already-submitted. When the referenced charge was created with the clearAfter property, the charge can be cancelled up until the timestamp specified. The endpoint only supports cancelling the full charge amount, no partial amounts are allowed.​ See the example request:

Restrictions: Can only be used for charges with clearingMode set to auto and only supports cancelling the full charge amount, no partial amounts are allowed.​

Refunding a Charge

The Refund Charge endpoint refunds the referenced charge. It supports full or partial refunds. It can not be used if the intent of the original charge is refund. Note that it does not check whether or not the referenced charge has been cleared already. One can use the Cancel Charge endpoint first, and if a 409 with /silverflow/problems/charge/clearing-already-submitted is returned, then call the refund endpoint instead to refund the charge. Example request:

The snippet above refunds the referenced charge for the declared refundAmount. Clearing of the charge is not affected. The refundAmount can be used for partial refunds, if omitted the full amount will be refunded. Here is an example response:

Restrictions:​ Can not be used if the intent of the original charge is refund.

Please be aware that there is no validation whether or not the referenced charge has already been cleared.

Cancel or Refund a Charge

The Cancel or Refund Charge endpoint will either cancel or refund the referenced charge. When a request is sent, it will first check if the charge has been cleared. If not, the charge will be cancelled. If the charged is already cleared, the charge will be refunded instead. This endpoint only supports cancelling or refunding the full charge amount, no partial amounts are supported. Example response:

Restrictions:​ This endpoint does not support cancelling or refunding of POS charges. It can only be used for charges with clearingMode set to auto and can only cancel or refund the full charge amount. No partial amounts are allowed.​

Manual Clearing Mode

When the clearingMode is set to manual the following endpoints can be used:

Reverse a Charge

The Reverse Charge endpoint will reverse the authorization of the referenced charge. It supports full and partial reversals. It does not check if the charge has been partially or fully cleared. If the charge has already been cleared this endpoint should not be used, but the Refund Charge endpoint should be used instead. Example request:

This endpoint will only send a 04xx ISO 8583 reversal message for the original authorization. The clearing status remains unchanged. Note that for this endpoint, the client can provide the replacementAmount. The replacementAmount will replace the original authorization amount, it is not the amount that will be reversed. If not specified, the full charge amount will be reversed.​ See the example response:

Restrictions: Can only be used for charges with clearingMode set to manual.​

Please note that a reversal will not show up in the settlement details since no clearing record has been submitted.

Unreferenced Refunds

It is possible to perform a refund without referencing a charge. For unreferenced refunds you can use the Create Charge endpoint with the intent refund.