notifyAuthorization
Antom uses this API to send the authorization result to the merchant when the authorization succeeds or when the authorization cancellation succeeds.
Structure
A message consists of a header and body. The following sections are focused on the body structure. For the header structure, see:
Note: Set the data type of each field (except array) as String. This means that you must use double quotation marks (" ") to enclose the field value. Examples:
- If the data type of a field is Integer and its value is 20, set it as "20".
- If the data type of a field is Boolean and its value is true, set it as "true".
Request parameters
authorizationNotifyType String REQUIRED
Authorization notification type. Valid values are:
AUTHCODE_CREATED
(for Auto Debit only): Indicates that the user agrees to authorize an Auto Debit payment. After the user agrees to authorize, the wallet-generated authorization code can be obtained from this notification and be used in the applyToken API to obtain the access token.TOKEN_CREATED
(for EasySafePay only): Indicates that the user initiated authorization for an EasySafePay payment on the merchant's client successfully.TOKEN_CANCELED
: Indicates that the authorization cancellation initiated from the merchant or payment method client succeeded.
More information:
- Maximum length: 32 characters
authClientId String
The unique ID of the secondary merchant to which the user grants resource access permission. The value is specified by the acquirer and needs to be registered in Antom.
Notes:
- This field is returned when the consult API is initiated by the Alipay+ payment methods.
- For an Alipay+ payment methods, the value of this field is the same as the value of referenceMerchantId in the pay (Checkout Payment) API.
More information:
- Maximum length: 64 characters
accessToken String
The access token that is used to access the corresponding scope of the user resource.
Note: This field is returned when the value of authorizationNotifyType is
TOKEN_CANCELED
orTOKEN_CREATED
.
More information:
- Maximum length: 128 characters
authState String
A string that is generated by the acquirer to represent the consult request. The value of this field is to be used for validating whether being consistent with the value of authState specified in the consult request.
Note: This field is returned when authorizationNotifyType is
AUTHCODE_CREATED
andTOKEN_CREATED
.
More information:
- Maximum length: 256 characters
authCode String
The authorization code, used for getting an access token. This value is obtained by the application from the reconstructed redirection URL returned by the wallet after the user is redirected to the reconstructed redirection URL.
Note: This field is returned when authorizationNotifyType is
AUTHCODE_CREATED
.
More information:
- Maximum length: 64 characters
reason String
The reason why the authorization is canceled. This field is sent to the merchant when the user provides the reason for authorization cancellation.
Note: This field is returned when authorizationNotifyType is
TOKEN_CANCELED
.
More information:
- Maximum length: 256 characters
result Result object REQUIRED
The authorization result. Antom returns the authorization notification only when the authorization succeeds or the authorization cancellation succeeds. Therefore, only the result of a successful authorization is provided.
userLoginId String
The login ID that the user used to register in the wallet. The login ID can be the user's email address or phone number.
Specify this parameter to remove the need for manual entry of the login ID by users.
More information:
- Maximum length: 64 characters
userId String
The ID assigned by the payment method provider to identify a user.
More information:
- Maximum length: 64 characters
Response parameters
result Result object REQUIRED
A fixed value that you need to send to Antom to acknowledge that the notification is received.
Request
Response
Result process logic
Send the following message with fixed values to Antom after receiving the notification, to acknowledge that the notification from Antom is received:
If no such message is returned to Antom due to operation issues or network issues, Antom will intermittently send the notification until the required message is returned by the merchant. Resending of the notification will be performed within 24 hours after the first notification is sent. The notification will be resent up to eight times, with an interval of 0s, 2min, 10min, 10min, 1h, 2h, 6h, and 15h.
Note: In the sandbox environment, if you do not return information in the specified format, Antom will not resend asynchronous notifications to you.