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[]
array
.

Fields 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 when
item_#_productCode
is set to
default
,
shipping_only
,
handling_only
, or
shipping_and_handling
orderInformation.lineItems[].productName
Optional when
item_#_productCode
is set to
default
,
shipping_only
,
handling_only
, or
shipping_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/payments
Test:
POST
https://apitest.cybersource.com
/pts/v2/payments

Required Fields for Processing an Authorization with Line Items

Use these required fields for processing an authorization that includes line items.
IMPORTANT
When relaxed requirements for address data and the expiration date are being used, not all fields in this list are required. It is your responsibility to determine whether your account is enabled to use this feature and which fields are required. For details about relaxed requirements, see Relaxed Requirements for Address Data and Expiration Date in Payment Transactions.
Authorizations with Line Items

REST Example: Processing an Authorization with Line Items

Request
{ "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": "" }, "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
{ "_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" }
Authorizations with Line Items