On This Page
Process a Sale
This section describes how to send a sale request to process a payment.
A sale request authorizes and captures a payment in the same request. A successful sale
response includes an CODi redirect URL and a
PENDING
status. Redirect
the customer to the CODi URL to allow the customer to complete the checkout using their
CODi account. When the customer completes the checkout, the customer is redirected to
your website.When you receive a successful response, save the sale request ID in the
requestID
response field to perform a follow-on check status request.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
Processing a Sale
Follow these steps to successfully process sale.
- Send aPOSTrequest to thehttps://ics2ws.ic3.com/commerce/1.x/transactionProcessorendpoint and include these required fields:
- Set toCOI.
- Set to the URL to which the customer is redirected after the payment is cancelled.
- Add?action=cancelto the end of the URL to help identify the response.
- Set to the URL to which the customer is redirected after the payment fails to complete.
- Add?action=failureto the end of the URL to help identify the response.
- Set to the URL to which the customer is redirected after successfully completing the payment.
- Add?action=successto the end of the URL to help identify the response.
- Set totrue.
- Set toMX.
- Set toMXN.
- You can include these optional fields in the request:
- 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.
- If this field is present, thepurchaseTotals_currencyfield is optional.
- Replace the#character with a sequential number starting from0.
- Replace the#character with a sequential number starting from0.
- Redirect the customer to the returned URL in themerchantURLresponse field.<merchantURL></merchantURL>
- When the customer completes the checkout using their CODi credentials, the customer is redirected to the merchant website based on the URL that you included in theapSaleService_successURLrequest field.
- Save the request ID in therequestIDfield from the sale response. Include the request ID in a check status request to confirm that the payment is complete.<requestID></requestID>
Example: Processing a Sale
Request
<requestMessage xmlns="urn:schemas-cybersource-com:transaction-data-1.211"> <merchantID>altpay_test</merchantID> <merchantReferenceCode>codi-Sale</merchantReferenceCode> <billTo> <firstName>Test</firstName> <lastName>Testerson</lastName> <country>MX</country> <email>test@email.com</email> </billTo> <purchaseTotals> <currency>MXN</currency> <grandTotalAmount>20.00</grandTotalAmount> </purchaseTotals> <apPaymentType>COI</apPaymentType> <apSaleService run="true"> <cancelURL>https://www.testcancel.com?action=cancel</cancelURL> <successURL>https://www.testsuccess.com?action=success</successURL> <failureURL>https://www.testfailure.com?action=failure</failureURL> </apSaleService> </requestMessage>
Response to a Successful Request
<replyMessage xmlns="urn:schemas-cybersource-com:transaction-data-1.211"> <merchantReferenceCode>codi-Sale</merchantReferenceCode> <requestID>7502721821026418103612</requestID> <decision>ACCEPT</decision> <reasonCode>100</reasonCode> <requestToken>AxjnrwSTlrkucRmDhxU8ANgZYiy69aFZpN5rCynkIGzFOzyC/oKGMMmkmXoxX6rUJOWuS5xGYOHFTwAA+Thq</requestToken> <purchaseTotals> <currency>MXN</currency> </purchaseTotals> <apSaleReply> <reasonCode>100</reasonCode> <paymentStatus>pending</paymentStatus> <responseCode>00001</responseCode> <merchantURL>https://payment.limonetikqualif.com/STP/Order/PayPage/685831861588</merchantURL> <processorTransactionID>685831861588</processorTransactionID> <reconciliationID>XEKWVBYR7M0Y</reconciliationID> <amount>20.00</amount> <processorResponse>00001</processorResponse> <dateTime>2025-06-18T18:43:03Z</dateTime> </apSaleReply> </replyMessage>
Response Statuses for Processing a Sale
Cybersource
responds to your sale request with one of these statuses
in the field:- FAILED: The sale cannot be completed.
- PENDING: The sale request is accepted but is not completed. Send a check status request as often as necessary to obtain the information that you need. For more information, see Check a Status.