---
title: Confirm receipt of a Purchase Order
slug: confirm-receipt-of-a-purchase-order
docTags: 
createdAt: 2026-09-15T14:46:26.795Z
---

{
  "id": "GjdFTu7PPypBNAfWYkuVz",
  "type": "api-oas-v2",
  "data": {
    "method": "POST",
    "url": "https://developer.digitail.io/api/v1/purchase-orders/{id}/receive",
    "servers": [
      {
        "url": "https://developer.digitail.io/api/v1/purchase-orders/{id}/receive",
        "description": "Sandbox server (uses test data)"
      },
      {
        "url": "https://vet.digitail.io/api/v1/purchase-orders/{id}/receive",
        "description": "Production server (uses live data)"
      }
    ],
    "name": "Confirm receipt of a Purchase Order",
    "description": "<p>Permissions needed: <code>EDIT_ORDERS</code>.</p>\n<p>Marks a pending, draft or backorder purchase order as completed and adds its lines to the clinic's stock, exactly as completing the order in the app does. Quantities, costs and prices are never changed by this call; only the order status and each line's <code>is_received</code> flag.</p>\n<p>Omit <code>items</code> (or send an empty body) to receive every line. To receive only some lines, list the ones that did not arrive with <code>is_received: false</code>; lines that are not listed count as received. A <code>finalization_strategy</code> is then required: <code>create_backorder</code> moves the unreceived lines to a new backorder purchase order (returned as <code>related_order</code>), <code>keep_unreceived</code> drops them from this order.</p>\n<p>An order that is already completed is rejected with 422.</p>",
    "contentType": "application/json",
    "request": {
      "pathParameters": [],
      "headerParameters": [
        {
          "name": "accept",
          "type": "string",
          "kind": "optional",
          "description": "Generated from available response content types",
          "enum": [
            "application/json"
          ],
          "default": "application/json"
        }
      ],
      "queryParameters": [],
      "bodyDataParameters": [
        {
          "kind": "optional",
          "name": "body",
          "type": "object",
          "example": "{\"items\":[{\"id\":1201,\"is_received\":false}],\"finalization_strategy\":\"create_backorder\"}",
          "description": "",
          "schema": [
            {
              "name": "items",
              "kind": "optional",
              "type": "array",
              "description": "Lines to flag explicitly. Unlisted lines are treated as received.",
              "example": "",
              "itemType": "object",
              "customType": "object[]",
              "schema": [
                {
                  "name": "id",
                  "kind": "required",
                  "type": "integer",
                  "description": "<p>Purchase order item id, as returned by the order detail.</p>",
                  "example": 1201
                },
                {
                  "name": "is_received",
                  "kind": "required",
                  "type": "boolean",
                  "description": "",
                  "example": false
                }
              ]
            },
            {
              "name": "finalization_strategy",
              "kind": "optional",
              "type": "string<create_backorder | keep_unreceived>",
              "description": "<p>Required when any listed line has <code>is_received: false</code>.</p>",
              "example": "create_backorder",
              "enum": [
                "create_backorder",
                "keep_unreceived"
              ]
            }
          ],
          "isExpanded": true
        }
      ],
      "formDataParameters": [],
      "oAuthParameters": [
        {
          "id": "passport",
          "name": "passport",
          "kind": "optional",
          "type": "oauth2",
          "description": "Laravel passport oauth2 security.",
          "oauth2Flows": {
            "authorizationCode": {
              "authorizationUrl": "https://digitail.test/oauth/authorize",
              "tokenUrl": "https://digitail.test/oauth/token",
              "refreshUrl": "https://digitail.test/oauth/token"
            }
          }
        },
        {
          "id": "Bearer",
          "name": "Bearer",
          "kind": "optional",
          "type": "http",
          "scheme": "bearer"
        }
      ],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "<p>The completed purchase order, with its received items and the backorder (if one was created) under <code>related_order</code>.</p>",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "schema": [
              {
                "name": "data",
                "kind": "optional",
                "type": "object",
                "description": "",
                "modelRef": "#/paths/~1api~1v1~1purchase-orders~1%7Bid%7D/get/responses/200/content/application~1json/schema/properties/data",
                "customType": "data",
                "schema": []
              }
            ],
            "isExpanded": true
          }
        ]
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "dZTezENspINthdLCD5v5t",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request POST \\\n     --url https://developer.digitail.io/api/v1/purchase-orders/{id}/receive \\\n     --header 'accept: application/json' \\\n     --header 'content-type: application/json' \\\n     --data '{\n     \"items\": [\n     {\n     \"id\": 1201,\n     \"is_received\": false\n     }\n     ]\n     }'"
        },
        {
          "id": "hxObhVXTuuJxX97nGgsaw",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"accept\", \"application/json\");\nmyHeaders.append(\"content-type\", \"application/json\");\n\nvar raw = JSON.stringify({\n   \"items\": [\n      {\n         \"id\": 1201,\n         \"is_received\": false\n      }\n   ]\n});\n\nvar requestOptions = {\n   method: 'POST',\n   headers: myHeaders,\n   body: raw,\n   redirect: 'follow'\n};\n\nfetch(\"https://developer.digitail.io/api/v1/purchase-orders/{id}/receive\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "weW0x-pcGinWmI3OiRwFX",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://developer.digitail.io/api/v1/purchase-orders/{id}/receive\")\n\nhttps = Net::HTTP.new(url.host, url.port)\nhttps.use_ssl = true\n\nrequest = Net::HTTP::Post.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"application/json\"\nrequest.body = JSON.dump({\n   \"items\": [\n      {\n         \"id\": 1201,\n         \"is_received\": false\n      }\n   ]\n})\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "N19r_Fi4ZOYH9hj_NemjT",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://developer.digitail.io/api/v1/purchase-orders/{id}/receive\"\n\npayload = json.dumps({\n   \"items\": [\n      {\n         \"id\": 1201,\n         \"is_received\": False\n      }\n   ]\n})\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/json'\n}\n\nresponse = requests.request(\"POST\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "dZTezENspINthdLCD5v5t"
    },
    "results": {
      "languages": [
        {
          "id": "5DK9kJajffWMMeDIa5lop",
          "language": "200",
          "code": "// The completed purchase order, with its received items and the backorder (if one was created) under related_order.\n{\n  \"data\": {}\n}"
        }
      ],
      "selectedLanguageId": "5DK9kJajffWMMeDIa5lop"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}