Skip to content

Latest commit

 

History

History
49 lines (42 loc) · 1.73 KB

calculate-order-request.md

File metadata and controls

49 lines (42 loc) · 1.73 KB

Calculate Order Request

Structure

CalculateOrderRequest

Fields

Name Type Tags Description Getter
Order Order 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()
ProposedRewards List<OrderReward> Optional Identifies one or more loyalty reward tiers to apply during order calculation.
The discounts defined by the reward tiers are added to the order only to preview the
effect of applying the specified reward(s). The reward(s) do not correspond to actual
redemptions, that is, no rewards are created. Therefore, the reward ids are
random strings used only to reference the reward tier.
List getProposedRewards()

Example (as JSON)

{
  "idempotency_key": "b3e98fe3-b8de-471c-82f1-545f371e637c",
  "order": {
    "location_id": "D7AVYMEAPJ3A3",
    "discounts": [
      {
        "name": "50% Off",
        "percentage": "50",
        "scope": "ORDER"
      }
    ],
    "line_items": [
      {
        "name": "Item 1",
        "quantity": "1",
        "base_price_money": {
          "amount": 500,
          "currency": "USD"
        }
      },
      {
        "name": "Item 2",
        "quantity": "2",
        "base_price_money": {
          "amount": 300,
          "currency": "USD"
        }
      }
    ]
  }
}