# Purchase

Purchase

## List purchase orders

> Lists all purchase orders.

```json
{"openapi":"3.0.2","info":{"title":"Flow Retail API version 2","version":"2.0.0"},"tags":[{"name":"Purchase","description":"Purchase"}],"servers":[{"description":"Flow Retail Production","url":"https://api.flowretail.com/v2"},{"description":"Flow Retail Stage","url":"https://api.stage.flowretail.com/v2"}],"security":[{"accessToken":[]},{"authToken":[]},{"integrationToken":[]}],"components":{"securitySchemes":{"accessToken":{"description":"Access token recevied after user login with a deviceToken","scheme":"bearer","type":"http"},"authToken":{"description":"Token received from the auth service","scheme":"bearer","type":"http"},"integrationToken":{"scheme":"bearer","type":"http"}},"parameters":{"purchaseOrderStatusQuery":{"description":"Reference to an PurchaseOrderStatus.","explode":false,"in":"query","name":"purchaseOrderStatus","schema":{"items":{"$ref":"#/components/schemas/PurchaseOrderStatusENUM"},"type":"array"},"style":"form"},"purchaseOrderExternalIdQuery":{"description":"External reference to a purchaseOrderUid.","in":"query","name":"purchaseOrderExternalId","required":false,"schema":{"type":"string"}},"pageNumberQuery":{"description":"Reference to a specific page in a result set.","in":"query","name":"pageNumber","required":false,"schema":{"type":"integer"}},"pageSizeQuery":{"description":"The number of items per page in a result set.","in":"query","name":"pageSize","required":false,"schema":{"type":"integer"}},"sortByQuery":{"description":"Defines which field the resource list is sorted by.","in":"query","name":"sortBy","required":false,"schema":{"type":"string"}},"sortDirectionQuery":{"description":"Reference to a sort direction","explode":false,"in":"query","name":"sortDirection","schema":{"$ref":"#/components/schemas/SortDirectionENUM"},"style":"form"}},"schemas":{"PurchaseOrderStatusENUM":{"description":"|ENUM      | Description |\n| ---------------- | ------------ |\n| NEW | Created, but not sent to supplier yet.|\n| SENT_TO_SUPPLIER | Sent to supplier.|\n| CANCELLED_BY_SUPPLIER | The purchase order have been cancelled by the supplier. This status is only applicable for suppliers who are integrated with FlowRetail.|\n| IN_TRANSIT | The goods are in transit. This status is only applicable for suppliers who are integrated with FlowRetail.|\n| PARTIALLY_RECEIVED | Not all goods have been received yet.|\n| RECEIVED | All goods have been received.|\n| CLOSED | No longer able to process purchase order.|\n| CANCELLED_BY_SUPPLIER | Purchase was cancelled by supplier|","enum":["NEW","PARTIALLY_RECEIVED","RECEIVED","SENT_TO_SUPPLIER","IN_TRANSIT","CLOSED","CANCELLED_BY_SUPPLIER"],"title":"PurchaseOrderStatusENUM","type":"string"},"SortDirectionENUM":{"description":"|ENUM      | Description |\n| ---------------- | ------------ |\n| ASC | Sort in ascending order|\n| DESC | Sort in descending order|\n","enum":["ASC","DESC"],"title":"SortDirectionENUM","type":"string"},"PurchaseOrderResponseSchema":{"title":"PurchaseOrderResponseSchema","type":"object","required":["createdAt","createdBy","deliveryAddress","deliveryCity","deliveryCountryCode","deliveryName","deliveryPostalCode","externalId","items","lastModifiedAt","lastModifiedBy","note","purchaseNumber","purchaseOrderUid","status","storeUid","storeName","supplierUid","supplierName","discountRate","freight","currency","supplierReferenceNumber","invoiceAddress","reserveAfter","hasConfirmedReceivements"],"properties":{"createdAt":{"format":"date-time","type":"string"},"createdBy":{"type":"string"},"deliveryAddress":{"type":"string"},"deliveryCity":{"type":"string"},"deliveryCountryCode":{"type":"string"},"deliveryName":{"type":"string"},"deliveryPostalCode":{"type":"string"},"externalId":{"type":"string"},"items":{"type":"array","items":{"$ref":"#/components/schemas/PurchaseOrderItemResponseSchema"}},"lastModifiedAt":{"format":"date-time","type":"string"},"lastModifiedBy":{"type":"string"},"note":{"type":"string"},"purchaseNumber":{"description":"Reference to a customer order","type":"string"},"purchaseOrderUid":{"$ref":"#/components/schemas/UID"},"status":{"$ref":"#/components/schemas/PurchaseOrderStatusENUM"},"storeUid":{"$ref":"#/components/schemas/UID"},"storeName":{"type":"string"},"supplierUid":{"$ref":"#/components/schemas/UID"},"supplierName":{"type":"string"},"discountRate":{"type":"integer"},"freight":{"type":"integer"},"currency":{"$ref":"#/components/schemas/PurchaseOrderCurrencySchema"},"supplierReferenceNumber":{"type":"string","description":"Supplier reference number"},"invoiceAddress":{"$ref":"#/components/schemas/PurchaseOrderInvoiceAddress"},"reserveAfter":{"type":"string","description":"If set, items in this purchase \norder cannot be reserved before this date.","format":"date-time","nullable":true},"hasConfirmedReceivements":{"type":"boolean"}}},"PurchaseOrderItemResponseSchema":{"title":"PurchaseOrderItemResponseSchema","type":"object","required":["createdAt","createdBy","expectedDeliveryDate","externalId","lastModifiedAt","lastModifiedBy","productUid","productName","productSerialNoRequired","productSku","purchaseOrderItemUid","quantityOrdered","quantityReceived","quantityReserved","supplierSku","unitPrice","receivementItems","discountAmount","freightAmount","unitCost","totalLinePrice","localCurrency","reservations","note","sortOrder","purchaseOrderItemLinks"],"properties":{"createdAt":{"type":"string","format":"date-time"},"createdBy":{"type":"string"},"expectedDeliveryDate":{"format":"date","type":"string"},"externalId":{"type":"string"},"lastModifiedAt":{"format":"date-time","type":"string"},"lastModifiedBy":{"type":"string"},"productUid":{"$ref":"#/components/schemas/UID"},"productName":{"type":"string"},"productSerialNoRequired":{"$ref":"#/components/schemas/SerialNoRequiredENUM"},"productSku":{"type":"string"},"purchaseOrderItemUid":{"$ref":"#/components/schemas/UID"},"quantityOrdered":{"type":"integer"},"quantityReceived":{"type":"integer"},"quantityReserved":{"type":"integer"},"supplierSku":{"type":"string"},"unitPrice":{"type":"integer","description":"unitPrice is in purchase price in order currency before discounts"},"receivementItems":{"type":"array","items":{"$ref":"#/components/schemas/PurchaseReceivementItemResponseSchema"}},"discountAmount":{"type":"integer","description":"The discount amount pr unit"},"freightAmount":{"type":"integer","description":"The portion of the shipping cost pr unit."},"unitCost":{"type":"integer","description":"The price pr unit including discount and freight. This is what will be used as cost price during receivement."},"totalLinePrice":{"type":"integer","description":"Total price for all the items including discounts and freight amount."},"currency":{"$ref":"#/components/schemas/DeprecatedPurchaseOrderItemCurrencySchema"},"localCurrency":{"$ref":"#/components/schemas/PurchaseOrderItemCurrencySchema"},"reservations":{"type":"array","items":{"$ref":"#/components/schemas/OrderItemReservationSchema"}},"note":{"type":"string"},"sortOrder":{"type":"integer"},"purchaseOrderItemLinks":{"type":"array","items":{"$ref":"#/components/schemas/PurchaseOrderItemLinkSchema"}}}},"UID":{"title":"UID","type":"string","pattern":"^[A-Za-z0-9-_]+"},"SerialNoRequiredENUM":{"description":"|ENUM      | Description |\n| ---------------- | ------------ |\n| NO | No Serial number required|\n| ON_SALE | Can register serial number when selling a product (Serial number is optional)|\n| ON_RECEIVE | Must register serial number when receiving and selling product (Serial number is required)|","enum":["NO","ON_SALE","ON_RECEIVE"],"title":"SerialNoRequiredENUM","type":"string"},"PurchaseReceivementItemResponseSchema":{"title":"PurchaseReceivementItemResponseSchema","description":"PurchaseReceivementItem","allOf":[{"type":"object","required":["receivementUid","receivementStatus"],"properties":{"receivementUid":{"$ref":"#/components/schemas/UID"},"receivementStatus":{"$ref":"#/components/schemas/ReceivementStatusENUM"}}},{"$ref":"#/components/schemas/ReceivementItemResponseSchema"}]},"ReceivementStatusENUM":{"description":"|ENUM      | Description |\n| ---------------- | ------------ |\n| RECEIVED | Received|\n| PENDING | Put aside, not finished|\n| UPDATING | Updating in progress|\n| CONFIRMED | Confirmed |","enum":["RECEIVED","PENDING","UPDATING","CONFIRMED"],"title":"ReceivementStatusENUM","type":"string"},"ReceivementItemResponseSchema":{"title":"ReceivementItemResponseSchema","type":"object","required":["createdAt","createdBy","externalId","lastModifiedAt","lastModifiedBy","product","purchaseOrderItemUid","quantity","receivementItemUid","status","note","tenantUserUid","tenantUserDisplayName","reservations"],"properties":{"createdAt":{"format":"date-time","type":"string"},"createdBy":{"type":"string"},"externalId":{"description":"External reference to receivement line","type":"string"},"lastModifiedAt":{"format":"date-time","type":"string"},"lastModifiedBy":{"type":"string"},"product":{"$ref":"#/components/schemas/ReceivementItemProductResponseSchema"},"purchaseOrderItemUid":{"$ref":"#/components/schemas/UID"},"quantity":{"type":"integer"},"unitPrice":{"type":"integer","deprecated":true,"description":"Deprecated: Use unitcost instead"},"unitCost":{"type":"integer"},"receivementItemUid":{"$ref":"#/components/schemas/UID"},"serialnumber":{"type":"string"},"status":{"type":"string"},"note":{"type":"string"},"tenantUserUid":{"$ref":"#/components/schemas/OptionalUID"},"tenantUserDisplayName":{"type":"string","description":"The display name of the user that made the receivement"},"reservations":{"type":"array","items":{"$ref":"#/components/schemas/OrderItemReservationSchema"}}}},"ReceivementItemProductResponseSchema":{"title":"ReceivementItemProductResponseSchema","type":"object","required":["productUid","name","sku"],"properties":{"productUid":{"$ref":"#/components/schemas/UID"},"name":{"type":"string"},"sku":{"type":"string"}}},"OptionalUID":{"title":"OptionalUID","type":"string","pattern":"^[A-Za-z0-9-_]*"},"OrderItemReservationSchema":{"title":"OrderItemReservationSchema","type":"object","required":["orderUid","orderItemUid","orderNumber","quantity","reservationType"],"properties":{"orderUid":{"$ref":"#/components/schemas/UID"},"orderItemUid":{"$ref":"#/components/schemas/UID"},"orderNumber":{"type":"string"},"quantity":{"type":"integer"},"reservationType":{"$ref":"#/components/schemas/SalesReservationTypeENUM"}}},"SalesReservationTypeENUM":{"title":"SalesReservationTypeENUM","type":"string","enum":["NONE","WAREHOUSE","PURCHASEORDER","REQUEST_PURCHASEORDER","PURCHASEORDER_CONFIRMED"],"description":""},"DeprecatedPurchaseOrderItemCurrencySchema":{"title":"DeprecatedPurchaseOrderItemCurrencySchema","type":"object","deprecated":true,"required":["unitPrice","discountAmount","freightAmount","totalLinePrice"],"properties":{"unitPrice":{"type":"integer"},"discountAmount":{"type":"integer"},"freightAmount":{"type":"integer"},"totalLinePrice":{"type":"integer"}}},"PurchaseOrderItemCurrencySchema":{"title":"PurchaseOrderItemCurrencySchema","type":"object","description":"All prices is in the local tenant currency","required":["unitPrice","discountAmount","freightAmount","unitCost","totalLinePrice"],"properties":{"unitPrice":{"type":"integer","description":"unitPrice is in local currency before discount"},"discountAmount":{"type":"integer","description":"The discount amount pr unit"},"freightAmount":{"type":"integer","description":"The portion of the shipping cost for this purchase order line."},"unitCost":{"type":"integer","description":"The price pr unit including discount and freight. This is what will be used as cost price during receivement."},"totalLinePrice":{"type":"integer","description":"Total price for all the items including discounts and freight amount."}}},"PurchaseOrderItemLinkSchema":{"description":"Order reference for an order product item","title":"PurchaseOrderItemLinkSchema","type":"object","required":["purchaseOrderItemUid","type"],"properties":{"purchaseOrderItemUid":{"$ref":"#/components/schemas/UID"},"type":{"$ref":"#/components/schemas/PurchaseOrderLinkTypeResponseENUM"}}},"PurchaseOrderLinkTypeResponseENUM":{"description":"Describes the type of link on an order product item\n\n|ENUM | Description |\n| --- | --- |\n| PACKAGE | Reference to orderline with main package product |\n| PACKAGE_COMPONENT | Reference to orderline with package component product |\n","enum":["PACKAGE","PACKAGE_COMPONENT"],"title":"PurchaseOrderLinkTypeResponseENUM","type":"string"},"PurchaseOrderCurrencySchema":{"title":"PurchaseOrderCurrencySchema","type":"object","required":["code","exchangeRate"],"properties":{"code":{"type":"string","description":"ISO 4217"},"exchangeRate":{"type":"integer"}}},"PurchaseOrderInvoiceAddress":{"title":"PurchaseOrderInvoiceAddress","type":"object","required":["companyName","address","postalCode","city","countryCode","vatNumber","email"],"properties":{"companyName":{"type":"string"},"address":{"type":"string"},"postalCode":{"type":"string"},"city":{"type":"string"},"countryCode":{"type":"string"},"vatNumber":{"type":"string"},"email":{"type":"string"}}},"Paging":{"description":"totalCount The total number of items in the result set.\n\npageSize The number of items per page.\n\npageNumber The current page in the result set.","properties":{"pageNumber":{"type":"integer"},"pageSize":{"type":"integer"},"totalCount":{"type":"integer"}},"required":["totalCount","pageSize","pageNumber"],"title":"Paging","type":"object"}},"responses":{"PurchaseOrderListResponse":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/PurchaseOrderResponseSchema"}},"paging":{"$ref":"#/components/schemas/Paging"}},"required":["items","paging"]}},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{"schema":{"type":"string","format":"binary"}}},"description":"Example response"}}},"paths":{"/tenants/{tenantUid}/stores/{storeUid}/purchase-orders":{"get":{"description":"Lists all purchase orders.","operationId":"get-tenants-stores-purchase-orders","parameters":[{"$ref":"#/components/parameters/purchaseOrderStatusQuery"},{"$ref":"#/components/parameters/purchaseOrderExternalIdQuery"},{"$ref":"#/components/parameters/pageNumberQuery"},{"$ref":"#/components/parameters/pageSizeQuery"},{"$ref":"#/components/parameters/sortByQuery"},{"$ref":"#/components/parameters/sortDirectionQuery"}],"responses":{"200":{"$ref":"#/components/responses/PurchaseOrderListResponse"}},"summary":"List purchase orders","tags":["Purchase"]}}}}
```

## Create a new purchase order

> Specify a \`currency\` when the order is not in local currency. \
> The currency must exist in your foreign currencies. \
> If you leave \`exchangeRate\` empty, the exchange rate that is on the foreign currency will be used.\
> \
> Required permissions: PURCHASE\_ORDER

```json
{"openapi":"3.0.2","info":{"title":"Flow Retail API version 2","version":"2.0.0"},"tags":[{"name":"Purchase","description":"Purchase"}],"servers":[{"description":"Flow Retail Production","url":"https://api.flowretail.com/v2"},{"description":"Flow Retail Stage","url":"https://api.stage.flowretail.com/v2"}],"security":[{"accessToken":[]},{"authToken":[]},{"integrationToken":[]}],"components":{"securitySchemes":{"accessToken":{"description":"Access token recevied after user login with a deviceToken","scheme":"bearer","type":"http"},"authToken":{"description":"Token received from the auth service","scheme":"bearer","type":"http"},"integrationToken":{"scheme":"bearer","type":"http"}},"requestBodies":{"PurchaseOrderCreateRequest":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PurchaseOrderCreateSchema"}}}}},"schemas":{"PurchaseOrderCreateSchema":{"title":"PurchaseOrderCreateSchema","type":"object","required":["supplierUid"],"properties":{"deliveryAddress":{"type":"string"},"deliveryCity":{"type":"string"},"deliveryCountryCode":{"type":"string"},"deliveryName":{"type":"string"},"deliveryPostalCode":{"type":"string"},"externalId":{"type":"string"},"note":{"type":"string"},"status":{"$ref":"#/components/schemas/PurchaseOrderStatusENUM"},"supplierUid":{"$ref":"#/components/schemas/UID"},"discountRate":{"type":"integer"},"freight":{"type":"integer"},"currency":{"type":"string","description":"ISO 4217 code"},"exchangeRate":{"type":"integer"},"purchaseOrderUid":{"$ref":"#/components/schemas/UID"},"items":{"type":"array","items":{"$ref":"#/components/schemas/PurchaseOrderItemCreateSchema"}},"autoOrderProposal":{"type":"object","description":"Generate a purchase order proposal based on min/max","required":["warehouseUid"],"properties":{"warehouseUid":{"$ref":"#/components/schemas/UID"},"countReservedItems":{"type":"boolean","default":true,"description":"Wether or not reserved items will be counted as part of existing stock. Defaults to true."},"honorTradeUnits":{"type":"boolean","description":"Quantities are rounded up to trade units for products where defined."}}},"supplierReferenceNumber":{"type":"string"},"invoiceAddress":{"$ref":"#/components/schemas/PurchaseOrderInvoiceAddressCreateSchema"},"reserveAfter":{"type":"string","format":"date-time","description":"If set, items in this purchase \norder cannot be reserved before this date."}}},"PurchaseOrderStatusENUM":{"description":"|ENUM      | Description |\n| ---------------- | ------------ |\n| NEW | Created, but not sent to supplier yet.|\n| SENT_TO_SUPPLIER | Sent to supplier.|\n| CANCELLED_BY_SUPPLIER | The purchase order have been cancelled by the supplier. This status is only applicable for suppliers who are integrated with FlowRetail.|\n| IN_TRANSIT | The goods are in transit. This status is only applicable for suppliers who are integrated with FlowRetail.|\n| PARTIALLY_RECEIVED | Not all goods have been received yet.|\n| RECEIVED | All goods have been received.|\n| CLOSED | No longer able to process purchase order.|\n| CANCELLED_BY_SUPPLIER | Purchase was cancelled by supplier|","enum":["NEW","PARTIALLY_RECEIVED","RECEIVED","SENT_TO_SUPPLIER","IN_TRANSIT","CLOSED","CANCELLED_BY_SUPPLIER"],"title":"PurchaseOrderStatusENUM","type":"string"},"UID":{"title":"UID","type":"string","pattern":"^[A-Za-z0-9-_]+"},"PurchaseOrderItemCreateSchema":{"allOf":[{"$ref":"#/components/schemas/PurchaseOrderItemUpdateSchema"},{"properties":{"purchaseOrderItemUid":{"$ref":"#/components/schemas/UID"},"productUid":{"$ref":"#/components/schemas/UID"},"quantityOrdered":{"type":"integer"}},"required":["productUid","quantityOrdered"]}],"title":"PurchaseOrderItemCreateSchema","type":"object"},"PurchaseOrderItemUpdateSchema":{"title":"PurchaseOrderItemUpdateSchema","type":"object","properties":{"expectedDeliveryDate":{"format":"date","type":"string"},"externalId":{"description":"External reference to purchase order line","type":"string"},"productUid":{"$ref":"#/components/schemas/UID"},"quantityOrdered":{"type":"integer"},"supplierSku":{"type":"string"},"unitPrice":{"type":"integer","description":"unitPrice is in purchase order currency"},"note":{"type":"string"},"sortOrder":{"type":"integer"}}},"PurchaseOrderInvoiceAddressCreateSchema":{"title":"PurchaseOrderInvoiceAddressCreateSchema","type":"object","required":["companyName","address","postalCode","city","countryCode"],"properties":{"companyName":{"type":"string"},"address":{"type":"string"},"postalCode":{"type":"string"},"city":{"type":"string"},"countryCode":{"type":"string"},"vatNumber":{"type":"string"},"email":{"type":"string"}}},"PurchaseOrderResponseSchema":{"title":"PurchaseOrderResponseSchema","type":"object","required":["createdAt","createdBy","deliveryAddress","deliveryCity","deliveryCountryCode","deliveryName","deliveryPostalCode","externalId","items","lastModifiedAt","lastModifiedBy","note","purchaseNumber","purchaseOrderUid","status","storeUid","storeName","supplierUid","supplierName","discountRate","freight","currency","supplierReferenceNumber","invoiceAddress","reserveAfter","hasConfirmedReceivements"],"properties":{"createdAt":{"format":"date-time","type":"string"},"createdBy":{"type":"string"},"deliveryAddress":{"type":"string"},"deliveryCity":{"type":"string"},"deliveryCountryCode":{"type":"string"},"deliveryName":{"type":"string"},"deliveryPostalCode":{"type":"string"},"externalId":{"type":"string"},"items":{"type":"array","items":{"$ref":"#/components/schemas/PurchaseOrderItemResponseSchema"}},"lastModifiedAt":{"format":"date-time","type":"string"},"lastModifiedBy":{"type":"string"},"note":{"type":"string"},"purchaseNumber":{"description":"Reference to a customer order","type":"string"},"purchaseOrderUid":{"$ref":"#/components/schemas/UID"},"status":{"$ref":"#/components/schemas/PurchaseOrderStatusENUM"},"storeUid":{"$ref":"#/components/schemas/UID"},"storeName":{"type":"string"},"supplierUid":{"$ref":"#/components/schemas/UID"},"supplierName":{"type":"string"},"discountRate":{"type":"integer"},"freight":{"type":"integer"},"currency":{"$ref":"#/components/schemas/PurchaseOrderCurrencySchema"},"supplierReferenceNumber":{"type":"string","description":"Supplier reference number"},"invoiceAddress":{"$ref":"#/components/schemas/PurchaseOrderInvoiceAddress"},"reserveAfter":{"type":"string","description":"If set, items in this purchase \norder cannot be reserved before this date.","format":"date-time","nullable":true},"hasConfirmedReceivements":{"type":"boolean"}}},"PurchaseOrderItemResponseSchema":{"title":"PurchaseOrderItemResponseSchema","type":"object","required":["createdAt","createdBy","expectedDeliveryDate","externalId","lastModifiedAt","lastModifiedBy","productUid","productName","productSerialNoRequired","productSku","purchaseOrderItemUid","quantityOrdered","quantityReceived","quantityReserved","supplierSku","unitPrice","receivementItems","discountAmount","freightAmount","unitCost","totalLinePrice","localCurrency","reservations","note","sortOrder","purchaseOrderItemLinks"],"properties":{"createdAt":{"type":"string","format":"date-time"},"createdBy":{"type":"string"},"expectedDeliveryDate":{"format":"date","type":"string"},"externalId":{"type":"string"},"lastModifiedAt":{"format":"date-time","type":"string"},"lastModifiedBy":{"type":"string"},"productUid":{"$ref":"#/components/schemas/UID"},"productName":{"type":"string"},"productSerialNoRequired":{"$ref":"#/components/schemas/SerialNoRequiredENUM"},"productSku":{"type":"string"},"purchaseOrderItemUid":{"$ref":"#/components/schemas/UID"},"quantityOrdered":{"type":"integer"},"quantityReceived":{"type":"integer"},"quantityReserved":{"type":"integer"},"supplierSku":{"type":"string"},"unitPrice":{"type":"integer","description":"unitPrice is in purchase price in order currency before discounts"},"receivementItems":{"type":"array","items":{"$ref":"#/components/schemas/PurchaseReceivementItemResponseSchema"}},"discountAmount":{"type":"integer","description":"The discount amount pr unit"},"freightAmount":{"type":"integer","description":"The portion of the shipping cost pr unit."},"unitCost":{"type":"integer","description":"The price pr unit including discount and freight. This is what will be used as cost price during receivement."},"totalLinePrice":{"type":"integer","description":"Total price for all the items including discounts and freight amount."},"currency":{"$ref":"#/components/schemas/DeprecatedPurchaseOrderItemCurrencySchema"},"localCurrency":{"$ref":"#/components/schemas/PurchaseOrderItemCurrencySchema"},"reservations":{"type":"array","items":{"$ref":"#/components/schemas/OrderItemReservationSchema"}},"note":{"type":"string"},"sortOrder":{"type":"integer"},"purchaseOrderItemLinks":{"type":"array","items":{"$ref":"#/components/schemas/PurchaseOrderItemLinkSchema"}}}},"SerialNoRequiredENUM":{"description":"|ENUM      | Description |\n| ---------------- | ------------ |\n| NO | No Serial number required|\n| ON_SALE | Can register serial number when selling a product (Serial number is optional)|\n| ON_RECEIVE | Must register serial number when receiving and selling product (Serial number is required)|","enum":["NO","ON_SALE","ON_RECEIVE"],"title":"SerialNoRequiredENUM","type":"string"},"PurchaseReceivementItemResponseSchema":{"title":"PurchaseReceivementItemResponseSchema","description":"PurchaseReceivementItem","allOf":[{"type":"object","required":["receivementUid","receivementStatus"],"properties":{"receivementUid":{"$ref":"#/components/schemas/UID"},"receivementStatus":{"$ref":"#/components/schemas/ReceivementStatusENUM"}}},{"$ref":"#/components/schemas/ReceivementItemResponseSchema"}]},"ReceivementStatusENUM":{"description":"|ENUM      | Description |\n| ---------------- | ------------ |\n| RECEIVED | Received|\n| PENDING | Put aside, not finished|\n| UPDATING | Updating in progress|\n| CONFIRMED | Confirmed |","enum":["RECEIVED","PENDING","UPDATING","CONFIRMED"],"title":"ReceivementStatusENUM","type":"string"},"ReceivementItemResponseSchema":{"title":"ReceivementItemResponseSchema","type":"object","required":["createdAt","createdBy","externalId","lastModifiedAt","lastModifiedBy","product","purchaseOrderItemUid","quantity","receivementItemUid","status","note","tenantUserUid","tenantUserDisplayName","reservations"],"properties":{"createdAt":{"format":"date-time","type":"string"},"createdBy":{"type":"string"},"externalId":{"description":"External reference to receivement line","type":"string"},"lastModifiedAt":{"format":"date-time","type":"string"},"lastModifiedBy":{"type":"string"},"product":{"$ref":"#/components/schemas/ReceivementItemProductResponseSchema"},"purchaseOrderItemUid":{"$ref":"#/components/schemas/UID"},"quantity":{"type":"integer"},"unitPrice":{"type":"integer","deprecated":true,"description":"Deprecated: Use unitcost instead"},"unitCost":{"type":"integer"},"receivementItemUid":{"$ref":"#/components/schemas/UID"},"serialnumber":{"type":"string"},"status":{"type":"string"},"note":{"type":"string"},"tenantUserUid":{"$ref":"#/components/schemas/OptionalUID"},"tenantUserDisplayName":{"type":"string","description":"The display name of the user that made the receivement"},"reservations":{"type":"array","items":{"$ref":"#/components/schemas/OrderItemReservationSchema"}}}},"ReceivementItemProductResponseSchema":{"title":"ReceivementItemProductResponseSchema","type":"object","required":["productUid","name","sku"],"properties":{"productUid":{"$ref":"#/components/schemas/UID"},"name":{"type":"string"},"sku":{"type":"string"}}},"OptionalUID":{"title":"OptionalUID","type":"string","pattern":"^[A-Za-z0-9-_]*"},"OrderItemReservationSchema":{"title":"OrderItemReservationSchema","type":"object","required":["orderUid","orderItemUid","orderNumber","quantity","reservationType"],"properties":{"orderUid":{"$ref":"#/components/schemas/UID"},"orderItemUid":{"$ref":"#/components/schemas/UID"},"orderNumber":{"type":"string"},"quantity":{"type":"integer"},"reservationType":{"$ref":"#/components/schemas/SalesReservationTypeENUM"}}},"SalesReservationTypeENUM":{"title":"SalesReservationTypeENUM","type":"string","enum":["NONE","WAREHOUSE","PURCHASEORDER","REQUEST_PURCHASEORDER","PURCHASEORDER_CONFIRMED"],"description":""},"DeprecatedPurchaseOrderItemCurrencySchema":{"title":"DeprecatedPurchaseOrderItemCurrencySchema","type":"object","deprecated":true,"required":["unitPrice","discountAmount","freightAmount","totalLinePrice"],"properties":{"unitPrice":{"type":"integer"},"discountAmount":{"type":"integer"},"freightAmount":{"type":"integer"},"totalLinePrice":{"type":"integer"}}},"PurchaseOrderItemCurrencySchema":{"title":"PurchaseOrderItemCurrencySchema","type":"object","description":"All prices is in the local tenant currency","required":["unitPrice","discountAmount","freightAmount","unitCost","totalLinePrice"],"properties":{"unitPrice":{"type":"integer","description":"unitPrice is in local currency before discount"},"discountAmount":{"type":"integer","description":"The discount amount pr unit"},"freightAmount":{"type":"integer","description":"The portion of the shipping cost for this purchase order line."},"unitCost":{"type":"integer","description":"The price pr unit including discount and freight. This is what will be used as cost price during receivement."},"totalLinePrice":{"type":"integer","description":"Total price for all the items including discounts and freight amount."}}},"PurchaseOrderItemLinkSchema":{"description":"Order reference for an order product item","title":"PurchaseOrderItemLinkSchema","type":"object","required":["purchaseOrderItemUid","type"],"properties":{"purchaseOrderItemUid":{"$ref":"#/components/schemas/UID"},"type":{"$ref":"#/components/schemas/PurchaseOrderLinkTypeResponseENUM"}}},"PurchaseOrderLinkTypeResponseENUM":{"description":"Describes the type of link on an order product item\n\n|ENUM | Description |\n| --- | --- |\n| PACKAGE | Reference to orderline with main package product |\n| PACKAGE_COMPONENT | Reference to orderline with package component product |\n","enum":["PACKAGE","PACKAGE_COMPONENT"],"title":"PurchaseOrderLinkTypeResponseENUM","type":"string"},"PurchaseOrderCurrencySchema":{"title":"PurchaseOrderCurrencySchema","type":"object","required":["code","exchangeRate"],"properties":{"code":{"type":"string","description":"ISO 4217"},"exchangeRate":{"type":"integer"}}},"PurchaseOrderInvoiceAddress":{"title":"PurchaseOrderInvoiceAddress","type":"object","required":["companyName","address","postalCode","city","countryCode","vatNumber","email"],"properties":{"companyName":{"type":"string"},"address":{"type":"string"},"postalCode":{"type":"string"},"city":{"type":"string"},"countryCode":{"type":"string"},"vatNumber":{"type":"string"},"email":{"type":"string"}}}},"responses":{"PurchaseOrderResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PurchaseOrderResponseSchema"}}},"description":"Example response"}}},"paths":{"/tenants/{tenantUid}/stores/{storeUid}/purchase-orders":{"post":{"description":"Specify a `currency` when the order is not in local currency. \nThe currency must exist in your foreign currencies. \nIf you leave `exchangeRate` empty, the exchange rate that is on the foreign currency will be used.\n\nRequired permissions: PURCHASE_ORDER","operationId":"post-tenants-stores-purchase-orders","requestBody":{"$ref":"#/components/requestBodies/PurchaseOrderCreateRequest"},"responses":{"200":{"$ref":"#/components/responses/PurchaseOrderResponse"}},"summary":"Create a new purchase order","tags":["Purchase"]}}}}
```

## Get purchase order details

> Get details for a purchase order.

```json
{"openapi":"3.0.2","info":{"title":"Flow Retail API version 2","version":"2.0.0"},"tags":[{"name":"Purchase","description":"Purchase"}],"servers":[{"description":"Flow Retail Production","url":"https://api.flowretail.com/v2"},{"description":"Flow Retail Stage","url":"https://api.stage.flowretail.com/v2"}],"security":[{"accessToken":[]},{"authToken":[]},{"integrationToken":[]}],"components":{"securitySchemes":{"accessToken":{"description":"Access token recevied after user login with a deviceToken","scheme":"bearer","type":"http"},"authToken":{"description":"Token received from the auth service","scheme":"bearer","type":"http"},"integrationToken":{"scheme":"bearer","type":"http"}},"responses":{"PurchaseOrderResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PurchaseOrderResponseSchema"}}},"description":"Example response"}},"schemas":{"PurchaseOrderResponseSchema":{"title":"PurchaseOrderResponseSchema","type":"object","required":["createdAt","createdBy","deliveryAddress","deliveryCity","deliveryCountryCode","deliveryName","deliveryPostalCode","externalId","items","lastModifiedAt","lastModifiedBy","note","purchaseNumber","purchaseOrderUid","status","storeUid","storeName","supplierUid","supplierName","discountRate","freight","currency","supplierReferenceNumber","invoiceAddress","reserveAfter","hasConfirmedReceivements"],"properties":{"createdAt":{"format":"date-time","type":"string"},"createdBy":{"type":"string"},"deliveryAddress":{"type":"string"},"deliveryCity":{"type":"string"},"deliveryCountryCode":{"type":"string"},"deliveryName":{"type":"string"},"deliveryPostalCode":{"type":"string"},"externalId":{"type":"string"},"items":{"type":"array","items":{"$ref":"#/components/schemas/PurchaseOrderItemResponseSchema"}},"lastModifiedAt":{"format":"date-time","type":"string"},"lastModifiedBy":{"type":"string"},"note":{"type":"string"},"purchaseNumber":{"description":"Reference to a customer order","type":"string"},"purchaseOrderUid":{"$ref":"#/components/schemas/UID"},"status":{"$ref":"#/components/schemas/PurchaseOrderStatusENUM"},"storeUid":{"$ref":"#/components/schemas/UID"},"storeName":{"type":"string"},"supplierUid":{"$ref":"#/components/schemas/UID"},"supplierName":{"type":"string"},"discountRate":{"type":"integer"},"freight":{"type":"integer"},"currency":{"$ref":"#/components/schemas/PurchaseOrderCurrencySchema"},"supplierReferenceNumber":{"type":"string","description":"Supplier reference number"},"invoiceAddress":{"$ref":"#/components/schemas/PurchaseOrderInvoiceAddress"},"reserveAfter":{"type":"string","description":"If set, items in this purchase \norder cannot be reserved before this date.","format":"date-time","nullable":true},"hasConfirmedReceivements":{"type":"boolean"}}},"PurchaseOrderItemResponseSchema":{"title":"PurchaseOrderItemResponseSchema","type":"object","required":["createdAt","createdBy","expectedDeliveryDate","externalId","lastModifiedAt","lastModifiedBy","productUid","productName","productSerialNoRequired","productSku","purchaseOrderItemUid","quantityOrdered","quantityReceived","quantityReserved","supplierSku","unitPrice","receivementItems","discountAmount","freightAmount","unitCost","totalLinePrice","localCurrency","reservations","note","sortOrder","purchaseOrderItemLinks"],"properties":{"createdAt":{"type":"string","format":"date-time"},"createdBy":{"type":"string"},"expectedDeliveryDate":{"format":"date","type":"string"},"externalId":{"type":"string"},"lastModifiedAt":{"format":"date-time","type":"string"},"lastModifiedBy":{"type":"string"},"productUid":{"$ref":"#/components/schemas/UID"},"productName":{"type":"string"},"productSerialNoRequired":{"$ref":"#/components/schemas/SerialNoRequiredENUM"},"productSku":{"type":"string"},"purchaseOrderItemUid":{"$ref":"#/components/schemas/UID"},"quantityOrdered":{"type":"integer"},"quantityReceived":{"type":"integer"},"quantityReserved":{"type":"integer"},"supplierSku":{"type":"string"},"unitPrice":{"type":"integer","description":"unitPrice is in purchase price in order currency before discounts"},"receivementItems":{"type":"array","items":{"$ref":"#/components/schemas/PurchaseReceivementItemResponseSchema"}},"discountAmount":{"type":"integer","description":"The discount amount pr unit"},"freightAmount":{"type":"integer","description":"The portion of the shipping cost pr unit."},"unitCost":{"type":"integer","description":"The price pr unit including discount and freight. This is what will be used as cost price during receivement."},"totalLinePrice":{"type":"integer","description":"Total price for all the items including discounts and freight amount."},"currency":{"$ref":"#/components/schemas/DeprecatedPurchaseOrderItemCurrencySchema"},"localCurrency":{"$ref":"#/components/schemas/PurchaseOrderItemCurrencySchema"},"reservations":{"type":"array","items":{"$ref":"#/components/schemas/OrderItemReservationSchema"}},"note":{"type":"string"},"sortOrder":{"type":"integer"},"purchaseOrderItemLinks":{"type":"array","items":{"$ref":"#/components/schemas/PurchaseOrderItemLinkSchema"}}}},"UID":{"title":"UID","type":"string","pattern":"^[A-Za-z0-9-_]+"},"SerialNoRequiredENUM":{"description":"|ENUM      | Description |\n| ---------------- | ------------ |\n| NO | No Serial number required|\n| ON_SALE | Can register serial number when selling a product (Serial number is optional)|\n| ON_RECEIVE | Must register serial number when receiving and selling product (Serial number is required)|","enum":["NO","ON_SALE","ON_RECEIVE"],"title":"SerialNoRequiredENUM","type":"string"},"PurchaseReceivementItemResponseSchema":{"title":"PurchaseReceivementItemResponseSchema","description":"PurchaseReceivementItem","allOf":[{"type":"object","required":["receivementUid","receivementStatus"],"properties":{"receivementUid":{"$ref":"#/components/schemas/UID"},"receivementStatus":{"$ref":"#/components/schemas/ReceivementStatusENUM"}}},{"$ref":"#/components/schemas/ReceivementItemResponseSchema"}]},"ReceivementStatusENUM":{"description":"|ENUM      | Description |\n| ---------------- | ------------ |\n| RECEIVED | Received|\n| PENDING | Put aside, not finished|\n| UPDATING | Updating in progress|\n| CONFIRMED | Confirmed |","enum":["RECEIVED","PENDING","UPDATING","CONFIRMED"],"title":"ReceivementStatusENUM","type":"string"},"ReceivementItemResponseSchema":{"title":"ReceivementItemResponseSchema","type":"object","required":["createdAt","createdBy","externalId","lastModifiedAt","lastModifiedBy","product","purchaseOrderItemUid","quantity","receivementItemUid","status","note","tenantUserUid","tenantUserDisplayName","reservations"],"properties":{"createdAt":{"format":"date-time","type":"string"},"createdBy":{"type":"string"},"externalId":{"description":"External reference to receivement line","type":"string"},"lastModifiedAt":{"format":"date-time","type":"string"},"lastModifiedBy":{"type":"string"},"product":{"$ref":"#/components/schemas/ReceivementItemProductResponseSchema"},"purchaseOrderItemUid":{"$ref":"#/components/schemas/UID"},"quantity":{"type":"integer"},"unitPrice":{"type":"integer","deprecated":true,"description":"Deprecated: Use unitcost instead"},"unitCost":{"type":"integer"},"receivementItemUid":{"$ref":"#/components/schemas/UID"},"serialnumber":{"type":"string"},"status":{"type":"string"},"note":{"type":"string"},"tenantUserUid":{"$ref":"#/components/schemas/OptionalUID"},"tenantUserDisplayName":{"type":"string","description":"The display name of the user that made the receivement"},"reservations":{"type":"array","items":{"$ref":"#/components/schemas/OrderItemReservationSchema"}}}},"ReceivementItemProductResponseSchema":{"title":"ReceivementItemProductResponseSchema","type":"object","required":["productUid","name","sku"],"properties":{"productUid":{"$ref":"#/components/schemas/UID"},"name":{"type":"string"},"sku":{"type":"string"}}},"OptionalUID":{"title":"OptionalUID","type":"string","pattern":"^[A-Za-z0-9-_]*"},"OrderItemReservationSchema":{"title":"OrderItemReservationSchema","type":"object","required":["orderUid","orderItemUid","orderNumber","quantity","reservationType"],"properties":{"orderUid":{"$ref":"#/components/schemas/UID"},"orderItemUid":{"$ref":"#/components/schemas/UID"},"orderNumber":{"type":"string"},"quantity":{"type":"integer"},"reservationType":{"$ref":"#/components/schemas/SalesReservationTypeENUM"}}},"SalesReservationTypeENUM":{"title":"SalesReservationTypeENUM","type":"string","enum":["NONE","WAREHOUSE","PURCHASEORDER","REQUEST_PURCHASEORDER","PURCHASEORDER_CONFIRMED"],"description":""},"DeprecatedPurchaseOrderItemCurrencySchema":{"title":"DeprecatedPurchaseOrderItemCurrencySchema","type":"object","deprecated":true,"required":["unitPrice","discountAmount","freightAmount","totalLinePrice"],"properties":{"unitPrice":{"type":"integer"},"discountAmount":{"type":"integer"},"freightAmount":{"type":"integer"},"totalLinePrice":{"type":"integer"}}},"PurchaseOrderItemCurrencySchema":{"title":"PurchaseOrderItemCurrencySchema","type":"object","description":"All prices is in the local tenant currency","required":["unitPrice","discountAmount","freightAmount","unitCost","totalLinePrice"],"properties":{"unitPrice":{"type":"integer","description":"unitPrice is in local currency before discount"},"discountAmount":{"type":"integer","description":"The discount amount pr unit"},"freightAmount":{"type":"integer","description":"The portion of the shipping cost for this purchase order line."},"unitCost":{"type":"integer","description":"The price pr unit including discount and freight. This is what will be used as cost price during receivement."},"totalLinePrice":{"type":"integer","description":"Total price for all the items including discounts and freight amount."}}},"PurchaseOrderItemLinkSchema":{"description":"Order reference for an order product item","title":"PurchaseOrderItemLinkSchema","type":"object","required":["purchaseOrderItemUid","type"],"properties":{"purchaseOrderItemUid":{"$ref":"#/components/schemas/UID"},"type":{"$ref":"#/components/schemas/PurchaseOrderLinkTypeResponseENUM"}}},"PurchaseOrderLinkTypeResponseENUM":{"description":"Describes the type of link on an order product item\n\n|ENUM | Description |\n| --- | --- |\n| PACKAGE | Reference to orderline with main package product |\n| PACKAGE_COMPONENT | Reference to orderline with package component product |\n","enum":["PACKAGE","PACKAGE_COMPONENT"],"title":"PurchaseOrderLinkTypeResponseENUM","type":"string"},"PurchaseOrderStatusENUM":{"description":"|ENUM      | Description |\n| ---------------- | ------------ |\n| NEW | Created, but not sent to supplier yet.|\n| SENT_TO_SUPPLIER | Sent to supplier.|\n| CANCELLED_BY_SUPPLIER | The purchase order have been cancelled by the supplier. This status is only applicable for suppliers who are integrated with FlowRetail.|\n| IN_TRANSIT | The goods are in transit. This status is only applicable for suppliers who are integrated with FlowRetail.|\n| PARTIALLY_RECEIVED | Not all goods have been received yet.|\n| RECEIVED | All goods have been received.|\n| CLOSED | No longer able to process purchase order.|\n| CANCELLED_BY_SUPPLIER | Purchase was cancelled by supplier|","enum":["NEW","PARTIALLY_RECEIVED","RECEIVED","SENT_TO_SUPPLIER","IN_TRANSIT","CLOSED","CANCELLED_BY_SUPPLIER"],"title":"PurchaseOrderStatusENUM","type":"string"},"PurchaseOrderCurrencySchema":{"title":"PurchaseOrderCurrencySchema","type":"object","required":["code","exchangeRate"],"properties":{"code":{"type":"string","description":"ISO 4217"},"exchangeRate":{"type":"integer"}}},"PurchaseOrderInvoiceAddress":{"title":"PurchaseOrderInvoiceAddress","type":"object","required":["companyName","address","postalCode","city","countryCode","vatNumber","email"],"properties":{"companyName":{"type":"string"},"address":{"type":"string"},"postalCode":{"type":"string"},"city":{"type":"string"},"countryCode":{"type":"string"},"vatNumber":{"type":"string"},"email":{"type":"string"}}}}},"paths":{"/tenants/{tenantUid}/stores/{storeUid}/purchase-orders/{purchaseOrderUid}":{"get":{"description":"Get details for a purchase order.","operationId":"get-tenants-stores-purchase-orders-details","responses":{"200":{"$ref":"#/components/responses/PurchaseOrderResponse"}},"summary":"Get purchase order details","tags":["Purchase"]}}}}
```

## Update purchase order details

> Specify a \`currency\` when the order is not in local currency. \
> The currency must exist in your foreign currencies. \
> If you leave \`exchangeRate\` empty, the exchange rate that is on the foreign currency will be used.\
> \
> Required permissions: PURCHASE\_ORDER

```json
{"openapi":"3.0.2","info":{"title":"Flow Retail API version 2","version":"2.0.0"},"tags":[{"name":"Purchase","description":"Purchase"}],"servers":[{"description":"Flow Retail Production","url":"https://api.flowretail.com/v2"},{"description":"Flow Retail Stage","url":"https://api.stage.flowretail.com/v2"}],"security":[{"accessToken":[]},{"authToken":[]},{"integrationToken":[]}],"components":{"securitySchemes":{"accessToken":{"description":"Access token recevied after user login with a deviceToken","scheme":"bearer","type":"http"},"authToken":{"description":"Token received from the auth service","scheme":"bearer","type":"http"},"integrationToken":{"scheme":"bearer","type":"http"}},"requestBodies":{"PurchaseOrderUpdateRequest":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PurchaseOrderUpdateSchema"}}}}},"schemas":{"PurchaseOrderUpdateSchema":{"title":"PurchaseOrderUpdateSchema","type":"object","properties":{"deliveryAddress":{"type":"string"},"deliveryCity":{"type":"string"},"deliveryCountryCode":{"type":"string"},"deliveryName":{"type":"string"},"deliveryPostalCode":{"type":"string"},"externalId":{"type":"string"},"note":{"type":"string"},"status":{"$ref":"#/components/schemas/PurchaseOrderStatusENUM"},"supplierUid":{"$ref":"#/components/schemas/UID"},"discountRate":{"type":"integer"},"freight":{"type":"integer"},"currency":{"type":"string","description":"ISO 4217 code"},"exchangeRate":{"type":"integer"},"items":{"type":"array","items":{"$ref":"#/components/schemas/PurchaseOrderItemUpdateQtyDeliveredSchema"}},"supplierReferenceNumber":{"type":"string","description":"Supplier reference number"},"invoiceAddress":{"$ref":"#/components/schemas/PurchaseOrderInvoiceAddressUpdateSchema"},"reserveAfter":{"type":"string","description":"If set, items in this purchase \norder cannot be reserved before this date.","format":"date-time","nullable":true}}},"PurchaseOrderStatusENUM":{"description":"|ENUM      | Description |\n| ---------------- | ------------ |\n| NEW | Created, but not sent to supplier yet.|\n| SENT_TO_SUPPLIER | Sent to supplier.|\n| CANCELLED_BY_SUPPLIER | The purchase order have been cancelled by the supplier. This status is only applicable for suppliers who are integrated with FlowRetail.|\n| IN_TRANSIT | The goods are in transit. This status is only applicable for suppliers who are integrated with FlowRetail.|\n| PARTIALLY_RECEIVED | Not all goods have been received yet.|\n| RECEIVED | All goods have been received.|\n| CLOSED | No longer able to process purchase order.|\n| CANCELLED_BY_SUPPLIER | Purchase was cancelled by supplier|","enum":["NEW","PARTIALLY_RECEIVED","RECEIVED","SENT_TO_SUPPLIER","IN_TRANSIT","CLOSED","CANCELLED_BY_SUPPLIER"],"title":"PurchaseOrderStatusENUM","type":"string"},"UID":{"title":"UID","type":"string","pattern":"^[A-Za-z0-9-_]+"},"PurchaseOrderItemUpdateQtyDeliveredSchema":{"title":"PurchaseOrderItemUpdateQtyDeliveredSchema","type":"object","description":"Use when setting quantityDelivered on a purchaseOrderItem without any adjustment of stock","required":["purchaseOrderItemUid"],"properties":{"purchaseOrderItemUid":{"$ref":"#/components/schemas/UID"},"quantityReceived":{"type":"integer"},"expectedDeliveryDate":{"type":"string","format":"date"},"unitPrice":{"type":"integer"}}},"PurchaseOrderInvoiceAddressUpdateSchema":{"title":"PurchaseOrderInvoiceAddressUpdateSchema","type":"object","properties":{"companyName":{"type":"string"},"address":{"type":"string"},"postalCode":{"type":"string"},"city":{"type":"string"},"countryCode":{"type":"string"},"vatNumber":{"type":"string"},"email":{"type":"string"}}},"PurchaseOrderResponseSchema":{"title":"PurchaseOrderResponseSchema","type":"object","required":["createdAt","createdBy","deliveryAddress","deliveryCity","deliveryCountryCode","deliveryName","deliveryPostalCode","externalId","items","lastModifiedAt","lastModifiedBy","note","purchaseNumber","purchaseOrderUid","status","storeUid","storeName","supplierUid","supplierName","discountRate","freight","currency","supplierReferenceNumber","invoiceAddress","reserveAfter","hasConfirmedReceivements"],"properties":{"createdAt":{"format":"date-time","type":"string"},"createdBy":{"type":"string"},"deliveryAddress":{"type":"string"},"deliveryCity":{"type":"string"},"deliveryCountryCode":{"type":"string"},"deliveryName":{"type":"string"},"deliveryPostalCode":{"type":"string"},"externalId":{"type":"string"},"items":{"type":"array","items":{"$ref":"#/components/schemas/PurchaseOrderItemResponseSchema"}},"lastModifiedAt":{"format":"date-time","type":"string"},"lastModifiedBy":{"type":"string"},"note":{"type":"string"},"purchaseNumber":{"description":"Reference to a customer order","type":"string"},"purchaseOrderUid":{"$ref":"#/components/schemas/UID"},"status":{"$ref":"#/components/schemas/PurchaseOrderStatusENUM"},"storeUid":{"$ref":"#/components/schemas/UID"},"storeName":{"type":"string"},"supplierUid":{"$ref":"#/components/schemas/UID"},"supplierName":{"type":"string"},"discountRate":{"type":"integer"},"freight":{"type":"integer"},"currency":{"$ref":"#/components/schemas/PurchaseOrderCurrencySchema"},"supplierReferenceNumber":{"type":"string","description":"Supplier reference number"},"invoiceAddress":{"$ref":"#/components/schemas/PurchaseOrderInvoiceAddress"},"reserveAfter":{"type":"string","description":"If set, items in this purchase \norder cannot be reserved before this date.","format":"date-time","nullable":true},"hasConfirmedReceivements":{"type":"boolean"}}},"PurchaseOrderItemResponseSchema":{"title":"PurchaseOrderItemResponseSchema","type":"object","required":["createdAt","createdBy","expectedDeliveryDate","externalId","lastModifiedAt","lastModifiedBy","productUid","productName","productSerialNoRequired","productSku","purchaseOrderItemUid","quantityOrdered","quantityReceived","quantityReserved","supplierSku","unitPrice","receivementItems","discountAmount","freightAmount","unitCost","totalLinePrice","localCurrency","reservations","note","sortOrder","purchaseOrderItemLinks"],"properties":{"createdAt":{"type":"string","format":"date-time"},"createdBy":{"type":"string"},"expectedDeliveryDate":{"format":"date","type":"string"},"externalId":{"type":"string"},"lastModifiedAt":{"format":"date-time","type":"string"},"lastModifiedBy":{"type":"string"},"productUid":{"$ref":"#/components/schemas/UID"},"productName":{"type":"string"},"productSerialNoRequired":{"$ref":"#/components/schemas/SerialNoRequiredENUM"},"productSku":{"type":"string"},"purchaseOrderItemUid":{"$ref":"#/components/schemas/UID"},"quantityOrdered":{"type":"integer"},"quantityReceived":{"type":"integer"},"quantityReserved":{"type":"integer"},"supplierSku":{"type":"string"},"unitPrice":{"type":"integer","description":"unitPrice is in purchase price in order currency before discounts"},"receivementItems":{"type":"array","items":{"$ref":"#/components/schemas/PurchaseReceivementItemResponseSchema"}},"discountAmount":{"type":"integer","description":"The discount amount pr unit"},"freightAmount":{"type":"integer","description":"The portion of the shipping cost pr unit."},"unitCost":{"type":"integer","description":"The price pr unit including discount and freight. This is what will be used as cost price during receivement."},"totalLinePrice":{"type":"integer","description":"Total price for all the items including discounts and freight amount."},"currency":{"$ref":"#/components/schemas/DeprecatedPurchaseOrderItemCurrencySchema"},"localCurrency":{"$ref":"#/components/schemas/PurchaseOrderItemCurrencySchema"},"reservations":{"type":"array","items":{"$ref":"#/components/schemas/OrderItemReservationSchema"}},"note":{"type":"string"},"sortOrder":{"type":"integer"},"purchaseOrderItemLinks":{"type":"array","items":{"$ref":"#/components/schemas/PurchaseOrderItemLinkSchema"}}}},"SerialNoRequiredENUM":{"description":"|ENUM      | Description |\n| ---------------- | ------------ |\n| NO | No Serial number required|\n| ON_SALE | Can register serial number when selling a product (Serial number is optional)|\n| ON_RECEIVE | Must register serial number when receiving and selling product (Serial number is required)|","enum":["NO","ON_SALE","ON_RECEIVE"],"title":"SerialNoRequiredENUM","type":"string"},"PurchaseReceivementItemResponseSchema":{"title":"PurchaseReceivementItemResponseSchema","description":"PurchaseReceivementItem","allOf":[{"type":"object","required":["receivementUid","receivementStatus"],"properties":{"receivementUid":{"$ref":"#/components/schemas/UID"},"receivementStatus":{"$ref":"#/components/schemas/ReceivementStatusENUM"}}},{"$ref":"#/components/schemas/ReceivementItemResponseSchema"}]},"ReceivementStatusENUM":{"description":"|ENUM      | Description |\n| ---------------- | ------------ |\n| RECEIVED | Received|\n| PENDING | Put aside, not finished|\n| UPDATING | Updating in progress|\n| CONFIRMED | Confirmed |","enum":["RECEIVED","PENDING","UPDATING","CONFIRMED"],"title":"ReceivementStatusENUM","type":"string"},"ReceivementItemResponseSchema":{"title":"ReceivementItemResponseSchema","type":"object","required":["createdAt","createdBy","externalId","lastModifiedAt","lastModifiedBy","product","purchaseOrderItemUid","quantity","receivementItemUid","status","note","tenantUserUid","tenantUserDisplayName","reservations"],"properties":{"createdAt":{"format":"date-time","type":"string"},"createdBy":{"type":"string"},"externalId":{"description":"External reference to receivement line","type":"string"},"lastModifiedAt":{"format":"date-time","type":"string"},"lastModifiedBy":{"type":"string"},"product":{"$ref":"#/components/schemas/ReceivementItemProductResponseSchema"},"purchaseOrderItemUid":{"$ref":"#/components/schemas/UID"},"quantity":{"type":"integer"},"unitPrice":{"type":"integer","deprecated":true,"description":"Deprecated: Use unitcost instead"},"unitCost":{"type":"integer"},"receivementItemUid":{"$ref":"#/components/schemas/UID"},"serialnumber":{"type":"string"},"status":{"type":"string"},"note":{"type":"string"},"tenantUserUid":{"$ref":"#/components/schemas/OptionalUID"},"tenantUserDisplayName":{"type":"string","description":"The display name of the user that made the receivement"},"reservations":{"type":"array","items":{"$ref":"#/components/schemas/OrderItemReservationSchema"}}}},"ReceivementItemProductResponseSchema":{"title":"ReceivementItemProductResponseSchema","type":"object","required":["productUid","name","sku"],"properties":{"productUid":{"$ref":"#/components/schemas/UID"},"name":{"type":"string"},"sku":{"type":"string"}}},"OptionalUID":{"title":"OptionalUID","type":"string","pattern":"^[A-Za-z0-9-_]*"},"OrderItemReservationSchema":{"title":"OrderItemReservationSchema","type":"object","required":["orderUid","orderItemUid","orderNumber","quantity","reservationType"],"properties":{"orderUid":{"$ref":"#/components/schemas/UID"},"orderItemUid":{"$ref":"#/components/schemas/UID"},"orderNumber":{"type":"string"},"quantity":{"type":"integer"},"reservationType":{"$ref":"#/components/schemas/SalesReservationTypeENUM"}}},"SalesReservationTypeENUM":{"title":"SalesReservationTypeENUM","type":"string","enum":["NONE","WAREHOUSE","PURCHASEORDER","REQUEST_PURCHASEORDER","PURCHASEORDER_CONFIRMED"],"description":""},"DeprecatedPurchaseOrderItemCurrencySchema":{"title":"DeprecatedPurchaseOrderItemCurrencySchema","type":"object","deprecated":true,"required":["unitPrice","discountAmount","freightAmount","totalLinePrice"],"properties":{"unitPrice":{"type":"integer"},"discountAmount":{"type":"integer"},"freightAmount":{"type":"integer"},"totalLinePrice":{"type":"integer"}}},"PurchaseOrderItemCurrencySchema":{"title":"PurchaseOrderItemCurrencySchema","type":"object","description":"All prices is in the local tenant currency","required":["unitPrice","discountAmount","freightAmount","unitCost","totalLinePrice"],"properties":{"unitPrice":{"type":"integer","description":"unitPrice is in local currency before discount"},"discountAmount":{"type":"integer","description":"The discount amount pr unit"},"freightAmount":{"type":"integer","description":"The portion of the shipping cost for this purchase order line."},"unitCost":{"type":"integer","description":"The price pr unit including discount and freight. This is what will be used as cost price during receivement."},"totalLinePrice":{"type":"integer","description":"Total price for all the items including discounts and freight amount."}}},"PurchaseOrderItemLinkSchema":{"description":"Order reference for an order product item","title":"PurchaseOrderItemLinkSchema","type":"object","required":["purchaseOrderItemUid","type"],"properties":{"purchaseOrderItemUid":{"$ref":"#/components/schemas/UID"},"type":{"$ref":"#/components/schemas/PurchaseOrderLinkTypeResponseENUM"}}},"PurchaseOrderLinkTypeResponseENUM":{"description":"Describes the type of link on an order product item\n\n|ENUM | Description |\n| --- | --- |\n| PACKAGE | Reference to orderline with main package product |\n| PACKAGE_COMPONENT | Reference to orderline with package component product |\n","enum":["PACKAGE","PACKAGE_COMPONENT"],"title":"PurchaseOrderLinkTypeResponseENUM","type":"string"},"PurchaseOrderCurrencySchema":{"title":"PurchaseOrderCurrencySchema","type":"object","required":["code","exchangeRate"],"properties":{"code":{"type":"string","description":"ISO 4217"},"exchangeRate":{"type":"integer"}}},"PurchaseOrderInvoiceAddress":{"title":"PurchaseOrderInvoiceAddress","type":"object","required":["companyName","address","postalCode","city","countryCode","vatNumber","email"],"properties":{"companyName":{"type":"string"},"address":{"type":"string"},"postalCode":{"type":"string"},"city":{"type":"string"},"countryCode":{"type":"string"},"vatNumber":{"type":"string"},"email":{"type":"string"}}}},"responses":{"PurchaseOrderResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PurchaseOrderResponseSchema"}}},"description":"Example response"}}},"paths":{"/tenants/{tenantUid}/stores/{storeUid}/purchase-orders/{purchaseOrderUid}":{"put":{"description":"Specify a `currency` when the order is not in local currency. \nThe currency must exist in your foreign currencies. \nIf you leave `exchangeRate` empty, the exchange rate that is on the foreign currency will be used.\n\nRequired permissions: PURCHASE_ORDER","operationId":"put-tenants-stores-purchase-orders-details","requestBody":{"$ref":"#/components/requestBodies/PurchaseOrderUpdateRequest"},"responses":{"200":{"$ref":"#/components/responses/PurchaseOrderResponse"}},"summary":"Update purchase order details","tags":["Purchase"]}}}}
```

## Delete a purchase order

> Deletes a purchase order.\
> \
> Required permissions: PURCHASE\_ORDER

```json
{"openapi":"3.0.2","info":{"title":"Flow Retail API version 2","version":"2.0.0"},"tags":[{"name":"Purchase","description":"Purchase"}],"servers":[{"description":"Flow Retail Production","url":"https://api.flowretail.com/v2"},{"description":"Flow Retail Stage","url":"https://api.stage.flowretail.com/v2"}],"security":[{"accessToken":[]},{"authToken":[]},{"integrationToken":[]}],"components":{"securitySchemes":{"accessToken":{"description":"Access token recevied after user login with a deviceToken","scheme":"bearer","type":"http"},"authToken":{"description":"Token received from the auth service","scheme":"bearer","type":"http"},"integrationToken":{"scheme":"bearer","type":"http"}}},"paths":{"/tenants/{tenantUid}/stores/{storeUid}/purchase-orders/{purchaseOrderUid}":{"delete":{"description":"Deletes a purchase order.\n\nRequired permissions: PURCHASE_ORDER","operationId":"delete-tenants-stores-purchase-orders-details","responses":{"204":{"description":"No Content"}},"summary":"Delete a purchase order","tags":["Purchase"]}}}}
```

## List purchase order items

> Lists all items on a purchase order.\
> \
> Required permissions: PURCHASE\_ORDER

```json
{"openapi":"3.0.2","info":{"title":"Flow Retail API version 2","version":"2.0.0"},"tags":[{"name":"Purchase","description":"Purchase"}],"servers":[{"description":"Flow Retail Production","url":"https://api.flowretail.com/v2"},{"description":"Flow Retail Stage","url":"https://api.stage.flowretail.com/v2"}],"security":[{"accessToken":[]},{"authToken":[]},{"integrationToken":[]}],"components":{"securitySchemes":{"accessToken":{"description":"Access token recevied after user login with a deviceToken","scheme":"bearer","type":"http"},"authToken":{"description":"Token received from the auth service","scheme":"bearer","type":"http"},"integrationToken":{"scheme":"bearer","type":"http"}},"parameters":{"pageNumberQuery":{"description":"Reference to a specific page in a result set.","in":"query","name":"pageNumber","required":false,"schema":{"type":"integer"}},"pageSizeQuery":{"description":"The number of items per page in a result set.","in":"query","name":"pageSize","required":false,"schema":{"type":"integer"}},"sortByQuery":{"description":"Defines which field the resource list is sorted by.","in":"query","name":"sortBy","required":false,"schema":{"type":"string"}},"sortDirectionQuery":{"description":"Reference to a sort direction","explode":false,"in":"query","name":"sortDirection","schema":{"$ref":"#/components/schemas/SortDirectionENUM"},"style":"form"}},"schemas":{"SortDirectionENUM":{"description":"|ENUM      | Description |\n| ---------------- | ------------ |\n| ASC | Sort in ascending order|\n| DESC | Sort in descending order|\n","enum":["ASC","DESC"],"title":"SortDirectionENUM","type":"string"},"PurchaseOrderItemResponseSchema":{"title":"PurchaseOrderItemResponseSchema","type":"object","required":["createdAt","createdBy","expectedDeliveryDate","externalId","lastModifiedAt","lastModifiedBy","productUid","productName","productSerialNoRequired","productSku","purchaseOrderItemUid","quantityOrdered","quantityReceived","quantityReserved","supplierSku","unitPrice","receivementItems","discountAmount","freightAmount","unitCost","totalLinePrice","localCurrency","reservations","note","sortOrder","purchaseOrderItemLinks"],"properties":{"createdAt":{"type":"string","format":"date-time"},"createdBy":{"type":"string"},"expectedDeliveryDate":{"format":"date","type":"string"},"externalId":{"type":"string"},"lastModifiedAt":{"format":"date-time","type":"string"},"lastModifiedBy":{"type":"string"},"productUid":{"$ref":"#/components/schemas/UID"},"productName":{"type":"string"},"productSerialNoRequired":{"$ref":"#/components/schemas/SerialNoRequiredENUM"},"productSku":{"type":"string"},"purchaseOrderItemUid":{"$ref":"#/components/schemas/UID"},"quantityOrdered":{"type":"integer"},"quantityReceived":{"type":"integer"},"quantityReserved":{"type":"integer"},"supplierSku":{"type":"string"},"unitPrice":{"type":"integer","description":"unitPrice is in purchase price in order currency before discounts"},"receivementItems":{"type":"array","items":{"$ref":"#/components/schemas/PurchaseReceivementItemResponseSchema"}},"discountAmount":{"type":"integer","description":"The discount amount pr unit"},"freightAmount":{"type":"integer","description":"The portion of the shipping cost pr unit."},"unitCost":{"type":"integer","description":"The price pr unit including discount and freight. This is what will be used as cost price during receivement."},"totalLinePrice":{"type":"integer","description":"Total price for all the items including discounts and freight amount."},"currency":{"$ref":"#/components/schemas/DeprecatedPurchaseOrderItemCurrencySchema"},"localCurrency":{"$ref":"#/components/schemas/PurchaseOrderItemCurrencySchema"},"reservations":{"type":"array","items":{"$ref":"#/components/schemas/OrderItemReservationSchema"}},"note":{"type":"string"},"sortOrder":{"type":"integer"},"purchaseOrderItemLinks":{"type":"array","items":{"$ref":"#/components/schemas/PurchaseOrderItemLinkSchema"}}}},"UID":{"title":"UID","type":"string","pattern":"^[A-Za-z0-9-_]+"},"SerialNoRequiredENUM":{"description":"|ENUM      | Description |\n| ---------------- | ------------ |\n| NO | No Serial number required|\n| ON_SALE | Can register serial number when selling a product (Serial number is optional)|\n| ON_RECEIVE | Must register serial number when receiving and selling product (Serial number is required)|","enum":["NO","ON_SALE","ON_RECEIVE"],"title":"SerialNoRequiredENUM","type":"string"},"PurchaseReceivementItemResponseSchema":{"title":"PurchaseReceivementItemResponseSchema","description":"PurchaseReceivementItem","allOf":[{"type":"object","required":["receivementUid","receivementStatus"],"properties":{"receivementUid":{"$ref":"#/components/schemas/UID"},"receivementStatus":{"$ref":"#/components/schemas/ReceivementStatusENUM"}}},{"$ref":"#/components/schemas/ReceivementItemResponseSchema"}]},"ReceivementStatusENUM":{"description":"|ENUM      | Description |\n| ---------------- | ------------ |\n| RECEIVED | Received|\n| PENDING | Put aside, not finished|\n| UPDATING | Updating in progress|\n| CONFIRMED | Confirmed |","enum":["RECEIVED","PENDING","UPDATING","CONFIRMED"],"title":"ReceivementStatusENUM","type":"string"},"ReceivementItemResponseSchema":{"title":"ReceivementItemResponseSchema","type":"object","required":["createdAt","createdBy","externalId","lastModifiedAt","lastModifiedBy","product","purchaseOrderItemUid","quantity","receivementItemUid","status","note","tenantUserUid","tenantUserDisplayName","reservations"],"properties":{"createdAt":{"format":"date-time","type":"string"},"createdBy":{"type":"string"},"externalId":{"description":"External reference to receivement line","type":"string"},"lastModifiedAt":{"format":"date-time","type":"string"},"lastModifiedBy":{"type":"string"},"product":{"$ref":"#/components/schemas/ReceivementItemProductResponseSchema"},"purchaseOrderItemUid":{"$ref":"#/components/schemas/UID"},"quantity":{"type":"integer"},"unitPrice":{"type":"integer","deprecated":true,"description":"Deprecated: Use unitcost instead"},"unitCost":{"type":"integer"},"receivementItemUid":{"$ref":"#/components/schemas/UID"},"serialnumber":{"type":"string"},"status":{"type":"string"},"note":{"type":"string"},"tenantUserUid":{"$ref":"#/components/schemas/OptionalUID"},"tenantUserDisplayName":{"type":"string","description":"The display name of the user that made the receivement"},"reservations":{"type":"array","items":{"$ref":"#/components/schemas/OrderItemReservationSchema"}}}},"ReceivementItemProductResponseSchema":{"title":"ReceivementItemProductResponseSchema","type":"object","required":["productUid","name","sku"],"properties":{"productUid":{"$ref":"#/components/schemas/UID"},"name":{"type":"string"},"sku":{"type":"string"}}},"OptionalUID":{"title":"OptionalUID","type":"string","pattern":"^[A-Za-z0-9-_]*"},"OrderItemReservationSchema":{"title":"OrderItemReservationSchema","type":"object","required":["orderUid","orderItemUid","orderNumber","quantity","reservationType"],"properties":{"orderUid":{"$ref":"#/components/schemas/UID"},"orderItemUid":{"$ref":"#/components/schemas/UID"},"orderNumber":{"type":"string"},"quantity":{"type":"integer"},"reservationType":{"$ref":"#/components/schemas/SalesReservationTypeENUM"}}},"SalesReservationTypeENUM":{"title":"SalesReservationTypeENUM","type":"string","enum":["NONE","WAREHOUSE","PURCHASEORDER","REQUEST_PURCHASEORDER","PURCHASEORDER_CONFIRMED"],"description":""},"DeprecatedPurchaseOrderItemCurrencySchema":{"title":"DeprecatedPurchaseOrderItemCurrencySchema","type":"object","deprecated":true,"required":["unitPrice","discountAmount","freightAmount","totalLinePrice"],"properties":{"unitPrice":{"type":"integer"},"discountAmount":{"type":"integer"},"freightAmount":{"type":"integer"},"totalLinePrice":{"type":"integer"}}},"PurchaseOrderItemCurrencySchema":{"title":"PurchaseOrderItemCurrencySchema","type":"object","description":"All prices is in the local tenant currency","required":["unitPrice","discountAmount","freightAmount","unitCost","totalLinePrice"],"properties":{"unitPrice":{"type":"integer","description":"unitPrice is in local currency before discount"},"discountAmount":{"type":"integer","description":"The discount amount pr unit"},"freightAmount":{"type":"integer","description":"The portion of the shipping cost for this purchase order line."},"unitCost":{"type":"integer","description":"The price pr unit including discount and freight. This is what will be used as cost price during receivement."},"totalLinePrice":{"type":"integer","description":"Total price for all the items including discounts and freight amount."}}},"PurchaseOrderItemLinkSchema":{"description":"Order reference for an order product item","title":"PurchaseOrderItemLinkSchema","type":"object","required":["purchaseOrderItemUid","type"],"properties":{"purchaseOrderItemUid":{"$ref":"#/components/schemas/UID"},"type":{"$ref":"#/components/schemas/PurchaseOrderLinkTypeResponseENUM"}}},"PurchaseOrderLinkTypeResponseENUM":{"description":"Describes the type of link on an order product item\n\n|ENUM | Description |\n| --- | --- |\n| PACKAGE | Reference to orderline with main package product |\n| PACKAGE_COMPONENT | Reference to orderline with package component product |\n","enum":["PACKAGE","PACKAGE_COMPONENT"],"title":"PurchaseOrderLinkTypeResponseENUM","type":"string"},"Paging":{"description":"totalCount The total number of items in the result set.\n\npageSize The number of items per page.\n\npageNumber The current page in the result set.","properties":{"pageNumber":{"type":"integer"},"pageSize":{"type":"integer"},"totalCount":{"type":"integer"}},"required":["totalCount","pageSize","pageNumber"],"title":"Paging","type":"object"}},"responses":{"PurchaseOrderItemListResponse":{"content":{"application/json":{"schema":{"properties":{"items":{"items":{"$ref":"#/components/schemas/PurchaseOrderItemResponseSchema"},"type":"array"},"paging":{"$ref":"#/components/schemas/Paging"}},"required":["items","paging"],"type":"object"}}},"description":"Example response"}}},"paths":{"/tenants/{tenantUid}/stores/{storeUid}/purchase-orders/{purchaseOrderUid}/purchase-order-items":{"get":{"description":"Lists all items on a purchase order.\n\nRequired permissions: PURCHASE_ORDER","operationId":"get-tenants-stores-purchase-orders-items","parameters":[{"$ref":"#/components/parameters/pageNumberQuery"},{"$ref":"#/components/parameters/pageSizeQuery"},{"$ref":"#/components/parameters/sortByQuery"},{"$ref":"#/components/parameters/sortDirectionQuery"}],"responses":{"200":{"$ref":"#/components/responses/PurchaseOrderItemListResponse"}},"summary":"List purchase order items","tags":["Purchase"]}}}}
```

## Add a purchase order item

> Adds an item to a purchase order.\
> \
> Required permissions: PURCHASE\_ORDER

```json
{"openapi":"3.0.2","info":{"title":"Flow Retail API version 2","version":"2.0.0"},"tags":[{"name":"Purchase","description":"Purchase"}],"servers":[{"description":"Flow Retail Production","url":"https://api.flowretail.com/v2"},{"description":"Flow Retail Stage","url":"https://api.stage.flowretail.com/v2"}],"security":[{"accessToken":[]},{"authToken":[]},{"integrationToken":[]}],"components":{"securitySchemes":{"accessToken":{"description":"Access token recevied after user login with a deviceToken","scheme":"bearer","type":"http"},"authToken":{"description":"Token received from the auth service","scheme":"bearer","type":"http"},"integrationToken":{"scheme":"bearer","type":"http"}},"requestBodies":{"PurchaseOrderItemCreateRequest":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PurchaseOrderItemCreateSchema"}}}}},"schemas":{"PurchaseOrderItemCreateSchema":{"allOf":[{"$ref":"#/components/schemas/PurchaseOrderItemUpdateSchema"},{"properties":{"purchaseOrderItemUid":{"$ref":"#/components/schemas/UID"},"productUid":{"$ref":"#/components/schemas/UID"},"quantityOrdered":{"type":"integer"}},"required":["productUid","quantityOrdered"]}],"title":"PurchaseOrderItemCreateSchema","type":"object"},"PurchaseOrderItemUpdateSchema":{"title":"PurchaseOrderItemUpdateSchema","type":"object","properties":{"expectedDeliveryDate":{"format":"date","type":"string"},"externalId":{"description":"External reference to purchase order line","type":"string"},"productUid":{"$ref":"#/components/schemas/UID"},"quantityOrdered":{"type":"integer"},"supplierSku":{"type":"string"},"unitPrice":{"type":"integer","description":"unitPrice is in purchase order currency"},"note":{"type":"string"},"sortOrder":{"type":"integer"}}},"UID":{"title":"UID","type":"string","pattern":"^[A-Za-z0-9-_]+"},"PurchaseOrderResponseSchema":{"title":"PurchaseOrderResponseSchema","type":"object","required":["createdAt","createdBy","deliveryAddress","deliveryCity","deliveryCountryCode","deliveryName","deliveryPostalCode","externalId","items","lastModifiedAt","lastModifiedBy","note","purchaseNumber","purchaseOrderUid","status","storeUid","storeName","supplierUid","supplierName","discountRate","freight","currency","supplierReferenceNumber","invoiceAddress","reserveAfter","hasConfirmedReceivements"],"properties":{"createdAt":{"format":"date-time","type":"string"},"createdBy":{"type":"string"},"deliveryAddress":{"type":"string"},"deliveryCity":{"type":"string"},"deliveryCountryCode":{"type":"string"},"deliveryName":{"type":"string"},"deliveryPostalCode":{"type":"string"},"externalId":{"type":"string"},"items":{"type":"array","items":{"$ref":"#/components/schemas/PurchaseOrderItemResponseSchema"}},"lastModifiedAt":{"format":"date-time","type":"string"},"lastModifiedBy":{"type":"string"},"note":{"type":"string"},"purchaseNumber":{"description":"Reference to a customer order","type":"string"},"purchaseOrderUid":{"$ref":"#/components/schemas/UID"},"status":{"$ref":"#/components/schemas/PurchaseOrderStatusENUM"},"storeUid":{"$ref":"#/components/schemas/UID"},"storeName":{"type":"string"},"supplierUid":{"$ref":"#/components/schemas/UID"},"supplierName":{"type":"string"},"discountRate":{"type":"integer"},"freight":{"type":"integer"},"currency":{"$ref":"#/components/schemas/PurchaseOrderCurrencySchema"},"supplierReferenceNumber":{"type":"string","description":"Supplier reference number"},"invoiceAddress":{"$ref":"#/components/schemas/PurchaseOrderInvoiceAddress"},"reserveAfter":{"type":"string","description":"If set, items in this purchase \norder cannot be reserved before this date.","format":"date-time","nullable":true},"hasConfirmedReceivements":{"type":"boolean"}}},"PurchaseOrderItemResponseSchema":{"title":"PurchaseOrderItemResponseSchema","type":"object","required":["createdAt","createdBy","expectedDeliveryDate","externalId","lastModifiedAt","lastModifiedBy","productUid","productName","productSerialNoRequired","productSku","purchaseOrderItemUid","quantityOrdered","quantityReceived","quantityReserved","supplierSku","unitPrice","receivementItems","discountAmount","freightAmount","unitCost","totalLinePrice","localCurrency","reservations","note","sortOrder","purchaseOrderItemLinks"],"properties":{"createdAt":{"type":"string","format":"date-time"},"createdBy":{"type":"string"},"expectedDeliveryDate":{"format":"date","type":"string"},"externalId":{"type":"string"},"lastModifiedAt":{"format":"date-time","type":"string"},"lastModifiedBy":{"type":"string"},"productUid":{"$ref":"#/components/schemas/UID"},"productName":{"type":"string"},"productSerialNoRequired":{"$ref":"#/components/schemas/SerialNoRequiredENUM"},"productSku":{"type":"string"},"purchaseOrderItemUid":{"$ref":"#/components/schemas/UID"},"quantityOrdered":{"type":"integer"},"quantityReceived":{"type":"integer"},"quantityReserved":{"type":"integer"},"supplierSku":{"type":"string"},"unitPrice":{"type":"integer","description":"unitPrice is in purchase price in order currency before discounts"},"receivementItems":{"type":"array","items":{"$ref":"#/components/schemas/PurchaseReceivementItemResponseSchema"}},"discountAmount":{"type":"integer","description":"The discount amount pr unit"},"freightAmount":{"type":"integer","description":"The portion of the shipping cost pr unit."},"unitCost":{"type":"integer","description":"The price pr unit including discount and freight. This is what will be used as cost price during receivement."},"totalLinePrice":{"type":"integer","description":"Total price for all the items including discounts and freight amount."},"currency":{"$ref":"#/components/schemas/DeprecatedPurchaseOrderItemCurrencySchema"},"localCurrency":{"$ref":"#/components/schemas/PurchaseOrderItemCurrencySchema"},"reservations":{"type":"array","items":{"$ref":"#/components/schemas/OrderItemReservationSchema"}},"note":{"type":"string"},"sortOrder":{"type":"integer"},"purchaseOrderItemLinks":{"type":"array","items":{"$ref":"#/components/schemas/PurchaseOrderItemLinkSchema"}}}},"SerialNoRequiredENUM":{"description":"|ENUM      | Description |\n| ---------------- | ------------ |\n| NO | No Serial number required|\n| ON_SALE | Can register serial number when selling a product (Serial number is optional)|\n| ON_RECEIVE | Must register serial number when receiving and selling product (Serial number is required)|","enum":["NO","ON_SALE","ON_RECEIVE"],"title":"SerialNoRequiredENUM","type":"string"},"PurchaseReceivementItemResponseSchema":{"title":"PurchaseReceivementItemResponseSchema","description":"PurchaseReceivementItem","allOf":[{"type":"object","required":["receivementUid","receivementStatus"],"properties":{"receivementUid":{"$ref":"#/components/schemas/UID"},"receivementStatus":{"$ref":"#/components/schemas/ReceivementStatusENUM"}}},{"$ref":"#/components/schemas/ReceivementItemResponseSchema"}]},"ReceivementStatusENUM":{"description":"|ENUM      | Description |\n| ---------------- | ------------ |\n| RECEIVED | Received|\n| PENDING | Put aside, not finished|\n| UPDATING | Updating in progress|\n| CONFIRMED | Confirmed |","enum":["RECEIVED","PENDING","UPDATING","CONFIRMED"],"title":"ReceivementStatusENUM","type":"string"},"ReceivementItemResponseSchema":{"title":"ReceivementItemResponseSchema","type":"object","required":["createdAt","createdBy","externalId","lastModifiedAt","lastModifiedBy","product","purchaseOrderItemUid","quantity","receivementItemUid","status","note","tenantUserUid","tenantUserDisplayName","reservations"],"properties":{"createdAt":{"format":"date-time","type":"string"},"createdBy":{"type":"string"},"externalId":{"description":"External reference to receivement line","type":"string"},"lastModifiedAt":{"format":"date-time","type":"string"},"lastModifiedBy":{"type":"string"},"product":{"$ref":"#/components/schemas/ReceivementItemProductResponseSchema"},"purchaseOrderItemUid":{"$ref":"#/components/schemas/UID"},"quantity":{"type":"integer"},"unitPrice":{"type":"integer","deprecated":true,"description":"Deprecated: Use unitcost instead"},"unitCost":{"type":"integer"},"receivementItemUid":{"$ref":"#/components/schemas/UID"},"serialnumber":{"type":"string"},"status":{"type":"string"},"note":{"type":"string"},"tenantUserUid":{"$ref":"#/components/schemas/OptionalUID"},"tenantUserDisplayName":{"type":"string","description":"The display name of the user that made the receivement"},"reservations":{"type":"array","items":{"$ref":"#/components/schemas/OrderItemReservationSchema"}}}},"ReceivementItemProductResponseSchema":{"title":"ReceivementItemProductResponseSchema","type":"object","required":["productUid","name","sku"],"properties":{"productUid":{"$ref":"#/components/schemas/UID"},"name":{"type":"string"},"sku":{"type":"string"}}},"OptionalUID":{"title":"OptionalUID","type":"string","pattern":"^[A-Za-z0-9-_]*"},"OrderItemReservationSchema":{"title":"OrderItemReservationSchema","type":"object","required":["orderUid","orderItemUid","orderNumber","quantity","reservationType"],"properties":{"orderUid":{"$ref":"#/components/schemas/UID"},"orderItemUid":{"$ref":"#/components/schemas/UID"},"orderNumber":{"type":"string"},"quantity":{"type":"integer"},"reservationType":{"$ref":"#/components/schemas/SalesReservationTypeENUM"}}},"SalesReservationTypeENUM":{"title":"SalesReservationTypeENUM","type":"string","enum":["NONE","WAREHOUSE","PURCHASEORDER","REQUEST_PURCHASEORDER","PURCHASEORDER_CONFIRMED"],"description":""},"DeprecatedPurchaseOrderItemCurrencySchema":{"title":"DeprecatedPurchaseOrderItemCurrencySchema","type":"object","deprecated":true,"required":["unitPrice","discountAmount","freightAmount","totalLinePrice"],"properties":{"unitPrice":{"type":"integer"},"discountAmount":{"type":"integer"},"freightAmount":{"type":"integer"},"totalLinePrice":{"type":"integer"}}},"PurchaseOrderItemCurrencySchema":{"title":"PurchaseOrderItemCurrencySchema","type":"object","description":"All prices is in the local tenant currency","required":["unitPrice","discountAmount","freightAmount","unitCost","totalLinePrice"],"properties":{"unitPrice":{"type":"integer","description":"unitPrice is in local currency before discount"},"discountAmount":{"type":"integer","description":"The discount amount pr unit"},"freightAmount":{"type":"integer","description":"The portion of the shipping cost for this purchase order line."},"unitCost":{"type":"integer","description":"The price pr unit including discount and freight. This is what will be used as cost price during receivement."},"totalLinePrice":{"type":"integer","description":"Total price for all the items including discounts and freight amount."}}},"PurchaseOrderItemLinkSchema":{"description":"Order reference for an order product item","title":"PurchaseOrderItemLinkSchema","type":"object","required":["purchaseOrderItemUid","type"],"properties":{"purchaseOrderItemUid":{"$ref":"#/components/schemas/UID"},"type":{"$ref":"#/components/schemas/PurchaseOrderLinkTypeResponseENUM"}}},"PurchaseOrderLinkTypeResponseENUM":{"description":"Describes the type of link on an order product item\n\n|ENUM | Description |\n| --- | --- |\n| PACKAGE | Reference to orderline with main package product |\n| PACKAGE_COMPONENT | Reference to orderline with package component product |\n","enum":["PACKAGE","PACKAGE_COMPONENT"],"title":"PurchaseOrderLinkTypeResponseENUM","type":"string"},"PurchaseOrderStatusENUM":{"description":"|ENUM      | Description |\n| ---------------- | ------------ |\n| NEW | Created, but not sent to supplier yet.|\n| SENT_TO_SUPPLIER | Sent to supplier.|\n| CANCELLED_BY_SUPPLIER | The purchase order have been cancelled by the supplier. This status is only applicable for suppliers who are integrated with FlowRetail.|\n| IN_TRANSIT | The goods are in transit. This status is only applicable for suppliers who are integrated with FlowRetail.|\n| PARTIALLY_RECEIVED | Not all goods have been received yet.|\n| RECEIVED | All goods have been received.|\n| CLOSED | No longer able to process purchase order.|\n| CANCELLED_BY_SUPPLIER | Purchase was cancelled by supplier|","enum":["NEW","PARTIALLY_RECEIVED","RECEIVED","SENT_TO_SUPPLIER","IN_TRANSIT","CLOSED","CANCELLED_BY_SUPPLIER"],"title":"PurchaseOrderStatusENUM","type":"string"},"PurchaseOrderCurrencySchema":{"title":"PurchaseOrderCurrencySchema","type":"object","required":["code","exchangeRate"],"properties":{"code":{"type":"string","description":"ISO 4217"},"exchangeRate":{"type":"integer"}}},"PurchaseOrderInvoiceAddress":{"title":"PurchaseOrderInvoiceAddress","type":"object","required":["companyName","address","postalCode","city","countryCode","vatNumber","email"],"properties":{"companyName":{"type":"string"},"address":{"type":"string"},"postalCode":{"type":"string"},"city":{"type":"string"},"countryCode":{"type":"string"},"vatNumber":{"type":"string"},"email":{"type":"string"}}}},"responses":{"PurchaseOrderResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PurchaseOrderResponseSchema"}}},"description":"Example response"}}},"paths":{"/tenants/{tenantUid}/stores/{storeUid}/purchase-orders/{purchaseOrderUid}/purchase-order-items":{"post":{"description":"Adds an item to a purchase order.\n\nRequired permissions: PURCHASE_ORDER","operationId":"post-tenants-stores-purchase-orders-items","requestBody":{"$ref":"#/components/requestBodies/PurchaseOrderItemCreateRequest"},"responses":{"200":{"$ref":"#/components/responses/PurchaseOrderResponse"}},"summary":"Add a purchase order item","tags":["Purchase"]}}}}
```

## Get purchase order item details

> Get details for an item on a purchase order.\
> \
> Required permissions: PURCHASE\_ORDER

```json
{"openapi":"3.0.2","info":{"title":"Flow Retail API version 2","version":"2.0.0"},"tags":[{"name":"Purchase","description":"Purchase"}],"servers":[{"description":"Flow Retail Production","url":"https://api.flowretail.com/v2"},{"description":"Flow Retail Stage","url":"https://api.stage.flowretail.com/v2"}],"security":[{"accessToken":[]},{"authToken":[]},{"integrationToken":[]}],"components":{"securitySchemes":{"accessToken":{"description":"Access token recevied after user login with a deviceToken","scheme":"bearer","type":"http"},"authToken":{"description":"Token received from the auth service","scheme":"bearer","type":"http"},"integrationToken":{"scheme":"bearer","type":"http"}},"responses":{"PurchaseOrderItemResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PurchaseOrderItemResponseSchema"}}},"description":"Example response"}},"schemas":{"PurchaseOrderItemResponseSchema":{"title":"PurchaseOrderItemResponseSchema","type":"object","required":["createdAt","createdBy","expectedDeliveryDate","externalId","lastModifiedAt","lastModifiedBy","productUid","productName","productSerialNoRequired","productSku","purchaseOrderItemUid","quantityOrdered","quantityReceived","quantityReserved","supplierSku","unitPrice","receivementItems","discountAmount","freightAmount","unitCost","totalLinePrice","localCurrency","reservations","note","sortOrder","purchaseOrderItemLinks"],"properties":{"createdAt":{"type":"string","format":"date-time"},"createdBy":{"type":"string"},"expectedDeliveryDate":{"format":"date","type":"string"},"externalId":{"type":"string"},"lastModifiedAt":{"format":"date-time","type":"string"},"lastModifiedBy":{"type":"string"},"productUid":{"$ref":"#/components/schemas/UID"},"productName":{"type":"string"},"productSerialNoRequired":{"$ref":"#/components/schemas/SerialNoRequiredENUM"},"productSku":{"type":"string"},"purchaseOrderItemUid":{"$ref":"#/components/schemas/UID"},"quantityOrdered":{"type":"integer"},"quantityReceived":{"type":"integer"},"quantityReserved":{"type":"integer"},"supplierSku":{"type":"string"},"unitPrice":{"type":"integer","description":"unitPrice is in purchase price in order currency before discounts"},"receivementItems":{"type":"array","items":{"$ref":"#/components/schemas/PurchaseReceivementItemResponseSchema"}},"discountAmount":{"type":"integer","description":"The discount amount pr unit"},"freightAmount":{"type":"integer","description":"The portion of the shipping cost pr unit."},"unitCost":{"type":"integer","description":"The price pr unit including discount and freight. This is what will be used as cost price during receivement."},"totalLinePrice":{"type":"integer","description":"Total price for all the items including discounts and freight amount."},"currency":{"$ref":"#/components/schemas/DeprecatedPurchaseOrderItemCurrencySchema"},"localCurrency":{"$ref":"#/components/schemas/PurchaseOrderItemCurrencySchema"},"reservations":{"type":"array","items":{"$ref":"#/components/schemas/OrderItemReservationSchema"}},"note":{"type":"string"},"sortOrder":{"type":"integer"},"purchaseOrderItemLinks":{"type":"array","items":{"$ref":"#/components/schemas/PurchaseOrderItemLinkSchema"}}}},"UID":{"title":"UID","type":"string","pattern":"^[A-Za-z0-9-_]+"},"SerialNoRequiredENUM":{"description":"|ENUM      | Description |\n| ---------------- | ------------ |\n| NO | No Serial number required|\n| ON_SALE | Can register serial number when selling a product (Serial number is optional)|\n| ON_RECEIVE | Must register serial number when receiving and selling product (Serial number is required)|","enum":["NO","ON_SALE","ON_RECEIVE"],"title":"SerialNoRequiredENUM","type":"string"},"PurchaseReceivementItemResponseSchema":{"title":"PurchaseReceivementItemResponseSchema","description":"PurchaseReceivementItem","allOf":[{"type":"object","required":["receivementUid","receivementStatus"],"properties":{"receivementUid":{"$ref":"#/components/schemas/UID"},"receivementStatus":{"$ref":"#/components/schemas/ReceivementStatusENUM"}}},{"$ref":"#/components/schemas/ReceivementItemResponseSchema"}]},"ReceivementStatusENUM":{"description":"|ENUM      | Description |\n| ---------------- | ------------ |\n| RECEIVED | Received|\n| PENDING | Put aside, not finished|\n| UPDATING | Updating in progress|\n| CONFIRMED | Confirmed |","enum":["RECEIVED","PENDING","UPDATING","CONFIRMED"],"title":"ReceivementStatusENUM","type":"string"},"ReceivementItemResponseSchema":{"title":"ReceivementItemResponseSchema","type":"object","required":["createdAt","createdBy","externalId","lastModifiedAt","lastModifiedBy","product","purchaseOrderItemUid","quantity","receivementItemUid","status","note","tenantUserUid","tenantUserDisplayName","reservations"],"properties":{"createdAt":{"format":"date-time","type":"string"},"createdBy":{"type":"string"},"externalId":{"description":"External reference to receivement line","type":"string"},"lastModifiedAt":{"format":"date-time","type":"string"},"lastModifiedBy":{"type":"string"},"product":{"$ref":"#/components/schemas/ReceivementItemProductResponseSchema"},"purchaseOrderItemUid":{"$ref":"#/components/schemas/UID"},"quantity":{"type":"integer"},"unitPrice":{"type":"integer","deprecated":true,"description":"Deprecated: Use unitcost instead"},"unitCost":{"type":"integer"},"receivementItemUid":{"$ref":"#/components/schemas/UID"},"serialnumber":{"type":"string"},"status":{"type":"string"},"note":{"type":"string"},"tenantUserUid":{"$ref":"#/components/schemas/OptionalUID"},"tenantUserDisplayName":{"type":"string","description":"The display name of the user that made the receivement"},"reservations":{"type":"array","items":{"$ref":"#/components/schemas/OrderItemReservationSchema"}}}},"ReceivementItemProductResponseSchema":{"title":"ReceivementItemProductResponseSchema","type":"object","required":["productUid","name","sku"],"properties":{"productUid":{"$ref":"#/components/schemas/UID"},"name":{"type":"string"},"sku":{"type":"string"}}},"OptionalUID":{"title":"OptionalUID","type":"string","pattern":"^[A-Za-z0-9-_]*"},"OrderItemReservationSchema":{"title":"OrderItemReservationSchema","type":"object","required":["orderUid","orderItemUid","orderNumber","quantity","reservationType"],"properties":{"orderUid":{"$ref":"#/components/schemas/UID"},"orderItemUid":{"$ref":"#/components/schemas/UID"},"orderNumber":{"type":"string"},"quantity":{"type":"integer"},"reservationType":{"$ref":"#/components/schemas/SalesReservationTypeENUM"}}},"SalesReservationTypeENUM":{"title":"SalesReservationTypeENUM","type":"string","enum":["NONE","WAREHOUSE","PURCHASEORDER","REQUEST_PURCHASEORDER","PURCHASEORDER_CONFIRMED"],"description":""},"DeprecatedPurchaseOrderItemCurrencySchema":{"title":"DeprecatedPurchaseOrderItemCurrencySchema","type":"object","deprecated":true,"required":["unitPrice","discountAmount","freightAmount","totalLinePrice"],"properties":{"unitPrice":{"type":"integer"},"discountAmount":{"type":"integer"},"freightAmount":{"type":"integer"},"totalLinePrice":{"type":"integer"}}},"PurchaseOrderItemCurrencySchema":{"title":"PurchaseOrderItemCurrencySchema","type":"object","description":"All prices is in the local tenant currency","required":["unitPrice","discountAmount","freightAmount","unitCost","totalLinePrice"],"properties":{"unitPrice":{"type":"integer","description":"unitPrice is in local currency before discount"},"discountAmount":{"type":"integer","description":"The discount amount pr unit"},"freightAmount":{"type":"integer","description":"The portion of the shipping cost for this purchase order line."},"unitCost":{"type":"integer","description":"The price pr unit including discount and freight. This is what will be used as cost price during receivement."},"totalLinePrice":{"type":"integer","description":"Total price for all the items including discounts and freight amount."}}},"PurchaseOrderItemLinkSchema":{"description":"Order reference for an order product item","title":"PurchaseOrderItemLinkSchema","type":"object","required":["purchaseOrderItemUid","type"],"properties":{"purchaseOrderItemUid":{"$ref":"#/components/schemas/UID"},"type":{"$ref":"#/components/schemas/PurchaseOrderLinkTypeResponseENUM"}}},"PurchaseOrderLinkTypeResponseENUM":{"description":"Describes the type of link on an order product item\n\n|ENUM | Description |\n| --- | --- |\n| PACKAGE | Reference to orderline with main package product |\n| PACKAGE_COMPONENT | Reference to orderline with package component product |\n","enum":["PACKAGE","PACKAGE_COMPONENT"],"title":"PurchaseOrderLinkTypeResponseENUM","type":"string"}}},"paths":{"/tenants/{tenantUid}/stores/{storeUid}/purchase-orders/{purchaseOrderUid}/purchase-order-items/{purchaseOrderItemUid}":{"get":{"description":"Get details for an item on a purchase order.\n\nRequired permissions: PURCHASE_ORDER","operationId":"get-tenants-stores-purchase-orders-purchase-order-items-details","responses":{"200":{"$ref":"#/components/responses/PurchaseOrderItemResponse"}},"summary":"Get purchase order item details","tags":["Purchase"]}}}}
```

## Update purchase order item details

> Update details for an item on a purchase order.\
> \
> Required permissions: PURCHASE\_ORDER

```json
{"openapi":"3.0.2","info":{"title":"Flow Retail API version 2","version":"2.0.0"},"tags":[{"name":"Purchase","description":"Purchase"}],"servers":[{"description":"Flow Retail Production","url":"https://api.flowretail.com/v2"},{"description":"Flow Retail Stage","url":"https://api.stage.flowretail.com/v2"}],"security":[{"accessToken":[]},{"authToken":[]},{"integrationToken":[]}],"components":{"securitySchemes":{"accessToken":{"description":"Access token recevied after user login with a deviceToken","scheme":"bearer","type":"http"},"authToken":{"description":"Token received from the auth service","scheme":"bearer","type":"http"},"integrationToken":{"scheme":"bearer","type":"http"}},"requestBodies":{"PurchaseOrderItemUpdateRequest":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PurchaseOrderItemUpdateSchema"}}}}},"schemas":{"PurchaseOrderItemUpdateSchema":{"title":"PurchaseOrderItemUpdateSchema","type":"object","properties":{"expectedDeliveryDate":{"format":"date","type":"string"},"externalId":{"description":"External reference to purchase order line","type":"string"},"productUid":{"$ref":"#/components/schemas/UID"},"quantityOrdered":{"type":"integer"},"supplierSku":{"type":"string"},"unitPrice":{"type":"integer","description":"unitPrice is in purchase order currency"},"note":{"type":"string"},"sortOrder":{"type":"integer"}}},"UID":{"title":"UID","type":"string","pattern":"^[A-Za-z0-9-_]+"},"PurchaseOrderResponseSchema":{"title":"PurchaseOrderResponseSchema","type":"object","required":["createdAt","createdBy","deliveryAddress","deliveryCity","deliveryCountryCode","deliveryName","deliveryPostalCode","externalId","items","lastModifiedAt","lastModifiedBy","note","purchaseNumber","purchaseOrderUid","status","storeUid","storeName","supplierUid","supplierName","discountRate","freight","currency","supplierReferenceNumber","invoiceAddress","reserveAfter","hasConfirmedReceivements"],"properties":{"createdAt":{"format":"date-time","type":"string"},"createdBy":{"type":"string"},"deliveryAddress":{"type":"string"},"deliveryCity":{"type":"string"},"deliveryCountryCode":{"type":"string"},"deliveryName":{"type":"string"},"deliveryPostalCode":{"type":"string"},"externalId":{"type":"string"},"items":{"type":"array","items":{"$ref":"#/components/schemas/PurchaseOrderItemResponseSchema"}},"lastModifiedAt":{"format":"date-time","type":"string"},"lastModifiedBy":{"type":"string"},"note":{"type":"string"},"purchaseNumber":{"description":"Reference to a customer order","type":"string"},"purchaseOrderUid":{"$ref":"#/components/schemas/UID"},"status":{"$ref":"#/components/schemas/PurchaseOrderStatusENUM"},"storeUid":{"$ref":"#/components/schemas/UID"},"storeName":{"type":"string"},"supplierUid":{"$ref":"#/components/schemas/UID"},"supplierName":{"type":"string"},"discountRate":{"type":"integer"},"freight":{"type":"integer"},"currency":{"$ref":"#/components/schemas/PurchaseOrderCurrencySchema"},"supplierReferenceNumber":{"type":"string","description":"Supplier reference number"},"invoiceAddress":{"$ref":"#/components/schemas/PurchaseOrderInvoiceAddress"},"reserveAfter":{"type":"string","description":"If set, items in this purchase \norder cannot be reserved before this date.","format":"date-time","nullable":true},"hasConfirmedReceivements":{"type":"boolean"}}},"PurchaseOrderItemResponseSchema":{"title":"PurchaseOrderItemResponseSchema","type":"object","required":["createdAt","createdBy","expectedDeliveryDate","externalId","lastModifiedAt","lastModifiedBy","productUid","productName","productSerialNoRequired","productSku","purchaseOrderItemUid","quantityOrdered","quantityReceived","quantityReserved","supplierSku","unitPrice","receivementItems","discountAmount","freightAmount","unitCost","totalLinePrice","localCurrency","reservations","note","sortOrder","purchaseOrderItemLinks"],"properties":{"createdAt":{"type":"string","format":"date-time"},"createdBy":{"type":"string"},"expectedDeliveryDate":{"format":"date","type":"string"},"externalId":{"type":"string"},"lastModifiedAt":{"format":"date-time","type":"string"},"lastModifiedBy":{"type":"string"},"productUid":{"$ref":"#/components/schemas/UID"},"productName":{"type":"string"},"productSerialNoRequired":{"$ref":"#/components/schemas/SerialNoRequiredENUM"},"productSku":{"type":"string"},"purchaseOrderItemUid":{"$ref":"#/components/schemas/UID"},"quantityOrdered":{"type":"integer"},"quantityReceived":{"type":"integer"},"quantityReserved":{"type":"integer"},"supplierSku":{"type":"string"},"unitPrice":{"type":"integer","description":"unitPrice is in purchase price in order currency before discounts"},"receivementItems":{"type":"array","items":{"$ref":"#/components/schemas/PurchaseReceivementItemResponseSchema"}},"discountAmount":{"type":"integer","description":"The discount amount pr unit"},"freightAmount":{"type":"integer","description":"The portion of the shipping cost pr unit."},"unitCost":{"type":"integer","description":"The price pr unit including discount and freight. This is what will be used as cost price during receivement."},"totalLinePrice":{"type":"integer","description":"Total price for all the items including discounts and freight amount."},"currency":{"$ref":"#/components/schemas/DeprecatedPurchaseOrderItemCurrencySchema"},"localCurrency":{"$ref":"#/components/schemas/PurchaseOrderItemCurrencySchema"},"reservations":{"type":"array","items":{"$ref":"#/components/schemas/OrderItemReservationSchema"}},"note":{"type":"string"},"sortOrder":{"type":"integer"},"purchaseOrderItemLinks":{"type":"array","items":{"$ref":"#/components/schemas/PurchaseOrderItemLinkSchema"}}}},"SerialNoRequiredENUM":{"description":"|ENUM      | Description |\n| ---------------- | ------------ |\n| NO | No Serial number required|\n| ON_SALE | Can register serial number when selling a product (Serial number is optional)|\n| ON_RECEIVE | Must register serial number when receiving and selling product (Serial number is required)|","enum":["NO","ON_SALE","ON_RECEIVE"],"title":"SerialNoRequiredENUM","type":"string"},"PurchaseReceivementItemResponseSchema":{"title":"PurchaseReceivementItemResponseSchema","description":"PurchaseReceivementItem","allOf":[{"type":"object","required":["receivementUid","receivementStatus"],"properties":{"receivementUid":{"$ref":"#/components/schemas/UID"},"receivementStatus":{"$ref":"#/components/schemas/ReceivementStatusENUM"}}},{"$ref":"#/components/schemas/ReceivementItemResponseSchema"}]},"ReceivementStatusENUM":{"description":"|ENUM      | Description |\n| ---------------- | ------------ |\n| RECEIVED | Received|\n| PENDING | Put aside, not finished|\n| UPDATING | Updating in progress|\n| CONFIRMED | Confirmed |","enum":["RECEIVED","PENDING","UPDATING","CONFIRMED"],"title":"ReceivementStatusENUM","type":"string"},"ReceivementItemResponseSchema":{"title":"ReceivementItemResponseSchema","type":"object","required":["createdAt","createdBy","externalId","lastModifiedAt","lastModifiedBy","product","purchaseOrderItemUid","quantity","receivementItemUid","status","note","tenantUserUid","tenantUserDisplayName","reservations"],"properties":{"createdAt":{"format":"date-time","type":"string"},"createdBy":{"type":"string"},"externalId":{"description":"External reference to receivement line","type":"string"},"lastModifiedAt":{"format":"date-time","type":"string"},"lastModifiedBy":{"type":"string"},"product":{"$ref":"#/components/schemas/ReceivementItemProductResponseSchema"},"purchaseOrderItemUid":{"$ref":"#/components/schemas/UID"},"quantity":{"type":"integer"},"unitPrice":{"type":"integer","deprecated":true,"description":"Deprecated: Use unitcost instead"},"unitCost":{"type":"integer"},"receivementItemUid":{"$ref":"#/components/schemas/UID"},"serialnumber":{"type":"string"},"status":{"type":"string"},"note":{"type":"string"},"tenantUserUid":{"$ref":"#/components/schemas/OptionalUID"},"tenantUserDisplayName":{"type":"string","description":"The display name of the user that made the receivement"},"reservations":{"type":"array","items":{"$ref":"#/components/schemas/OrderItemReservationSchema"}}}},"ReceivementItemProductResponseSchema":{"title":"ReceivementItemProductResponseSchema","type":"object","required":["productUid","name","sku"],"properties":{"productUid":{"$ref":"#/components/schemas/UID"},"name":{"type":"string"},"sku":{"type":"string"}}},"OptionalUID":{"title":"OptionalUID","type":"string","pattern":"^[A-Za-z0-9-_]*"},"OrderItemReservationSchema":{"title":"OrderItemReservationSchema","type":"object","required":["orderUid","orderItemUid","orderNumber","quantity","reservationType"],"properties":{"orderUid":{"$ref":"#/components/schemas/UID"},"orderItemUid":{"$ref":"#/components/schemas/UID"},"orderNumber":{"type":"string"},"quantity":{"type":"integer"},"reservationType":{"$ref":"#/components/schemas/SalesReservationTypeENUM"}}},"SalesReservationTypeENUM":{"title":"SalesReservationTypeENUM","type":"string","enum":["NONE","WAREHOUSE","PURCHASEORDER","REQUEST_PURCHASEORDER","PURCHASEORDER_CONFIRMED"],"description":""},"DeprecatedPurchaseOrderItemCurrencySchema":{"title":"DeprecatedPurchaseOrderItemCurrencySchema","type":"object","deprecated":true,"required":["unitPrice","discountAmount","freightAmount","totalLinePrice"],"properties":{"unitPrice":{"type":"integer"},"discountAmount":{"type":"integer"},"freightAmount":{"type":"integer"},"totalLinePrice":{"type":"integer"}}},"PurchaseOrderItemCurrencySchema":{"title":"PurchaseOrderItemCurrencySchema","type":"object","description":"All prices is in the local tenant currency","required":["unitPrice","discountAmount","freightAmount","unitCost","totalLinePrice"],"properties":{"unitPrice":{"type":"integer","description":"unitPrice is in local currency before discount"},"discountAmount":{"type":"integer","description":"The discount amount pr unit"},"freightAmount":{"type":"integer","description":"The portion of the shipping cost for this purchase order line."},"unitCost":{"type":"integer","description":"The price pr unit including discount and freight. This is what will be used as cost price during receivement."},"totalLinePrice":{"type":"integer","description":"Total price for all the items including discounts and freight amount."}}},"PurchaseOrderItemLinkSchema":{"description":"Order reference for an order product item","title":"PurchaseOrderItemLinkSchema","type":"object","required":["purchaseOrderItemUid","type"],"properties":{"purchaseOrderItemUid":{"$ref":"#/components/schemas/UID"},"type":{"$ref":"#/components/schemas/PurchaseOrderLinkTypeResponseENUM"}}},"PurchaseOrderLinkTypeResponseENUM":{"description":"Describes the type of link on an order product item\n\n|ENUM | Description |\n| --- | --- |\n| PACKAGE | Reference to orderline with main package product |\n| PACKAGE_COMPONENT | Reference to orderline with package component product |\n","enum":["PACKAGE","PACKAGE_COMPONENT"],"title":"PurchaseOrderLinkTypeResponseENUM","type":"string"},"PurchaseOrderStatusENUM":{"description":"|ENUM      | Description |\n| ---------------- | ------------ |\n| NEW | Created, but not sent to supplier yet.|\n| SENT_TO_SUPPLIER | Sent to supplier.|\n| CANCELLED_BY_SUPPLIER | The purchase order have been cancelled by the supplier. This status is only applicable for suppliers who are integrated with FlowRetail.|\n| IN_TRANSIT | The goods are in transit. This status is only applicable for suppliers who are integrated with FlowRetail.|\n| PARTIALLY_RECEIVED | Not all goods have been received yet.|\n| RECEIVED | All goods have been received.|\n| CLOSED | No longer able to process purchase order.|\n| CANCELLED_BY_SUPPLIER | Purchase was cancelled by supplier|","enum":["NEW","PARTIALLY_RECEIVED","RECEIVED","SENT_TO_SUPPLIER","IN_TRANSIT","CLOSED","CANCELLED_BY_SUPPLIER"],"title":"PurchaseOrderStatusENUM","type":"string"},"PurchaseOrderCurrencySchema":{"title":"PurchaseOrderCurrencySchema","type":"object","required":["code","exchangeRate"],"properties":{"code":{"type":"string","description":"ISO 4217"},"exchangeRate":{"type":"integer"}}},"PurchaseOrderInvoiceAddress":{"title":"PurchaseOrderInvoiceAddress","type":"object","required":["companyName","address","postalCode","city","countryCode","vatNumber","email"],"properties":{"companyName":{"type":"string"},"address":{"type":"string"},"postalCode":{"type":"string"},"city":{"type":"string"},"countryCode":{"type":"string"},"vatNumber":{"type":"string"},"email":{"type":"string"}}}},"responses":{"PurchaseOrderResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PurchaseOrderResponseSchema"}}},"description":"Example response"}}},"paths":{"/tenants/{tenantUid}/stores/{storeUid}/purchase-orders/{purchaseOrderUid}/purchase-order-items/{purchaseOrderItemUid}":{"put":{"description":"Update details for an item on a purchase order.\n\nRequired permissions: PURCHASE_ORDER","operationId":"put-tenants-stores-purchase-orders-purchase-order-items-details","requestBody":{"$ref":"#/components/requestBodies/PurchaseOrderItemUpdateRequest"},"responses":{"200":{"$ref":"#/components/responses/PurchaseOrderResponse"}},"summary":"Update purchase order item details","tags":["Purchase"]}}}}
```

## Remove a purchase order item

> Removes an item from a purchase order.\
> \
> Required permissions: PURCHASE\_ORDER

```json
{"openapi":"3.0.2","info":{"title":"Flow Retail API version 2","version":"2.0.0"},"tags":[{"name":"Purchase","description":"Purchase"}],"servers":[{"description":"Flow Retail Production","url":"https://api.flowretail.com/v2"},{"description":"Flow Retail Stage","url":"https://api.stage.flowretail.com/v2"}],"security":[{"accessToken":[]},{"authToken":[]},{"integrationToken":[]}],"components":{"securitySchemes":{"accessToken":{"description":"Access token recevied after user login with a deviceToken","scheme":"bearer","type":"http"},"authToken":{"description":"Token received from the auth service","scheme":"bearer","type":"http"},"integrationToken":{"scheme":"bearer","type":"http"}},"responses":{"PurchaseOrderResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PurchaseOrderResponseSchema"}}},"description":"Example response"}},"schemas":{"PurchaseOrderResponseSchema":{"title":"PurchaseOrderResponseSchema","type":"object","required":["createdAt","createdBy","deliveryAddress","deliveryCity","deliveryCountryCode","deliveryName","deliveryPostalCode","externalId","items","lastModifiedAt","lastModifiedBy","note","purchaseNumber","purchaseOrderUid","status","storeUid","storeName","supplierUid","supplierName","discountRate","freight","currency","supplierReferenceNumber","invoiceAddress","reserveAfter","hasConfirmedReceivements"],"properties":{"createdAt":{"format":"date-time","type":"string"},"createdBy":{"type":"string"},"deliveryAddress":{"type":"string"},"deliveryCity":{"type":"string"},"deliveryCountryCode":{"type":"string"},"deliveryName":{"type":"string"},"deliveryPostalCode":{"type":"string"},"externalId":{"type":"string"},"items":{"type":"array","items":{"$ref":"#/components/schemas/PurchaseOrderItemResponseSchema"}},"lastModifiedAt":{"format":"date-time","type":"string"},"lastModifiedBy":{"type":"string"},"note":{"type":"string"},"purchaseNumber":{"description":"Reference to a customer order","type":"string"},"purchaseOrderUid":{"$ref":"#/components/schemas/UID"},"status":{"$ref":"#/components/schemas/PurchaseOrderStatusENUM"},"storeUid":{"$ref":"#/components/schemas/UID"},"storeName":{"type":"string"},"supplierUid":{"$ref":"#/components/schemas/UID"},"supplierName":{"type":"string"},"discountRate":{"type":"integer"},"freight":{"type":"integer"},"currency":{"$ref":"#/components/schemas/PurchaseOrderCurrencySchema"},"supplierReferenceNumber":{"type":"string","description":"Supplier reference number"},"invoiceAddress":{"$ref":"#/components/schemas/PurchaseOrderInvoiceAddress"},"reserveAfter":{"type":"string","description":"If set, items in this purchase \norder cannot be reserved before this date.","format":"date-time","nullable":true},"hasConfirmedReceivements":{"type":"boolean"}}},"PurchaseOrderItemResponseSchema":{"title":"PurchaseOrderItemResponseSchema","type":"object","required":["createdAt","createdBy","expectedDeliveryDate","externalId","lastModifiedAt","lastModifiedBy","productUid","productName","productSerialNoRequired","productSku","purchaseOrderItemUid","quantityOrdered","quantityReceived","quantityReserved","supplierSku","unitPrice","receivementItems","discountAmount","freightAmount","unitCost","totalLinePrice","localCurrency","reservations","note","sortOrder","purchaseOrderItemLinks"],"properties":{"createdAt":{"type":"string","format":"date-time"},"createdBy":{"type":"string"},"expectedDeliveryDate":{"format":"date","type":"string"},"externalId":{"type":"string"},"lastModifiedAt":{"format":"date-time","type":"string"},"lastModifiedBy":{"type":"string"},"productUid":{"$ref":"#/components/schemas/UID"},"productName":{"type":"string"},"productSerialNoRequired":{"$ref":"#/components/schemas/SerialNoRequiredENUM"},"productSku":{"type":"string"},"purchaseOrderItemUid":{"$ref":"#/components/schemas/UID"},"quantityOrdered":{"type":"integer"},"quantityReceived":{"type":"integer"},"quantityReserved":{"type":"integer"},"supplierSku":{"type":"string"},"unitPrice":{"type":"integer","description":"unitPrice is in purchase price in order currency before discounts"},"receivementItems":{"type":"array","items":{"$ref":"#/components/schemas/PurchaseReceivementItemResponseSchema"}},"discountAmount":{"type":"integer","description":"The discount amount pr unit"},"freightAmount":{"type":"integer","description":"The portion of the shipping cost pr unit."},"unitCost":{"type":"integer","description":"The price pr unit including discount and freight. This is what will be used as cost price during receivement."},"totalLinePrice":{"type":"integer","description":"Total price for all the items including discounts and freight amount."},"currency":{"$ref":"#/components/schemas/DeprecatedPurchaseOrderItemCurrencySchema"},"localCurrency":{"$ref":"#/components/schemas/PurchaseOrderItemCurrencySchema"},"reservations":{"type":"array","items":{"$ref":"#/components/schemas/OrderItemReservationSchema"}},"note":{"type":"string"},"sortOrder":{"type":"integer"},"purchaseOrderItemLinks":{"type":"array","items":{"$ref":"#/components/schemas/PurchaseOrderItemLinkSchema"}}}},"UID":{"title":"UID","type":"string","pattern":"^[A-Za-z0-9-_]+"},"SerialNoRequiredENUM":{"description":"|ENUM      | Description |\n| ---------------- | ------------ |\n| NO | No Serial number required|\n| ON_SALE | Can register serial number when selling a product (Serial number is optional)|\n| ON_RECEIVE | Must register serial number when receiving and selling product (Serial number is required)|","enum":["NO","ON_SALE","ON_RECEIVE"],"title":"SerialNoRequiredENUM","type":"string"},"PurchaseReceivementItemResponseSchema":{"title":"PurchaseReceivementItemResponseSchema","description":"PurchaseReceivementItem","allOf":[{"type":"object","required":["receivementUid","receivementStatus"],"properties":{"receivementUid":{"$ref":"#/components/schemas/UID"},"receivementStatus":{"$ref":"#/components/schemas/ReceivementStatusENUM"}}},{"$ref":"#/components/schemas/ReceivementItemResponseSchema"}]},"ReceivementStatusENUM":{"description":"|ENUM      | Description |\n| ---------------- | ------------ |\n| RECEIVED | Received|\n| PENDING | Put aside, not finished|\n| UPDATING | Updating in progress|\n| CONFIRMED | Confirmed |","enum":["RECEIVED","PENDING","UPDATING","CONFIRMED"],"title":"ReceivementStatusENUM","type":"string"},"ReceivementItemResponseSchema":{"title":"ReceivementItemResponseSchema","type":"object","required":["createdAt","createdBy","externalId","lastModifiedAt","lastModifiedBy","product","purchaseOrderItemUid","quantity","receivementItemUid","status","note","tenantUserUid","tenantUserDisplayName","reservations"],"properties":{"createdAt":{"format":"date-time","type":"string"},"createdBy":{"type":"string"},"externalId":{"description":"External reference to receivement line","type":"string"},"lastModifiedAt":{"format":"date-time","type":"string"},"lastModifiedBy":{"type":"string"},"product":{"$ref":"#/components/schemas/ReceivementItemProductResponseSchema"},"purchaseOrderItemUid":{"$ref":"#/components/schemas/UID"},"quantity":{"type":"integer"},"unitPrice":{"type":"integer","deprecated":true,"description":"Deprecated: Use unitcost instead"},"unitCost":{"type":"integer"},"receivementItemUid":{"$ref":"#/components/schemas/UID"},"serialnumber":{"type":"string"},"status":{"type":"string"},"note":{"type":"string"},"tenantUserUid":{"$ref":"#/components/schemas/OptionalUID"},"tenantUserDisplayName":{"type":"string","description":"The display name of the user that made the receivement"},"reservations":{"type":"array","items":{"$ref":"#/components/schemas/OrderItemReservationSchema"}}}},"ReceivementItemProductResponseSchema":{"title":"ReceivementItemProductResponseSchema","type":"object","required":["productUid","name","sku"],"properties":{"productUid":{"$ref":"#/components/schemas/UID"},"name":{"type":"string"},"sku":{"type":"string"}}},"OptionalUID":{"title":"OptionalUID","type":"string","pattern":"^[A-Za-z0-9-_]*"},"OrderItemReservationSchema":{"title":"OrderItemReservationSchema","type":"object","required":["orderUid","orderItemUid","orderNumber","quantity","reservationType"],"properties":{"orderUid":{"$ref":"#/components/schemas/UID"},"orderItemUid":{"$ref":"#/components/schemas/UID"},"orderNumber":{"type":"string"},"quantity":{"type":"integer"},"reservationType":{"$ref":"#/components/schemas/SalesReservationTypeENUM"}}},"SalesReservationTypeENUM":{"title":"SalesReservationTypeENUM","type":"string","enum":["NONE","WAREHOUSE","PURCHASEORDER","REQUEST_PURCHASEORDER","PURCHASEORDER_CONFIRMED"],"description":""},"DeprecatedPurchaseOrderItemCurrencySchema":{"title":"DeprecatedPurchaseOrderItemCurrencySchema","type":"object","deprecated":true,"required":["unitPrice","discountAmount","freightAmount","totalLinePrice"],"properties":{"unitPrice":{"type":"integer"},"discountAmount":{"type":"integer"},"freightAmount":{"type":"integer"},"totalLinePrice":{"type":"integer"}}},"PurchaseOrderItemCurrencySchema":{"title":"PurchaseOrderItemCurrencySchema","type":"object","description":"All prices is in the local tenant currency","required":["unitPrice","discountAmount","freightAmount","unitCost","totalLinePrice"],"properties":{"unitPrice":{"type":"integer","description":"unitPrice is in local currency before discount"},"discountAmount":{"type":"integer","description":"The discount amount pr unit"},"freightAmount":{"type":"integer","description":"The portion of the shipping cost for this purchase order line."},"unitCost":{"type":"integer","description":"The price pr unit including discount and freight. This is what will be used as cost price during receivement."},"totalLinePrice":{"type":"integer","description":"Total price for all the items including discounts and freight amount."}}},"PurchaseOrderItemLinkSchema":{"description":"Order reference for an order product item","title":"PurchaseOrderItemLinkSchema","type":"object","required":["purchaseOrderItemUid","type"],"properties":{"purchaseOrderItemUid":{"$ref":"#/components/schemas/UID"},"type":{"$ref":"#/components/schemas/PurchaseOrderLinkTypeResponseENUM"}}},"PurchaseOrderLinkTypeResponseENUM":{"description":"Describes the type of link on an order product item\n\n|ENUM | Description |\n| --- | --- |\n| PACKAGE | Reference to orderline with main package product |\n| PACKAGE_COMPONENT | Reference to orderline with package component product |\n","enum":["PACKAGE","PACKAGE_COMPONENT"],"title":"PurchaseOrderLinkTypeResponseENUM","type":"string"},"PurchaseOrderStatusENUM":{"description":"|ENUM      | Description |\n| ---------------- | ------------ |\n| NEW | Created, but not sent to supplier yet.|\n| SENT_TO_SUPPLIER | Sent to supplier.|\n| CANCELLED_BY_SUPPLIER | The purchase order have been cancelled by the supplier. This status is only applicable for suppliers who are integrated with FlowRetail.|\n| IN_TRANSIT | The goods are in transit. This status is only applicable for suppliers who are integrated with FlowRetail.|\n| PARTIALLY_RECEIVED | Not all goods have been received yet.|\n| RECEIVED | All goods have been received.|\n| CLOSED | No longer able to process purchase order.|\n| CANCELLED_BY_SUPPLIER | Purchase was cancelled by supplier|","enum":["NEW","PARTIALLY_RECEIVED","RECEIVED","SENT_TO_SUPPLIER","IN_TRANSIT","CLOSED","CANCELLED_BY_SUPPLIER"],"title":"PurchaseOrderStatusENUM","type":"string"},"PurchaseOrderCurrencySchema":{"title":"PurchaseOrderCurrencySchema","type":"object","required":["code","exchangeRate"],"properties":{"code":{"type":"string","description":"ISO 4217"},"exchangeRate":{"type":"integer"}}},"PurchaseOrderInvoiceAddress":{"title":"PurchaseOrderInvoiceAddress","type":"object","required":["companyName","address","postalCode","city","countryCode","vatNumber","email"],"properties":{"companyName":{"type":"string"},"address":{"type":"string"},"postalCode":{"type":"string"},"city":{"type":"string"},"countryCode":{"type":"string"},"vatNumber":{"type":"string"},"email":{"type":"string"}}}}},"paths":{"/tenants/{tenantUid}/stores/{storeUid}/purchase-orders/{purchaseOrderUid}/purchase-order-items/{purchaseOrderItemUid}":{"delete":{"description":"Removes an item from a purchase order.\n\nRequired permissions: PURCHASE_ORDER","operationId":"delete-tenants-stores-purchase-orders-purchase-order-items-details","responses":{"200":{"$ref":"#/components/responses/PurchaseOrderResponse"}},"summary":"Remove a purchase order item","tags":["Purchase"]}}}}
```

## Print or send receipt

> Send receipt as PDF, print on printer or get as PDF\
> \
> Required permissions: PURCHASE\_ORDER

```json
{"openapi":"3.0.2","info":{"title":"Flow Retail API version 2","version":"2.0.0"},"tags":[{"name":"Purchase","description":"Purchase"}],"servers":[{"description":"Flow Retail Production","url":"https://api.flowretail.com/v2"},{"description":"Flow Retail Stage","url":"https://api.stage.flowretail.com/v2"}],"security":[{"accessToken":[]},{"authToken":[]},{"integrationToken":[]}],"components":{"securitySchemes":{"accessToken":{"description":"Access token recevied after user login with a deviceToken","scheme":"bearer","type":"http"},"authToken":{"description":"Token received from the auth service","scheme":"bearer","type":"http"},"integrationToken":{"scheme":"bearer","type":"http"}},"requestBodies":{"PurchaseOrderEmailNotificationRequest":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PurchaseOrderEmailNotificationRequestSchema"}}}}},"schemas":{"PurchaseOrderEmailNotificationRequestSchema":{"title":"PurchaseOrderEmailNotificationRequestSchema","type":"object","required":["email"],"properties":{"email":{"$ref":"#/components/schemas/EmailTYPE"},"recepients":{"type":"array","items":{"$ref":"#/components/schemas/EmailTYPE"}},"subject":{"type":"string"},"body":{"type":"string"},"includePDF":{"type":"boolean","default":true},"attachments":{"type":"array","items":{"$ref":"#/components/schemas/Base64EncodedFileContentSchema"}}}},"EmailTYPE":{"title":"Email","type":"string"},"Base64EncodedFileContentSchema":{"title":"Base64EncodedFileContentSchema","type":"object","properties":{"content":{"type":"string","description":" base64 encoded"},"contentType":{"description":"mime type","type":"string"},"filename":{"type":"string"}},"required":["content","contentType","filename"]}},"responses":{"FileResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Base64EncodedFileContentSchema"}},"application/pdf":{"schema":{"format":"binary","type":"string"}},"text/html":{"schema":{"type":"string"}},"application/octet-stream":{"schema":{"type":"string","format":"binary"}}},"description":"Based on the Accept header the response will be base64 json encoded or a raw file.\napplication/octet-stream will return a binary file\napplication/json will return a json with the file content base64 encoded."}}},"paths":{"/tenants/{tenantUid}/stores/{storeUid}/purchase-orders/{purchaseOrderUid}/receipt":{"post":{"description":"Send receipt as PDF, print on printer or get as PDF\n\nRequired permissions: PURCHASE_ORDER","operationId":"post-tenants-stores-purchase-orders-receipt","requestBody":{"$ref":"#/components/requestBodies/PurchaseOrderEmailNotificationRequest"},"responses":{"200":{"$ref":"#/components/responses/FileResponse"},"201":{"description":"Created"},"400":{"description":"Bad Request"}},"summary":"Print or send receipt","tags":["Purchase"]}}}}
```

## List supplier products for product

> Lists all supplier products for a productUid. If the product has been linked to a tenant productUid then additional information will be added.

```json
{"openapi":"3.0.2","info":{"title":"Flow Retail API version 2","version":"2.0.0"},"tags":[{"name":"Purchase","description":"Purchase"}],"servers":[{"description":"Flow Retail Production","url":"https://api.flowretail.com/v2"},{"description":"Flow Retail Stage","url":"https://api.stage.flowretail.com/v2"}],"security":[{"accessToken":[]},{"authToken":[]},{"integrationToken":[]}],"components":{"securitySchemes":{"accessToken":{"description":"Access token recevied after user login with a deviceToken","scheme":"bearer","type":"http"},"authToken":{"description":"Token received from the auth service","scheme":"bearer","type":"http"},"integrationToken":{"scheme":"bearer","type":"http"}},"parameters":{"pageNumberQuery":{"description":"Reference to a specific page in a result set.","in":"query","name":"pageNumber","required":false,"schema":{"type":"integer"}},"pageSizeQuery":{"description":"The number of items per page in a result set.","in":"query","name":"pageSize","required":false,"schema":{"type":"integer"}},"sortByQuery":{"description":"Defines which field the resource list is sorted by.","in":"query","name":"sortBy","required":false,"schema":{"type":"string"}},"sortDirectionQuery":{"description":"Reference to a sort direction","explode":false,"in":"query","name":"sortDirection","schema":{"$ref":"#/components/schemas/SortDirectionENUM"},"style":"form"}},"schemas":{"SortDirectionENUM":{"description":"|ENUM      | Description |\n| ---------------- | ------------ |\n| ASC | Sort in ascending order|\n| DESC | Sort in descending order|\n","enum":["ASC","DESC"],"title":"SortDirectionENUM","type":"string"},"SupplierProductResponseSchema":{"title":"SupplierProductResponseSchema","type":"object","properties":{"createdAt":{"format":"date-time","type":"string"},"lastModifiedAt":{"format":"date-time","type":"string"},"productUid":{"$ref":"#/components/schemas/UID"},"supplierUid":{"$ref":"#/components/schemas/UID"},"purchasePrice":{"type":"integer"},"supplierProductUid":{"$ref":"#/components/schemas/UID"},"supplierSku":{"type":"string"}},"required":["createdAt","lastModifiedAt","productUid","supplierUid","purchasePrice","supplierProductUid","supplierSku"]},"UID":{"title":"UID","type":"string","pattern":"^[A-Za-z0-9-_]+"},"Paging":{"description":"totalCount The total number of items in the result set.\n\npageSize The number of items per page.\n\npageNumber The current page in the result set.","properties":{"pageNumber":{"type":"integer"},"pageSize":{"type":"integer"},"totalCount":{"type":"integer"}},"required":["totalCount","pageSize","pageNumber"],"title":"Paging","type":"object"}},"responses":{"SupplierProductListResponse":{"content":{"application/json":{"schema":{"properties":{"items":{"items":{"$ref":"#/components/schemas/SupplierProductResponseSchema"},"type":"array"},"paging":{"$ref":"#/components/schemas/Paging"}},"required":["items","paging"],"type":"object"}}},"description":"Example response"}}},"paths":{"/tenants/{tenantUid}/products/{productUid}/suppliers":{"get":{"description":"Lists all supplier products for a productUid. If the product has been linked to a tenant productUid then additional information will be added.","operationId":"get-tenants-products-suppliers","parameters":[{"$ref":"#/components/parameters/pageNumberQuery"},{"$ref":"#/components/parameters/pageSizeQuery"},{"$ref":"#/components/parameters/sortByQuery"},{"$ref":"#/components/parameters/sortDirectionQuery"}],"responses":{"200":{"$ref":"#/components/responses/SupplierProductListResponse"}},"summary":"List supplier products for product","tags":["Purchase"]}}}}
```

## Search for purchase orders

> Search for purchase orders

```json
{"openapi":"3.0.2","info":{"title":"Flow Retail API version 2","version":"2.0.0"},"tags":[{"name":"Purchase","description":"Purchase"}],"servers":[{"description":"Flow Retail Production","url":"https://api.flowretail.com/v2"},{"description":"Flow Retail Stage","url":"https://api.stage.flowretail.com/v2"}],"security":[{"accessToken":[]},{"authToken":[]},{"integrationToken":[]}],"components":{"securitySchemes":{"accessToken":{"description":"Access token recevied after user login with a deviceToken","scheme":"bearer","type":"http"},"authToken":{"description":"Token received from the auth service","scheme":"bearer","type":"http"},"integrationToken":{"scheme":"bearer","type":"http"}},"responses":{"PurchaseOrderListResponse":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/PurchaseOrderResponseSchema"}},"paging":{"$ref":"#/components/schemas/Paging"}},"required":["items","paging"]}},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{"schema":{"type":"string","format":"binary"}}},"description":"Example response"}},"schemas":{"PurchaseOrderResponseSchema":{"title":"PurchaseOrderResponseSchema","type":"object","required":["createdAt","createdBy","deliveryAddress","deliveryCity","deliveryCountryCode","deliveryName","deliveryPostalCode","externalId","items","lastModifiedAt","lastModifiedBy","note","purchaseNumber","purchaseOrderUid","status","storeUid","storeName","supplierUid","supplierName","discountRate","freight","currency","supplierReferenceNumber","invoiceAddress","reserveAfter","hasConfirmedReceivements"],"properties":{"createdAt":{"format":"date-time","type":"string"},"createdBy":{"type":"string"},"deliveryAddress":{"type":"string"},"deliveryCity":{"type":"string"},"deliveryCountryCode":{"type":"string"},"deliveryName":{"type":"string"},"deliveryPostalCode":{"type":"string"},"externalId":{"type":"string"},"items":{"type":"array","items":{"$ref":"#/components/schemas/PurchaseOrderItemResponseSchema"}},"lastModifiedAt":{"format":"date-time","type":"string"},"lastModifiedBy":{"type":"string"},"note":{"type":"string"},"purchaseNumber":{"description":"Reference to a customer order","type":"string"},"purchaseOrderUid":{"$ref":"#/components/schemas/UID"},"status":{"$ref":"#/components/schemas/PurchaseOrderStatusENUM"},"storeUid":{"$ref":"#/components/schemas/UID"},"storeName":{"type":"string"},"supplierUid":{"$ref":"#/components/schemas/UID"},"supplierName":{"type":"string"},"discountRate":{"type":"integer"},"freight":{"type":"integer"},"currency":{"$ref":"#/components/schemas/PurchaseOrderCurrencySchema"},"supplierReferenceNumber":{"type":"string","description":"Supplier reference number"},"invoiceAddress":{"$ref":"#/components/schemas/PurchaseOrderInvoiceAddress"},"reserveAfter":{"type":"string","description":"If set, items in this purchase \norder cannot be reserved before this date.","format":"date-time","nullable":true},"hasConfirmedReceivements":{"type":"boolean"}}},"PurchaseOrderItemResponseSchema":{"title":"PurchaseOrderItemResponseSchema","type":"object","required":["createdAt","createdBy","expectedDeliveryDate","externalId","lastModifiedAt","lastModifiedBy","productUid","productName","productSerialNoRequired","productSku","purchaseOrderItemUid","quantityOrdered","quantityReceived","quantityReserved","supplierSku","unitPrice","receivementItems","discountAmount","freightAmount","unitCost","totalLinePrice","localCurrency","reservations","note","sortOrder","purchaseOrderItemLinks"],"properties":{"createdAt":{"type":"string","format":"date-time"},"createdBy":{"type":"string"},"expectedDeliveryDate":{"format":"date","type":"string"},"externalId":{"type":"string"},"lastModifiedAt":{"format":"date-time","type":"string"},"lastModifiedBy":{"type":"string"},"productUid":{"$ref":"#/components/schemas/UID"},"productName":{"type":"string"},"productSerialNoRequired":{"$ref":"#/components/schemas/SerialNoRequiredENUM"},"productSku":{"type":"string"},"purchaseOrderItemUid":{"$ref":"#/components/schemas/UID"},"quantityOrdered":{"type":"integer"},"quantityReceived":{"type":"integer"},"quantityReserved":{"type":"integer"},"supplierSku":{"type":"string"},"unitPrice":{"type":"integer","description":"unitPrice is in purchase price in order currency before discounts"},"receivementItems":{"type":"array","items":{"$ref":"#/components/schemas/PurchaseReceivementItemResponseSchema"}},"discountAmount":{"type":"integer","description":"The discount amount pr unit"},"freightAmount":{"type":"integer","description":"The portion of the shipping cost pr unit."},"unitCost":{"type":"integer","description":"The price pr unit including discount and freight. This is what will be used as cost price during receivement."},"totalLinePrice":{"type":"integer","description":"Total price for all the items including discounts and freight amount."},"currency":{"$ref":"#/components/schemas/DeprecatedPurchaseOrderItemCurrencySchema"},"localCurrency":{"$ref":"#/components/schemas/PurchaseOrderItemCurrencySchema"},"reservations":{"type":"array","items":{"$ref":"#/components/schemas/OrderItemReservationSchema"}},"note":{"type":"string"},"sortOrder":{"type":"integer"},"purchaseOrderItemLinks":{"type":"array","items":{"$ref":"#/components/schemas/PurchaseOrderItemLinkSchema"}}}},"UID":{"title":"UID","type":"string","pattern":"^[A-Za-z0-9-_]+"},"SerialNoRequiredENUM":{"description":"|ENUM      | Description |\n| ---------------- | ------------ |\n| NO | No Serial number required|\n| ON_SALE | Can register serial number when selling a product (Serial number is optional)|\n| ON_RECEIVE | Must register serial number when receiving and selling product (Serial number is required)|","enum":["NO","ON_SALE","ON_RECEIVE"],"title":"SerialNoRequiredENUM","type":"string"},"PurchaseReceivementItemResponseSchema":{"title":"PurchaseReceivementItemResponseSchema","description":"PurchaseReceivementItem","allOf":[{"type":"object","required":["receivementUid","receivementStatus"],"properties":{"receivementUid":{"$ref":"#/components/schemas/UID"},"receivementStatus":{"$ref":"#/components/schemas/ReceivementStatusENUM"}}},{"$ref":"#/components/schemas/ReceivementItemResponseSchema"}]},"ReceivementStatusENUM":{"description":"|ENUM      | Description |\n| ---------------- | ------------ |\n| RECEIVED | Received|\n| PENDING | Put aside, not finished|\n| UPDATING | Updating in progress|\n| CONFIRMED | Confirmed |","enum":["RECEIVED","PENDING","UPDATING","CONFIRMED"],"title":"ReceivementStatusENUM","type":"string"},"ReceivementItemResponseSchema":{"title":"ReceivementItemResponseSchema","type":"object","required":["createdAt","createdBy","externalId","lastModifiedAt","lastModifiedBy","product","purchaseOrderItemUid","quantity","receivementItemUid","status","note","tenantUserUid","tenantUserDisplayName","reservations"],"properties":{"createdAt":{"format":"date-time","type":"string"},"createdBy":{"type":"string"},"externalId":{"description":"External reference to receivement line","type":"string"},"lastModifiedAt":{"format":"date-time","type":"string"},"lastModifiedBy":{"type":"string"},"product":{"$ref":"#/components/schemas/ReceivementItemProductResponseSchema"},"purchaseOrderItemUid":{"$ref":"#/components/schemas/UID"},"quantity":{"type":"integer"},"unitPrice":{"type":"integer","deprecated":true,"description":"Deprecated: Use unitcost instead"},"unitCost":{"type":"integer"},"receivementItemUid":{"$ref":"#/components/schemas/UID"},"serialnumber":{"type":"string"},"status":{"type":"string"},"note":{"type":"string"},"tenantUserUid":{"$ref":"#/components/schemas/OptionalUID"},"tenantUserDisplayName":{"type":"string","description":"The display name of the user that made the receivement"},"reservations":{"type":"array","items":{"$ref":"#/components/schemas/OrderItemReservationSchema"}}}},"ReceivementItemProductResponseSchema":{"title":"ReceivementItemProductResponseSchema","type":"object","required":["productUid","name","sku"],"properties":{"productUid":{"$ref":"#/components/schemas/UID"},"name":{"type":"string"},"sku":{"type":"string"}}},"OptionalUID":{"title":"OptionalUID","type":"string","pattern":"^[A-Za-z0-9-_]*"},"OrderItemReservationSchema":{"title":"OrderItemReservationSchema","type":"object","required":["orderUid","orderItemUid","orderNumber","quantity","reservationType"],"properties":{"orderUid":{"$ref":"#/components/schemas/UID"},"orderItemUid":{"$ref":"#/components/schemas/UID"},"orderNumber":{"type":"string"},"quantity":{"type":"integer"},"reservationType":{"$ref":"#/components/schemas/SalesReservationTypeENUM"}}},"SalesReservationTypeENUM":{"title":"SalesReservationTypeENUM","type":"string","enum":["NONE","WAREHOUSE","PURCHASEORDER","REQUEST_PURCHASEORDER","PURCHASEORDER_CONFIRMED"],"description":""},"DeprecatedPurchaseOrderItemCurrencySchema":{"title":"DeprecatedPurchaseOrderItemCurrencySchema","type":"object","deprecated":true,"required":["unitPrice","discountAmount","freightAmount","totalLinePrice"],"properties":{"unitPrice":{"type":"integer"},"discountAmount":{"type":"integer"},"freightAmount":{"type":"integer"},"totalLinePrice":{"type":"integer"}}},"PurchaseOrderItemCurrencySchema":{"title":"PurchaseOrderItemCurrencySchema","type":"object","description":"All prices is in the local tenant currency","required":["unitPrice","discountAmount","freightAmount","unitCost","totalLinePrice"],"properties":{"unitPrice":{"type":"integer","description":"unitPrice is in local currency before discount"},"discountAmount":{"type":"integer","description":"The discount amount pr unit"},"freightAmount":{"type":"integer","description":"The portion of the shipping cost for this purchase order line."},"unitCost":{"type":"integer","description":"The price pr unit including discount and freight. This is what will be used as cost price during receivement."},"totalLinePrice":{"type":"integer","description":"Total price for all the items including discounts and freight amount."}}},"PurchaseOrderItemLinkSchema":{"description":"Order reference for an order product item","title":"PurchaseOrderItemLinkSchema","type":"object","required":["purchaseOrderItemUid","type"],"properties":{"purchaseOrderItemUid":{"$ref":"#/components/schemas/UID"},"type":{"$ref":"#/components/schemas/PurchaseOrderLinkTypeResponseENUM"}}},"PurchaseOrderLinkTypeResponseENUM":{"description":"Describes the type of link on an order product item\n\n|ENUM | Description |\n| --- | --- |\n| PACKAGE | Reference to orderline with main package product |\n| PACKAGE_COMPONENT | Reference to orderline with package component product |\n","enum":["PACKAGE","PACKAGE_COMPONENT"],"title":"PurchaseOrderLinkTypeResponseENUM","type":"string"},"PurchaseOrderStatusENUM":{"description":"|ENUM      | Description |\n| ---------------- | ------------ |\n| NEW | Created, but not sent to supplier yet.|\n| SENT_TO_SUPPLIER | Sent to supplier.|\n| CANCELLED_BY_SUPPLIER | The purchase order have been cancelled by the supplier. This status is only applicable for suppliers who are integrated with FlowRetail.|\n| IN_TRANSIT | The goods are in transit. This status is only applicable for suppliers who are integrated with FlowRetail.|\n| PARTIALLY_RECEIVED | Not all goods have been received yet.|\n| RECEIVED | All goods have been received.|\n| CLOSED | No longer able to process purchase order.|\n| CANCELLED_BY_SUPPLIER | Purchase was cancelled by supplier|","enum":["NEW","PARTIALLY_RECEIVED","RECEIVED","SENT_TO_SUPPLIER","IN_TRANSIT","CLOSED","CANCELLED_BY_SUPPLIER"],"title":"PurchaseOrderStatusENUM","type":"string"},"PurchaseOrderCurrencySchema":{"title":"PurchaseOrderCurrencySchema","type":"object","required":["code","exchangeRate"],"properties":{"code":{"type":"string","description":"ISO 4217"},"exchangeRate":{"type":"integer"}}},"PurchaseOrderInvoiceAddress":{"title":"PurchaseOrderInvoiceAddress","type":"object","required":["companyName","address","postalCode","city","countryCode","vatNumber","email"],"properties":{"companyName":{"type":"string"},"address":{"type":"string"},"postalCode":{"type":"string"},"city":{"type":"string"},"countryCode":{"type":"string"},"vatNumber":{"type":"string"},"email":{"type":"string"}}},"Paging":{"description":"totalCount The total number of items in the result set.\n\npageSize The number of items per page.\n\npageNumber The current page in the result set.","properties":{"pageNumber":{"type":"integer"},"pageSize":{"type":"integer"},"totalCount":{"type":"integer"}},"required":["totalCount","pageSize","pageNumber"],"title":"Paging","type":"object"},"SortDirectionENUM":{"description":"|ENUM      | Description |\n| ---------------- | ------------ |\n| ASC | Sort in ascending order|\n| DESC | Sort in descending order|\n","enum":["ASC","DESC"],"title":"SortDirectionENUM","type":"string"},"TenantPurchaseOrderSearchSchema":{"description":"Search for purchase orders in all stores on tenant. \n\nAn empty string will be ignored, and handeled as if the key did not exist in the payload.\n\nFuzzy search means that it will try to find words that contains the query string that is supplied. The search is case-insensitive. \nExample: If you search for \"Ol\" you will get \"Olsen\", \"Olstad\", \"Bolset\", \"Ormebol\", kolstad@example.com, etc ..","title":"TenantPurchaseOrderSearchSchema","type":"object","properties":{"fromDateTime":{"format":"date-time","type":"string"},"toDateTime":{"format":"date-time","type":"string"},"orderStatuses":{"type":"array","description":"Reference to a list of orderStatuses.","items":{"$ref":"#/components/schemas/PurchaseOrderStatusENUM"}},"storeUids":{"type":"array","description":"Reference to a list of storeUids","items":{"$ref":"#/components/schemas/UID"}},"organizationUids":{"type":"array","description":"Reference to a list of organizationUids","items":{"$ref":"#/components/schemas/UID"}},"supplierUid":{"$ref":"#/components/schemas/UID"},"query":{"type":"string"},"productUids":{"type":"array","items":{"$ref":"#/components/schemas/UID"}},"hasConfirmedReceivements":{"type":"boolean"}}}},"parameters":{"pageNumberQuery":{"description":"Reference to a specific page in a result set.","in":"query","name":"pageNumber","required":false,"schema":{"type":"integer"}},"pageSizeQuery":{"description":"The number of items per page in a result set.","in":"query","name":"pageSize","required":false,"schema":{"type":"integer"}},"sortByQuery":{"description":"Defines which field the resource list is sorted by.","in":"query","name":"sortBy","required":false,"schema":{"type":"string"}},"sortDirectionQuery":{"description":"Reference to a sort direction","explode":false,"in":"query","name":"sortDirection","schema":{"$ref":"#/components/schemas/SortDirectionENUM"},"style":"form"}},"requestBodies":{"TenantPurchaseOrderSearchRequest":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantPurchaseOrderSearchSchema"}}}}}},"paths":{"/tenants/{tenantUid}/purchase-orders/search":{"post":{"summary":"Search for purchase orders","tags":["Purchase"],"responses":{"200":{"$ref":"#/components/responses/PurchaseOrderListResponse"}},"operationId":"get-tenants-purchase-orders-search","parameters":[{"$ref":"#/components/parameters/pageNumberQuery"},{"$ref":"#/components/parameters/pageSizeQuery"},{"$ref":"#/components/parameters/sortByQuery"},{"$ref":"#/components/parameters/sortDirectionQuery"}],"requestBody":{"$ref":"#/components/requestBodies/TenantPurchaseOrderSearchRequest"},"description":"Search for purchase orders"}}}}
```

## Search purchase requests

> List of products from orders where order item reservation type is \`REQUEST\_PURCHASE\_ORDERORDER\`.  \
> Optionally filter on organisation, store, supplier, and order state.

```json
{"openapi":"3.0.2","info":{"title":"Flow Retail API version 2","version":"2.0.0"},"tags":[{"name":"Purchase","description":"Purchase"}],"servers":[{"description":"Flow Retail Production","url":"https://api.flowretail.com/v2"},{"description":"Flow Retail Stage","url":"https://api.stage.flowretail.com/v2"}],"security":[{"accessToken":[]},{"authToken":[]},{"integrationToken":[]}],"components":{"securitySchemes":{"accessToken":{"description":"Access token recevied after user login with a deviceToken","scheme":"bearer","type":"http"},"authToken":{"description":"Token received from the auth service","scheme":"bearer","type":"http"},"integrationToken":{"scheme":"bearer","type":"http"}},"responses":{"PurchaseRequestListResponse":{"description":"Example response","content":{"application/json":{"schema":{"type":"object","required":["items","paging"],"properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/PurchaseRequestProductSchema"}},"paging":{"$ref":"#/components/schemas/Paging"}}}}}}},"schemas":{"PurchaseRequestProductSchema":{"title":"PurchaseRequestProductSchema","type":"object","required":["productUid","sku","productName","totalQuantityOrdered","oldestOrderCreatedAt","suppliers","orders"],"properties":{"productUid":{"$ref":"#/components/schemas/UID"},"sku":{"type":"string"},"productName":{"type":"string"},"totalQuantityOrdered":{"type":"integer","description":"total quantity in order lines"},"oldestOrderCreatedAt":{"type":"string","format":"date-time","description":"the oldest createdAt in order lines"},"suppliers":{"type":"array","items":{"$ref":"#/components/schemas/PurchaseRequestSupplierSchema"}},"orders":{"type":"array","items":{"$ref":"#/components/schemas/PurchaseRequestOrderSchema"}}}},"UID":{"title":"UID","type":"string","pattern":"^[A-Za-z0-9-_]+"},"PurchaseRequestSupplierSchema":{"title":"PurchaseRequestSupplierSchema","type":"object","required":["supplierUid","name"],"properties":{"supplierUid":{"$ref":"#/components/schemas/UID"},"name":{"type":"string"}}},"PurchaseRequestOrderSchema":{"title":"PurchaseRequestOrderSchema","type":"object","required":["orderUid","orderNumber","orderState","settleState","customerDisplayName","storeUid","storeName","items","createdAt"],"properties":{"orderUid":{"$ref":"#/components/schemas/UID"},"orderNumber":{"type":"string"},"orderState":{"$ref":"#/components/schemas/OrderOrderStateENUM"},"settleState":{"$ref":"#/components/schemas/OrderSettleStateENUM"},"customerDisplayName":{"type":"string"},"storeUid":{"$ref":"#/components/schemas/UID"},"storeName":{"type":"string"},"items":{"type":"array","items":{"$ref":"#/components/schemas/PurchaseRequestOrderItemSchema"}},"createdAt":{"type":"string","format":"date-time"}},"description":""},"OrderOrderStateENUM":{"description":"|ENUM | Description |\n| --- | --- |\n| OPEN | Order is open and beeing edited by someone|\n| PARKED | Order is parked|\n| CANCELED | Order is canceled/deleted|\n| COMPLETE | Order is complete|\n| CONFIRMED | Order is confirmed|\n","enum":["OPEN","PARKED","CANCELED","COMPLETE","CONFIRMED"],"title":"OrderOrderStateENUM","type":"string"},"OrderSettleStateENUM":{"description":"|ENUM      | Description |\n| ---------------- | ------------ |\n| NOT_STARTED | Settlement not started|\n| IN_PROGRESS | Settlement is in progress and the order cannot be changed|\n| COMPLETE | Settlement is complete|","enum":["NOT_STARTED","IN_PROGRESS","COMPLETE"],"title":"OrderSettleStateENUM","type":"string"},"PurchaseRequestOrderItemSchema":{"title":"PurchaseRequestOrderItemSchema","type":"object","required":["orderItemUid","sortOrder","quantityOrdered","note"],"properties":{"orderItemUid":{"$ref":"#/components/schemas/UID"},"sortOrder":{"type":"integer"},"quantityOrdered":{"type":"integer"},"note":{"type":"string"}}},"Paging":{"description":"totalCount The total number of items in the result set.\n\npageSize The number of items per page.\n\npageNumber The current page in the result set.","properties":{"pageNumber":{"type":"integer"},"pageSize":{"type":"integer"},"totalCount":{"type":"integer"}},"required":["totalCount","pageSize","pageNumber"],"title":"Paging","type":"object"}},"parameters":{"pageNumberQuery":{"description":"Reference to a specific page in a result set.","in":"query","name":"pageNumber","required":false,"schema":{"type":"integer"}},"pageSizeQuery":{"description":"The number of items per page in a result set.","in":"query","name":"pageSize","required":false,"schema":{"type":"integer"}}},"requestBodies":{"PurchaseRequestRequest":{"content":{"application/json":{"schema":{"type":"object","properties":{"organizationUids":{"type":"array","items":{"$ref":"#/components/schemas/UID"}},"storeUids":{"type":"array","items":{"$ref":"#/components/schemas/UID"}},"supplierUids":{"type":"array","items":{"$ref":"#/components/schemas/UID"}},"orderStates":{"type":"array","items":{"$ref":"#/components/schemas/OrderOrderStateENUM"}}}}}}}}},"paths":{"/tenants/{tenantUid}/purchase-orders/requests":{"post":{"summary":"Search purchase requests","tags":["Purchase"],"responses":{"200":{"$ref":"#/components/responses/PurchaseRequestListResponse"}},"operationId":"post-purchase-orders-requests","parameters":[{"$ref":"#/components/parameters/pageNumberQuery"},{"$ref":"#/components/parameters/pageSizeQuery"}],"description":"List of products from orders where order item reservation type is `REQUEST_PURCHASE_ORDERORDER`.  \nOptionally filter on organisation, store, supplier, and order state.","requestBody":{"$ref":"#/components/requestBodies/PurchaseRequestRequest"}}}}}
```

## Search purchase requests

> List of products from orders where order item reservation type is \`REQUEST\_PURCHASE\_ORDERORDER\`.  \
> Optionally filter on organisation, store, supplier, and order state.\
> \
> The output is group by orders

```json
{"openapi":"3.0.2","info":{"title":"Flow Retail API version 2","version":"2.0.0"},"tags":[{"name":"Purchase","description":"Purchase"}],"servers":[{"description":"Flow Retail Production","url":"https://api.flowretail.com/v2"},{"description":"Flow Retail Stage","url":"https://api.stage.flowretail.com/v2"}],"security":[{"accessToken":[]},{"authToken":[]},{"integrationToken":[]}],"components":{"securitySchemes":{"accessToken":{"description":"Access token recevied after user login with a deviceToken","scheme":"bearer","type":"http"},"authToken":{"description":"Token received from the auth service","scheme":"bearer","type":"http"},"integrationToken":{"scheme":"bearer","type":"http"}},"responses":{"PurchaseRequestOrdersListResponse":{"description":"Example response","content":{"application/json":{"schema":{"type":"object","required":["items","paging"],"properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/PurchaseRequestOrderGroupSchema"}},"paging":{"$ref":"#/components/schemas/Paging"}}}}}}},"schemas":{"PurchaseRequestOrderGroupSchema":{"title":"PurchaseRequestOrderGroupSchema","type":"object","required":["orderUid","orderNumber","orderState","settleState","customerDisplayName","storeUid","storeName","items","createdAt"],"properties":{"orderUid":{"$ref":"#/components/schemas/UID"},"orderNumber":{"type":"string"},"orderState":{"$ref":"#/components/schemas/OrderOrderStateENUM"},"settleState":{"$ref":"#/components/schemas/OrderSettleStateENUM"},"customerDisplayName":{"type":"string"},"storeUid":{"$ref":"#/components/schemas/UID"},"storeName":{"type":"string"},"items":{"type":"array","items":{"$ref":"#/components/schemas/PurchaseRequestOrderItemGroupByOrderSchema"}},"createdAt":{"type":"string","format":"date-time"}}},"UID":{"title":"UID","type":"string","pattern":"^[A-Za-z0-9-_]+"},"OrderOrderStateENUM":{"description":"|ENUM | Description |\n| --- | --- |\n| OPEN | Order is open and beeing edited by someone|\n| PARKED | Order is parked|\n| CANCELED | Order is canceled/deleted|\n| COMPLETE | Order is complete|\n| CONFIRMED | Order is confirmed|\n","enum":["OPEN","PARKED","CANCELED","COMPLETE","CONFIRMED"],"title":"OrderOrderStateENUM","type":"string"},"OrderSettleStateENUM":{"description":"|ENUM      | Description |\n| ---------------- | ------------ |\n| NOT_STARTED | Settlement not started|\n| IN_PROGRESS | Settlement is in progress and the order cannot be changed|\n| COMPLETE | Settlement is complete|","enum":["NOT_STARTED","IN_PROGRESS","COMPLETE"],"title":"OrderSettleStateENUM","type":"string"},"PurchaseRequestOrderItemGroupByOrderSchema":{"title":"PurchaseRequestOrderItemGroupByOrderSchema","type":"object","required":["orderItemUid","sortOrder","quantityOrdered","note","sku","productName","productUid","suppliers"],"properties":{"orderItemUid":{"$ref":"#/components/schemas/UID"},"sortOrder":{"type":"integer"},"quantityOrdered":{"type":"integer"},"note":{"type":"string"},"sku":{"type":"string"},"productName":{"type":"string"},"productUid":{"$ref":"#/components/schemas/UID"},"suppliers":{"type":"array","items":{"$ref":"#/components/schemas/PurchaseRequestSupplierSchema"}}}},"PurchaseRequestSupplierSchema":{"title":"PurchaseRequestSupplierSchema","type":"object","required":["supplierUid","name"],"properties":{"supplierUid":{"$ref":"#/components/schemas/UID"},"name":{"type":"string"}}},"Paging":{"description":"totalCount The total number of items in the result set.\n\npageSize The number of items per page.\n\npageNumber The current page in the result set.","properties":{"pageNumber":{"type":"integer"},"pageSize":{"type":"integer"},"totalCount":{"type":"integer"}},"required":["totalCount","pageSize","pageNumber"],"title":"Paging","type":"object"}},"parameters":{"pageNumberQuery":{"description":"Reference to a specific page in a result set.","in":"query","name":"pageNumber","required":false,"schema":{"type":"integer"}},"pageSizeQuery":{"description":"The number of items per page in a result set.","in":"query","name":"pageSize","required":false,"schema":{"type":"integer"}}},"requestBodies":{"PurchaseRequestRequest":{"content":{"application/json":{"schema":{"type":"object","properties":{"organizationUids":{"type":"array","items":{"$ref":"#/components/schemas/UID"}},"storeUids":{"type":"array","items":{"$ref":"#/components/schemas/UID"}},"supplierUids":{"type":"array","items":{"$ref":"#/components/schemas/UID"}},"orderStates":{"type":"array","items":{"$ref":"#/components/schemas/OrderOrderStateENUM"}}}}}}}}},"paths":{"/tenants/{tenantUid}/purchase-orders/requests-by-orders":{"post":{"summary":"Search purchase requests","tags":["Purchase"],"responses":{"200":{"$ref":"#/components/responses/PurchaseRequestOrdersListResponse"}},"operationId":"post-purchase-orders-requests-by-orders","parameters":[{"$ref":"#/components/parameters/pageNumberQuery"},{"$ref":"#/components/parameters/pageSizeQuery"}],"description":"List of products from orders where order item reservation type is `REQUEST_PURCHASE_ORDERORDER`.  \nOptionally filter on organisation, store, supplier, and order state.\n\nThe output is group by orders","requestBody":{"$ref":"#/components/requestBodies/PurchaseRequestRequest"}}}}}
```
