{"openapi":"3.1.0","info":{"title":"Zobrx API","version":"1.0.0-preview","description":"Public REST API for sellers and their ERP systems. **Preview** — endpoints roll out per module; Amazon Vendor Central is first. Authenticate with a per-tenant API key (Bearer `zbx_live_…`) generated in app.zobrx.com → Settings → Developers."},"servers":[{"url":"https://app.zobrx.com/api/v1","description":"Production"}],"security":[{"apiKey":[]}],"paths":{"/me":{"get":{"summary":"Identify the calling key","description":"Returns the tenant, key name and scopes for the presented API key. Use to verify a key works.","operationId":"getMe","responses":{"200":{"description":"Key identity.","content":{"application/json":{"schema":{"type":"object","properties":{"tenantId":{"type":"string"},"keyId":{"type":"string"},"keyName":{"type":"string"},"scopes":{"type":"array","items":{"type":"string"}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/vendor/purchase-orders":{"get":{"tags":["Vendor — Purchase Orders"],"summary":"List purchase orders","description":"POs Zobrx ingests from Amazon Vendor Central, newest first. Poll incrementally with `changedSince`. Requires scope `vendor:pos:read`.","operationId":"listPurchaseOrders","parameters":[{"$ref":"#/components/parameters/IntegrationId"},{"name":"ackState","in":"query","schema":{"type":"string","enum":["pending","partially-acknowledged","accepted","rejected","mixed"]}},{"name":"changedSince","in":"query","schema":{"type":"string","format":"date-time"}},{"name":"page","in":"query","schema":{"type":"integer","minimum":1,"default":1}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":200,"default":50}}],"responses":{"200":{"description":"A page of purchase orders.","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/PurchaseOrder"}},"total":{"type":"integer"},"page":{"type":"integer"},"limit":{"type":"integer"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/vendor/purchase-orders/{poNumber}":{"get":{"tags":["Vendor — Purchase Orders"],"summary":"Get a purchase order","operationId":"getPurchaseOrder","parameters":[{"$ref":"#/components/parameters/IntegrationId"},{"name":"poNumber","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The purchase order.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PurchaseOrder"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"description":"Not found."}}}},"/vendor/invoices":{"get":{"tags":["Vendor — Invoices"],"summary":"List invoices","description":"Track invoice status (any source) incl. the Amazon submission result. Scope `vendor:invoices:read`.","operationId":"listInvoices","parameters":[{"$ref":"#/components/parameters/IntegrationId"},{"name":"intakeStatus","in":"query","schema":{"type":"string","enum":["received","mapped","validated","submitted","failed","rejected"]}},{"name":"poNumber","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Invoices.","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Invoice"}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"}}},"post":{"tags":["Vendor — Invoices"],"summary":"Push an invoice","description":"Submit an ERP-generated invoice. Zobrx maps it to the PO, validates quantities, computes the GST tax split, and submits to Amazon. Idempotent on `externalInvoiceId` (and the `Idempotency-Key` header). Scope `vendor:invoices:write`.","operationId":"pushInvoice","parameters":[{"$ref":"#/components/parameters/IntegrationId"},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoiceIntake"}}}},"responses":{"200":{"description":"Replay (same externalInvoiceId already ingested).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Invoice"}}}},"201":{"description":"Created + submitted.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Invoice"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"422":{"description":"Validation/precondition failed (unmapped SKU, qty over accepted, missing ship-from GSTIN)."}}}},"/vendor/inventory":{"post":{"tags":["Vendor — Inventory"],"summary":"Sync inventory","description":"Push available stock per SKU. Drives auto-acknowledgement of pending POs per your account's mode (off/suggest/auto). Scope `vendor:inventory:write`.","operationId":"syncInventory","parameters":[{"$ref":"#/components/parameters/IntegrationId"},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["items"],"properties":{"items":{"type":"array","items":{"type":"object","required":["availableQty"],"properties":{"sku":{"type":"string","description":"Vendor SKU (or asin)."},"asin":{"type":"string"},"availableQty":{"type":"integer","minimum":0},"warehouseCode":{"type":"string"}}}}}}}}},"responses":{"200":{"description":"Upserted; includes the auto-ack result.","content":{"application/json":{"schema":{"type":"object","properties":{"upserted":{"type":"integer"},"autoAck":{"type":"object","nullable":true}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"}}}},"/ping":{"get":{"summary":"Liveness check","operationId":"ping","responses":{"200":{"description":"OK.","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"},"ts":{"type":"string","format":"date-time"}}}}}}}}},"/ecommerce/orders":{"get":{"tags":["Ecommerce — Orders"],"summary":"List orders","description":"Unified multi-channel order lines (Amazon, Flipkart, Meesho, Myntra, Snapdeal, JioMart, AJIO, Shopify, offline), newest first. Money is paise integers. Buyer PII (buyerName, shippingAddress) is null unless the key holds `ecommerce:pii:read`. Requires scope `ecommerce:orders:read`.\n\n**Date filters:** `orderSince`/`orderUntil` filter by **order date** (the response's `orderDate`); `invoiceSince`/`invoiceUntil` filter by **invoice date** (the response's `invoiceDate`). Orders without an invoice date are excluded when an invoice-date filter is set. `since`/`until` are accepted as aliases of `orderSince`/`orderUntil`.","operationId":"listOrders","parameters":[{"name":"orderSince","in":"query","schema":{"type":"string","format":"date-time"},"description":"Order date ≥ (ISO 8601, inclusive). Filters on the response's orderDate. Alias: since."},{"name":"orderUntil","in":"query","schema":{"type":"string","format":"date-time"},"description":"Order date ≤ (ISO 8601, inclusive). Filters on the response's orderDate. Alias: until."},{"name":"invoiceSince","in":"query","schema":{"type":"string","format":"date-time"},"description":"Invoice date ≥ (ISO 8601, inclusive). Filters on the response's invoiceDate."},{"name":"invoiceUntil","in":"query","schema":{"type":"string","format":"date-time"},"description":"Invoice date ≤ (ISO 8601, inclusive). Filters on the response's invoiceDate."},{"$ref":"#/components/parameters/Channels"},{"$ref":"#/components/parameters/StoreIds"},{"name":"attributionState","in":"query","schema":{"type":"string"},"description":"CSV of pending-delivery|shipped|delivered|returned|cancelled|prepaid-paid."},{"name":"settlement","in":"query","schema":{"type":"string","enum":["paid","unpaid"]}},{"name":"search","in":"query","schema":{"type":"string"}},{"$ref":"#/components/parameters/Limit"},{"$ref":"#/components/parameters/Offset"}],"responses":{"200":{"description":"A page of orders.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderList"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"}}}},"/ecommerce/orders/{channel}/{lineItemId}":{"get":{"tags":["Ecommerce — Orders"],"summary":"Get one order line","description":"One order line + its linked return (if any). Requires scope `ecommerce:orders:read`.","operationId":"getOrder","parameters":[{"name":"channel","in":"path","required":true,"schema":{"type":"string"}},{"name":"lineItemId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Order detail.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderDetail"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/ecommerce/returns":{"get":{"tags":["Ecommerce — Returns"],"summary":"List returns","description":"Unified multi-channel returns with claim-eligibility + reimbursement tracking. Money is paise integers. Buyer PII redacted unless the key holds `ecommerce:pii:read`. Requires scope `ecommerce:returns:read`.","operationId":"listReturns","parameters":[{"$ref":"#/components/parameters/Since"},{"$ref":"#/components/parameters/Until"},{"name":"dateType","in":"query","schema":{"type":"string","enum":["order","return"],"default":"return"}},{"$ref":"#/components/parameters/Channels"},{"$ref":"#/components/parameters/StoreIds"},{"name":"bucket","in":"query","schema":{"type":"string"},"description":"CSV of customer-return|rto|buyer-cancellation|courier-return|non-merchantable|unknown."},{"name":"received","in":"query","schema":{"type":"string","enum":["true","false"]}},{"name":"search","in":"query","schema":{"type":"string"}},{"$ref":"#/components/parameters/Limit"},{"$ref":"#/components/parameters/Offset"}],"responses":{"200":{"description":"A page of returns.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReturnList"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"}}}},"/ecommerce/settlements":{"get":{"tags":["Ecommerce — Money"],"summary":"List settlements","description":"Per-cycle settlement summaries across channels (gross, fees, tax withheld, net settled, variance). Money is paise integers. Requires scope `ecommerce:money:read`.","operationId":"listSettlements","parameters":[{"$ref":"#/components/parameters/Since"},{"$ref":"#/components/parameters/Until"},{"$ref":"#/components/parameters/Channels"},{"$ref":"#/components/parameters/StoreIds"},{"$ref":"#/components/parameters/Limit"},{"$ref":"#/components/parameters/Offset"}],"responses":{"200":{"description":"A page of settlements.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SettlementList"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"}}}},"/ecommerce/settlements/{channel}/{settlementId}":{"get":{"tags":["Ecommerce — Money"],"summary":"Get settlement detail","description":"Line-level breakdown for one settlement cycle. Pass `storeId` when the id is synthetic (Meesho/Myntra weekly buckets). Requires scope `ecommerce:money:read`.","operationId":"getSettlement","parameters":[{"name":"channel","in":"path","required":true,"schema":{"type":"string"}},{"name":"settlementId","in":"path","required":true,"schema":{"type":"string"}},{"name":"storeId","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Settlement detail.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/ecommerce/reimbursements":{"get":{"tags":["Ecommerce — Money"],"summary":"List reimbursements","description":"Amazon FBA reimbursements bucketed by reason (warehouse-lost, warehouse-damaged, fulfillment-error, …). Money is paise integers. Requires scope `ecommerce:money:read`.","operationId":"listReimbursements","parameters":[{"$ref":"#/components/parameters/Since"},{"$ref":"#/components/parameters/Until"},{"name":"reason","in":"query","schema":{"type":"string"}},{"name":"search","in":"query","schema":{"type":"string"}},{"$ref":"#/components/parameters/StoreIds"},{"$ref":"#/components/parameters/Limit"},{"$ref":"#/components/parameters/Offset"}],"responses":{"200":{"description":"A page of reimbursements.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"}}}},"/ecommerce/tax/commission-invoices":{"get":{"tags":["Ecommerce — Tax"],"summary":"List commission (marketplace fee) tax invoices","description":"Marketplace commission GST invoices with per-channel + total tax splits (IGST/CGST/SGST). Money is paise integers. Requires scope `ecommerce:tax:read`.","operationId":"listCommissionInvoices","parameters":[{"name":"period","in":"query","schema":{"type":"string","enum":["mtd","last-month","qtd","ytd"],"default":"mtd"}},{"$ref":"#/components/parameters/Since"},{"$ref":"#/components/parameters/Until"},{"$ref":"#/components/parameters/Channels"}],"responses":{"200":{"description":"Commission invoices with totals + per-channel rollup.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"}}}},"/ecommerce/tax/commission-invoices/{invoiceId}":{"get":{"tags":["Ecommerce — Tax"],"summary":"Get one commission invoice","description":"Full invoice with vendor/buyer blocks + line items (SAC/HSN, tax breakdown). Requires scope `ecommerce:tax:read`.","operationId":"getCommissionInvoice","parameters":[{"name":"invoiceId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Invoice detail.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/ecommerce/inventory/products":{"get":{"tags":["Ecommerce — Inventory"],"summary":"List products (Zobrx's inventory rollup)","description":"Zobrx's unified per-master inventory rollup across channels + warehouses. Requires scope `ecommerce:inventory:read`.","operationId":"listInventoryProducts","parameters":[{"name":"search","in":"query","schema":{"type":"string"}},{"name":"healthState","in":"query","schema":{"type":"string"},"description":"CSV of healthy|low|alert|stockout|unknown."},{"$ref":"#/components/parameters/Channels"},{"$ref":"#/components/parameters/StoreIds"},{"$ref":"#/components/parameters/Limit"},{"$ref":"#/components/parameters/Offset"}],"responses":{"200":{"description":"A page of products.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"}}},"post":{"tags":["Ecommerce — Inventory"],"summary":"Push products + stock FROM your ERP","description":"Inbound: your ERP pushes its catalog + stock to Zobrx. Idempotent per SKU and via the `Idempotency-Key` header. Requires scope `ecommerce:inventory:write`.","operationId":"pushInventoryProducts","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErpProductPush"}}}},"responses":{"201":{"description":"Ingest result.","content":{"application/json":{"schema":{"type":"object","properties":{"upserted":{"type":"integer"},"linked":{"type":"integer"},"skipped":{"type":"integer"}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"}}}},"/ecommerce/inventory/product-feed":{"get":{"tags":["Ecommerce — Inventory"],"summary":"Get the ERP product pull-feed config","description":"The registered feed URL Zobrx polls for your products/stock (the pull direction). Requires scope `ecommerce:inventory:read`.","operationId":"getProductFeed","responses":{"200":{"description":"Feed config (or null).","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthorized"}}},"put":{"tags":["Ecommerce — Inventory"],"summary":"Register/update the ERP product pull-feed","description":"Register the feed URL Zobrx polls on a schedule for your products/stock. The ERP implements: `GET <feedUrl>?since=<cursor> → { products: [...], cursor }`. Requires scope `ecommerce:inventory:write`.","operationId":"putProductFeed","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErpProductFeedConfig"}}}},"responses":{"200":{"description":"Saved feed config.","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"}}}}},"components":{"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","bearerFormat":"API key (zbx_live_…)","description":"Per-tenant API key from app.zobrx.com → Settings → Developers."}},"parameters":{"IntegrationId":{"name":"X-Zobrx-Integration-Id","in":"header","required":false,"description":"Selects which connected Vendor Central account to act on (its integration id OR Amazon vendor id). Optional when only one is connected.","schema":{"type":"string"}},"Since":{"name":"since","in":"query","required":false,"description":"ISO-8601 lower bound (inclusive) on the window.","schema":{"type":"string","format":"date-time"}},"Until":{"name":"until","in":"query","required":false,"description":"ISO-8601 upper bound (inclusive) on the window.","schema":{"type":"string","format":"date-time"}},"Channels":{"name":"channels","in":"query","required":false,"description":"CSV of channel codes (amazon,flipkart,meesho,myntra,snapdeal,jiomart,ajio,shopify,offline). Omit for all.","schema":{"type":"string"}},"StoreIds":{"name":"storeIds","in":"query","required":false,"description":"CSV of store ids to scope to (overrides channels).","schema":{"type":"string"}},"Limit":{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":200,"default":50}},"Offset":{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0}}},"schemas":{"Money":{"type":"object","description":"Integer minor units (paise) + currency.","properties":{"minor":{"type":"integer"},"currency":{"type":"string"}}},"ListPagination":{"type":"object","properties":{"total":{"type":"integer"},"limit":{"type":"integer"},"offset":{"type":"integer"},"hasMore":{"type":"boolean"}}},"UnifiedOrder":{"type":"object","description":"One order line, normalised across channels. Every *Minor field is paise (integer). buyerName + shippingAddress are null unless the key holds ecommerce:pii:read. The full field set matches the app's unified order contract; key fields shown.","properties":{"orderId":{"type":"string","nullable":true},"lineItemId":{"type":"string"},"channelCode":{"type":"string"},"storeId":{"type":"string"},"sku":{"type":"string"},"marketplaceListingId":{"type":"string","nullable":true},"productName":{"type":"string"},"qty":{"type":"integer"},"sellingPriceMinor":{"type":"integer","nullable":true},"itemTaxMinor":{"type":"integer","nullable":true},"netSettledPaymentMinor":{"type":"integer","nullable":true},"feeMinor":{"type":"integer","nullable":true},"currencyCode":{"type":"string","nullable":true},"attributionState":{"type":"string"},"paymentType":{"type":"string","nullable":true},"awbNumber":{"type":"string","nullable":true},"courierPartner":{"type":"string","nullable":true},"orderDate":{"type":"string","format":"date-time","description":"When the order was placed (ISO 8601)."},"invoiceDate":{"type":"string","format":"date-time","nullable":true,"description":"Tax-invoice date (ISO 8601), from the channel's GST/invoice data. null until the order is invoice-enriched."},"deliveredOn":{"type":"string","format":"date-time","nullable":true},"customerState":{"type":"string","nullable":true},"customerPincode":{"type":"string","nullable":true},"buyerName":{"type":"string","nullable":true},"shippingAddress":{"type":"object","nullable":true,"additionalProperties":true},"channelSpecific":{"type":"object","additionalProperties":true}}},"OrderList":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/UnifiedOrder"}},"pagination":{"$ref":"#/components/schemas/ListPagination"},"perChannelCount":{"type":"object","additionalProperties":{"type":"integer"}}}},"OrderDetail":{"type":"object","properties":{"order":{"$ref":"#/components/schemas/UnifiedOrder"},"linkedReturn":{"$ref":"#/components/schemas/UnifiedReturn","nullable":true}}},"UnifiedReturn":{"type":"object","description":"One return, normalised across channels. *Minor fields are paise. Includes claim-eligibility + reimbursement tracking. Key fields shown.","properties":{"returnId":{"type":"string"},"orderId":{"type":"string","nullable":true},"lineItemId":{"type":"string"},"channelCode":{"type":"string"},"storeId":{"type":"string"},"sku":{"type":"string"},"productName":{"type":"string"},"qty":{"type":"integer"},"refundAmountMinor":{"type":"integer","nullable":true},"feeReversedMinor":{"type":"integer","nullable":true},"reimbursementReceivedMinor":{"type":"integer","nullable":true},"state":{"type":"string"},"bucket":{"type":"string"},"returnReason":{"type":"string","nullable":true},"claim":{"type":"object","additionalProperties":true},"returnInitiatedOn":{"type":"string","format":"date-time","nullable":true},"received":{"type":"boolean"},"channelSpecific":{"type":"object","additionalProperties":true}}},"ReturnList":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/UnifiedReturn"}},"pagination":{"$ref":"#/components/schemas/ListPagination"},"perChannelCount":{"type":"object","additionalProperties":{"type":"integer"}}}},"UnifiedSettlement":{"type":"object","description":"One settlement cycle, normalised across channels. All *Minor fields are paise.","properties":{"settlementId":{"type":"string"},"channelCode":{"type":"string"},"storeId":{"type":"string"},"periodStart":{"type":"string","format":"date-time"},"periodEnd":{"type":"string","format":"date-time"},"paidOn":{"type":"string","format":"date-time","nullable":true},"utr":{"type":"string","nullable":true},"state":{"type":"string"},"grossSalesMinor":{"type":"integer"},"returnsMinor":{"type":"integer"},"feesMinor":{"type":"integer"},"taxWithheldMinor":{"type":"integer"},"adjustmentsMinor":{"type":"integer"},"netSettledMinor":{"type":"integer"},"varianceMinor":{"type":"integer","nullable":true},"currencyCode":{"type":"string"}}},"SettlementList":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/UnifiedSettlement"}},"pagination":{"$ref":"#/components/schemas/ListPagination"},"perChannelCount":{"type":"object","additionalProperties":{"type":"integer"}}}},"ErpProductPush":{"type":"object","required":["products"],"description":"Inbound catalog + stock from your ERP. Prices in paise. Idempotent per SKU.","properties":{"products":{"type":"array","minItems":1,"maxItems":5000,"items":{"type":"object","required":["sku"],"properties":{"sku":{"type":"string"},"name":{"type":"string","nullable":true},"hsnCode":{"type":"string","nullable":true},"brand":{"type":"string","nullable":true},"mrpMinor":{"type":"integer","nullable":true},"costMinor":{"type":"integer","nullable":true},"stock":{"type":"array","items":{"type":"object","required":["warehouseCode","availableQty"],"properties":{"warehouseCode":{"type":"string"},"availableQty":{"type":"integer"}}}}}}}}},"ErpProductFeedConfig":{"type":"object","required":["feedUrl"],"description":"Registers the URL Zobrx polls for your products/stock (the pull direction).","properties":{"feedUrl":{"type":"string","format":"uri"},"authHeaderName":{"type":"string","nullable":true},"authHeaderValue":{"type":"string","nullable":true,"description":"Write-only; never returned."},"pollIntervalMinutes":{"type":"integer","minimum":5,"maximum":1440,"default":60},"active":{"type":"boolean","default":true}}},"PurchaseOrderLine":{"type":"object","properties":{"itemSequenceNumber":{"type":"integer"},"vendorSku":{"type":"string","nullable":true},"asin":{"type":"string","nullable":true},"title":{"type":"string","nullable":true},"orderedQuantity":{"type":"integer"},"acknowledgedQuantity":{"type":"integer"},"invoicedQuantity":{"type":"integer"},"shippedQuantity":{"type":"integer"},"netCost":{"$ref":"#/components/schemas/Money"}}},"PurchaseOrder":{"type":"object","properties":{"poNumber":{"type":"string"},"orderDate":{"type":"string","format":"date-time","nullable":true},"purchaseOrderState":{"type":"string","nullable":true},"ackState":{"type":"string","enum":["pending","partially-acknowledged","accepted","rejected","mixed"]},"invoiceState":{"type":"string","enum":["none","partial","invoiced","credited"]},"shipState":{"type":"string","enum":["none","partial","shipped"]},"buyingPartyKey":{"type":"string","nullable":true},"buyingPartyName":{"type":"string","nullable":true},"totalValue":{"$ref":"#/components/schemas/Money"},"itemCount":{"type":"integer"},"lines":{"type":"array","items":{"$ref":"#/components/schemas/PurchaseOrderLine"}}}},"InvoiceIntake":{"type":"object","required":["poNumber","externalInvoiceId","lines"],"properties":{"poNumber":{"type":"string","description":"The PO this invoice settles."},"externalInvoiceId":{"type":"string","description":"Your ERP's invoice number (dedupe key)."},"invoiceDate":{"type":"string","format":"date"},"lines":{"type":"array","items":{"type":"object","required":["quantity"],"properties":{"vendorSku":{"type":"string","description":"Vendor SKU (or use asin)."},"asin":{"type":"string"},"quantity":{"type":"integer","minimum":1}}}}}},"Invoice":{"type":"object","properties":{"invoiceId":{"type":"string"},"externalInvoiceId":{"type":"string","nullable":true},"poNumber":{"type":"string","nullable":true},"source":{"type":"string","enum":["zobrx-generated","erp-api","erp-pull","upload"]},"intakeStatus":{"type":"string","enum":["received","mapped","validated","submitted","failed","rejected"]},"status":{"type":"string","enum":["submitted","failed"]},"validationErrors":{"type":"array","items":{"type":"string"}},"invoiceTotal":{"$ref":"#/components/schemas/Money"},"amazonTransactionId":{"type":"string","nullable":true},"amazonProcessingStatus":{"type":"string","enum":["Processing","Success","Failure"],"nullable":true,"description":"Confirmed outcome from the Amazon Vendor Transaction Status API. null until polled (typically minutes after submit). Success = Amazon accepted; Failure = rejected (see amazonProcessingErrors)."},"amazonProcessingErrors":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string","nullable":true},"message":{"type":"string","nullable":true}}}},"submittedAt":{"type":"string","format":"date-time","nullable":true}}}},"responses":{"Unauthorized":{"description":"Missing/invalid API key.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"Forbidden":{"description":"The API key is missing the scope this endpoint requires.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"NotFound":{"description":"No such resource.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}},"BadRequest":{"description":"Invalid request body or parameters.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}}}}}}}}}}}