{"openapi":"3.1.0","info":{"title":"Alder & Pine Home: merchant systems API","version":"1.3.0","summary":"Connect a warehouse, 3PL, ERP, shipping platform or point of sale to a Pegasus Commerce store.","description":"Read paid orders, hear about every change by webhook, and send back stock, shipments, deliveries, received returns and lines you can't fill.\n\nA point of sale (scope `pos`) sends what happens at the counter: sales and returns as stock changes, pickups handed over, and web or agent orders brought back in person. The showroom and the web then sell from one shelf. Shoppers' agents choose pickup at checkout like any delivery option (UCP `selected_option_id`, ACP `fulfillment_option_id`, or `pickup: true` in the store's MCP `create_cart`); it's never chosen for them. A pickup order's `delivery` starts with \"Pickup at\".\n\nEach connected system has its own key (`pgi_…`), created in the store's console (Systems) and limited to its scopes. Sandbox keys, from the store's /developers page, see only the orders placed with their own email.\n\nVersioning: v1 only ever adds. Breaking changes go to /integrations/v2, announced at least 90 days ahead. Every response carries `Pegasus-Api-Version`.","contact":{"url":"https://shop.silverlakefinancialgroup.com/developers"}},"servers":[{"url":"https://shop.silverlakefinancialgroup.com","description":"Alder & Pine Home"}],"security":[{"systemKey":[]}],"tags":[{"name":"Key"},{"name":"Orders"},{"name":"Shipping"},{"name":"Returns"},{"name":"Stock"},{"name":"Point of sale"},{"name":"Spec"}],"paths":{"/integrations/v1/me":{"get":{"summary":"Check a key","description":"Which system the key belongs to, its scopes, and (for a sandbox key) its email and expiry. A quick way to test a key.","tags":["Key"],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"system":{"$ref":"#/components/schemas/System"}}}}}},"401":{"$ref":"#/components/responses/E401"}}}},"/integrations/v1/orders":{"get":{"summary":"List paid orders","tags":["Orders"],"description":"Oldest change first, so a system can page forward and keep the last cursor. Paying, shipping, delivering, cancelling and every return step count as changes. Scope: `orders`.","parameters":[{"name":"updated_since","in":"query","schema":{"type":"string","format":"date-time"},"description":"Only orders changed at or after this time."},{"name":"status","in":"query","schema":{"type":"string"},"description":"Comma-separated order states: placed, partially_shipped, shipped, delivered, cancelled, return_requested, return_accepted, returned."},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":50}},{"name":"cursor","in":"query","schema":{"type":"string"},"description":"The next_cursor from the last page, unchanged."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","required":["orders","has_more"],"properties":{"orders":{"type":"array","items":{"$ref":"#/components/schemas/Order"}},"next_cursor":{"type":["string","null"]},"has_more":{"type":"boolean"}}}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"500":{"$ref":"#/components/responses/E500"}}}},"/integrations/v1/orders/{order_id}":{"get":{"summary":"Read one order","tags":["Orders"],"description":"Scope: `orders`.","parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"string"},"description":"The store's order id (order_…)."}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","properties":{"order":{"$ref":"#/components/schemas/Order"}}}}}},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"}}}},"/integrations/v1/orders/{order_id}/shipped":{"post":{"summary":"Ship an order, or part of it","description":"With `items`, only those leave in this box and the order is `partially_shipped` until the rest follow; without, everything still to ship leaves. Each call is one shipment, numbered from 1. The shopper is emailed.\n\nScope: `shipments`. Send a unique `event_id`: a retry with the same id changes nothing and gets the first answer back, with `replayed: true`.","tags":["Shipping"],"parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"string"},"description":"The store's order id (order_…)."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["event_id"],"properties":{"event_id":{"$ref":"#/components/schemas/EventId"},"tracking":{"type":"string","maxLength":60},"carrier":{"type":"string","maxLength":40},"items":{"type":"array","minItems":1,"maxItems":200,"items":{"$ref":"#/components/schemas/ItemQuantity"}}}}}}},"responses":{"200":{"description":"Applied (or replayed).","content":{"application/json":{"schema":{"type":"object","properties":{"order_id":{"type":"string"},"state":{"$ref":"#/components/schemas/OrderState"},"tracking":{"type":["string","null"]},"shipment":{"$ref":"#/components/schemas/Shipment"},"replayed":{"type":"boolean"}}}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"500":{"$ref":"#/components/responses/E500"}}}},"/integrations/v1/orders/{order_id}/delivered":{"post":{"summary":"Mark a shipment delivered","description":"`shipment` is the number the shipped answer gave; without it, every shipment still on its way arrived. Once every line has shipped and arrived, the order is `delivered` and the shopper's 30-day return window starts.\n\nScope: `shipments`. Send a unique `event_id`: a retry with the same id changes nothing and gets the first answer back, with `replayed: true`.","tags":["Shipping"],"parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"string"},"description":"The store's order id (order_…)."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["event_id"],"properties":{"event_id":{"$ref":"#/components/schemas/EventId"},"shipment":{"type":"integer","minimum":1}}}}}},"responses":{"200":{"description":"Applied (or replayed).","content":{"application/json":{"schema":{"type":"object","properties":{"order_id":{"type":"string"},"state":{"$ref":"#/components/schemas/OrderState"},"replayed":{"type":"boolean"}}}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"500":{"$ref":"#/components/responses/E500"}}}},"/integrations/v1/orders/{order_id}/return-received":{"post":{"summary":"Receive returned goods","description":"`items` names what arrived, some of the accepted return; without it, all of it. Only what arrived is refunded (the way the order was paid, with its share of the tax) and put back in stock.\n\nScope: `returns`. Send a unique `event_id`: a retry with the same id changes nothing and gets the first answer back, with `replayed: true`.","tags":["Returns"],"parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"string"},"description":"The store's order id (order_…)."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["event_id"],"properties":{"event_id":{"$ref":"#/components/schemas/EventId"},"items":{"type":"array","minItems":1,"maxItems":200,"items":{"$ref":"#/components/schemas/ItemQuantity"}}}}}}},"responses":{"200":{"description":"Applied (or replayed).","content":{"application/json":{"schema":{"type":"object","properties":{"order_id":{"type":"string"},"state":{"$ref":"#/components/schemas/OrderState"},"refunded_cents":{"type":"integer"},"replayed":{"type":"boolean"}}}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"500":{"$ref":"#/components/responses/E500"}}}},"/integrations/v1/orders/{order_id}/cancel":{"post":{"summary":"Cancel lines you can't fill","description":"Before shipping only. `items` names what can't be filled; without it, everything not yet shipped. The shopper is refunded for those lines the way they paid, the stock held for them is released, and the shopper and their agent are told why. Cancelling everything on an unshipped order cancels the order.\n\nScope: `shipments`. Send a unique `event_id`: a retry with the same id changes nothing and gets the first answer back, with `replayed: true`.","tags":["Shipping"],"parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"string"},"description":"The store's order id (order_…)."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["event_id","reason"],"properties":{"event_id":{"$ref":"#/components/schemas/EventId"},"reason":{"type":"string","maxLength":200},"items":{"type":"array","minItems":1,"maxItems":200,"items":{"$ref":"#/components/schemas/ItemQuantity"}}}}}}},"responses":{"200":{"description":"Applied (or replayed).","content":{"application/json":{"schema":{"type":"object","properties":{"order_id":{"type":"string"},"state":{"$ref":"#/components/schemas/OrderState"},"whole_order":{"type":"boolean"},"refunded_cents":{"type":"integer"},"replayed":{"type":"boolean"}}}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"500":{"$ref":"#/components/responses/E500"}}}},"/integrations/v1/stock":{"post":{"summary":"Send stock levels","description":"`quantity` is what's on hand. The store subtracts what's held for carts and ordered, so agents see what's really available. An update older than one already applied for that SKU is ignored. Not available to sandbox keys.\n\nScope: `stock`. Send a unique `event_id`: a retry with the same id changes nothing and gets the first answer back, with `replayed: true`.","tags":["Stock"],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["event_id","levels"],"properties":{"event_id":{"$ref":"#/components/schemas/EventId"},"as_of":{"type":"string","format":"date-time"},"levels":{"type":"array","minItems":1,"maxItems":500,"items":{"type":"object","required":["sku","quantity"],"properties":{"sku":{"type":"string"},"quantity":{"type":"integer","minimum":0},"location_id":{"type":"string"}}}}}}}}},"responses":{"200":{"description":"Applied (or replayed).","content":{"application/json":{"schema":{"type":"object","properties":{"applied":{"type":"array","items":{"type":"object"}},"ignored":{"type":"array","items":{"type":"object","properties":{"sku":{"type":["string","null"]},"why":{"type":"string","enum":["invalid","unknown_sku","unknown_location","older_than_last_update"]}}}},"replayed":{"type":"boolean"}}}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"500":{"$ref":"#/components/responses/E500"}}}},"/integrations/v1/stock/adjust":{"post":{"summary":"Counter sales and returns","description":"What changed on the shelf at the counter, as changes, never as levels, so a register can't overwrite units online orders have reserved. `change` is negative for units sold and positive for units back; `reason` is `sale` (all negative), `return` (all positive) or `correction`. Sales and returns show in the console's showroom channel. Unknown SKUs are reported back, not guessed. A sandbox key's changes are checked and answered with `sandbox: true`, not applied (stock is shared by everyone using the demo store).\n\nScope: `pos`. Send a unique `event_id`: a retry with the same id changes nothing and gets the first answer back, with `replayed: true`.","tags":["Point of sale"],"parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["event_id","reason","items"],"properties":{"event_id":{"$ref":"#/components/schemas/EventId"},"reason":{"type":"string","enum":["sale","return","correction"]},"items":{"type":"array","minItems":1,"maxItems":200,"items":{"type":"object","required":["sku","change"],"properties":{"sku":{"type":"string"},"change":{"type":"integer","description":"Negative: sold. Positive: back on the shelf. Not 0."}}}},"pos_ref":{"type":"string","maxLength":100,"description":"The register's own id for the sale or return."},"total_cents":{"type":"integer","minimum":0,"description":"What the counter took, for the showroom channel. Card details stay at the register."},"occurred_at":{"type":"string","format":"date-time"}}}}}},"responses":{"200":{"description":"Applied (or replayed).","content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string"},"applied":{"type":"array","items":{"type":"object","properties":{"sku":{"type":"string"},"change":{"type":"integer"}}}},"ignored":{"type":"array","items":{"type":"object","properties":{"sku":{"type":"string"},"why":{"type":"string","enum":["unknown_sku","stock_not_tracked"]}}}},"sandbox":{"type":"boolean"},"replayed":{"type":"boolean"}}}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"500":{"$ref":"#/components/responses/E500"}}}},"/integrations/v1/orders/{order_id}/collected":{"post":{"summary":"Hand over a pickup","description":"The shopper collected a pickup order at the counter: it ships and arrives in one step, and their 30-day return window starts. Only for orders whose `delivery` is a pickup (otherwise `409 not_pickup`).\n\nScope: `pos`. Send a unique `event_id`: a retry with the same id changes nothing and gets the first answer back, with `replayed: true`.","tags":["Point of sale"],"parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"string"},"description":"The store's order id (order_…)."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["event_id"],"properties":{"event_id":{"$ref":"#/components/schemas/EventId"}}}}}},"responses":{"200":{"description":"Applied (or replayed).","content":{"application/json":{"schema":{"type":"object","properties":{"order_id":{"type":"string"},"state":{"$ref":"#/components/schemas/OrderState"},"replayed":{"type":"boolean"}}}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"500":{"$ref":"#/components/responses/E500"}}}},"/integrations/v1/orders/{order_id}/returned-in-person":{"post":{"summary":"Take back a web or agent order at the counter","description":"In one step the return is opened, accepted and received. What came back (`items`; without it, everything still returnable) is refunded the way the order was paid, with its share of the tax, and put back in stock. The order must be delivered or collected. The shopper is emailed about the refund.\n\nScope: `pos`. Send a unique `event_id`: a retry with the same id changes nothing and gets the first answer back, with `replayed: true`.","tags":["Point of sale"],"parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"string"},"description":"The store's order id (order_…)."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["event_id"],"properties":{"event_id":{"$ref":"#/components/schemas/EventId"},"items":{"type":"array","minItems":1,"maxItems":200,"items":{"$ref":"#/components/schemas/ItemQuantity"}},"reason":{"type":"string","maxLength":200}}}}}},"responses":{"200":{"description":"Applied (or replayed).","content":{"application/json":{"schema":{"type":"object","properties":{"order_id":{"type":"string"},"state":{"$ref":"#/components/schemas/OrderState"},"refunded_cents":{"type":"integer"},"replayed":{"type":"boolean"}}}}}},"400":{"$ref":"#/components/responses/E400"},"401":{"$ref":"#/components/responses/E401"},"403":{"$ref":"#/components/responses/E403"},"404":{"$ref":"#/components/responses/E404"},"409":{"$ref":"#/components/responses/E409"},"500":{"$ref":"#/components/responses/E500"}}}},"/integrations/v1/openapi.json":{"get":{"summary":"This document","tags":["Spec"],"security":[],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object"}}}}}}}},"webhooks":{"order.paid":{"post":{"summary":"order.paid","tags":["Orders"],"description":"Sent to every active system with the `orders` scope and a webhook address. Signed: `Pegasus-Signature: t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\">` with the system's webhook secret; reject anything older than five minutes. Answer 2xx within 10 seconds. Retried after 1m, 5m, 30m, 2h, 6h and 12h, then marked failed (staff can resend it from the console). The same event can arrive twice: de-duplicate on `id`.","parameters":[{"name":"Pegasus-Signature","in":"header","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEvent"}}}},"responses":{"200":{"description":"Received."}}}},"order.shipped":{"post":{"summary":"order.shipped","tags":["Orders"],"description":"Sent to every active system with the `orders` scope and a webhook address. Signed: `Pegasus-Signature: t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\">` with the system's webhook secret; reject anything older than five minutes. Answer 2xx within 10 seconds. Retried after 1m, 5m, 30m, 2h, 6h and 12h, then marked failed (staff can resend it from the console). The same event can arrive twice: de-duplicate on `id`.","parameters":[{"name":"Pegasus-Signature","in":"header","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEvent"}}}},"responses":{"200":{"description":"Received."}}}},"order.delivered":{"post":{"summary":"order.delivered","tags":["Orders"],"description":"Sent to every active system with the `orders` scope and a webhook address. Signed: `Pegasus-Signature: t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\">` with the system's webhook secret; reject anything older than five minutes. Answer 2xx within 10 seconds. Retried after 1m, 5m, 30m, 2h, 6h and 12h, then marked failed (staff can resend it from the console). The same event can arrive twice: de-duplicate on `id`.","parameters":[{"name":"Pegasus-Signature","in":"header","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEvent"}}}},"responses":{"200":{"description":"Received."}}}},"order.cancelled":{"post":{"summary":"order.cancelled","tags":["Orders"],"description":"Sent to every active system with the `orders` scope and a webhook address. Signed: `Pegasus-Signature: t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\">` with the system's webhook secret; reject anything older than five minutes. Answer 2xx within 10 seconds. Retried after 1m, 5m, 30m, 2h, 6h and 12h, then marked failed (staff can resend it from the console). The same event can arrive twice: de-duplicate on `id`.","parameters":[{"name":"Pegasus-Signature","in":"header","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEvent"}}}},"responses":{"200":{"description":"Received."}}}},"return.requested":{"post":{"summary":"return.requested","tags":["Orders"],"description":"Sent to every active system with the `orders` scope and a webhook address. Signed: `Pegasus-Signature: t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\">` with the system's webhook secret; reject anything older than five minutes. Answer 2xx within 10 seconds. Retried after 1m, 5m, 30m, 2h, 6h and 12h, then marked failed (staff can resend it from the console). The same event can arrive twice: de-duplicate on `id`.","parameters":[{"name":"Pegasus-Signature","in":"header","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEvent"}}}},"responses":{"200":{"description":"Received."}}}},"return.accepted":{"post":{"summary":"return.accepted","tags":["Orders"],"description":"Sent to every active system with the `orders` scope and a webhook address. Signed: `Pegasus-Signature: t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\">` with the system's webhook secret; reject anything older than five minutes. Answer 2xx within 10 seconds. Retried after 1m, 5m, 30m, 2h, 6h and 12h, then marked failed (staff can resend it from the console). The same event can arrive twice: de-duplicate on `id`.","parameters":[{"name":"Pegasus-Signature","in":"header","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEvent"}}}},"responses":{"200":{"description":"Received."}}}},"refund.issued":{"post":{"summary":"refund.issued","tags":["Returns"],"description":"Sent to every active system with the `orders` scope and a webhook address. Signed: `Pegasus-Signature: t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\">` with the system's webhook secret; reject anything older than five minutes. Answer 2xx within 10 seconds. Retried after 1m, 5m, 30m, 2h, 6h and 12h, then marked failed (staff can resend it from the console). The same event can arrive twice: de-duplicate on `id`.","parameters":[{"name":"Pegasus-Signature","in":"header","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEvent"}}}},"responses":{"200":{"description":"Received."}}}}},"components":{"securitySchemes":{"systemKey":{"type":"http","scheme":"bearer","description":"A connected system's key: `Authorization: Bearer pgi_…`."}},"schemas":{"EventId":{"type":"string","pattern":"^[A-Za-z0-9._:-]{6,100}$","description":"Unique per update, so a retry can't apply twice."},"Scope":{"type":"string","enum":["orders","stock","shipments","returns","pos"]},"OrderState":{"type":"string","enum":["placed","partially_shipped","shipped","delivered","cancelled","return_requested","return_accepted","returned"]},"ItemQuantity":{"type":"object","required":["sku","quantity"],"properties":{"sku":{"type":"string"},"quantity":{"type":"integer","minimum":1}}},"System":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"scopes":{"type":"array","items":{"$ref":"#/components/schemas/Scope"}},"webhook_url":{"type":["string","null"]},"active":{"type":"boolean"},"sandbox":{"type":["object","null"],"properties":{"email":{"type":"string"},"expires_at":{"type":"string","format":"date-time"}}}}},"Shipment":{"type":"object","properties":{"n":{"type":"integer"},"items":{"type":["array","null"],"items":{"$ref":"#/components/schemas/ItemQuantity"}},"shipped_at":{"type":"string","format":"date-time"},"carrier":{"type":["string","null"]},"tracking":{"type":["string","null"]},"delivered_at":{"type":["string","null"],"format":"date-time"}}},"Address":{"type":"object","properties":{"name":{"type":"string"},"address_1":{"type":"string"},"address_2":{"type":["string","null"]},"city":{"type":"string"},"region":{"type":"string"},"postal_code":{"type":"string"},"country":{"type":"string"},"phone":{"type":["string","null"]}}},"Order":{"type":"object","properties":{"order_id":{"type":"string"},"display_id":{"type":["integer","null"]},"placed_at":{"type":["string","null"],"format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"state":{"$ref":"#/components/schemas/OrderState"},"lines":{"type":"array","items":{"type":"object","properties":{"line_id":{"type":"string"},"sku":{"type":["string","null"]},"title":{"type":"string"},"option":{"type":["string","null"]},"quantity":{"type":"integer"},"unit_price_cents":{"type":"integer"},"total_cents":{"type":"integer"}}}},"ship_to":{"oneOf":[{"$ref":"#/components/schemas/Address"},{"type":"null"}]},"contact_email":{"type":["string","null"]},"delivery":{"type":["string","null"],"description":"The delivery option's name. Starts with \"Pickup at\" when the shopper will collect it at the counter."},"totals":{"type":"object","properties":{"subtotal_cents":{"type":"integer"},"shipping_cents":{"type":"integer"},"tax_cents":{"type":"integer"},"total_cents":{"type":"integer"},"refunded_cents":{"type":"integer"},"currency":{"type":"string"}}},"payment":{"type":"object","properties":{"method":{"type":["string","null"]}},"description":"The method's name only. No payment details."},"shipments":{"type":"array","items":{"$ref":"#/components/schemas/Shipment"}},"returns":{"type":"array","items":{"type":"object"}},"cancellations":{"type":"array","items":{"type":"object"}},"timeline":{"type":"array","items":{"type":"object","properties":{"state":{"type":"string"},"at":{"type":"string","format":"date-time"},"by":{"type":"string"}}}}}},"WebhookEvent":{"type":"object","required":["id","type","created_at","data"],"properties":{"id":{"type":"string","description":"Unique per event: de-duplicate on it."},"type":{"type":"string","enum":["order.paid","order.shipped","order.delivered","order.cancelled","return.requested","return.accepted","refund.issued"]},"created_at":{"type":"string","format":"date-time"},"data":{"allOf":[{"$ref":"#/components/schemas/Order"}],"description":"The order as GET /orders/{order_id} gives it, plus what the event is about: `shipment` and `complete` (order.shipped), `shipments` and `complete` (order.delivered), `refund` {amount_cents, tax_cents, currency, why, items, parts} (refund.issued)."}}},"Error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"field":{"type":"string"}}}},"responses":{"E400":{"description":"The request isn't right; `code` and `field` say what.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"E401":{"description":"Unknown, paused or expired key (`unknown_key`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"E403":{"description":"The key doesn't have the scope this needs (`scope_missing`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"E404":{"description":"No such order, or not one this key may see (`unknown_order`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"E409":{"description":"The order isn't in a state for this step, or the same event is still being applied (`in_progress`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"E500":{"description":"Nothing changed; retry with the same event_id (`not_applied`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"x-changelog":[{"version":"1.3.0","date":"2026-11-17","changes":["Point of sale: the pos scope, POST /stock/adjust (counter sales and returns as changes), POST /orders/{order_id}/collected (a pickup handed over) and POST /orders/{order_id}/returned-in-person (a web or agent order brought back to the counter).","An order's delivery says \"Pickup at …\" when the shopper chose pickup."]},{"version":"1.2.0","date":"2026-11-17","changes":["OpenAPI spec, developer docs and sandbox keys.","Pegasus-Api-Version response header."]},{"version":"1.1.0","date":"2026-11-16","changes":["Webhooks order.shipped, order.delivered and refund.issued.","Cancel lines the warehouse can't fill (POST /orders/{order_id}/cancel).","Partial shipments and partial returns (items on shipped and return-received)."]},{"version":"1.0.0","date":"2026-11-16","changes":["Read orders (GET /orders, GET /orders/{order_id}) with updated_since and cursor paging."]}]}