{"openapi":"3.1.0","info":{"title":"Fulfillbot API","version":"1.0.0","description":"Authentication: send `Authorization: Bearer <key>`. Create keys in Settings > API access.\n\nPermissions: each key has a list of permissions. A call without the needed permission returns 403 `insufficient_scope`.\n\nRate limits per customer: 120 reads a minute, 30 writes a minute, 2000 writes a day. Over the limit returns 429 with Retry-After.\n\nRate limit headers: responses to requests with a valid key carry `RateLimit-Limit` (requests allowed in the current one-minute window), `RateLimit-Remaining` (requests left in that window) and `RateLimit-Reset` (seconds until the window resets). A 429 response carries `Retry-After`: the number of seconds to wait before trying again. Too many failed attempts (malformed, unknown or revoked keys; a request without a key is not counted) from one network make further failed attempts return 429 `rate_limited` with Retry-After; a valid key is never blocked by this.\n\nIdempotency: send `Idempotency-Key` on writes that need it. Repeating the same request returns the saved response. If a call fails with 5xx or `request_in_progress`, check the current state with GET before retrying with a new key.\n\nRequest bodies: send JSON with `Content-Type: application/json`, at most 1 MB. An empty body is rejected with 422 `validation_failed`, except on the few endpoints whose body is optional (marked in their `requestBody`). Text can't contain NUL characters. A call that creates something returns 201 with the new resource; other writes return 200 with the resource as it is now.\n\nCharges: Orders created through the API can use your wallet balance. Creating an order doesn't charge your wallet. When the order has no problems, we reserve its stock and hold the estimated shipping and handling fee from your available balance. When our warehouse weighs the parcel, the shipping and handling fee is charged to your wallet automatically. If auto purchase is on and an order is short of stock, we place and pay for a purchase order automatically, within the limits you set. Confirming a shipment doesn't charge your wallet. It creates an amount due that you pay separately. These are the same rules as in the portal.\n\nLists: send `page` (1 to 10000, default 1). Each page has up to 50 items and `meta` gives `total`, `page`, `limit` (always 50) and `pageCount`. Asking for a page after the last one returns an empty `data` list. Each endpoint says how its list is sorted.\n\nValues: money is in integer cents (fields ending in `Cents`) of the `currency` given, which is USD except for product reference prices (CNY). Times are ISO 8601 in UTC; fields that are only a date use YYYY-MM-DD in China time (UTC+8). `status` and `kind` values are stable codes; fields ending in `Label` are English text for display and may change. Responses do not include images or file links.\n\nErrors: `{ success: false, error, code, details? }`. Rely on `code`; `error` is a human-readable message and may change. Every API response except this document carries `X-Request-Id`; quote it when you contact support.\n\nError codes:\n\n| Code | HTTP status | Meaning |\n|---|---|---|\n| `invalid_json` | 400 | The request body is not valid JSON. |\n| `idempotency_key_required` | 400 | This request needs an Idempotency-Key header. |\n| `invalid_idempotency_key` | 400 | Idempotency-Key must be 1 to 255 visible ASCII characters. |\n| `invalid_api_key` | 401 | The API key is missing, malformed, revoked or no longer valid. |\n| `api_not_enabled` | 403 | API access is not enabled for this account. |\n| `account_action_required` | 403 | Sign in to the portal and finish the required account steps first. |\n| `insufficient_scope` | 403 | The API key does not have the permission this call needs. |\n| `account_on_hold` | 403 | The account is on hold. Writes are refused; reads still work. |\n| `not_found` | 404 | The resource does not exist or does not belong to this account. |\n| `method_not_allowed` | 405 | The path exists but does not support this method. The Allow header lists the supported methods. |\n| `request_in_progress` | 409 | A request with this Idempotency-Key is still running or its result is unknown. |\n| `payload_too_large` | 413 | The request body is larger than 1 MB. |\n| `unsupported_media_type` | 415 | The request body must be sent as application/json. |\n| `validation_failed` | 422 | The input is not valid. `details` lists each field and the reason. |\n| `idempotency_key_reused` | 422 | This Idempotency-Key was already used with a different request. |\n| `request_rejected` | 422 | The request was rejected by a business rule. |\n| `rate_limited` | 429 | Too many requests. Wait for the number of seconds in Retry-After. |\n| `internal_error` | 500 | Unexpected error. Quote X-Request-Id when you contact support. |\n\nBusiness rules add more codes: codes ending in `_not_found` return 404 (the resource does not exist or does not belong to your account); codes ending in `_changed` (data changed, refresh and try again) and other state conflicts such as `shipment_not_cancellable`, `order_not_editable` or `library_sku_taken` return 409; quota and usage limits such as `api_key_limit`, `top_up_pending_limit` or `upload_quota_exceeded` also return 409 (waiting does not reliably clear them, so do not retry automatically); other rule failures return 422. An id inside a request body (such as a product or a shipping option) that doesn't exist or isn't yours is a rule failure (422, for example `order_product_not_allowed`); 404 is only for the `{id}` in the path. 429 is only `rate_limited`, which always carries Retry-After.\n\nWebhooks: add endpoints in Settings > API access and pick the events you want (`webhooks` in this document lists each event and its payload). We send a POST with a JSON body `{ id, type, createdAt, data: { id, status } }`: only the id of what changed and its new status. Fetch the details with the matching GET endpoint. Events also cover changes made through the API or the portal, and resources being created (their first status; the payload does not say what the previous status was). Payloads never contain personal data, amounts, images or file links.\n\nWebhook headers: `X-Webhook-Id` (the event id, the same on every retry and every endpoint), `X-Webhook-Event` (the event type), `X-Webhook-Attempt` (1 to 6) and `X-Webhook-Signature: t=<unix seconds>,v1=<hex>`. v1 is the HMAC-SHA256 of `<t>.<raw request body>`, keyed with your endpoint's signing secret (the whole `whsec_...` string). Verify against the raw body before parsing the JSON. Compare in constant time and reject requests whose t is more than 5 minutes away from your clock. The secret is shown once, when you add the endpoint or create a new secret; a new secret replaces the old one immediately.\n\nVerifying a webhook in Node.js:\n\n```js\nimport { createHmac, timingSafeEqual } from \"node:crypto\";\n\n// rawBody: the request body exactly as received (a string, before JSON parsing)\n// now: Unix time in seconds, optional; pass 1762653600 to check the sample request in the docs\nfunction isValidWebhook(secret, signatureHeader, rawBody, now = Date.now() / 1000) {\n  const parts = new Map(\n    signatureHeader.split(\",\").map((part) => {\n      const index = part.indexOf(\"=\");\n      return index < 0 ? [part.trim(), \"\"] : [part.slice(0, index).trim(), part.slice(index + 1)];\n    }),\n  );\n  const rawTimestamp = parts.get(\"t\") ?? \"\";\n  const given = parts.get(\"v1\") ?? \"\";\n  const timestamp = Number(rawTimestamp);\n  if (!/^[0-9]+$/.test(rawTimestamp) || !Number.isSafeInteger(timestamp) || Math.abs(now - timestamp) > 300) return false;\n  if (!/^[0-9a-f]{64}$/.test(given)) return false;\n  const expected = createHmac(\"sha256\", secret).update(`${timestamp}.${rawBody}`).digest();\n  return timingSafeEqual(Buffer.from(given, \"hex\"), expected);\n}\n```\n\nWebhook delivery: answer with any 2xx status within 10 seconds; the body of your response is ignored and must be at most 64 KB. Other statuses, redirects (they are not followed), timeouts and connection errors count as failures and are retried after 1, 5, 25, 125, 625 minutes, at most 6 attempts within 24 hours. After 50 failed attempts in a row the endpoint is turned off and you get a notification; turn it back on in the portal (events from while it was off are not resent). Endpoints must be public HTTPS addresses. Events are usually sent within a minute, until your endpoint accepts them or the retries run out (so you may get one more than once), in no particular order: skip duplicates by `id` and treat the GET response as the current state. Send test event in the portal sends a `webhook.test` event (once every 30 seconds per endpoint; it is not retried and does not count towards turning the endpoint off). You can add up to 5 endpoints."},"servers":[{"url":"https://api.rephut.com"}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Create an API key in Settings > API access."}}},"paths":{"/v1/me":{"get":{"operationId":"getMe","summary":"Get the customer and API key for this request","security":[{"bearerAuth":[]}],"parameters":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"const":true},"data":{"type":"object","properties":{"customer":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},"apiKey":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"keyPrefix":{"type":"string"},"scopes":{"type":"array","items":{"type":"string"}}},"required":["id","name","keyPrefix","scopes"],"additionalProperties":false}},"required":["customer","apiKey"],"additionalProperties":false}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"type":"object","required":["success","error","code"],"properties":{"success":{"const":false},"error":{"type":"string"},"code":{"type":"string"},"details":{"type":"array","items":{"type":"object"}}}}}}}}}},"/v1/wallet":{"get":{"operationId":"getWallet","summary":"Get the wallet balance","security":[{"bearerAuth":[]}],"x-required-scope":"wallet:read","parameters":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"const":true},"data":{"type":"object","properties":{"currency":{"type":"string","const":"USD"},"balanceCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"creditLimitCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"heldForShippingCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Set aside for orders waiting to be packed"},"availableCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"balanceCents + creditLimitCents - heldForShippingCents"}},"required":["currency","balanceCents","creditLimitCents","heldForShippingCents","availableCents"],"additionalProperties":false}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"type":"object","required":["success","error","code"],"properties":{"success":{"const":false},"error":{"type":"string"},"code":{"type":"string"},"details":{"type":"array","items":{"type":"object"}}}}}}}}}},"/v1/wallet/ledger":{"get":{"operationId":"listWalletLedger","summary":"List wallet transactions","description":"Every top-up, payment, charge and refund that changed the balance. Newest first.","security":[{"bearerAuth":[]}],"x-required-scope":"wallet:read","parameters":[{"name":"page","in":"query","required":false,"schema":{"default":1,"type":"integer","minimum":1,"maximum":10000}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data","meta"],"properties":{"success":{"const":true},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"kind":{"type":"string","enum":["RECHARGE","RECHARGE_VOID","GOODS_DEBIT","GOODS_REFUND","GOODS_REFUND_VOID","SHIPPING_DEBIT","SURCHARGE","ADJUST","HANDLING_DEBIT","SHIPPING_REFUND","HANDLING_REFUND","SHIPMENT_DEBIT","SHIPMENT_REFUND","SHIPMENT_REFUND_VOID","SURCHARGE_VOID"]},"kindLabel":{"type":"string"},"reference":{"type":"string","description":"Order, purchase order or shipment number, or the payment method of a top-up"},"currency":{"type":"string","const":"USD"},"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"balanceAfterCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"note":{"type":"string","description":"Only adjustments carry a note"}},"required":["id","createdAt","kind","kindLabel","reference","currency","amountCents","balanceAfterCents","note"],"additionalProperties":false}},"meta":{"type":"object","required":["total","page","limit","pageCount"],"properties":{"total":{"type":"integer","minimum":0},"page":{"type":"integer","minimum":1},"limit":{"type":"integer","minimum":1},"pageCount":{"type":"integer","minimum":1}}}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"type":"object","required":["success","error","code"],"properties":{"success":{"const":false},"error":{"type":"string"},"code":{"type":"string"},"details":{"type":"array","items":{"type":"object"}}}}}}}}}},"/v1/wallet/top-ups":{"get":{"operationId":"listWalletTopUps","summary":"List top-ups","description":"Includes pending, rejected and reversed top-ups. Newest first.","security":[{"bearerAuth":[]}],"x-required-scope":"wallet:read","parameters":[{"name":"page","in":"query","required":false,"schema":{"default":1,"type":"integer","minimum":1,"maximum":10000}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data","meta"],"properties":{"success":{"const":true},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["PENDING","CONFIRMED","REJECTED","VOIDED"]},"statusLabel":{"type":"string"},"paidOn":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"methodName":{"type":"string"},"currency":{"type":"string","const":"USD"},"paidCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"feeCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"creditedCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"originalCurrency":{"type":"string","description":"Currency you paid in (ISO 4217)"},"originalAmountMinor":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"Amount in the smallest unit of originalCurrency; null for USD"},"rejectReason":{"type":"string"}},"required":["id","status","statusLabel","paidOn","createdAt","methodName","currency","paidCents","feeCents","creditedCents","originalCurrency","originalAmountMinor","rejectReason"],"additionalProperties":false}},"meta":{"type":"object","required":["total","page","limit","pageCount"],"properties":{"total":{"type":"integer","minimum":0},"page":{"type":"integer","minimum":1},"limit":{"type":"integer","minimum":1},"pageCount":{"type":"integer","minimum":1}}}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"type":"object","required":["success","error","code"],"properties":{"success":{"const":false},"error":{"type":"string"},"code":{"type":"string"},"details":{"type":"array","items":{"type":"object"}}}}}}}}}},"/v1/products":{"get":{"operationId":"listProducts","summary":"List your products","description":"Every product in My products, one item per variant, including hidden and unavailable ones. Newest added first, then by SKU.","security":[{"bearerAuth":[]}],"x-required-scope":"catalog:read","parameters":[{"name":"page","in":"query","required":false,"schema":{"default":1,"type":"integer","minimum":1,"maximum":10000}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data","meta"],"properties":{"success":{"const":true},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"sku":{"type":"string"},"title":{"type":"string"},"variantLabel":{"type":"string"},"customerSkus":{"type":"array","items":{"type":"string"},"description":"Your SKUs mapped to this product"},"quoteCustomerSku":{"description":"Your SKU from the quote, when it is not already mapped","type":["string","null"]},"price":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"AGREED"},"currency":{"type":"string","const":"USD"},"unitPriceCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["kind","currency","unitPriceCents"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"REFERENCE"},"currency":{"type":"string","const":"CNY"},"unitPriceCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Current supplier price in fen (1/100 CNY)"},"approxUsdCents":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"Rough USD equivalent; null when no exchange rate is set"},"checkedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["kind","currency","unitPriceCents","approxUsdCents","checkedAt"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"NONE"}},"required":["kind"],"additionalProperties":false}],"description":"AGREED: your agreed unit price. REFERENCE: the supplier's price before you have an agreed price. NONE: no price yet."},"availableQty":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"available":{"type":"boolean"},"inactiveReason":{"type":"string"},"hidden":{"type":"boolean"},"canReorder":{"type":"boolean"},"weightKnown":{"type":"boolean"},"addedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","sku","title","variantLabel","customerSkus","quoteCustomerSku","price","availableQty","available","inactiveReason","hidden","canReorder","weightKnown","addedAt"],"additionalProperties":false}},"meta":{"type":"object","required":["total","page","limit","pageCount"],"properties":{"total":{"type":"integer","minimum":0},"page":{"type":"integer","minimum":1},"limit":{"type":"integer","minimum":1},"pageCount":{"type":"integer","minimum":1}}}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"type":"object","required":["success","error","code"],"properties":{"success":{"const":false},"error":{"type":"string"},"code":{"type":"string"},"details":{"type":"array","items":{"type":"object"}}}}}}}}}},"/v1/products/{id}":{"get":{"operationId":"getProduct","summary":"Get one of your products","security":[{"bearerAuth":[]}],"x-required-scope":"catalog:read","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"const":true},"data":{"type":"object","properties":{"id":{"type":"string"},"sku":{"type":"string"},"title":{"type":"string"},"variantLabel":{"type":"string"},"customerSkus":{"type":"array","items":{"type":"string"},"description":"Your SKUs mapped to this product"},"quoteCustomerSku":{"description":"Your SKU from the quote, when it is not already mapped","type":["string","null"]},"price":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"AGREED"},"currency":{"type":"string","const":"USD"},"unitPriceCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["kind","currency","unitPriceCents"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"REFERENCE"},"currency":{"type":"string","const":"CNY"},"unitPriceCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Current supplier price in fen (1/100 CNY)"},"approxUsdCents":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"Rough USD equivalent; null when no exchange rate is set"},"checkedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["kind","currency","unitPriceCents","approxUsdCents","checkedAt"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"NONE"}},"required":["kind"],"additionalProperties":false}],"description":"AGREED: your agreed unit price. REFERENCE: the supplier's price before you have an agreed price. NONE: no price yet."},"availableQty":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"available":{"type":"boolean"},"inactiveReason":{"type":"string"},"hidden":{"type":"boolean"},"canReorder":{"type":"boolean"},"weightKnown":{"type":"boolean"},"addedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","sku","title","variantLabel","customerSkus","quoteCustomerSku","price","availableQty","available","inactiveReason","hidden","canReorder","weightKnown","addedAt"],"additionalProperties":false}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"type":"object","required":["success","error","code"],"properties":{"success":{"const":false},"error":{"type":"string"},"code":{"type":"string"},"details":{"type":"array","items":{"type":"object"}}}}}}}}}},"/v1/sku-mappings":{"post":{"operationId":"createSkuMapping","summary":"Map your SKU to one of your products","description":"Adds your SKU to a product in My products, like adding a SKU on the portal's My products page. Orders that need attention because of this SKU are matched again right away. A product that isn't in My products returns 422 library_not_in_library.","security":[{"bearerAuth":[]}],"x-required-scope":"catalog:write","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":1,"maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"customerSku":{"type":"string","minLength":1,"maxLength":100,"description":"Your SKU, as it appears on your orders"},"productId":{"type":"string","minLength":1,"maxLength":64,"description":"Our product id from GET /v1/products (a product in My products)"},"move":{"default":false,"description":"Your SKU is already mapped to another product: send true to move it to this product. Otherwise you get 409 library_sku_taken.","type":"boolean"}},"required":["customerSku","productId"]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"const":true},"data":{"type":"object","properties":{"customerSku":{"type":"string"},"productId":{"type":"string"},"rematchedOrders":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Orders waiting on this SKU that now use the product"},"ordersStillNeedingAttention":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Of those orders, how many still need other fixes"},"moreOrders":{"type":"boolean","description":"More waiting orders use this SKU than we updated now; save them again with PATCH /v1/orders/{id} to match them"}},"required":["customerSku","productId","rematchedOrders","ordersStillNeedingAttention","moreOrders"],"additionalProperties":false}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"type":"object","required":["success","error","code"],"properties":{"success":{"const":false},"error":{"type":"string"},"code":{"type":"string"},"details":{"type":"array","items":{"type":"object"}}}}}}}}}},"/v1/inventory":{"get":{"operationId":"listInventory","summary":"List your stock","description":"Products with stock in our warehouse, stock set aside for orders, or stock on the way. Sorted by SKU.","security":[{"bearerAuth":[]}],"x-required-scope":"catalog:read","parameters":[{"name":"page","in":"query","required":false,"schema":{"default":1,"type":"integer","minimum":1,"maximum":10000}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data","meta"],"properties":{"success":{"const":true},"data":{"type":"array","items":{"type":"object","properties":{"productId":{"type":"string"},"sku":{"type":"string"},"name":{"type":"string"},"attributes":{"type":"string"},"customerSku":{"type":"string"},"onHandQty":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"reservedQty":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"availableQty":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"incomingQty":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Bought but not yet in our warehouse"}},"required":["productId","sku","name","attributes","customerSku","onHandQty","reservedQty","availableQty","incomingQty"],"additionalProperties":false}},"meta":{"type":"object","required":["total","page","limit","pageCount"],"properties":{"total":{"type":"integer","minimum":0},"page":{"type":"integer","minimum":1},"limit":{"type":"integer","minimum":1},"pageCount":{"type":"integer","minimum":1}}}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"type":"object","required":["success","error","code"],"properties":{"success":{"const":false},"error":{"type":"string"},"code":{"type":"string"},"details":{"type":"array","items":{"type":"object"}}}}}}}}}},"/v1/orders":{"get":{"operationId":"listOrders","summary":"List orders","description":"Newest first (by creation time). Filter by one `status`, or by `updatedSince` to get orders changed at or after that time. To sync without webhooks, note the time just before you request page 1, read every page with the same `updatedSince`, then use that time minus a safety margin (for example 5 minutes) as `updatedSince` next time. Expect to see some orders again and match them on `id`. Any edit through `PATCH /v1/orders/{id}` changes `updatedAt`.","security":[{"bearerAuth":[]}],"x-required-scope":"orders:read","parameters":[{"name":"page","in":"query","required":false,"schema":{"default":1,"type":"integer","minimum":1,"maximum":10000}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["NEEDS_ATTENTION","READY","BACKORDERED","RESERVED","WEIGHED","SHIPPED","CANCELLED"],"description":"One order status, uppercase, for example SHIPPED"}},{"name":"updatedSince","in":"query","required":false,"schema":{"description":"ISO 8601 date-time with a time zone, for example 2026-11-01T00:00:00Z. Send a + in an offset as %2B (2026-11-01T08:00:00%2B08:00), or it arrives as a space and is rejected","type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data","meta"],"properties":{"success":{"const":true},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"string"},"storeOrderNo":{"type":"string"},"status":{"type":"string","enum":["NEEDS_ATTENTION","READY","BACKORDERED","RESERVED","WEIGHED","SHIPPED","CANCELLED"]},"statusLabel":{"type":"string"},"recipientName":{"type":"string"},"country":{"type":"string"},"countryCode":{"type":["string","null"]},"itemCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"lines":{"type":"array","items":{"type":"object","properties":{"productId":{"description":"Our product id; null while the line is not matched to a product","type":["string","null"]},"productSku":{"type":["string","null"]},"productName":{"type":["string","null"]},"customerSku":{"type":"string"},"title":{"type":"string","description":"Item name from your store or file"},"qty":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["productId","productSku","productName","customerSku","title","qty"],"additionalProperties":false}},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","number","storeOrderNo","status","statusLabel","recipientName","country","countryCode","itemCount","lines","createdAt","updatedAt"],"additionalProperties":false}},"meta":{"type":"object","required":["total","page","limit","pageCount"],"properties":{"total":{"type":"integer","minimum":0},"page":{"type":"integer","minimum":1},"limit":{"type":"integer","minimum":1},"pageCount":{"type":"integer","minimum":1}}}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"type":"object","required":["success","error","code"],"properties":{"success":{"const":false},"error":{"type":"string"},"code":{"type":"string"},"details":{"type":"array","items":{"type":"object"}}}}}}}}},"post":{"operationId":"createOrder","summary":"Create an order","description":"Saves the order like the portal's order form and returns it. Creating an order doesn't charge your wallet. When the order has no problems, we reserve its stock and hold the estimated shipping and handling fee from your available balance. When our warehouse weighs the parcel, the shipping and handling fee is charged to your wallet automatically. If auto purchase is on and an order is short of stock, we place and pay for a purchase order automatically, within the limits you set. An order with problems is saved with status NEEDS_ATTENTION; fix it with PATCH /v1/orders/{id}. Check it first with POST /v1/orders/preview. Send an Idempotency-Key so a retry can't create the order twice.","security":[{"bearerAuth":[]}],"x-required-scope":"orders:write","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"storeOrderNo":{"description":"Your store's order number, unique among your orders. Leave empty to use our order number.","default":"","type":"string"},"recipientName":{"default":"","type":"string"},"recipientCompany":{"default":"","type":"string"},"recipientPhone":{"default":"","type":"string"},"recipientEmail":{"default":"","type":"string"},"address1":{"default":"","type":"string"},"address2":{"default":"","type":"string"},"city":{"default":"","type":"string"},"province":{"default":"","type":"string"},"postalCode":{"default":"","type":"string"},"countryCode":{"default":"","description":"Two-letter country code, for example US","type":"string"},"channelId":{"default":"","description":"A shipping option from POST /v1/orders/preview (shippingOptions[].channelId). Leave empty to use your shipping preference for the country.","type":"string","maxLength":64},"buyerNote":{"default":"","type":"string"},"lines":{"description":"The items in the order","maxItems":200,"type":"array","items":{"type":"object","properties":{"customerSku":{"description":"Your SKU for this item. When productId is empty we match it to a product through your SKU mappings.","default":"","type":"string"},"title":{"description":"Item name, for example from your store","default":"","type":"string"},"qty":{"type":"integer","minimum":1,"maximum":100000},"productId":{"default":"","description":"Our product id from GET /v1/products. Leave empty to match by customerSku.","type":"string","maxLength":64}},"required":["qty"]}}}}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"const":true},"data":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"string"},"storeOrderNo":{"type":"string"},"status":{"type":"string","enum":["NEEDS_ATTENTION","READY","BACKORDERED","RESERVED","WEIGHED","SHIPPED","CANCELLED"]},"statusLabel":{"type":"string"},"sourceLabel":{"type":"string"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"cancelledAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"recipient":{"type":"object","properties":{"name":{"type":"string"},"company":{"type":"string"},"phone":{"type":"string"},"email":{"type":"string"},"address1":{"type":"string"},"address2":{"type":"string"},"city":{"type":"string"},"province":{"type":"string"},"postalCode":{"type":"string"},"country":{"type":"string"},"countryCode":{"type":["string","null"]}},"required":["name","company","phone","email","address1","address2","city","province","postalCode","country","countryCode"],"additionalProperties":false},"buyerNote":{"type":"string"},"lines":{"type":"array","items":{"type":"object","properties":{"productId":{"description":"Our product id; null while the line is not matched to a product","type":["string","null"]},"productSku":{"type":["string","null"]},"productName":{"type":["string","null"]},"customerSku":{"type":"string"},"title":{"type":"string","description":"Item name from your store or file"},"qty":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["productId","productSku","productName","customerSku","title","qty"],"additionalProperties":false}},"shippingChannelLabel":{"type":"string"},"shippedInStore":{"type":"boolean"},"currency":{"type":"string","const":"USD"},"estimatedShippingCents":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"weightEstimated":{"type":"boolean"},"problems":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string","enum":["NO_LINES","UNBOUND_LINE","MISSING_RECIPIENT","UNKNOWN_COUNTRY","NO_CHANNEL","CHANNEL_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"],"additionalProperties":false},"description":"Why the order needs attention; empty otherwise. Rely on `code`; `message` is English text that may change"},"fulfilment":{"anyOf":[{"type":"object","properties":{"trackingNo":{"type":"string"},"trackingUrl":{"type":["string","null"]},"shippedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"actualWeightG":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"freightCents":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"handlingFeeCents":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"surchargeCents":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"totalChargedCents":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["trackingNo","trackingUrl","shippedAt","actualWeightG","freightCents","handlingFeeCents","surchargeCents","totalChargedCents"],"additionalProperties":false},{"type":"null"}]},"payment":{"anyOf":[{"type":"object","properties":{"freightCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"handlingFeeCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"dueCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"availableCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"topUpCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"At least this much to top up"}},"required":["freightCents","handlingFeeCents","dueCents","availableCents","topUpCents"],"additionalProperties":false},{"type":"null"}],"description":"Shipping charge waiting for wallet funds; null when nothing is due"},"shippingHold":{"anyOf":[{"type":"object","properties":{"heldCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"topUpCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["heldCents","topUpCents"],"additionalProperties":false},{"type":"null"}]},"backorder":{"anyOf":[{"type":"object","properties":{"lines":{"type":"array","items":{"type":"object","properties":{"productSku":{"type":"string"},"productName":{"type":"string"},"orderedQty":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"waitingQty":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["productSku","productName","orderedQty","waitingQty"],"additionalProperties":false}},"purchaseOrders":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"string"},"statusLabel":{"type":"string"}},"required":["id","number","statusLabel"],"additionalProperties":false}}},"required":["lines","purchaseOrders"],"additionalProperties":false},{"type":"null"}]}},"required":["id","number","storeOrderNo","status","statusLabel","sourceLabel","createdAt","updatedAt","cancelledAt","recipient","buyerNote","lines","shippingChannelLabel","shippedInStore","currency","estimatedShippingCents","weightEstimated","problems","fulfilment","payment","shippingHold","backorder"],"additionalProperties":false}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"type":"object","required":["success","error","code"],"properties":{"success":{"const":false},"error":{"type":"string"},"code":{"type":"string"},"details":{"type":"array","items":{"type":"object"}}}}}}}}}},"/v1/orders/{id}":{"get":{"operationId":"getOrder","summary":"Get an order","security":[{"bearerAuth":[]}],"x-required-scope":"orders:read","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"const":true},"data":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"string"},"storeOrderNo":{"type":"string"},"status":{"type":"string","enum":["NEEDS_ATTENTION","READY","BACKORDERED","RESERVED","WEIGHED","SHIPPED","CANCELLED"]},"statusLabel":{"type":"string"},"sourceLabel":{"type":"string"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"cancelledAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"recipient":{"type":"object","properties":{"name":{"type":"string"},"company":{"type":"string"},"phone":{"type":"string"},"email":{"type":"string"},"address1":{"type":"string"},"address2":{"type":"string"},"city":{"type":"string"},"province":{"type":"string"},"postalCode":{"type":"string"},"country":{"type":"string"},"countryCode":{"type":["string","null"]}},"required":["name","company","phone","email","address1","address2","city","province","postalCode","country","countryCode"],"additionalProperties":false},"buyerNote":{"type":"string"},"lines":{"type":"array","items":{"type":"object","properties":{"productId":{"description":"Our product id; null while the line is not matched to a product","type":["string","null"]},"productSku":{"type":["string","null"]},"productName":{"type":["string","null"]},"customerSku":{"type":"string"},"title":{"type":"string","description":"Item name from your store or file"},"qty":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["productId","productSku","productName","customerSku","title","qty"],"additionalProperties":false}},"shippingChannelLabel":{"type":"string"},"shippedInStore":{"type":"boolean"},"currency":{"type":"string","const":"USD"},"estimatedShippingCents":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"weightEstimated":{"type":"boolean"},"problems":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string","enum":["NO_LINES","UNBOUND_LINE","MISSING_RECIPIENT","UNKNOWN_COUNTRY","NO_CHANNEL","CHANNEL_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"],"additionalProperties":false},"description":"Why the order needs attention; empty otherwise. Rely on `code`; `message` is English text that may change"},"fulfilment":{"anyOf":[{"type":"object","properties":{"trackingNo":{"type":"string"},"trackingUrl":{"type":["string","null"]},"shippedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"actualWeightG":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"freightCents":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"handlingFeeCents":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"surchargeCents":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"totalChargedCents":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["trackingNo","trackingUrl","shippedAt","actualWeightG","freightCents","handlingFeeCents","surchargeCents","totalChargedCents"],"additionalProperties":false},{"type":"null"}]},"payment":{"anyOf":[{"type":"object","properties":{"freightCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"handlingFeeCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"dueCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"availableCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"topUpCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"At least this much to top up"}},"required":["freightCents","handlingFeeCents","dueCents","availableCents","topUpCents"],"additionalProperties":false},{"type":"null"}],"description":"Shipping charge waiting for wallet funds; null when nothing is due"},"shippingHold":{"anyOf":[{"type":"object","properties":{"heldCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"topUpCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["heldCents","topUpCents"],"additionalProperties":false},{"type":"null"}]},"backorder":{"anyOf":[{"type":"object","properties":{"lines":{"type":"array","items":{"type":"object","properties":{"productSku":{"type":"string"},"productName":{"type":"string"},"orderedQty":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"waitingQty":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["productSku","productName","orderedQty","waitingQty"],"additionalProperties":false}},"purchaseOrders":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"string"},"statusLabel":{"type":"string"}},"required":["id","number","statusLabel"],"additionalProperties":false}}},"required":["lines","purchaseOrders"],"additionalProperties":false},{"type":"null"}]}},"required":["id","number","storeOrderNo","status","statusLabel","sourceLabel","createdAt","updatedAt","cancelledAt","recipient","buyerNote","lines","shippingChannelLabel","shippedInStore","currency","estimatedShippingCents","weightEstimated","problems","fulfilment","payment","shippingHold","backorder"],"additionalProperties":false}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"type":"object","required":["success","error","code"],"properties":{"success":{"const":false},"error":{"type":"string"},"code":{"type":"string"},"details":{"type":"array","items":{"type":"object"}}}}}}}}},"patch":{"operationId":"updateOrder","summary":"Change an order that needs attention","description":"Replaces the whole order with the body, like saving the portal's order form: send every field and every line, as for POST /v1/orders; fields you leave out are cleared. Only orders with status NEEDS_ATTENTION can be changed (otherwise 409 order_not_editable). Orders from a connected store keep the store's order number. Creating an order doesn't charge your wallet. When the order has no problems, we reserve its stock and hold the estimated shipping and handling fee from your available balance.","security":[{"bearerAuth":[]}],"x-required-scope":"orders:write","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":1,"maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"storeOrderNo":{"description":"Your store's order number, unique among your orders. Leave empty to use our order number.","default":"","type":"string"},"recipientName":{"default":"","type":"string"},"recipientCompany":{"default":"","type":"string"},"recipientPhone":{"default":"","type":"string"},"recipientEmail":{"default":"","type":"string"},"address1":{"default":"","type":"string"},"address2":{"default":"","type":"string"},"city":{"default":"","type":"string"},"province":{"default":"","type":"string"},"postalCode":{"default":"","type":"string"},"countryCode":{"default":"","description":"Two-letter country code, for example US","type":"string"},"channelId":{"default":"","description":"A shipping option from POST /v1/orders/preview (shippingOptions[].channelId). Leave empty to use your shipping preference for the country.","type":"string","maxLength":64},"buyerNote":{"default":"","type":"string"},"lines":{"description":"The items in the order","maxItems":200,"type":"array","items":{"type":"object","properties":{"customerSku":{"description":"Your SKU for this item. When productId is empty we match it to a product through your SKU mappings.","default":"","type":"string"},"title":{"description":"Item name, for example from your store","default":"","type":"string"},"qty":{"type":"integer","minimum":1,"maximum":100000},"productId":{"default":"","description":"Our product id from GET /v1/products. Leave empty to match by customerSku.","type":"string","maxLength":64}},"required":["qty"]}}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"const":true},"data":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"string"},"storeOrderNo":{"type":"string"},"status":{"type":"string","enum":["NEEDS_ATTENTION","READY","BACKORDERED","RESERVED","WEIGHED","SHIPPED","CANCELLED"]},"statusLabel":{"type":"string"},"sourceLabel":{"type":"string"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"cancelledAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"recipient":{"type":"object","properties":{"name":{"type":"string"},"company":{"type":"string"},"phone":{"type":"string"},"email":{"type":"string"},"address1":{"type":"string"},"address2":{"type":"string"},"city":{"type":"string"},"province":{"type":"string"},"postalCode":{"type":"string"},"country":{"type":"string"},"countryCode":{"type":["string","null"]}},"required":["name","company","phone","email","address1","address2","city","province","postalCode","country","countryCode"],"additionalProperties":false},"buyerNote":{"type":"string"},"lines":{"type":"array","items":{"type":"object","properties":{"productId":{"description":"Our product id; null while the line is not matched to a product","type":["string","null"]},"productSku":{"type":["string","null"]},"productName":{"type":["string","null"]},"customerSku":{"type":"string"},"title":{"type":"string","description":"Item name from your store or file"},"qty":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["productId","productSku","productName","customerSku","title","qty"],"additionalProperties":false}},"shippingChannelLabel":{"type":"string"},"shippedInStore":{"type":"boolean"},"currency":{"type":"string","const":"USD"},"estimatedShippingCents":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"weightEstimated":{"type":"boolean"},"problems":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string","enum":["NO_LINES","UNBOUND_LINE","MISSING_RECIPIENT","UNKNOWN_COUNTRY","NO_CHANNEL","CHANNEL_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"],"additionalProperties":false},"description":"Why the order needs attention; empty otherwise. Rely on `code`; `message` is English text that may change"},"fulfilment":{"anyOf":[{"type":"object","properties":{"trackingNo":{"type":"string"},"trackingUrl":{"type":["string","null"]},"shippedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"actualWeightG":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"freightCents":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"handlingFeeCents":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"surchargeCents":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"totalChargedCents":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["trackingNo","trackingUrl","shippedAt","actualWeightG","freightCents","handlingFeeCents","surchargeCents","totalChargedCents"],"additionalProperties":false},{"type":"null"}]},"payment":{"anyOf":[{"type":"object","properties":{"freightCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"handlingFeeCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"dueCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"availableCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"topUpCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"At least this much to top up"}},"required":["freightCents","handlingFeeCents","dueCents","availableCents","topUpCents"],"additionalProperties":false},{"type":"null"}],"description":"Shipping charge waiting for wallet funds; null when nothing is due"},"shippingHold":{"anyOf":[{"type":"object","properties":{"heldCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"topUpCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["heldCents","topUpCents"],"additionalProperties":false},{"type":"null"}]},"backorder":{"anyOf":[{"type":"object","properties":{"lines":{"type":"array","items":{"type":"object","properties":{"productSku":{"type":"string"},"productName":{"type":"string"},"orderedQty":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"waitingQty":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["productSku","productName","orderedQty","waitingQty"],"additionalProperties":false}},"purchaseOrders":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"string"},"statusLabel":{"type":"string"}},"required":["id","number","statusLabel"],"additionalProperties":false}}},"required":["lines","purchaseOrders"],"additionalProperties":false},{"type":"null"}]}},"required":["id","number","storeOrderNo","status","statusLabel","sourceLabel","createdAt","updatedAt","cancelledAt","recipient","buyerNote","lines","shippingChannelLabel","shippedInStore","currency","estimatedShippingCents","weightEstimated","problems","fulfilment","payment","shippingHold","backorder"],"additionalProperties":false}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"type":"object","required":["success","error","code"],"properties":{"success":{"const":false},"error":{"type":"string"},"code":{"type":"string"},"details":{"type":"array","items":{"type":"object"}}}}}}}}}},"/v1/orders/preview":{"post":{"operationId":"previewOrder","summary":"Check a new order without saving it","description":"Takes the same body as POST /v1/orders and returns what creating it would do: problems, the shipping options and their prices, the wallet hold and stock shortages. Nothing is saved, and it works while your account is on hold. It checks new orders only. The body is optional (an empty body is checked as an empty order).","security":[{"bearerAuth":[]}],"x-required-scope":"orders:read","parameters":[],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"storeOrderNo":{"description":"Your store's order number, unique among your orders. Leave empty to use our order number.","default":"","type":"string"},"recipientName":{"default":"","type":"string"},"recipientCompany":{"default":"","type":"string"},"recipientPhone":{"default":"","type":"string"},"recipientEmail":{"default":"","type":"string"},"address1":{"default":"","type":"string"},"address2":{"default":"","type":"string"},"city":{"default":"","type":"string"},"province":{"default":"","type":"string"},"postalCode":{"default":"","type":"string"},"countryCode":{"default":"","description":"Two-letter country code, for example US","type":"string"},"channelId":{"default":"","description":"A shipping option from POST /v1/orders/preview (shippingOptions[].channelId). Leave empty to use your shipping preference for the country.","type":"string","maxLength":64},"buyerNote":{"default":"","type":"string"},"lines":{"description":"The items in the order","maxItems":200,"type":"array","items":{"type":"object","properties":{"customerSku":{"description":"Your SKU for this item. When productId is empty we match it to a product through your SKU mappings.","default":"","type":"string"},"title":{"description":"Item name, for example from your store","default":"","type":"string"},"qty":{"type":"integer","minimum":1,"maximum":100000},"productId":{"default":"","description":"Our product id from GET /v1/products. Leave empty to match by customerSku.","type":"string","maxLength":64}},"required":["qty"]}}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"const":true},"data":{"type":"object","properties":{"willReserve":{"type":"boolean","description":"true when the order has no problems: creating it reserves stock, holds the estimated shipping and handling fee in your wallet, and you can't change it afterwards"},"problems":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string","enum":["NO_LINES","UNBOUND_LINE","MISSING_RECIPIENT","UNKNOWN_COUNTRY","NO_CHANNEL","CHANNEL_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"],"additionalProperties":false},"description":"Why the order would need attention; empty when there are none. Rely on `code`; `message` is English text that may change"},"shippingChannelLabel":{"type":"string","description":"The shipping option the order would use, in English"},"currency":{"type":"string","const":"USD"},"estimatedShippingCents":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"weightEstimated":{"type":"boolean","description":"true when a product's weight is unknown and we estimated it"},"lines":{"type":"array","items":{"type":"object","properties":{"productId":{"description":"The product the line matched; null when it doesn't match one of your products","type":["string","null"]},"productLabel":{"type":["string","null"]}},"required":["productId","productLabel"],"additionalProperties":false},"description":"One entry per line you sent, in the same order"},"shippingOptions":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"channelId":{"type":"string","description":"Send this as channelId to use this shipping option"},"name":{"type":"string"},"priceCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Estimated shipping in US cents"},"priceMaxCents":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"Upper end of the estimate when the price depends on the postal code; null otherwise"},"transitLabel":{"type":"string","description":"Delivery time in English, for example 7–12 days"},"chargeableG":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"cheapest":{"type":"boolean"},"fastest":{"type":"boolean"}},"required":["channelId","name","priceCents","priceMaxCents","transitLabel","chargeableG","cheapest","fastest"],"additionalProperties":false}},{"type":"null"}],"description":"Shipping options for this order, cheapest first; null until the order has a country and at least one matched product"},"preferredShipping":{"anyOf":[{"type":"object","properties":{"name":{"type":"string"},"priceCents":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["name","priceCents"],"additionalProperties":false},{"type":"null"}],"description":"The option your shipping preference would pick when channelId is empty; null when no preference applies"},"charges":{"type":"object","properties":{"shippingCents":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"handlingFeeCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"holdCents":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"Held from your available balance when the order is created with no problems; null when nothing is held"},"availableCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Your available wallet balance now"},"topUpCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Top up at least this much to cover the hold; 0 when your balance is enough"}},"required":["shippingCents","handlingFeeCents","holdCents","availableCents","topUpCents"],"additionalProperties":false},"shortages":{"type":"array","items":{"type":"object","properties":{"productLabel":{"type":"string"},"wantedQty":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"availableQty":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["productLabel","wantedQty","availableQty"],"additionalProperties":false},"description":"Products with less available stock than ordered: the order waits for stock before packing"}},"required":["willReserve","problems","shippingChannelLabel","currency","estimatedShippingCents","weightEstimated","lines","shippingOptions","preferredShipping","charges","shortages"],"additionalProperties":false}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"type":"object","required":["success","error","code"],"properties":{"success":{"const":false},"error":{"type":"string"},"code":{"type":"string"},"details":{"type":"array","items":{"type":"object"}}}}}}}}}},"/v1/orders/{id}/cancel":{"post":{"operationId":"cancelOrder","summary":"Cancel an order that needs attention","description":"Only orders with status NEEDS_ATTENTION can be cancelled here (otherwise 409 order_not_editable); for other orders contact your account manager. The body is optional.","security":[{"bearerAuth":[]}],"x-required-scope":"orders:write","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":1,"maxLength":255}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"description":"Why you cancel the order, up to 500 characters. Optional; our team can see it.","default":"","type":"string"}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"const":true},"data":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"string"},"storeOrderNo":{"type":"string"},"status":{"type":"string","enum":["NEEDS_ATTENTION","READY","BACKORDERED","RESERVED","WEIGHED","SHIPPED","CANCELLED"]},"statusLabel":{"type":"string"},"sourceLabel":{"type":"string"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"cancelledAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"recipient":{"type":"object","properties":{"name":{"type":"string"},"company":{"type":"string"},"phone":{"type":"string"},"email":{"type":"string"},"address1":{"type":"string"},"address2":{"type":"string"},"city":{"type":"string"},"province":{"type":"string"},"postalCode":{"type":"string"},"country":{"type":"string"},"countryCode":{"type":["string","null"]}},"required":["name","company","phone","email","address1","address2","city","province","postalCode","country","countryCode"],"additionalProperties":false},"buyerNote":{"type":"string"},"lines":{"type":"array","items":{"type":"object","properties":{"productId":{"description":"Our product id; null while the line is not matched to a product","type":["string","null"]},"productSku":{"type":["string","null"]},"productName":{"type":["string","null"]},"customerSku":{"type":"string"},"title":{"type":"string","description":"Item name from your store or file"},"qty":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["productId","productSku","productName","customerSku","title","qty"],"additionalProperties":false}},"shippingChannelLabel":{"type":"string"},"shippedInStore":{"type":"boolean"},"currency":{"type":"string","const":"USD"},"estimatedShippingCents":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"weightEstimated":{"type":"boolean"},"problems":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string","enum":["NO_LINES","UNBOUND_LINE","MISSING_RECIPIENT","UNKNOWN_COUNTRY","NO_CHANNEL","CHANNEL_UNAVAILABLE"]},"message":{"type":"string"}},"required":["code","message"],"additionalProperties":false},"description":"Why the order needs attention; empty otherwise. Rely on `code`; `message` is English text that may change"},"fulfilment":{"anyOf":[{"type":"object","properties":{"trackingNo":{"type":"string"},"trackingUrl":{"type":["string","null"]},"shippedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"actualWeightG":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"freightCents":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"handlingFeeCents":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"surchargeCents":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"totalChargedCents":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["trackingNo","trackingUrl","shippedAt","actualWeightG","freightCents","handlingFeeCents","surchargeCents","totalChargedCents"],"additionalProperties":false},{"type":"null"}]},"payment":{"anyOf":[{"type":"object","properties":{"freightCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"handlingFeeCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"dueCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"availableCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"topUpCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"At least this much to top up"}},"required":["freightCents","handlingFeeCents","dueCents","availableCents","topUpCents"],"additionalProperties":false},{"type":"null"}],"description":"Shipping charge waiting for wallet funds; null when nothing is due"},"shippingHold":{"anyOf":[{"type":"object","properties":{"heldCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"topUpCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["heldCents","topUpCents"],"additionalProperties":false},{"type":"null"}]},"backorder":{"anyOf":[{"type":"object","properties":{"lines":{"type":"array","items":{"type":"object","properties":{"productSku":{"type":"string"},"productName":{"type":"string"},"orderedQty":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"waitingQty":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["productSku","productName","orderedQty","waitingQty"],"additionalProperties":false}},"purchaseOrders":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"string"},"statusLabel":{"type":"string"}},"required":["id","number","statusLabel"],"additionalProperties":false}}},"required":["lines","purchaseOrders"],"additionalProperties":false},{"type":"null"}]}},"required":["id","number","storeOrderNo","status","statusLabel","sourceLabel","createdAt","updatedAt","cancelledAt","recipient","buyerNote","lines","shippingChannelLabel","shippedInStore","currency","estimatedShippingCents","weightEstimated","problems","fulfilment","payment","shippingHold","backorder"],"additionalProperties":false}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"type":"object","required":["success","error","code"],"properties":{"success":{"const":false},"error":{"type":"string"},"code":{"type":"string"},"details":{"type":"array","items":{"type":"object"}}}}}}}}}},"/v1/purchase-orders":{"get":{"operationId":"listPurchaseOrders","summary":"List purchase orders","description":"All your purchase orders, including cancelled ones. Newest first.","security":[{"bearerAuth":[]}],"x-required-scope":"purchase_orders:read","parameters":[{"name":"page","in":"query","required":false,"schema":{"default":1,"type":"integer","minimum":1,"maximum":10000}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data","meta"],"properties":{"success":{"const":true},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"string"},"status":{"type":"string","enum":["AWAITING_PAYMENT","DEPOSIT_PAID","PAID","PURCHASING","ORDERED","IN_TRANSIT","PARTIALLY_ARRIVED","ARRIVED","STORED","COMPLETED","CANCELLED"]},"statusLabel":{"type":"string"},"itemCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","const":"USD"},"receivableCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"What you pay: the total minus short-shipped items"},"paidCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"dueCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","number","status","statusLabel","itemCount","currency","receivableCents","paidCents","dueCents","createdAt"],"additionalProperties":false}},"meta":{"type":"object","required":["total","page","limit","pageCount"],"properties":{"total":{"type":"integer","minimum":0},"page":{"type":"integer","minimum":1},"limit":{"type":"integer","minimum":1},"pageCount":{"type":"integer","minimum":1}}}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"type":"object","required":["success","error","code"],"properties":{"success":{"const":false},"error":{"type":"string"},"code":{"type":"string"},"details":{"type":"array","items":{"type":"object"}}}}}}}}}},"/v1/purchase-orders/{id}":{"get":{"operationId":"getPurchaseOrder","summary":"Get a purchase order","security":[{"bearerAuth":[]}],"x-required-scope":"purchase_orders:read","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"const":true},"data":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"string"},"status":{"type":"string","enum":["AWAITING_PAYMENT","DEPOSIT_PAID","PAID","PURCHASING","ORDERED","IN_TRANSIT","PARTIALLY_ARRIVED","ARRIVED","STORED","COMPLETED","CANCELLED"]},"statusLabel":{"type":"string"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"cancelledAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"paymentMethodName":{"type":["string","null"]},"note":{"type":"string"},"placedViaSearch":{"type":"boolean"},"currency":{"type":"string","const":"USD"},"items":{"type":"array","items":{"type":"object","properties":{"productId":{"type":"string"},"sku":{"type":"string"},"name":{"type":"string"},"attributes":{"type":"string"},"customerSku":{"type":"string"},"qty":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unitPriceCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"orderedQty":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"inWarehouseQty":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"shortQty":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Short-shipped or refunded by the seller"}},"required":["productId","sku","name","attributes","customerSku","qty","unitPriceCents","amountCents","orderedQty","inWarehouseQty","shortQty"],"additionalProperties":false}},"charges":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["label","amountCents"],"additionalProperties":false}},"totalCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"shortageCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"receivableCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"paidCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"dueCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"payments":{"type":"array","items":{"type":"object","properties":{"paidOn":{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"methodLabel":{"type":"string"}},"required":["paidOn","amountCents","methodLabel"],"additionalProperties":false}},"refunds":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"refundedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["label","amountCents","refundedAt"],"additionalProperties":false}},"paymentInstructions":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"instructions":{"type":"string"}},"required":["name","instructions"],"additionalProperties":false},"description":"How to pay; empty when nothing is due"}},"required":["id","number","status","statusLabel","createdAt","cancelledAt","paymentMethodName","note","placedViaSearch","currency","items","charges","totalCents","shortageCents","receivableCents","paidCents","dueCents","payments","refunds","paymentInstructions"],"additionalProperties":false}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"type":"object","required":["success","error","code"],"properties":{"success":{"const":false},"error":{"type":"string"},"code":{"type":"string"},"details":{"type":"array","items":{"type":"object"}}}}}}}}}},"/v1/shipments":{"get":{"operationId":"listShipments","summary":"List shipments","description":"Shipments we have sent you for confirmation, and the ones you asked for from your stock. Newest first.","security":[{"bearerAuth":[]}],"x-required-scope":"shipments:read","parameters":[{"name":"page","in":"query","required":false,"schema":{"default":1,"type":"integer","minimum":1,"maximum":10000}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data","meta"],"properties":{"success":{"const":true},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"string"},"kind":{"type":"string","enum":["WHOLESALE","FBA"]},"kindLabel":{"type":"string"},"status":{"type":"string","enum":["DRAFT","PENDING_CONFIRMATION","AWAITING_PAYMENT","PAID","SHIPPED","CANCELLED"]},"statusLabel":{"type":"string"},"boxCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","const":"USD"},"receivableCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"paidCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","number","kind","kindLabel","status","statusLabel","boxCount","currency","receivableCents","paidCents","createdAt"],"additionalProperties":false}},"meta":{"type":"object","required":["total","page","limit","pageCount"],"properties":{"total":{"type":"integer","minimum":0},"page":{"type":"integer","minimum":1},"limit":{"type":"integer","minimum":1},"pageCount":{"type":"integer","minimum":1}}}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"type":"object","required":["success","error","code"],"properties":{"success":{"const":false},"error":{"type":"string"},"code":{"type":"string"},"details":{"type":"array","items":{"type":"object"}}}}}}}}},"post":{"operationId":"createShipment","summary":"Request a shipment from your stock","description":"Creates a shipment like the portal's New shipment form and reserves the stock; not enough available stock returns 422 stock_short. We pack it, set the shipping and send you the freight quote; then confirm it with POST /v1/shipments/{id}/confirm. You can cancel it until we send the quote. Creating it doesn't charge your wallet. Send an Idempotency-Key so a retry can't create it twice.","security":[{"bearerAuth":[]}],"x-required-scope":"shipments:write","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"kind":{"type":"string","enum":["WHOLESALE","FBA"],"description":"WHOLESALE ships to an address, FBA to an Amazon warehouse"},"channelId":{"default":"","description":"A shipping option from POST /v1/shipments/estimate (options[].channelId). Leave empty to let us choose; then send transportMode.","type":"string","maxLength":64},"transportMode":{"default":"","description":"How we should ship it when channelId is empty: AIR, SEA, EXPRESS, TRUCK","type":"string"},"recipientName":{"default":"","type":"string","maxLength":200},"recipientPhone":{"default":"","type":"string","maxLength":200},"address1":{"default":"","type":"string","maxLength":200},"address2":{"default":"","type":"string","maxLength":200},"city":{"default":"","type":"string","maxLength":200},"province":{"default":"","type":"string","maxLength":200},"postalCode":{"default":"","type":"string","maxLength":200},"countryCode":{"type":"string","description":"Two-letter country code, for example US"},"fbaWarehouseCode":{"default":"","description":"Amazon warehouse code; required for FBA","type":"string","maxLength":50},"fbaShipmentId":{"default":"","type":"string","maxLength":100},"note":{"default":"","type":"string","maxLength":2000},"lines":{"minItems":1,"maxItems":200,"type":"array","items":{"type":"object","properties":{"productId":{"type":"string","minLength":1},"qty":{"type":"integer","minimum":1,"maximum":100000}},"required":["productId","qty"]},"description":"Products from your stock (productId from GET /v1/inventory) with quantities; each product once"}},"required":["kind","countryCode","lines"]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"const":true},"data":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"string"},"kind":{"type":"string","enum":["WHOLESALE","FBA"]},"kindLabel":{"type":"string"},"status":{"type":"string","enum":["DRAFT","PENDING_CONFIRMATION","AWAITING_PAYMENT","PAID","SHIPPED","CANCELLED"]},"statusLabel":{"type":"string"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"submittedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"requestedByCustomer":{"type":"boolean"},"lines":{"type":"array","items":{"type":"object","properties":{"sku":{"type":"string"},"name":{"type":"string"},"qty":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["sku","name","qty"],"additionalProperties":false}},"transportLabel":{"type":"string"},"shippingOption":{"type":["string","null"]},"address":{"type":"object","properties":{"recipientName":{"type":"string"},"recipientPhone":{"type":"string"},"address1":{"type":"string"},"address2":{"type":"string"},"city":{"type":"string"},"province":{"type":"string"},"postalCode":{"type":"string"},"countryCode":{"type":["string","null"]}},"required":["recipientName","recipientPhone","address1","address2","city","province","postalCode","countryCode"],"additionalProperties":false},"fbaWarehouseCode":{"type":"string"},"fbaShipmentId":{"type":"string"},"boxes":{"type":"array","items":{"type":"object","properties":{"boxNo":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"weightG":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"lengthCm":{"type":"number"},"widthCm":{"type":"number"},"heightCm":{"type":"number"},"lines":{"type":"array","items":{"type":"object","properties":{"sku":{"type":"string"},"name":{"type":"string"},"qty":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["sku","name","qty"],"additionalProperties":false}}},"required":["boxNo","weightG","lengthCm","widthCm","heightCm","lines"],"additionalProperties":false}},"boxCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"totalWeightG":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"chargeableG":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"currency":{"type":"string","const":"USD"},"freightCents":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"fees":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"description":{"type":"string"},"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["label","description","amountCents"],"additionalProperties":false}},"receivableCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"paidCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"dueCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"paymentInstructions":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"instructions":{"type":"string"}},"required":["name","instructions"],"additionalProperties":false},"description":"How to pay; empty when nothing is due"},"trackingNos":{"type":"array","items":{"type":"string"}},"shippedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"confirmedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"canConfirm":{"type":"boolean"},"canCancel":{"type":"boolean"},"version":{"type":"string","description":"Send this back when you confirm the shipment"},"feedback":{"type":"string"},"feedbackAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]}},"required":["id","number","kind","kindLabel","status","statusLabel","createdAt","submittedAt","requestedByCustomer","lines","transportLabel","shippingOption","address","fbaWarehouseCode","fbaShipmentId","boxes","boxCount","totalWeightG","chargeableG","currency","freightCents","fees","receivableCents","paidCents","dueCents","paymentInstructions","trackingNos","shippedAt","confirmedAt","canConfirm","canCancel","version","feedback","feedbackAt"],"additionalProperties":false}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"type":"object","required":["success","error","code"],"properties":{"success":{"const":false},"error":{"type":"string"},"code":{"type":"string"},"details":{"type":"array","items":{"type":"object"}}}}}}}}}},"/v1/shipments/{id}":{"get":{"operationId":"getShipment","summary":"Get a shipment","security":[{"bearerAuth":[]}],"x-required-scope":"shipments:read","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"const":true},"data":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"string"},"kind":{"type":"string","enum":["WHOLESALE","FBA"]},"kindLabel":{"type":"string"},"status":{"type":"string","enum":["DRAFT","PENDING_CONFIRMATION","AWAITING_PAYMENT","PAID","SHIPPED","CANCELLED"]},"statusLabel":{"type":"string"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"submittedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"requestedByCustomer":{"type":"boolean"},"lines":{"type":"array","items":{"type":"object","properties":{"sku":{"type":"string"},"name":{"type":"string"},"qty":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["sku","name","qty"],"additionalProperties":false}},"transportLabel":{"type":"string"},"shippingOption":{"type":["string","null"]},"address":{"type":"object","properties":{"recipientName":{"type":"string"},"recipientPhone":{"type":"string"},"address1":{"type":"string"},"address2":{"type":"string"},"city":{"type":"string"},"province":{"type":"string"},"postalCode":{"type":"string"},"countryCode":{"type":["string","null"]}},"required":["recipientName","recipientPhone","address1","address2","city","province","postalCode","countryCode"],"additionalProperties":false},"fbaWarehouseCode":{"type":"string"},"fbaShipmentId":{"type":"string"},"boxes":{"type":"array","items":{"type":"object","properties":{"boxNo":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"weightG":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"lengthCm":{"type":"number"},"widthCm":{"type":"number"},"heightCm":{"type":"number"},"lines":{"type":"array","items":{"type":"object","properties":{"sku":{"type":"string"},"name":{"type":"string"},"qty":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["sku","name","qty"],"additionalProperties":false}}},"required":["boxNo","weightG","lengthCm","widthCm","heightCm","lines"],"additionalProperties":false}},"boxCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"totalWeightG":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"chargeableG":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"currency":{"type":"string","const":"USD"},"freightCents":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"fees":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"description":{"type":"string"},"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["label","description","amountCents"],"additionalProperties":false}},"receivableCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"paidCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"dueCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"paymentInstructions":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"instructions":{"type":"string"}},"required":["name","instructions"],"additionalProperties":false},"description":"How to pay; empty when nothing is due"},"trackingNos":{"type":"array","items":{"type":"string"}},"shippedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"confirmedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"canConfirm":{"type":"boolean"},"canCancel":{"type":"boolean"},"version":{"type":"string","description":"Send this back when you confirm the shipment"},"feedback":{"type":"string"},"feedbackAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]}},"required":["id","number","kind","kindLabel","status","statusLabel","createdAt","submittedAt","requestedByCustomer","lines","transportLabel","shippingOption","address","fbaWarehouseCode","fbaShipmentId","boxes","boxCount","totalWeightG","chargeableG","currency","freightCents","fees","receivableCents","paidCents","dueCents","paymentInstructions","trackingNos","shippedAt","confirmedAt","canConfirm","canCancel","version","feedback","feedbackAt"],"additionalProperties":false}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"type":"object","required":["success","error","code"],"properties":{"success":{"const":false},"error":{"type":"string"},"code":{"type":"string"},"details":{"type":"array","items":{"type":"object"}}}}}}}}}},"/v1/shipments/estimate":{"post":{"operationId":"estimateShipment","summary":"Estimate shipping for a shipment from your stock","description":"Lists the shipping options for these products and destination, cheapest first, with prices estimated from the total product weight. Nothing is saved, and it works while your account is on hold.","security":[{"bearerAuth":[]}],"x-required-scope":"shipments:read","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"countryCode":{"type":"string","description":"Two-letter country code, for example US"},"postalCode":{"default":"","description":"Postal code. Some countries are priced by postal code zone; without it you get a price range","type":"string","maxLength":200},"lines":{"minItems":1,"maxItems":200,"type":"array","items":{"type":"object","properties":{"productId":{"type":"string","minLength":1},"qty":{"type":"integer","minimum":1,"maximum":100000}},"required":["productId","qty"]},"description":"Products from your stock (productId from GET /v1/inventory) with quantities"}},"required":["countryCode","lines"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"const":true},"data":{"type":"object","properties":{"available":{"type":"boolean","description":"false when we can't price shipments right now; options is then empty. You can still create the shipment and let us choose"},"totalWeightG":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Total weight of the products in your stock; products that aren't in your stock count as 0"},"currency":{"type":"string","const":"USD"},"options":{"type":"array","items":{"type":"object","properties":{"channelId":{"type":"string","description":"Send this as channelId to use this shipping option"},"name":{"type":"string"},"priceCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Estimated shipping in US cents"},"priceMaxCents":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"Upper end of the estimate when the price depends on the postal code; null otherwise"},"transitLabel":{"type":"string","description":"Delivery time in English, for example 7–12 days"},"chargeableG":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"cheapest":{"type":"boolean"},"fastest":{"type":"boolean"},"transportMode":{"type":"string","enum":["AIR","SEA","EXPRESS","TRUCK"]},"transportLabel":{"type":"string"}},"required":["channelId","name","priceCents","priceMaxCents","transitLabel","chargeableG","cheapest","fastest","transportMode","transportLabel"],"additionalProperties":false},"description":"Shipping options for the shipment, cheapest first. Empty when none fits the weight or destination. The price is a guide: we price the shipment again from the packed boxes"}},"required":["available","totalWeightG","currency","options"],"additionalProperties":false}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"type":"object","required":["success","error","code"],"properties":{"success":{"const":false},"error":{"type":"string"},"code":{"type":"string"},"details":{"type":"array","items":{"type":"object"}}}}}}}}}},"/v1/shipments/{id}/cancel":{"post":{"operationId":"cancelShipment","summary":"Cancel a shipment you requested","description":"Only shipments you requested that we haven't quoted yet (status DRAFT) can be cancelled; their stock is available again. Otherwise 409 shipment_not_cancellable: contact your account manager. No request body.","security":[{"bearerAuth":[]}],"x-required-scope":"shipments:write","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":1,"maxLength":255}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"const":true},"data":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"string"},"kind":{"type":"string","enum":["WHOLESALE","FBA"]},"kindLabel":{"type":"string"},"status":{"type":"string","enum":["DRAFT","PENDING_CONFIRMATION","AWAITING_PAYMENT","PAID","SHIPPED","CANCELLED"]},"statusLabel":{"type":"string"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"submittedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"requestedByCustomer":{"type":"boolean"},"lines":{"type":"array","items":{"type":"object","properties":{"sku":{"type":"string"},"name":{"type":"string"},"qty":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["sku","name","qty"],"additionalProperties":false}},"transportLabel":{"type":"string"},"shippingOption":{"type":["string","null"]},"address":{"type":"object","properties":{"recipientName":{"type":"string"},"recipientPhone":{"type":"string"},"address1":{"type":"string"},"address2":{"type":"string"},"city":{"type":"string"},"province":{"type":"string"},"postalCode":{"type":"string"},"countryCode":{"type":["string","null"]}},"required":["recipientName","recipientPhone","address1","address2","city","province","postalCode","countryCode"],"additionalProperties":false},"fbaWarehouseCode":{"type":"string"},"fbaShipmentId":{"type":"string"},"boxes":{"type":"array","items":{"type":"object","properties":{"boxNo":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"weightG":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"lengthCm":{"type":"number"},"widthCm":{"type":"number"},"heightCm":{"type":"number"},"lines":{"type":"array","items":{"type":"object","properties":{"sku":{"type":"string"},"name":{"type":"string"},"qty":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["sku","name","qty"],"additionalProperties":false}}},"required":["boxNo","weightG","lengthCm","widthCm","heightCm","lines"],"additionalProperties":false}},"boxCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"totalWeightG":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"chargeableG":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"currency":{"type":"string","const":"USD"},"freightCents":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"fees":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"description":{"type":"string"},"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["label","description","amountCents"],"additionalProperties":false}},"receivableCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"paidCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"dueCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"paymentInstructions":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"instructions":{"type":"string"}},"required":["name","instructions"],"additionalProperties":false},"description":"How to pay; empty when nothing is due"},"trackingNos":{"type":"array","items":{"type":"string"}},"shippedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"confirmedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"canConfirm":{"type":"boolean"},"canCancel":{"type":"boolean"},"version":{"type":"string","description":"Send this back when you confirm the shipment"},"feedback":{"type":"string"},"feedbackAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]}},"required":["id","number","kind","kindLabel","status","statusLabel","createdAt","submittedAt","requestedByCustomer","lines","transportLabel","shippingOption","address","fbaWarehouseCode","fbaShipmentId","boxes","boxCount","totalWeightG","chargeableG","currency","freightCents","fees","receivableCents","paidCents","dueCents","paymentInstructions","trackingNos","shippedAt","confirmedAt","canConfirm","canCancel","version","feedback","feedbackAt"],"additionalProperties":false}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"type":"object","required":["success","error","code"],"properties":{"success":{"const":false},"error":{"type":"string"},"code":{"type":"string"},"details":{"type":"array","items":{"type":"object"}}}}}}}}}},"/v1/shipments/{id}/confirm":{"post":{"operationId":"confirmShipment","summary":"Confirm a shipment's freight quote","description":"Confirms the shipment as you saw it, like the Confirm button in the portal. Only shipments with status PENDING_CONFIRMATION can be confirmed (otherwise 409 shipment_not_decidable). Confirming a shipment doesn't charge your wallet. It creates an amount due that you pay separately.","security":[{"bearerAuth":[]}],"x-required-scope":"shipments:write","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":1,"maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"version":{"type":"string","minLength":1,"description":"The shipment's version from GET /v1/shipments/{id}. If the shipment changed since, you get 409 shipment_changed: read it again and confirm the new version"}},"required":["version"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"const":true},"data":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"string"},"kind":{"type":"string","enum":["WHOLESALE","FBA"]},"kindLabel":{"type":"string"},"status":{"type":"string","enum":["DRAFT","PENDING_CONFIRMATION","AWAITING_PAYMENT","PAID","SHIPPED","CANCELLED"]},"statusLabel":{"type":"string"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"submittedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"requestedByCustomer":{"type":"boolean"},"lines":{"type":"array","items":{"type":"object","properties":{"sku":{"type":"string"},"name":{"type":"string"},"qty":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["sku","name","qty"],"additionalProperties":false}},"transportLabel":{"type":"string"},"shippingOption":{"type":["string","null"]},"address":{"type":"object","properties":{"recipientName":{"type":"string"},"recipientPhone":{"type":"string"},"address1":{"type":"string"},"address2":{"type":"string"},"city":{"type":"string"},"province":{"type":"string"},"postalCode":{"type":"string"},"countryCode":{"type":["string","null"]}},"required":["recipientName","recipientPhone","address1","address2","city","province","postalCode","countryCode"],"additionalProperties":false},"fbaWarehouseCode":{"type":"string"},"fbaShipmentId":{"type":"string"},"boxes":{"type":"array","items":{"type":"object","properties":{"boxNo":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"weightG":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"lengthCm":{"type":"number"},"widthCm":{"type":"number"},"heightCm":{"type":"number"},"lines":{"type":"array","items":{"type":"object","properties":{"sku":{"type":"string"},"name":{"type":"string"},"qty":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["sku","name","qty"],"additionalProperties":false}}},"required":["boxNo","weightG","lengthCm","widthCm","heightCm","lines"],"additionalProperties":false}},"boxCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"totalWeightG":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"chargeableG":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"currency":{"type":"string","const":"USD"},"freightCents":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"fees":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"description":{"type":"string"},"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["label","description","amountCents"],"additionalProperties":false}},"receivableCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"paidCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"dueCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"paymentInstructions":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"instructions":{"type":"string"}},"required":["name","instructions"],"additionalProperties":false},"description":"How to pay; empty when nothing is due"},"trackingNos":{"type":"array","items":{"type":"string"}},"shippedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"confirmedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"canConfirm":{"type":"boolean"},"canCancel":{"type":"boolean"},"version":{"type":"string","description":"Send this back when you confirm the shipment"},"feedback":{"type":"string"},"feedbackAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]}},"required":["id","number","kind","kindLabel","status","statusLabel","createdAt","submittedAt","requestedByCustomer","lines","transportLabel","shippingOption","address","fbaWarehouseCode","fbaShipmentId","boxes","boxCount","totalWeightG","chargeableG","currency","freightCents","fees","receivableCents","paidCents","dueCents","paymentInstructions","trackingNos","shippedAt","confirmedAt","canConfirm","canCancel","version","feedback","feedbackAt"],"additionalProperties":false}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"type":"object","required":["success","error","code"],"properties":{"success":{"const":false},"error":{"type":"string"},"code":{"type":"string"},"details":{"type":"array","items":{"type":"object"}}}}}}}}}},"/v1/requests":{"get":{"operationId":"listRequests","summary":"List sourcing and reorder requests","description":"Newest first.","security":[{"bearerAuth":[]}],"x-required-scope":"requests:read","parameters":[{"name":"page","in":"query","required":false,"schema":{"default":1,"type":"integer","minimum":1,"maximum":10000}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data","meta"],"properties":{"success":{"const":true},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"string"},"kind":{"type":"string","enum":["SOURCING","REORDER"]},"kindLabel":{"type":"string"},"status":{"type":"string","enum":["SUBMITTED","IN_PROGRESS","QUOTED","DONE","CANCELLED"]},"statusLabel":{"type":"string"},"itemCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","number","kind","kindLabel","status","statusLabel","itemCount","createdAt","updatedAt"],"additionalProperties":false}},"meta":{"type":"object","required":["total","page","limit","pageCount"],"properties":{"total":{"type":"integer","minimum":0},"page":{"type":"integer","minimum":1},"limit":{"type":"integer","minimum":1},"pageCount":{"type":"integer","minimum":1}}}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"type":"object","required":["success","error","code"],"properties":{"success":{"const":false},"error":{"type":"string"},"code":{"type":"string"},"details":{"type":"array","items":{"type":"object"}}}}}}}}}},"/v1/requests/{id}":{"get":{"operationId":"getRequest","summary":"Get a sourcing or reorder request","security":[{"bearerAuth":[]}],"x-required-scope":"requests:read","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"const":true},"data":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"string"},"kind":{"type":"string","enum":["SOURCING","REORDER"]},"kindLabel":{"type":"string"},"status":{"type":"string","enum":["SUBMITTED","IN_PROGRESS","QUOTED","DONE","CANCELLED"]},"statusLabel":{"type":"string"},"itemCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"purpose":{"type":"string","enum":["DROPSHIP_STOCK","SHIP_TO_ME","AMAZON_FBA"]},"purposeLabel":{"type":"string"},"countryCode":{"type":["string","null"]},"neededBy":{"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"null"}]},"note":{"type":"string"},"staffReply":{"type":"string"},"cancelReason":{"type":"string"},"cancelledByCustomer":{"type":"boolean"},"canCancel":{"type":"boolean"},"quoteId":{"type":["string","null"]},"quoteNumber":{"type":["string","null"]},"purchaseOrderId":{"type":["string","null"]},"purchaseOrderNumber":{"type":["string","null"]},"currency":{"type":"string","const":"USD"},"totalCents":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"Reorders only: agreed price times quantity"},"items":{"type":"array","items":{"type":"object","properties":{"title":{"type":"string"},"productUrl":{"type":"string"},"specs":{"type":"string"},"qty":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"targetPriceCents":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"sku":{"type":"string"},"agreedPriceCents":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["title","productUrl","specs","qty","targetPriceCents","sku","agreedPriceCents"],"additionalProperties":false}}},"required":["id","number","kind","kindLabel","status","statusLabel","itemCount","createdAt","updatedAt","purpose","purposeLabel","countryCode","neededBy","note","staffReply","cancelReason","cancelledByCustomer","canCancel","quoteId","quoteNumber","purchaseOrderId","purchaseOrderNumber","currency","totalCents","items"],"additionalProperties":false}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"type":"object","required":["success","error","code"],"properties":{"success":{"const":false},"error":{"type":"string"},"code":{"type":"string"},"details":{"type":"array","items":{"type":"object"}}}}}}}}}},"/v1/requests/sourcing":{"post":{"operationId":"createSourcingRequest","summary":"Ask us to source new products","description":"Submits a sourcing request like the portal's New request form. Give a product link for each product (the API can't upload images). We reply with a quote: follow it with GET /v1/requests/{id}. Send an Idempotency-Key so a retry can't submit it twice.","security":[{"bearerAuth":[]}],"x-required-scope":"requests:write","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"countryCode":{"type":"string","pattern":"^[A-Z]{2}$","description":"Destination country, two-letter code such as US"},"purpose":{"type":"string","enum":["DROPSHIP_STOCK","SHIP_TO_ME","AMAZON_FBA"],"description":"What the goods are for: DROPSHIP_STOCK, SHIP_TO_ME, AMAZON_FBA"},"neededBy":{"default":null,"description":"When you need the goods, YYYY-MM-DD; null if there is no date","type":["string","null"]},"note":{"default":"","type":"string","maxLength":1000},"items":{"minItems":1,"maxItems":20,"type":"array","items":{"type":"object","properties":{"productUrl":{"type":"string","maxLength":1000,"description":"Link to the product you want, starting with http:// or https://"},"title":{"type":"string","minLength":1,"maxLength":200},"specs":{"default":"","description":"Size, colour, material and other details","type":"string","maxLength":1000},"sourceCustomerSku":{"default":"","type":"string","maxLength":100},"qty":{"type":"integer","minimum":1,"maximum":1000000},"targetPriceCents":{"default":null,"description":"Target unit price in US cents; null if you have none","anyOf":[{"type":"integer","minimum":0,"maximum":999999999},{"type":"null"}]}},"required":["productUrl","title","qty"]}}},"required":["countryCode","purpose","items"]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"const":true},"data":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"string"},"kind":{"type":"string","enum":["SOURCING","REORDER"]},"kindLabel":{"type":"string"},"status":{"type":"string","enum":["SUBMITTED","IN_PROGRESS","QUOTED","DONE","CANCELLED"]},"statusLabel":{"type":"string"},"itemCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"purpose":{"type":"string","enum":["DROPSHIP_STOCK","SHIP_TO_ME","AMAZON_FBA"]},"purposeLabel":{"type":"string"},"countryCode":{"type":["string","null"]},"neededBy":{"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"null"}]},"note":{"type":"string"},"staffReply":{"type":"string"},"cancelReason":{"type":"string"},"cancelledByCustomer":{"type":"boolean"},"canCancel":{"type":"boolean"},"quoteId":{"type":["string","null"]},"quoteNumber":{"type":["string","null"]},"purchaseOrderId":{"type":["string","null"]},"purchaseOrderNumber":{"type":["string","null"]},"currency":{"type":"string","const":"USD"},"totalCents":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"Reorders only: agreed price times quantity"},"items":{"type":"array","items":{"type":"object","properties":{"title":{"type":"string"},"productUrl":{"type":"string"},"specs":{"type":"string"},"qty":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"targetPriceCents":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"sku":{"type":"string"},"agreedPriceCents":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["title","productUrl","specs","qty","targetPriceCents","sku","agreedPriceCents"],"additionalProperties":false}}},"required":["id","number","kind","kindLabel","status","statusLabel","itemCount","createdAt","updatedAt","purpose","purposeLabel","countryCode","neededBy","note","staffReply","cancelReason","cancelledByCustomer","canCancel","quoteId","quoteNumber","purchaseOrderId","purchaseOrderNumber","currency","totalCents","items"],"additionalProperties":false}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"type":"object","required":["success","error","code"],"properties":{"success":{"const":false},"error":{"type":"string"},"code":{"type":"string"},"details":{"type":"array","items":{"type":"object"}}}}}}}}}},"/v1/requests/reorder":{"post":{"operationId":"createReorderRequest","summary":"Ask us to restock products at your agreed prices","description":"Submits a reorder request like the portal's Reorder form. Only products with an agreed price can be reordered (canReorder in GET /v1/products); others return 422 product_not_reorderable. Send an Idempotency-Key so a retry can't submit it twice.","security":[{"bearerAuth":[]}],"x-required-scope":"requests:write","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":255}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"purpose":{"type":"string","enum":["DROPSHIP_STOCK","SHIP_TO_ME","AMAZON_FBA"],"description":"What the goods are for: DROPSHIP_STOCK, SHIP_TO_ME, AMAZON_FBA"},"note":{"default":"","type":"string","maxLength":1000},"items":{"minItems":1,"maxItems":20,"type":"array","items":{"type":"object","properties":{"productId":{"type":"string","minLength":1},"qty":{"type":"integer","minimum":1,"maximum":1000000}},"required":["productId","qty"]},"description":"Products you can reorder (canReorder in GET /v1/products), each once, with quantities"}},"required":["purpose","items"]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"const":true},"data":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"string"},"kind":{"type":"string","enum":["SOURCING","REORDER"]},"kindLabel":{"type":"string"},"status":{"type":"string","enum":["SUBMITTED","IN_PROGRESS","QUOTED","DONE","CANCELLED"]},"statusLabel":{"type":"string"},"itemCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"purpose":{"type":"string","enum":["DROPSHIP_STOCK","SHIP_TO_ME","AMAZON_FBA"]},"purposeLabel":{"type":"string"},"countryCode":{"type":["string","null"]},"neededBy":{"anyOf":[{"type":"string","format":"date","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"},{"type":"null"}]},"note":{"type":"string"},"staffReply":{"type":"string"},"cancelReason":{"type":"string"},"cancelledByCustomer":{"type":"boolean"},"canCancel":{"type":"boolean"},"quoteId":{"type":["string","null"]},"quoteNumber":{"type":["string","null"]},"purchaseOrderId":{"type":["string","null"]},"purchaseOrderNumber":{"type":["string","null"]},"currency":{"type":"string","const":"USD"},"totalCents":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"Reorders only: agreed price times quantity"},"items":{"type":"array","items":{"type":"object","properties":{"title":{"type":"string"},"productUrl":{"type":"string"},"specs":{"type":"string"},"qty":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"targetPriceCents":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"sku":{"type":"string"},"agreedPriceCents":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["title","productUrl","specs","qty","targetPriceCents","sku","agreedPriceCents"],"additionalProperties":false}}},"required":["id","number","kind","kindLabel","status","statusLabel","itemCount","createdAt","updatedAt","purpose","purposeLabel","countryCode","neededBy","note","staffReply","cancelReason","cancelledByCustomer","canCancel","quoteId","quoteNumber","purchaseOrderId","purchaseOrderNumber","currency","totalCents","items"],"additionalProperties":false}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"type":"object","required":["success","error","code"],"properties":{"success":{"const":false},"error":{"type":"string"},"code":{"type":"string"},"details":{"type":"array","items":{"type":"object"}}}}}}}}}},"/v1/quotes":{"get":{"operationId":"listQuotes","summary":"List quotes","description":"The version you can see of each quote number. Newest quote number first.","security":[{"bearerAuth":[]}],"x-required-scope":"quotes:read","parameters":[{"name":"page","in":"query","required":false,"schema":{"default":1,"type":"integer","minimum":1,"maximum":10000}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data","meta"],"properties":{"success":{"const":true},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"string"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"status":{"type":"string","enum":["AWAITING","UPDATING","SUPERSEDED","ACCEPTED","DECLINED","EXPIRED"]},"statusLabel":{"type":"string"},"issuedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"validUntil":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"itemCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"currency":{"type":"string","const":"USD"},"goodsCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","number","version","status","statusLabel","issuedAt","validUntil","itemCount","currency","goodsCents"],"additionalProperties":false}},"meta":{"type":"object","required":["total","page","limit","pageCount"],"properties":{"total":{"type":"integer","minimum":0},"page":{"type":"integer","minimum":1},"limit":{"type":"integer","minimum":1},"pageCount":{"type":"integer","minimum":1}}}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"type":"object","required":["success","error","code"],"properties":{"success":{"const":false},"error":{"type":"string"},"code":{"type":"string"},"details":{"type":"array","items":{"type":"object"}}}}}}}}}},"/v1/quotes/{id}":{"get":{"operationId":"getQuote","summary":"Get a quote","security":[{"bearerAuth":[]}],"x-required-scope":"quotes:read","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","required":["success","data"],"properties":{"success":{"const":true},"data":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"string"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"status":{"type":"string","enum":["AWAITING","UPDATING","SUPERSEDED","ACCEPTED","DECLINED","EXPIRED"]},"statusLabel":{"type":"string"},"canDecide":{"type":"boolean"},"issuedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"validUntil":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"decidedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"destinationCountryCode":{"type":"string"},"destination":{"type":"string"},"paymentMethodName":{"type":["string","null"]},"note":{"type":"string"},"customerFeedback":{"type":"string"},"currency":{"type":"string","const":"USD"},"items":{"type":"array","items":{"type":"object","properties":{"sku":{"type":"string"},"name":{"type":"string"},"attributes":{"type":"string"},"customerSku":{"type":"string"},"qty":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unitPriceCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"amountCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["sku","name","attributes","customerSku","qty","unitPriceCents","amountCents"],"additionalProperties":false}},"goodsCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"shippingOptions":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"transitDays":{"type":"string"},"shippingCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"totalCents":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"shippingMaxCents":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"Upper bound when shipping depends on the postcode; otherwise null"},"totalMaxCents":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["label","transitDays","shippingCents","totalCents","shippingMaxCents","totalMaxCents"],"additionalProperties":false}},"newerVersionId":{"description":"Set when a newer version replaced this one","type":["string","null"]}},"required":["id","number","version","status","statusLabel","canDecide","issuedAt","validUntil","decidedAt","destinationCountryCode","destination","paymentMethodName","note","customerFeedback","currency","items","goodsCents","shippingOptions","newerVersionId"],"additionalProperties":false}}}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"type":"object","required":["success","error","code"],"properties":{"success":{"const":false},"error":{"type":"string"},"code":{"type":"string"},"details":{"type":"array","items":{"type":"object"}}}}}}}}}}},"webhooks":{"order.status_changed":{"post":{"summary":"Order status changed","description":"An order was created or its status changed, for example to RESERVED, WEIGHED, SHIPPED or CANCELLED.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Event id. Retries and every endpoint get the same id; use it to skip duplicates"},"type":{"type":"string","const":"order.status_changed"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"When the change happened (ISO 8601, UTC)"},"data":{"type":"object","properties":{"id":{"type":"string","description":"Order id. Fetch it with GET /v1/orders/{id}"},"status":{"type":"string","enum":["NEEDS_ATTENTION","READY","BACKORDERED","RESERVED","WEIGHED","SHIPPED","CANCELLED"],"description":"The status after the change (uppercase code)"}},"required":["id","status"],"additionalProperties":false}},"required":["id","type","createdAt","data"],"additionalProperties":false}}}},"responses":{"200":{"description":"Any 2xx status acknowledges the event. Other statuses, redirects, timeouts (10 seconds) and responses over 64 KB count as failures and are retried."}}}},"order.awaiting_payment":{"post":{"summary":"Order needs payment to ship","description":"Your available balance didn't cover the shipping and handling fee when the parcel was weighed. The order waits for a top-up; GET the order for the amount due.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Event id. Retries and every endpoint get the same id; use it to skip duplicates"},"type":{"type":"string","const":"order.awaiting_payment"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"When the change happened (ISO 8601, UTC)"},"data":{"type":"object","properties":{"id":{"type":"string","description":"Order id. GET /v1/orders/{id} shows the amount due"},"status":{"type":"string","enum":["NEEDS_ATTENTION","READY","BACKORDERED","RESERVED","WEIGHED","SHIPPED","CANCELLED"],"description":"The status after the change (uppercase code)"}},"required":["id","status"],"additionalProperties":false}},"required":["id","type","createdAt","data"],"additionalProperties":false}}}},"responses":{"200":{"description":"Any 2xx status acknowledges the event. Other statuses, redirects, timeouts (10 seconds) and responses over 64 KB count as failures and are retried."}}}},"purchase_order.status_changed":{"post":{"summary":"Purchase order status changed","description":"A purchase order was created or its status changed.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Event id. Retries and every endpoint get the same id; use it to skip duplicates"},"type":{"type":"string","const":"purchase_order.status_changed"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"When the change happened (ISO 8601, UTC)"},"data":{"type":"object","properties":{"id":{"type":"string","description":"Purchase order id. Fetch it with GET /v1/purchase-orders/{id}"},"status":{"type":"string","enum":["AWAITING_PAYMENT","DEPOSIT_PAID","PAID","PURCHASING","ORDERED","IN_TRANSIT","PARTIALLY_ARRIVED","ARRIVED","STORED","COMPLETED","CANCELLED"],"description":"The status after the change (uppercase code)"}},"required":["id","status"],"additionalProperties":false}},"required":["id","type","createdAt","data"],"additionalProperties":false}}}},"responses":{"200":{"description":"Any 2xx status acknowledges the event. Other statuses, redirects, timeouts (10 seconds) and responses over 64 KB count as failures and are retried."}}}},"shipment.status_changed":{"post":{"summary":"Shipment status changed","description":"A shipment was created by you in the portal, sent to you for confirmation, or changed status.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Event id. Retries and every endpoint get the same id; use it to skip duplicates"},"type":{"type":"string","const":"shipment.status_changed"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"When the change happened (ISO 8601, UTC)"},"data":{"type":"object","properties":{"id":{"type":"string","description":"Shipment id. Fetch it with GET /v1/shipments/{id}"},"status":{"type":"string","enum":["DRAFT","PENDING_CONFIRMATION","AWAITING_PAYMENT","PAID","SHIPPED","CANCELLED"],"description":"The status after the change (uppercase code)"}},"required":["id","status"],"additionalProperties":false}},"required":["id","type","createdAt","data"],"additionalProperties":false}}}},"responses":{"200":{"description":"Any 2xx status acknowledges the event. Other statuses, redirects, timeouts (10 seconds) and responses over 64 KB count as failures and are retried."}}}},"shipment.tracking_updated":{"post":{"summary":"Shipment tracking numbers added","description":"Tracking numbers were added to a shipment. GET the shipment to read them.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Event id. Retries and every endpoint get the same id; use it to skip duplicates"},"type":{"type":"string","const":"shipment.tracking_updated"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"When the change happened (ISO 8601, UTC)"},"data":{"type":"object","properties":{"id":{"type":"string","description":"Shipment id. GET /v1/shipments/{id} lists the tracking numbers"},"status":{"type":"string","enum":["DRAFT","PENDING_CONFIRMATION","AWAITING_PAYMENT","PAID","SHIPPED","CANCELLED"],"description":"The status after the change (uppercase code)"}},"required":["id","status"],"additionalProperties":false}},"required":["id","type","createdAt","data"],"additionalProperties":false}}}},"responses":{"200":{"description":"Any 2xx status acknowledges the event. Other statuses, redirects, timeouts (10 seconds) and responses over 64 KB count as failures and are retried."}}}},"quote.created":{"post":{"summary":"New quote ready","description":"We sent you a quote. A new version of a quote has a new id.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Event id. Retries and every endpoint get the same id; use it to skip duplicates"},"type":{"type":"string","const":"quote.created"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"When the change happened (ISO 8601, UTC)"},"data":{"type":"object","properties":{"id":{"type":"string","description":"Quote id. Fetch it with GET /v1/quotes/{id}"},"status":{"type":"string","enum":["AWAITING","UPDATING","SUPERSEDED","ACCEPTED","DECLINED","EXPIRED"],"description":"The status after the change (uppercase code)"}},"required":["id","status"],"additionalProperties":false}},"required":["id","type","createdAt","data"],"additionalProperties":false}}}},"responses":{"200":{"description":"Any 2xx status acknowledges the event. Other statuses, redirects, timeouts (10 seconds) and responses over 64 KB count as failures and are retried."}}}},"wallet.top_up_approved":{"post":{"summary":"Top-up approved","description":"A top-up was approved and credited to your wallet.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Event id. Retries and every endpoint get the same id; use it to skip duplicates"},"type":{"type":"string","const":"wallet.top_up_approved"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"When the change happened (ISO 8601, UTC)"},"data":{"type":"object","properties":{"id":{"type":"string","description":"Top-up id, as listed by GET /v1/wallet/top-ups"},"status":{"type":"string","enum":["PENDING","CONFIRMED","REJECTED","VOIDED"],"description":"The status after the change (uppercase code)"}},"required":["id","status"],"additionalProperties":false}},"required":["id","type","createdAt","data"],"additionalProperties":false}}}},"responses":{"200":{"description":"Any 2xx status acknowledges the event. Other statuses, redirects, timeouts (10 seconds) and responses over 64 KB count as failures and are retried."}}}},"webhook.test":{"post":{"summary":"Test event","description":"Sent when you click Send test event in the portal. Not retried.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Event id. Retries and every endpoint get the same id; use it to skip duplicates"},"type":{"type":"string","const":"webhook.test"},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"When the change happened (ISO 8601, UTC)"},"data":{"type":"object","properties":{"id":{"type":"string","description":"The id of the endpoint the test was sent to"},"status":{"type":"string","enum":["TEST"],"description":"The status after the change (uppercase code)"}},"required":["id","status"],"additionalProperties":false}},"required":["id","type","createdAt","data"],"additionalProperties":false}}}},"responses":{"200":{"description":"Any 2xx status acknowledges the event. Other statuses, redirects, timeouts (10 seconds) and responses over 64 KB count as failures and are retried."}}}}}}