Authorization with Line Items {#payments-processing-basic-auth-lineitem-intro}
==============================================================================

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`
{#payments-processing-basic-auth-lineitem-intro_dl_ht4_hlx_rxb}  
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 {#payments-processing-basic-auth-lineitem-intro_d7e16}
---------------------------------------------------------------

**Production:** `POST ``https://api.cybersource.com``/pts/v2/payments`{#payments-processing-basic-auth-lineitem-intro_d7e25}  
**Test:** `POST ``https://apitest.cybersource.com``/pts/v2/payments`{#payments-processing-basic-auth-lineitem-intro_d7e35}

Required Fields for Processing an Authorization with Line Items {#payments-processing-basic-auth-lineitem-required}
===================================================================================================================

> 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 a Payment](/docs/cybs/en-us/payments/developer/ctv/rest/payments/payments-relax-reqs.md "").

[orderInformation.amountDetails.currency](https://developer.cybersource.com/docs/cybs/en-us/api-fields/reference/all/rest/api-fields/order-info-aa/order-info-amount-details-currency.md "")

[orderInformation.billTo.address1](https://developer.cybersource.com/docs/cybs/en-us/api-fields/reference/all/rest/api-fields/order-info-aa/order-info-bill-to-address1.md "")
:

[orderInformation.billTo.administrativeArea](https://developer.cybersource.com/docs/cybs/en-us/api-fields/reference/all/rest/api-fields/order-info-aa/order-info-bill-to-admin-area.md "")
:

[orderInformation.billTo.country](https://developer.cybersource.com/docs/cybs/en-us/api-fields/reference/all/rest/api-fields/order-info-aa/order-info-bill-to-company-country.md "")
:

[orderInformation.billTo.email](https://developer.cybersource.com/docs/cybs/en-us/api-fields/reference/all/rest/api-fields/order-info-aa/order-info-bill-to-email.md "")
:

[orderInformation.billTo.firstName](https://developer.cybersource.com/docs/cybs/en-us/api-fields/reference/all/rest/api-fields/order-info-aa/order-info-bill-to-first-name.md "")
:

[orderInformation.billTo.lastName](https://developer.cybersource.com/docs/cybs/en-us/api-fields/reference/all/rest/api-fields/order-info-aa/order-info-bill-to-last-name.md "")
:

[orderInformation.billTo.locality](https://developer.cybersource.com/docs/cybs/en-us/api-fields/reference/all/rest/api-fields/order-info-aa/order-info-bill-to-locality.md "")
:

[orderInformation.billTo.postalCode](https://developer.cybersource.com/docs/cybs/en-us/api-fields/reference/all/rest/api-fields/order-info-aa/order-info-bill-to-postal-code.md "")
:

[paymentInformation.card.expirationMonth](https://developer.cybersource.com/docs/cybs/en-us/api-fields/reference/all/rest/api-fields/payment-info-aa/payment-info-card-exp-mo.md "")
:

[paymentInformation.card.expirationYear](https://developer.cybersource.com/docs/cybs/en-us/api-fields/reference/all/rest/api-fields/payment-info-aa/payment-info-card-exp-year.md "")
:

[paymentInformation.card.number](https://developer.cybersource.com/docs/cybs/en-us/api-fields/reference/all/rest/api-fields/payment-info-aa/payment-info-card-number.md "")
:

Country-Specific Required Fields for Processing an Authorization with Line Items {#payments-processing-basic-auth-lineitem-req-country}
=======================================================================================================================================

Use these country-specific required fields to process a process an authorization with line items.

Argentina
---------

merchantInformation.taxId
:
Required for Mastercard transactions.
{#payments-processing-basic-auth-lineitem-req-country_taxID}

merchantInformation.transactionLocalDateTime
:
Required in Argentina when the time zone is not included in your account. Otherwise, this field is optional.

Brazil
------

paymentInformation.card.sourceAccountType
:
Required for combo card transactions.

paymentInformation.card.sourceAccountTypeDetails
:
Required for combo card line-of-credit and prepaid-card transactions.

Chile
-----

merchantInformation.taxId
:
Required for Mastercard transactions.

Paraguay
--------

merchantInformation.taxId
:
Required for Mastercard transactions.

Saudi Arabia
------------

processingInformation.authorizationOptions.transactionMode
:
Required only for merchants in Saudi Arabia.

REST Example: Processing an Authorization with Line Items {#payments-processing-basic-auth-lineitem-ex-rest}
============================================================================================================

Request

```keyword
{
  "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

```
{
  "_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"
}
```

