Authorizations with Line Items
This section shows you how to process an authorization with line items.
The main difference between a basic authorization and an authorization that includes
line items is that the
orderInformation.amountDetails.totalAmount
field, which is
included in a basic authorization, is substituted with one or more line items that
are included in a
.lineItem[]
arrayFields Specific to this Use Case
These
fields
are required for each line item that you use:- orderInformation.lineItems[].unitPrice
- orderInformation.lineItems[].quantity
- orderInformation.lineItems[].productCode
- orderInformation.lineItems[].productSku
- Optional whenitem_#_productCodeis set todefault,shipping_only,handling_only, orshipping_and_handling
- orderInformation.lineItems[].productName
- Optional whenitem_#_productCodeis set todefault,shipping_only,handling_only, orshipping_and_handling
At a minimum, you must include the
orderInformation.lineItems[].unitPrice
field in order to include a line item in an
authorization. When this field is the only field included in the authorization, the
system sets:- orderInformation.lineItems[].productCode:default
- orderInformation.lineItems[].quantity:1
For example, these three line items are valid.
"orderInformation": { "lineItems": [ { "unitPrice": "10.00" }, { "unitPrice": "5.99", "quantity": "3", "productCode": "shipping_only" }, { "unitPrice": "29.99", "quantity": "3", "productCode": "electronic_good", "productSku": "12384569", "productName": "receiver" } ] }
Endpoint
Production:
POST
https://api.cybersource.com
/pts/v2/paymentsTest:
POST
https://apitest.cybersource.com
/pts/v2/paymentsRequired Fields for Processing an Authorization with Line Items
Use these required fields for processing an authorization that includes line items.
Related Information
REST Example: Processing an Authorization with Line Items
Request
123456789101112131415161718192021222324252627282930313233343536373839404142434445{"currencyConversion": { "indicator": "Y" }, "paymentInformation": { "card": { "number": "4111111111111111", "expirationMonth": "12", "expirationYear": "2031" } }, "orderInformation": { "amountDetails": { "currency": "USD", "exchangeRate": ".91", "originalAmount": "107.33", "originalCurrency": "eur" }, "billTo": { "firstName": "John", "lastName": "Doe", "address1": "1 Market St", "locality": "san francisco", "administrativeArea": "CA", "postalCode": "94105", "country": "US", "email": "test@cybs.com" }, "lineItems": [ { "unitPrice": "10.00" }, { "unitPrice": "5.99", "quantity": "3", "productCode": "shipping_only" }, { "unitPrice": "29.99", "quantity": "3", "productCode": "electronic_good", "productSku": "12384569", "productName": "receiver" } ] }}
Response to a Successful Request
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960{"_links": { "authReversal": { "method": "POST", "href": "/pts/v2/payments/6482385519226028804003/reversals" }, "self": { "method": "GET", "href": "/pts/v2/payments/6482385519226028804003" }, "capture": { "method": "POST", "href": "/pts/v2/payments/6482385519226028804003/captures" } }, "clientReferenceInformation": { "code": "1648238551902" }, "id": "6482385519226028804003", "orderInformation": { "amountDetails": { "authorizedAmount": "117.94", "currency": "USD" } }, "paymentAccountInformation": { "card": { "type": "001" } }, "paymentInformation": { "tokenizedCard": { "type": "001" }, "card": { "type": "001" } }, "processorInformation": { "systemTraceAuditNumber": "191521", "approvalCode": "831000", "merchantAdvice": { "code": "01", "codeRaw": "M001" }, "responseDetails": "ABC", "networkTransactionId": "016153570198200", "consumerAuthenticationResponse": { "code": "2", "codeRaw": "2" }, "transactionId": "016153570198200", "responseCode": "00", "avs": { "code": "Y", "codeRaw": "Y" } }, "reconciliationId": "6482385519226028804003", "status": "AUTHORIZED", "submitTimeUtc": "2022-03-25T20:02:32Z"}