Create a sale

Records a completed sale, with its lines and payments, as if it had been rung up at a register. Use it to bring in orders from your online store or another system.

The response is the saved sale, with its new id.

Required: store_id and at least one entry in lines. Each line needs quantity plus either item_id or barcode (we look the item up by barcode when item_id is 0).

Totals are calculated for you from the lines, so any total_* you send is ignored, apart from total_loyalty and total_loyalty_points, which are stored as sent. status is set from the payments.

Returns: send a line with a negative quantity, and add linked_sale_line_id to link it to the original line. receipt_number isn't checked for duplicates.

Required permission:

GroupPermission
SalesCreate, edit and delete sales; manage = create sales and change their staff member or customer (includes view)
Body Params
string
integer

ID of the customer the sale is attached to. Leave it out for a walk-in sale.

integer

ID of the employee who processed the sale.

fulfillments
array of objects

Any fulfillments to create along with the sale, such as a delivery or click-and-collect order. Each one uses the same fields as Create a fulfillment.

fulfillments
boolean

Set to true to print a gift receipt.

lines
array of objects
required

The items sold.

lines*
date-time

When the sale happened (ISO 8601). Reads back as 0001-01-01T00:00:00Z when it isn't set.

metadata
object

Your own data, stored with the sale. Each value is an object like {"type": "string", "value": "…"}.

payments
array of objects

Payments taken for the sale.

payments
string

Your receipt or order number. You can search by it with GET /sales.json?receipt_number=….

integer

Number identifying the register within the store, such as 101. Send a number: a string like "101" is rejected.

number

Shipping amount charged. Send 0 if there's no shipping.

number

Tax included in shipping. Send 0 if none.

integer
required

ID of the store the sale belongs to. Get IDs from GET /stores.json.

tags
array of strings

Free-text tags.

tags
number

Total discount across all lines.

number

Total value paid with loyalty.

integer

Loyalty points earned on the sale.

number

Amount paid so far.

number

Sale total.

integer

Total number of units across all lines.

number

Total tax across all lines and shipping.

Responses

Language
Credentials
Header
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json