Create Orders
You can create Order
objects by calling the CreateOrder endpoint. Orders objects can be created with any combination of line items, fulfillment objects, taxes, and discounts. They can also be created empty and updated
with elements over time.
The following sample cURL command creates an order using catalog items:
Replace
COFFEE_ITEM_ID
with your catalog item ID andSMALL_MODIFIER_ID
with your catalog item variation ID.Generate a unique string for your idempotency key.
Send a POST request to the
CreateOrder
endpoint (/v2/orders
).For more information about line items, see the Orders API Technical Reference.
The following sample cURL command creates an order with a line item:
Replace
name
andquantity
.Set
base_price_money
with a money object representing your cost. For more information, see Working With Monetary Amounts.Generate a unique string for your idempotency key.
Send a POST request to the
CreateOrder
endpoint (/v2/orders
).The following shows a sample JSON body for a cURL command that creates an order using an ad hoc line item:
For more information about line items, see the Orders API Technical Reference.
This sample command creates a pickup order for a small coffee:
View orders in the Seller Dashboard
An order appears in the Seller Dashboard if the following conditions are true:
The order includes fulfillment.
The order is paid.
If you are testing in the Square Sandbox, the order appears in the Seller Dashboard in Sandbox mode, but not in Production mode. For more information, see Sandbox Seller Dashboard.