Skip to main content

Authorization

Definition

An Authorization refers to the process of obtaining approval from a financial institution or payment gateway to proceed with a transaction.

When a customer initiates a payment, an authorization request is sent to:
Verify the validity of the payment method.
Ensure sufficient funds are available.
Authenticate the user before proceeding.

This step reserves the specified amount but does not yet transfer it, ensuring the payer has the necessary funds before capture.


Authorization in Payment API V2

In Payment API V2, an authorization consists of multiple partner authorizations, reflecting the buyer's choice of payment providers.

Example

{
"authorization": {
"updated_at": "2024-07-26T14:15:02.569Z",
"status": "AUTHORIZED",
"partner_transactions": [
{
[...]
}
]
}
}

Authorization Statuses

The authorization status is computed based on all partner authorizations.
This helps merchants determine when a payment is ready for further actions (capture, refund, void).

Available Statuses:

StatusDescription
AUTHORIZEDAll partner authorizations are successful, the merchant can validate checkout.
PENDINGSome authorizations are still in process. Merchant will receive a notification once updated.
ERRORA technical error occurred while processing authorization.
ABORTEDThe customer aborted the payment process.
REFUSEDThe payment provider refused the authorization.
UNCERTAINThe PSP did not return a clear response after multiple attempts.

Authorization Status Workflow

Authorization status workflow schema


Compensating Transactions

A compensating transaction is a payment operation that targets successful authorized transactions to undo the reservation of funds.

Why are compensating transactions needed?

Sometimes, a payment is split across multiple partners, and some authorizations succeed while others fail.
In this case, the system needs to cancel the successful authorizations, as the full payment cannot proceed.

How it works behind the scenes

A compensating transaction targets the authorization transactions with a SUCCESS status.
It occurs when an authorization contains both successful and failing transactions, and the system reacts depending on whether the authorization is one-step or two-step:


One-step Authorizations

  • If the transaction is successful, a capture is automatically triggered by the AUTHORIZATION flag itself.
  • If this transaction later becomes part of a compensating flow, a refund is automatically triggered by the ORCHESTRATOR flag.

Two-step Authorizations

  • If the transaction is successful but compensation is needed, the ORCHESTRATOR flag will automatically trigger a void operation.

Combined Scenarios

When an authorization contains:

  • One or more successful one-step or two-step transactions, and
  • At least one failing one-step transaction,

Then the orchestrator will:

  • Void the successful two-step transactions
  • Refund the successful one-step transactions
Why it matters

This orchestration logic is integral to handling edge cases in multi-partner payments, ensuring funds are never blocked if a payment fails in part.