> ## Documentation Index
> Fetch the complete documentation index at: https://docs.procuros.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Work Orders

> As a goods owner, send work orders (production, assembly or service orders) to your provider via the Procuros API: check enabled trade partners, build the payload, and track status.

This is the right section for you if you own the goods and want to send work orders to your production, assembly or service provider. Examples are production orders, kitting or set assembly, and relabelling.

Throughout this guide you will learn how to send work orders to the Procuros API.

PHP examples are included but you will likely also want to look at the relevant API calls in the [API reference](https://docs.procuros.io/en/api/v2/overview.md).

## Process

These are usually the steps taken when sending a work order to Procuros:

1. Check, if this document should be sent via Procuros (see: [Enabled Trade Partners](https://docs.procuros.io/en/api/v2/features-enabled-trade-partners.md))
2. Verify this document has not already been sent (see: [Tracking Document Status](https://docs.procuros.io/en/api/v2/features-tracking-document-status.md))
3. Build the transaction payload to be sent via Procuros.
4. Send the transaction payload via the Procuros API

## Authentication

You will need an API token to authenticate. We use a bearer token which has to be included in each request you send to the API.

Please read the [Authentication](https://docs.procuros.io/en/api/v2/concept-authentication.md) section of our API reference for a detailed description.

## Error Handling

The API will return a `2xx` status code for successful requests. Anything else indicates an error.

Please read the [Errors](https://docs.procuros.io/en/api/v2/concept-error-handling.md) section of our API reference for a detailed description plus examples of how to handle them.

## Send work orders

The API call [Send transaction](https://docs.procuros.io/en/api/v2/outgoing-transactions/send-transaction.md) is used to create transactions, including work orders.

The following fields are required:

* `type` (Transaction type. In this case `WORK_ORDER`)
* `content.header.workOrderIdentifier`
* `content.header.workOrderDate`
* `content.header.type` (One of `PRODUCTION`, `ASSEMBLY` or `SERVICE`)
* `content.header.buyer` and `content.header.supplier`, each with at least one identifier
* `content.outputItems` (At least one item, each with a `workOrderLineIdentifier`)

A work order has two item levels:

* `outputItems` are the items the work order produces, for example a finished gift set.
* `inputItems` (inside each output item) are the items that the output item consumes, for example the jars and the box of the gift set.

Procuros sends the work order to the `technicalRecipient`. If you do not set a `technicalRecipient`, Procuros sends it to the `buyer`.

All details can be found in the `WORK_ORDER` schema as described in the [API reference](https://docs.procuros.io/en/api/v2/outgoing-transactions/send-transaction.md).

An example request would look like:

```php php theme={null}
// install dependency
// $ composer require guzzlehttp/guzzle

<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$transaction = [
  "type" => "WORK_ORDER",
  "content" => [
    "header" => [
      "workOrderIdentifier" => "WO-2026-004711",
      "workOrderDate" => "2026-09-28T08:30:00Z",
      "type" => "ASSEMBLY",
      "requestedStartDate" => "2026-10-05T06:00:00Z",
      "requestedCompletionDate" => "2026-10-09T16:00:00Z",
      "workNotes" => "Assembly of autumn gift sets",
      "buyer" => [
        "name" => "Lager & Service Nord GmbH",
        "identifiers" => [
          [
            "domain" => "GS1",
            "identifier" => "4012345999990"
          ]
        ]
      ],
      "supplier" => [
        "name" => "Honigmanufaktur Beispiel GmbH",
        "identifiers" => [
          [
            "domain" => "GS1",
            "identifier" => "4012345000000"
          ]
        ]
      ]
    ],
    "outputItems" => [
      [
        "workOrderLineIdentifier" => "10",
        "identifiers" => [
          [
            "domain" => "SUPPLIER",
            "identifier" => "GIFTSET-001"
          ]
        ],
        "description" => "Gift set with two jars of honey",
        "unitOfMeasure" => "EA",
        "quantity" => 500,
        "workNotes" => "Assemble set, apply customer label on the lid",
        "inputItems" => [
          [
            "workOrderLineIdentifier" => "10.1",
            "identifiers" => [
              [
                "domain" => "SUPPLIER",
                "identifier" => "HONEY-250"
              ]
            ],
            "description" => "Acacia honey 250 g",
            "unitOfMeasure" => "EA",
            "quantity" => 1000,
            "location" => [
              "identifier" => "WH-A-02-11",
              "status" => "AVAILABLE"
            ]
          ],
          [
            "workOrderLineIdentifier" => "10.2",
            "identifiers" => [
              [
                "domain" => "SUPPLIER",
                "identifier" => "BOX-GIFT-02"
              ]
            ],
            "description" => "Gift box for two jars",
            "unitOfMeasure" => "EA",
            "quantity" => 500
          ]
        ]
      ]
    ]
  ]
];

$response = $client->request('POST', 'https://api.procuros.io/v2/transactions', [
  'headers' => [
    'Accept' => 'application/json',
    'Authorization' => 'Bearer <your-api-token>',
  ],
  'json' => $transaction,
]);
```

## Mark Document Status

Finally, as per the instructions mentioned under [Tracking Document Status](https://docs.procuros.io/en/api/v2/features-tracking-document-status.md) you must now track the status of the document locally, based on the returned HTTP response.

The document should be marked with either status `TRANSMITTED` or `NO_ACTION`. If there is an error with the document and it is not accepted, do not mark it with a status so it may be retried. For more information on retrying failed documents, please see: [Retrying Documents](https://docs.procuros.io/en/api/v2/features-tracking-document-status.md#retrying-documents).

For example:

```php php theme={null}
$statusCode = $response->getStatusCode();

if ($statusCode == 201) {
  $document->updateProcurosStatus("TRANSMITTED");
} else if ($statusCode == 202) {
  $document->updateProcurosStatus("NO_ACTION");
} else {
  // No need to do anything if it's not accepted, in an error case the document should be retried.
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.