Authorizations
Use the authorization service to process a payment request to Afterpay or Clearpay. You
must include the token received from the session response in the authorization request
to receive a successful response.
Endpoints
Set the
apAuthService_run
field to
true
, and send the request to one of these
endpoints:Production:
https://ics2ws.ic3.com/commerce/1.x/transactionProcessor
Test:
https://ics2wstest.ic3.com/commerce/1.x/transactionProcessor
Response Status
An authorization can have one of the following statuses:
- AUTHORIZED: the payment is authorized.
- PENDING: the authorization request is accepted, but the payment is not authorized. To authorize the payment, complete the authorization using the payment redirection URL that you received in the authorization response.
- FAILED: the authorization request fails when there are invalid or missing fields.
Required Fields for Authorizing a Payment
Include these required fields in the authorization request.
- Set to theprocessorTokenfrom the session response.
- Set totrue.
- Set toafp.
Optional Fields for Authorizing a Payment
Choose from these optional fields to include in the authorization request.
- apAuthService_reconciliationID
- Set to thereconciliationIDreturned in the session response.
- Replace the#character with a sequential number starting from0.
- Replace the#character with a sequential number starting from0.
- Replace the#character with a sequential number starting from0.
- Replace the#character with a sequential number starting from0.
- Replace the#character with a sequential number starting from0.
- If this field is present, thepurchaseTotals_grandTotalAmountfield becomes optional.
- Replace the#character with a sequential number starting from0.
- Replace the#character with a sequential number starting from0.
- Set toinline.
Example: Authorizing a Payment with XML
These examples show successful authorization requests.
Request
123456789101112131415161718192021222324252627282930313233<="urn:schemas-cybersource-com:transaction-data-1.213"> <merchantID>test_merchant</merchantID> <merchantReferenceCode>refnum-1234</merchantReferenceCode> <billTo> <firstName>John</firstName> <lastName>Smith</lastName> <street1>123 Happy St</street1> <city>Austin</city> <state>TX</state> <postalCode>78757</postalCode> <country>US</country> <email>test@cybs.com</email> </billTo> <shipTo> <firstName>John</firstName> <lastName>Smith</lastName> <street1>123 Happy</street1> <city>Austin</city> <state>TX</state> <postalCode>78757</postalCode> <country>US</country> </shipTo> <purchaseTotals> <currency>USD</currency> <grandTotalAmount>75.00</grandTotalAmount> </purchaseTotals> <apPaymentType>afp</apPaymentType> <apAuthService run="true"> <cancelURL>https://www.test.com</cancelURL> <successURL>https://www.test.com</successURL> <preapprovalToken>519ff272-d850-4c81-ab65-674f670063c7</preapprovalToken> </apAuthService> </>
Response to a Successful Request
123456789101112131415161718192021<:c="urn:schemas-cybersource-com:transaction-data-1.213"> <merchantReferenceCode>refnum-1234</merchantReferenceCode> <requestID>6246274241256683803069</requestID> <decision>ACCEPT</decision> <reasonCode>100</reasonCode> <requestToken>AxjnrwSTeaOOe5Ed6nFKAAUZYjWmrWdFqOaFmiojml/qNzSBvUwzPhk0ky9GMFti5JvNHHPciO9TilAA4hjb</requestToken> <purchaseTotals> <currency>USD</currency> </purchaseTotals> <apAuthReply> <reasonCode>100</reasonCode> <status>AUTHORIZED</status> <processorResponse>00003</processorResponse> <amount>75.00</amount> <dateTime>2023-10-06T19:33:21Z</dateTime> <paymentStatus>authorized</paymentStatus> <responseCode>00003</responseCode> <reconciliationID>XFZ55NET9PYQ</reconciliationID> <processorTransactionID>519ff272-d850-4c81-ab65-674f670063c7</processorTransactionID> </apAuthReply> </>
Request with Optional Line Items
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748<="urn:schemas-cybersource-com:transaction-data-1.213"> <merchantID>test_merchant</merchantID> <merchantReferenceCode>refnum-1234</merchantReferenceCode> <billTo> <firstName>John</firstName> <lastName>Smith</lastName> <street1>Peachtree St</street1> <city>Atlanta</city> <state>GA</state> <postalCode>33019</postalCode> <country>US</country> <email>test@cybs.com</email> </billTo> <shipTo> <firstName>John</firstName> <lastName>Smith</lastName> <street1>Peachtree St</street1> <city>Atlanta</city> <state>GA</state> <postalCode>33019</postalCode> <country>US</country> </shipTo> <item id="0"> <unitPrice>1</unitPrice> <quantity>10</quantity> <productCode>4564</productCode> <productName>TV</productName> <productSKU>testI</productSKU> <totalAmount>10</totalAmount> </item> <item id="1"> <unitPrice>15</unitPrice> <quantity>1</quantity> <productCode>65432</productCode> <productName>TV</productName> <productSKU>testJ</productSKU> <totalAmount>15</totalAmount> </item> <purchaseTotals> <currency>USD</currency> </purchaseTotals> <apPaymentType>AFP</apPaymentType> <apAuthService run="true"> <cancelURL>https://www.test.com</cancelURL> <successURL>https://www.test1.com</successURL> <preapprovalToken>0d97aa1b-a9dd-4e9c-b60c-b1157470d034</preapprovalToken> </apAuthService> </>
Response with Optional Line Items
123456789101112131415161718192021<:c="urn:schemas-cybersource-com:transaction-data-1.213"> <merchantReferenceCode>refnum-1234</merchantReferenceCode> <requestID>6977375233876065503009</requestID> <decision>ACCEPT</decision> <reasonCode>100</reasonCode> <requestToken>AxjnrwSTej6Ib33u98chAAUZYiy69adJpUaUiInkFtpV8ukDJxDNyGTSTL0YwW2Lkm9H0Q3vvd745CAA6Qe8</requestToken> <purchaseTotals> <currency>USD</currency> </purchaseTotals> <apAuthReply> <reasonCode>100</reasonCode> <status>AUTHORIZED</status> <processorResponse>00003</processorResponse> <amount>25.00</amount> <dateTime>2023-10-19T17:45:24Z</dateTime> <paymentStatus>authorized</paymentStatus> <responseCode>00003</responseCode> <reconciliationID>XEKWVNIRQRHD</reconciliationID> <processorTransactionID>0d97aa1b-a9dd-4e9c-b60c-b1157470d034</processorTransactionID> </apAuthReply> </>