Authorize
Authorize an amount.
The authorization call guarantees the payment by the payment service provider for up to seven days. If the authorization is not debited within this period, the authorization is cancelled and the amount is released.
Money flow
The authorization does not trigger a debit transaction. It only reserves the amount for the customer’s payment type.
The authorization does not trigger a debit transaction. It only reserves the amount for the customer’s payment type.
Authorization supporting payment methods
Not every payment type supports authorization. Check the following table to see which payment type does support authorization.
Not every payment type supports authorization. Check the following table to see which payment type does support authorization.
Payment types supporting authorization
Payment method | Supports authorization |
---|---|
/types/card | yes |
/types/paypal | yes |
/types/applepay | yes |
/types/sepa-direct-debit-secured | no |
/types/sofort | no |
/types/giropay | no |
/types/ideal | no |
/types/przelewy24 | no |
/types/prepayment | no |
Request Response
Authorization calls are described in the API reference.
Success response example
{
"id": "s-aut-1",
"isSuccess": true,
"isPending": false,
"isError": false,
"message": {
"code": "COR.000.100.112",
"customer": "Request successfully processed in 'Merchant in Connector Test Mode'"
},
"amount": "100.0000",
"currency": "EUR",
"returnUrl": "https://www.unzer.com",
"paymentReference": "Test authorize transaction",
"date": "2018-09-13 19:41:49",
"resources": {
"customerId": "",
"basketId": "",
"paymentId": "s-pay-1",
"metadataId": "",
"typeId": "s-crd-fm7tifzkqewy"
},
"processing": {
"uniqueId": "31HA07BC8179DC97ADB6249F09E3BBBE",
"shortId": "4007.9410.9870",
"3dsecure": false //card only
}
}
Pending response example
{
"id": "s-aut-1",
"isSuccess": false,
"isPending": true,
"isError": false,
"redirectUrl": "https://payment.unzer.com/v1/redirect/3ds/s-akC1Y8TzBjQu",
"message": {
"code": "COR.000.200.000",
"customer": "Transaction pending"
},
"amount": "11.0000",
"currency": "EUR",
"returnUrl": "http://vnexpress.vn",
"date": "2018-11-30 03:03:12",
"resources": {
"customerId": "",
"paymentId": "s-pay-1226",
"basketId": "",
"metadataId": "",
"typeId": "s-crd-oiwm8rlbezhk"
},
"processing": {
"uniqueId": "31HA07BC815F7DC727FB78F183AE2C36",
"shortId": "4074.7339.2804"
}
}
An authorized call returns a payment ID and the authorization ID 1, since only one authorization per payment is possible.
The parameters isSuccess, isPending, isError indicate the result of the payment. Only one of these three can be true.
Status parameter | Description |
---|---|
isSuccess | The authorization call was executed successfully. |
isPending | The authorization call also returns a RedirectUrl. The customer must be redirected to the RedirectUrl so that the customer can complete the payment. The payment method determines whether an authorization call can enter the pending state. |
isError | Something went wrong. You’ll also find a news section that describes in more detail what the trouble was. |
Name | Format | Description |
---|---|---|
id | string | ID of this authorized transaction. |
isSuccess | string | If the transaction was successful the value is set to true. |
isPending | string | If the transaction is pending, the value is set to true, for instance, if a redirect to an external system is required. |
isError | string | If an error occurs, this value is set to true. |
redirectUrl | string | If customer’s confirmation is required, a redirect URL will be returned. Customer needs to be redirected to this URL and proceed the confirmation. |
paymentReference | string | Transaction description. |
message | object | |
message.code | string | Every error returns a unique id. |
message.customer | string | Error message for the customer. Translated into the language specified in the Accept language header. |
message.merchant | string | Error message for the merchant. This message always appears in English. |
amount | string | The amount to be authorized on the specified account. The amount is in decimal form, e.g. EUR 1.22. |
currency | string(3) | ISO currency code: For a list of possible codes, see: Amounts and Currencies |
returnUrl | string | Some payment methods require the customer to leave the merchant application. This URL is used to bring the customer back to the application. |
date | date | Timestamp of this transaction. |
resources | object | |
resources.customerId | string | Customer ID used for this transaction. |
resource.basketId | string | Basket ID used for this transaction. |
resource.metadataId | string | Meta data ID used for this transaction. |
resources.paymentId | string | ID of the payment object. |
resources.typeId | string | ID of the types resource which was used for this transaction. |
processing | object | |
processing.uniqueId | string | Reference id of the payment system. |
processing.shortId | string | User-friendly reference ID of the payment system. |
processing.iban | string | Iban of the merchant in case of prepayment or invoice. In case of direct debit this value contains the customer IBAN. |
processing.bic | string | Bic of the merchant for prepayment or invoice. In the case of a direct debit, this value contains the customer BIC. |
processing.identification | string | This value returns the descriptor for invoice and prepayment. |
processing.creatorId | string | This value returns your creditor id. |
processing.3dsecure | boolean | Indicate a 3ds transaction (card payment type only). |