Simulate an in-store order
POST/v1/test/in_store_orders
Credits a visit as if the member paid at a Square register at the location. Use it to see how points earned at the register show up in your app: the balance, an activity entry, and the order.credited and points.changed webhooks with channel: "in_store".
Permissions: Sandbox secret key.
Guide
SandboxRequest headers#
Idempotency-KeystringAny string up to 255 characters; use a UUID v4. Kept 24 hours per key (or member) and endpoint. Same key and body replays the first response withIdempotent-Replayed: true.Max Length 255
Request body#
member_idstring (uuid)RequiredThe member who visits.location_idstring (uuid)RequiredA location in your sandbox brand.subtotal_centsintegerRequiredThe visit's subtotal. It earns at the program's rate.Min 0
$8.00 at 10 Beans per dollar is 80 Beans, so Maya goes from 420 to 500 and can now afford Free drip coffee. The response above is trimmed; it is an order object.
Response fields#
Returns 201 with Order
idstring (uuid)unPLUG's id for the order.external_order_idstringNullableYour order id. Unique in your brand, forever.statusstringOne ofcredited,partially_refunded,refundedmember_idstring (uuid)Nullablenullfor a guest order, which earns nothing.location_idstring (uuid)channelstringapporwebfor orders you send. Points earned at the register also show up, as orders within_store. May grow.One ofapp,web,in_storefulfillmentstringNullablepickup,delivery,curbsideordine_in.placed_atstring (date-time)When the guest placed the order. The earn rate and bonuses in force at this time apply.currencystringUSD.subtotal_centsintegerSum of the lines, before discounts, tax and tip.Min 0discount_centsintegerAll discounts on the order, including the unPLUG redemption.Min 0tax_centsintegerRecorded for reports. They never earn.Min 0tip_centsintegerRecorded for reports. They never earn.Min 0total_centsintegerWhat the guest paid: subtotal minus discount, plus tax and tip.Min 0itemsarray of CartItemThe cart lines, same shape as preview.Show attributesCartItem
line_idstringYour id for the line, unique within the cart.pos_item_idstringSquare catalog item variation id.namestringquantityintegerMin 1unit_price_centsintegerInteger cents.Min 0pos_category_idsarray of stringmodifiersarray of objectShow attributesHide attributes
pos_modifier_idstringnamestringprice_centsintegerInteger cents.Min 0
points_earnedintegerPoints from the earn rate, on the subtotal after discounts, rounded down.bonus_pointsintegerExtra points from promotions in force atplaced_at.redemptionsarray of object[{ "id", "status" }]for each redemption the order used.Show attributesHide attributes
idstring (uuid)statusstring
memberobjectNullable{ "points_balance", "tier" }right after the order was credited. Only on the create response and theorder.creditedwebhook.Show attributesHide attributes
points_balanceintegertierTierRefShow attributesTierRef
idstring (uuid)namestring
created_atstring (date-time)When unPLUG recorded the order.
Error descriptions#
404Not found
member_not_found
, 404 location_not_found An id doesn't exist in your sandbox brand.
404Not found
not_found
Called on production.
Any endpoint can also return the common errors.