Openapi
Create a draft purchase order for a supplier. Sending and emailing it happens in the app.
sb-auth-token<token>Supabase browser session cookie. Supabase may split larger session values into chunked cookies like sb-auth-token.0.
organizationId*stringuuidThe supplier and variant lines.
application/jsoncurrency?string^[A-Z]{3}$exchangeRate?number0 < value <= 1000000expectedAt?|nulllines*array<>items <= 500notes*|length <= 4000shipToLocationId?|uuidsupplierId*stringuuidsupplierNotes*|length <= 4000supplierReference*|length <= 120templateId?|uuidReturns the draft purchase order.
application/jsoncanceledAt*string|nullclosedAt*string|nullcreatedAt*stringcreatedBy*|uuidcurrency*stringexchangeRate*numberexpectedAt*|nullformattedNumber*stringid*stringuuidlineCount*integernumber*integerreceivedAt*string|nullreceivedRatio*numbersentAt*string|nullshipToLocationId*|uuidshipToLocationName*string|nullstatus*purchaseOrderStatusSchema"draft""sent""partially_received""received""closed""canceled"subtotalExcl*numbersupplier*supplierReference*string|nulltemplateId*|uuidtotalIncl*numberupdatedAt*stringvatTotal*numberlines*array<>notes*string|nullsupplierNotes*string|nullcurl -X POST 'https://app.localhost/api/v1/organizations/123/purchase-orders' \ -H 'Content-Type: application/json' \ -d '{ "lines": [ { "quantityOrdered": 1, "supplierSku": "string", "title": "string", "unitCost": 0, "variantId": "d53feca7-c65b-4741-aca7-827a42d686bf", "vatRate": 0 } ], "notes": "string", "supplierId": "e01eb4c4-8eb9-4fb7-b625-61f58c6148db", "supplierNotes": "string", "supplierReference": "string"}'{ "canceledAt": "string", "closedAt": "string", "createdAt": "string", "createdBy": "25a02396-1048-48f9-bf93-102d2fb7895e", "currency": "string", "exchangeRate": 0, "expectedAt": "2019-08-24", "formattedNumber": "string", "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "lineCount": 0, "number": 0, "receivedAt": "string", "receivedRatio": 0, "sentAt": "string", "shipToLocationId": "17d01ddf-03d0-401e-8692-7b8be54e80b5", "shipToLocationName": "string", "status": "draft", "subtotalExcl": 0, "supplier": { "email": "string", "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "name": "string", "orderingEmail": "string" }, "supplierReference": "string", "templateId": "196100ac-4eec-4fb6-a7f7-86c8b584771d", "totalIncl": 0, "updatedAt": "string", "vatTotal": 0, "lines": [ { "expectedAt": "2019-08-24", "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "position": 0, "productId": "dcd53ddb-8104-4e48-8cc0-5df1088c6113", "productName": "string", "productSupplierLinkId": "21596cd8-f6bb-4540-85e0-ab9655b92639", "quantityCanceled": 0, "quantityOpen": 0, "quantityOrdered": 0, "quantityReceived": 0, "sku": "string", "supplierSku": "string", "title": "string", "unitCost": 0, "variantId": "d53feca7-c65b-4741-aca7-827a42d686bf", "variantTitle": "string", "vatRate": 0 } ], "notes": "string", "supplierNotes": "string"}