Sales
This service enables you to send both a payment authorization request and a capture
request as a single transaction using the sale service. You must include the token
received from the session response in the sale request to receive a successful response.
Endpoints
Set the
apSaleService_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
A sale request can have one of the following statuses:
- FAILED: the sale request fails when there are invalid or missing fields.
- PENDING: the sale request is accepted but is not settled. To settle the payment, check out using the payment redirect URL that you received in the sale response.
Once
SETTLED
, a sale transaction cannot
be reversed using the authorization-reversal service. You must use a credit
request to refund a transaction. Required Fields for a Sale
Include these required fields in the sale request.
- Set toafp.
- Set totrue.
- apSaleService_successfulURL
- apSaleService_preapprovalToken
- Set to theprocessorTokenreturned in the session response.
Optional Fields for a Sale
- 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.
- Replace the#character with a sequential number starting from0.
- When this field is included in the request, thepurchaseTotals_grandTotalAmountfield is no longer required.
- Replace the#character with a sequential number starting from0.
Example: Performing a Sale with XML
Request
1234567891011121314151617181920212223242526272829303132333435<="urn:schemas-cybersource-com:transaction-data-1.213"> <merchantID>test_merchant</merchantID> <merchantReferenceCode>ref-1234</merchantReferenceCode> <billTo> <firstName>John</firstName> <lastName>Smith</lastName> <street1>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>Happy</street1> <city>Austin</city> <state>TX</state> <postalCode>78757</postalCode> <country>US</country> <phoneNumber>33623456789</phoneNumber> </shipTo> <purchaseTotals> <currency>USD</currency> <grandTotalAmount>100.00</grandTotalAmount> </purchaseTotals> <apPaymentType>afp</apPaymentType> <apSaleService run="true"> <cancelURL>http://test0.com</cancelURL> <successURL>http://test1.com</successURL> <failureURL>http://test2.com</failureURL> <preapprovalToken>c25e5752-ce21-4426-9b77-635a2d6a7aee</preapprovalToken> </apSaleService> </>
Response to a Successful Request
12345678910111213141516171819<:c="urn:schemas-cybersource-com:transaction-data-1.213"> <merchantReferenceCode>refnum-1234</merchantReferenceCode> <requestID>6246055293446455103056</requestID> <decision>ACCEPT</decision> <reasonCode>100</reasonCode> <purchaseTotals> <currency>USD</currency> </purchaseTotals> <apSaleReply> <reasonCode>100</reasonCode> <paymentStatus>pending</paymentStatus> <responseCode>00001</responseCode> <merchantURL>https://portal.afterpay.com/us/checkout/?token=002.co8</merchantURL> <processorTransactionID>ab19e56a-1056</processorTransactionID> <reconciliationID>XFZOQQ97FEIW</reconciliationID> <amount>10.00</amount> <processorResponse>00001</processorResponse> </apSaleReply> </>