Skip to content

Latest commit

 

History

History
80 lines (73 loc) · 2.56 KB

create-order-request.md

File metadata and controls

80 lines (73 loc) · 2.56 KB

Create Order Request

Structure

CreateOrderRequest

Fields

Name Type Tags Description Getter
Order Order Optional Contains all information related to a single order to process with Square,
including line items that specify the products to purchase. Order objects also
include information on any associated tenders, refunds, and returns.

All Connect V2 Transactions have all been converted to Orders including all associated
itemization data.
Order getOrder()
LocationId String Optional The ID of the business location to associate the order with. String getLocationId()
IdempotencyKey String Optional A value you specify that uniquely identifies this
order among orders you've created.

If you're unsure whether a particular order was created successfully,
you can reattempt it with the same idempotency key without
worrying about creating duplicate orders.

See Idempotency for more information.
String getIdempotencyKey()

Example (as JSON)

{
  "idempotency_key": "8193148c-9586-11e6-99f9-28cfe92138cf",
  "order": {
    "reference_id": "my-order-001",
    "location_id": "057P5VYJ4A5X1",
    "line_items": [
      {
        "name": "New York Strip Steak",
        "quantity": "1",
        "base_price_money": {
          "amount": 1599,
          "currency": "USD"
        }
      },
      {
        "quantity": "2",
        "catalog_object_id": "BEMYCSMIJL46OCDV4KYIKXIB",
        "modifiers": [
          {
            "catalog_object_id": "CHQX7Y4KY6N5KINJKZCFURPZ"
          }
        ],
        "applied_discounts": [
          {
            "discount_uid": "one-dollar-off"
          }
        ]
      }
    ],
    "taxes": [
      {
        "uid": "state-sales-tax",
        "name": "State Sales Tax",
        "percentage": "9",
        "scope": "ORDER"
      }
    ],
    "discounts": [
      {
        "uid": "labor-day-sale",
        "name": "Labor Day Sale",
        "percentage": "5",
        "scope": "ORDER"
      },
      {
        "uid": "membership-discount",
        "catalog_object_id": "DB7L55ZH2BGWI4H23ULIWOQ7",
        "scope": "ORDER"
      },
      {
        "uid": "one-dollar-off",
        "name": "Sale - $1.00 off",
        "amount_money": {
          "amount": 100,
          "currency": "USD"
        },
        "scope": "LINE_ITEM"
      }
    ]
  }
}