Order

May 28, 2020 ยท View on GitHub

Description

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.

Properties

NameGetterSetterTypeDescriptionNotes
idgetId()setId($value)stringThe order's unique ID.[optional]
location_idgetLocationId()setLocationId($value)stringThe ID of the merchant location this order is associated with.
reference_idgetReferenceId()setReferenceId($value)stringA client specified identifier to associate an entity in another system with this order.[optional]
sourcegetSource()setSource($value)\SquareConnect\Model\OrderSourceThe origination details of the order.[optional]
customer_idgetCustomerId()setCustomerId($value)stringThe `Customer` ID of the customer associated with the order.[optional] [beta]
line_itemsgetLineItems()setLineItems($value)\SquareConnect\Model\OrderLineItem[]The line items included in the order.[optional]
taxesgetTaxes()setTaxes($value)\SquareConnect\Model\OrderLineItemTax[]The list of all taxes associated with the order. Taxes can be scoped to either `ORDER` or `LINE_ITEM`. For taxes with `LINE_ITEM` scope, an `OrderLineItemAppliedTax` must be added to each line item that the tax applies to. For taxes with `ORDER` scope, the server will generate an `OrderLineItemAppliedTax` for every line item. On reads, each tax in the list will include the total amount of that tax applied to the order. IMPORTANT: If `LINE_ITEM` scope is set on any taxes in this field, usage of the deprecated `line_items.taxes` field will result in an error. Please use `line_items.applied_taxes` instead.[optional]
discountsgetDiscounts()setDiscounts($value)\SquareConnect\Model\OrderLineItemDiscount[]The list of all discounts associated with the order. Discounts can be scoped to either `ORDER` or `LINE_ITEM`. For discounts scoped to `LINE_ITEM`, an `OrderLineItemAppliedDiscount` must be added to each line item that the discount applies to. For discounts with `ORDER` scope, the server will generate an `OrderLineItemAppliedDiscount` for every line item. IMPORTANT: If `LINE_ITEM` scope is set on any discounts in this field, usage of the deprecated `line_items.discounts` field will result in an error. Please use `line_items.applied_discounts` instead.[optional]
service_chargesgetServiceCharges()setServiceCharges($value)\SquareConnect\Model\OrderServiceCharge[]A list of service charges applied to the order.[optional]
fulfillmentsgetFulfillments()setFulfillments($value)\SquareConnect\Model\OrderFulfillment[]Details on order fulfillment. Orders can only be created with at most one fulfillment. However, orders returned by the API may contain multiple fulfillments.[optional]
returnsgetReturns()setReturns($value)\SquareConnect\Model\OrderReturn[]Collection of items from sale Orders being returned in this one. Normally part of an Itemized Return or Exchange. There will be exactly one `Return` object per sale Order being referenced.[optional] [beta]
return_amountsgetReturnAmounts()setReturnAmounts($value)\SquareConnect\Model\OrderMoneyAmountsRollup of returned money amounts.[optional]
net_amountsgetNetAmounts()setNetAmounts($value)\SquareConnect\Model\OrderMoneyAmountsNet money amounts (sale money - return money).[optional]
rounding_adjustmentgetRoundingAdjustment()setRoundingAdjustment($value)\SquareConnect\Model\OrderRoundingAdjustmentA positive or negative rounding adjustment to the total of the order, commonly used to apply Cash Rounding when the minimum unit of account is smaller than the lowest physical denomination of currency.[optional]
tendersgetTenders()setTenders($value)\SquareConnect\Model\Tender[]The Tenders which were used to pay for the Order.[optional] [beta]
refundsgetRefunds()setRefunds($value)\SquareConnect\Model\Refund[]The Refunds that are part of this Order.[optional] [beta]
metadatagetMetadata()setMetadata($value)map[string,string]Application-defined data attached to this order. Metadata fields are intended to store descriptive references or associations with an entity in another system or store brief information about the object. Square does not process this field; it only stores and returns it in relevant API calls. Do not use metadata to store any sensitive information (personally identifiable information, card details, etc.). Keys written by applications must be 60 characters or less and must be in the character set `[a-zA-Z0-9_-]`. Entries may also include metadata generated by Square. These keys are prefixed with a namespace, separated from the key with a ':' character. Values have a max length of 255 characters. An application may have up to 10 entries per metadata field. Entries written by applications are private and can only be read or modified by the same application. See Metadata for more information.[optional] [beta]
created_atgetCreatedAt()setCreatedAt($value)stringTimestamp for when the order was created. In RFC 3339 format, e.g., "2016-09-04T23:59:33.123Z".[optional]
updated_atgetUpdatedAt()setUpdatedAt($value)stringTimestamp for when the order was last updated. In RFC 3339 format, e.g., "2016-09-04T23:59:33.123Z".[optional]
closed_atgetClosedAt()setClosedAt($value)stringTimestamp for when the order reached a terminal state. In RFC 3339 format, e.g., "2016-09-04T23:59:33.123Z".[optional]
stategetState()setState($value)stringThe current state of the order. `OPEN`,`COMPLETED`,`CANCELED` See OrderState for possible values[optional]
versiongetVersion()setVersion($value)intVersion number which is incremented each time an update is committed to the order. Orders that were not created through the API will not include a version and thus cannot be updated. Read more about working with versions.[optional] [beta]
total_moneygetTotalMoney()setTotalMoney($value)\SquareConnect\Model\MoneyThe total amount of money to collect for the order.[optional]
total_tax_moneygetTotalTaxMoney()setTotalTaxMoney($value)\SquareConnect\Model\MoneyThe total tax amount of money to collect for the order.[optional]
total_discount_moneygetTotalDiscountMoney()setTotalDiscountMoney($value)\SquareConnect\Model\MoneyThe total discount amount of money to collect for the order.[optional]
total_service_charge_moneygetTotalServiceChargeMoney()setTotalServiceChargeMoney($value)\SquareConnect\Model\MoneyThe total amount of money collected in service charges for the order. Note: `total_service_charge_money` is the sum of `applied_money` fields for each individual service charge. Therefore, `total_service_charge_money` will only include inclusive tax amounts, not additive tax amounts.[optional]
rewardsgetRewards()setRewards($value)\SquareConnect\Model\OrderReward[]A set-like list of rewards that have been added to the order.[optional] [beta]

Note: All properties are protected and only accessed via getters and setters.

[Back to Model list] [Back to API list] [Back to README]