# Order and Line Item data
source: https://developer.mastercard.com/mastercard-gateway/documentation/gateway-features/trans-enrich-data/order-and-line-item-data/index.md

Order and line item data includes information about the order and the line items that are contained in the order.
Warning: Certain order and line item data can qualify the transaction for better interchange rates with corporate, business, or purchase card cardholders. For more information, see [Level 2 and 3 Data](https://developer.mastercard.com/mastercard-gateway/documentation/gateway-features/trans-enrich-data/order-and-line-item-data/level-2-and-3/index.md).

The following methods are supported:

|                               Integration methods                                |                      Payment methods                      |        Transactions        |
|----------------------------------------------------------------------------------|-----------------------------------------------------------|----------------------------|
| * Hosted Checkout (for all payment methods) * All (when using a browser payment) | * Browser payments * All (when using the Hosted Checkout) | * AUTHORIZE * PAY * VERIFY |

To view the example of an API request with order and line item data, download the [Postman collection](https://www.postman.com/mastercard/mastercard-developers/collection/4fakvrd/mastercard-gateway-api).

The order amount (`order.amount`) and currency (`order.currency`) are mandatory fields that you must define for each order you create.
In addition, you can provide various supplementary details about the order and its individual line items in your request to allow the system to display the data to the payer before they confirm the payment.

* If you are using [Hosted Checkout](https://developer.mastercard.com/mastercard-gateway/documentation/integrations-types/hosted-checkout/index.md), the data is displayed on the hosted payment page.
* If you are using a [browser payment](https://developer.mastercard.com/mastercard-gateway/documentation/payment-methods/index.md), the payment provider displays the data on their own site where the payer defines their payment details.

## General order details {#general-order-details}

You can provide the following general order-related details in the order object in the request:

* `order.id`  

  Unique ID for this order.

* `order.description`  

  Brief description of the order content.

* `order.shippingAndHandlingAmount`  

  Total shipping and handling amount for the order, including taxes on shipping and handling.

* `order.taxAmount`  

  Total tax amount for the order. If you do not provide this field but provide any line item data, this amount is computed as the sum of the total tax amount (`order.item[n].unitTaxAmount` x `order.item[n].quantity`) for all the line items.  

If you provide both, this field and any line item data, the value in this field must equal the computed value.

* `order.discount.amount`  
  Total amount of the discount you have applied to the order. If you do not provide this field but provide any line item data, this amount is computed as the sum of the total discount amount (`order.item[n].unitDiscountAmount` x `order.item[n].quantity`) for all the line items.  

If you provide both, this field and any line item data, the value in this field must equal the computed value.

* `order.gratuityAmount`  
  Amount the payer has chosen to provide as a gratuity or tip in addition to the amount they are paying for the goods or services they are purchasing from you. The gratuity amount is included in the total amount of the order that you provide in `order.amount`.

Warning: The `order.gratuityAmount` field is only applicable to the AUTHORIZE and PAY requests.

* `order.cashbackAmount`  
  Amount the payer has chosen to receive as cash in addition to the amount they are paying for the goods or services they are purchasing from you. The cash back amount is included in the total amount of the order that you provide in `order.amount`.

Warning: The `order.cashbackAmount` field is only applicable to the AUTHORIZE and PAY requests.

## Line item details {#line-item-details}

Warning: All line item data is optional; however, if you provide any line item data in a request, you must provide at least `order.item[n].name`, `order.item[n].quantity`, and `order.item[n].unitPrice` fields for that item.

You can provide the following line item data in the order.item\[\] objects in the request.

* `order.item[n].brand`  

  Brand of the item.

* `order.item[n].category`  

  Your category for the item.

* `order.item[n].description`  

  Description for the item with information, such as size and color.

* `order.item[n].name`  

  Short name describing the item.

* `order.item[n].quantity`  

  Number of items.

Warning: When a decimal quantity is multiplied by amounts (`order.item[n].unitPrice`, `order.item[n].unitTaxAmount`, or `order.item[n].unitDiscountAmount`), and if the decimal places in the computed value exceed the minor units of the payer's currency, the gateway rounds the total using the round half to even algorithm. For example, if the payer's currency (USD) has 2 minor units, and 2.555 (quantity) times 3 (unit price) totals 7.665, the rounded item amount equals 7.66. Ensure that you apply this rounding when you provide these amount fields in the request.

* `order.item[n].sku`  

  Stock Keeping Unit (SKU) or the item identifier for this item.

* `order.item[n].unitPrice`  

  This amount is multiplied by `order.item[n].quantity` to compute the total item amount for the line item. If `order.itemAmount` is provided, the sum of the total item amount for all the line items must equal the value in `order.itemAmount`.

* `order.item[n].unitTaxAmount`  

  This amount is multiplied by `order.item[n].quantity` to compute the total tax amount for the line item. If `order.taxAmount` is provided, the sum of the total tax amount for all the line items must equal the value in `order.taxAmount`.

* `order.item[n].unitDiscountAmount`  

  This amount is multiplied by the `order.item[n].quantity` to compute the total discount amount for the line item. If `order.discount.amount` is provided, the sum of the total discount amount for all the line items must equal the value in `order.discount.amount`.

* `order.itemAmount`  

  If you do not provide this field but provide any line item data, this amount is computed as the sum of the total item amount (`order.item[n].unitPrice` x `order.item[n].quantity`) for all the line items. If you provide both this field and any line item data, the value in this field must equal the computed value.

The submitted data is returned in the transaction response.

### Example of order and line item data fields {#example-of-order-and-line-item-data-fields}

```json
{
  "order": {
    "id": "123",
    "amount": "100.00",
    "currency": "USD",
    "shippingAndHandlingAmount": "55.00",
    "item": {
      "brand": "Testco",
      "category": "H1",
      "description": "Ergonomic handle and new, compact size",
      "name": "One-inch spanner",
      "quantity": "1",
      "sku": "TCO-1INCH-SPN",
      "unitTaxAmount": "2",
      "unitPrice": "50.00"
    }
  }
}
```

**Order Data API Reference** [\[REST\]](https://developer.mastercard.com/mastercard-gateway/documentation/api-reference/v100/rest/api-ops/index.md#transaction) [\[NVP\]](https://developer.mastercard.com/mastercard-gateway/documentation/api-reference/v100/nvp/api-ops/index.md#transaction)
**Line Item Data API Reference** [\[REST\]](https://developer.mastercard.com/mastercard-gateway/documentation/api-reference/v100/rest/api-ops/index.md#transaction) [\[NVP\]](https://developer.mastercard.com/mastercard-gateway/documentation/api-reference/v100/nvp/api-ops/index.md#transaction)
