> For the complete documentation index, see [llms.txt](https://docs.flowretail.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.flowretail.com/docs/developers/api-documentation/internal-purchase-order/create-an-internal-purchase-order.md).

# Create an internal purchase order

`sendingStoreUid` is the sender of the internal purchase order.\
`receivingStoreUid` is the receiver of the internal purchase order.\
`creatingStoreUid` is the store that creates the internal purchase order, which can be any of the above or another store.

If the creating store is not the sender, then the sender must confirm the request before the products on the order can be sent.

Required permissions: INTERNAL\_PURCHASE\_ORDER

```json
{"openapi":"3.0.2","info":{"title":"Flow Retail API version 2","version":"2.0.0"},"tags":[{"name":"InternalPurchaseOrder","description":"InternalPurchaseOrder"}],"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":{"InternalPurchaseOrderResponse":{"description":"Example response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalPurchaseOrderResponseSchema"}}}}},"schemas":{"InternalPurchaseOrderResponseSchema":{"title":"InternalPurchaseOrderResponseSchema","type":"object","description":"- sendingStoreUid: The store that creates/sends the internal purchase order. \n- receivingStoreUid: The store that receives the internal purchase order\n- creatingStoreUid: The store that creates the internal purchase order. May be different than sendingStoreUid","required":["createdAt","createdBy","lastModifiedAt","lastModifiedBy","shippedAt","shippedBy","receivedAt","receivedBy","sendingStoreUid","receivingStoreUid","note","status","trackingNumber","items","internalPurchaseOrderUid","allowedStatuses","internalPurchaseOrderNumber","creatingStoreUid"],"properties":{"createdAt":{"type":"string","format":"date-time"},"createdBy":{"type":"string"},"lastModifiedAt":{"format":"date-time","type":"string"},"lastModifiedBy":{"type":"string"},"shippedAt":{"type":"string","format":"date-time","nullable":true},"shippedBy":{"type":"string","nullable":true},"receivedAt":{"type":"string","format":"date-time","nullable":true},"receivedBy":{"type":"string","nullable":true},"sendingStoreUid":{"$ref":"#/components/schemas/UID"},"receivingStoreUid":{"$ref":"#/components/schemas/UID"},"note":{"type":"string"},"status":{"$ref":"#/components/schemas/InternalPurchaseOrderStatusENUM"},"trackingNumber":{"type":"string","nullable":true},"items":{"type":"array","items":{"$ref":"#/components/schemas/InternalPurchaseOrderItemResponseSchema"}},"internalPurchaseOrderUid":{"$ref":"#/components/schemas/UID"},"allowedStatuses":{"type":"array","items":{"$ref":"#/components/schemas/InternalPurchaseOrderStatusENUM"}},"internalPurchaseOrderNumber":{"type":"string"},"creatingStoreUid":{"$ref":"#/components/schemas/UID"}}},"UID":{"title":"UID","type":"string","pattern":"^[A-Za-z0-9-_]+"},"InternalPurchaseOrderStatusENUM":{"title":"InternalPurchaseOrderStatusENUM","type":"string","description":"|ENUM      | Description |\n| ---------------- | ------------ |\n| NEW | Draft/work in progress|\n| READY_FOR_CONFIRMATION | The order is ready for confirmation by receiving store|\n| PREPARING_FOR_SHIPMENT | Internal purchase order is ready to be shipped from the sending store|\n| IN_TRANSIT | All quantity sent is registered and products are sent from sending store (and removed from warehouse)|\n| ARRIVED | Purchase order has arrived to requesting store and is ready for registering and controlling quantity|\n| COMPLETE | Purchase order is complete (and stock is added to the receiving stores warehouse)|\n| CANCELLED | Purchase order is cancelled.|\n","enum":["NEW","READY_FOR_CONFIRMATION","PREPARING_FOR_SHIPMENT","IN_TRANSIT","ARRIVED","COMPLETE","CANCELLED"]},"InternalPurchaseOrderItemResponseSchema":{"title":"InternalPurchaseOrderItemResponseSchema","type":"object","required":["createdAt","createdBy","lastModifiedAt","lastModifiedBy","product","serialnumbers","quantityOrdered","shipFromWarehouseUid","quantitySent","quantityReceived","receiveToWarehouseUid","costPrice","internalPurchaseOrderItemUid"],"properties":{"createdAt":{"type":"string","format":"date-time"},"createdBy":{"type":"string"},"lastModifiedAt":{"format":"date-time","type":"string"},"lastModifiedBy":{"type":"string"},"product":{"$ref":"#/components/schemas/InternalPurchaseOrderItemProductResponseSchema"},"serialnumbers":{"type":"array","items":{"type":"string"}},"quantityOrdered":{"type":"integer"},"shipFromWarehouseUid":{"$ref":"#/components/schemas/OptionalUID"},"quantitySent":{"type":"integer"},"quantityReceived":{"type":"integer"},"receiveToWarehouseUid":{"$ref":"#/components/schemas/OptionalUID"},"costPrice":{"type":"integer"},"internalPurchaseOrderItemUid":{"$ref":"#/components/schemas/UID"}}},"InternalPurchaseOrderItemProductResponseSchema":{"title":"InternalPurchaseOrderItemProductResponseSchema","type":"object","required":["productUid","productName","productSku","coverImage","serialNoRequired"],"properties":{"productUid":{"$ref":"#/components/schemas/UID"},"productName":{"type":"string"},"productSku":{"type":"string"},"coverImage":{"$ref":"#/components/schemas/CoverImageSchema"},"serialNoRequired":{"$ref":"#/components/schemas/SerialNoRequiredENUM"}}},"CoverImageSchema":{"title":"CoverImageSchema","type":"object","properties":{"productMediaUid":{"$ref":"#/components/schemas/OptionalUID"},"mainUrl":{"type":"string"},"thumbnailUrl":{"type":"string"}},"required":["productMediaUid","mainUrl","thumbnailUrl"]},"OptionalUID":{"title":"OptionalUID","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"},"InternalPurchaseOrderCreateSchema":{"title":"InternalPurchaseOrderCreateSchema","description":"","type":"object","required":["sendingStoreUid","receivingStoreUid","creatingStoreUid"],"properties":{"sendingStoreUid":{"$ref":"#/components/schemas/UID"},"receivingStoreUid":{"$ref":"#/components/schemas/UID"},"internalPurchaseOrderUid":{"$ref":"#/components/schemas/UID"},"items":{"type":"array","items":{"$ref":"#/components/schemas/InternalPurchaseOrderItemCreateSchema"}},"note":{"type":"string"},"status":{"$ref":"#/components/schemas/InternalPurchaseOrderStatusENUM"},"creatingStoreUid":{"$ref":"#/components/schemas/UID"},"autoOrderProposal":{"type":"object","description":"Generate a internal purchase order proposal based on min/max","required":["sendingWarehouseUid","receivingWarehouseUid"],"properties":{"sendingWarehouseUid":{"$ref":"#/components/schemas/UID"},"receivingWarehouseUid":{"$ref":"#/components/schemas/UID"}}}}},"InternalPurchaseOrderItemCreateSchema":{"title":"InternalPurchaseOrderItemCreateSchema","type":"object","required":["quantityOrdered"],"properties":{"quantityOrdered":{"type":"integer"},"costPrice":{"type":"integer"},"internalPurchaseOrderItemUid":{"$ref":"#/components/schemas/UID"},"productUid":{"$ref":"#/components/schemas/UID"}}}},"requestBodies":{"InternalPurchaseOrderCreateRequest":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalPurchaseOrderCreateSchema"}}}}}},"paths":{"/tenants/{tenantUid}/organizations/{organizationUid}/internal-purchase-orders":{"post":{"tags":["InternalPurchaseOrder"],"summary":"Create an internal purchase order","operationId":"post-internal-purchase-order","responses":{"201":{"$ref":"#/components/responses/InternalPurchaseOrderResponse"}},"requestBody":{"$ref":"#/components/requestBodies/InternalPurchaseOrderCreateRequest"},"description":"`sendingStoreUid` is the sender of the internal purchase order.  \n`receivingStoreUid` is the receiver of the internal purchase order.  \n`creatingStoreUid` is the store that creates the internal purchase order, which can be any of the above or another store.\n\nIf the creating store is not the sender, \nthen the sender must confirm the request before the products on the order can be sent.\n\nRequired permissions: INTERNAL_PURCHASE_ORDER"}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.flowretail.com/docs/developers/api-documentation/internal-purchase-order/create-an-internal-purchase-order.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
