> For the complete documentation index, see [llms.txt](https://docs.akinon.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.akinon.com/technical-guides/oms/invoice-code-on-the-cargo-label.md).

# Invoice Code on the Cargo Label

When `"invoice_qr_code_enabled": true` is added to the `shipper_info` setting of a cargo integration, a code carrying the package's invoice URL is printed on the cargo label generated by OMS. The text "Faturaya ulaşmak için okutun" ("Scan to access the invoice") appears below the code.

The code is printed only when both of the following conditions are met:

* The label must be generated by OMS.
* The package's invoice URL must be populated at the moment the label is generated.

If the setting is not entered or is set to `false`, the label remains as it is today.

## <mark style="color:red;">Supported Integrations</mark>

The code is added to the OMS HTML label template. If the label is generated by the cargo company or the Akinon Shipment service, OMS does not modify that file and the code cannot be printed.

| Integration                                    | Who generates the label                                                          | Required for the code                                                                                     |
| ---------------------------------------------- | -------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- |
| Akinon Shipment (extension)                    | The service if `strategies.fetch_label` is `true` or not entered; OMS if `false` | `invoice_qr_code_enabled: true` and `strategies.fetch_label: false`                                       |
| Trendyol Express (direct Trendyol integration) | OMS                                                                              | Only `invoice_qr_code_enabled: true`                                                                      |
| Other cargo companies                          | Varies by company                                                                | `invoice_qr_code_enabled: true`; if the label comes from the company as PDF/ZPL, the code does not appear |

Transfer order labels use the same template; if the transfer order's invoice URL is populated, the code is printed on them as well.

## <mark style="color:red;">Parameters</mark>

All parameters are written to the `shipper_info` section of the cargo integration setting.

| Parameter                                | Type    | Default | Required                                 | What it does                                                                                                                                                                    |
| ---------------------------------------- | ------- | ------- | ---------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `invoice_qr_code_enabled`                | boolean | `false` | Yes, for all integrations                | When `true`, prints the code carrying the invoice URL on the OMS label.                                                                                                         |
| `strategies.fetch_label`                 | boolean | `true`  | Yes for Akinon Shipment; must be `false` | When `true`, the label is fetched from the Akinon Shipment service (PDF/PNG/ZPL) and the code cannot be added. When `false`, OMS generates the label.                           |
| `strategies.fetch_defined_shipment_info` | boolean | `false` | No                                       | When `true`, OMS queries the service for the actual cargo company carrying the package and shows that company's name on the label. Does not affect whether the code is printed. |

When `fetch_label` is set to `false`, the label format switches to the OMS HTML template; the `label_format` setting is not used in this case.

`fetch_defined_shipment_info` is not required for this feature; setting it to `true` or `false` does not change whether the code is printed. If left as `true`, an additional request is sent to the service each time a label is generated, and if this request fails, label generation also fails. If you do not need the actual cargo company information, leaving it as `false` is recommended.

## <mark style="color:red;">Activation Steps</mark>

1. In OMS, open the integration setting of the relevant cargo company.
2. Set the `invoice_qr_code_enabled` field to `true`.
3. If the integration is Akinon Shipment, set `fetch_label` to `false` inside `strategies`. `strategies` is saved as a single object; add only `fetch_label` without deleting the existing keys inside it (e.g., `send_product_info`, `send_price_info`).
4. Save, then generate the label for an invoiced package and check in the preview that the code appears.
5. Scan the code and verify that the invoice page opens.

**Example setting for Akinon Shipment:**

```json
{
  "bcp47_code": "tr-TR",
  "invoice_qr_code_enabled": true,
  "strategies": {
    "fetch_label": false,
    "fetch_defined_shipment_info": false
  }
}
```

For Trendyol Express and other integrations that use the OMS label, `"invoice_qr_code_enabled": true` is sufficient.

## <mark style="color:red;">Orders Without an Invoice Yet</mark>

The label is generated at the moment the shipment record is created. If the package's invoice URL is empty at that moment, the label is printed without errors; only the code area is left off the label.

When the invoice is created later, the label is not regenerated automatically. There are two ways to get the code onto the label:

* Set up the flow so that the invoice is issued before the shipment record is created (recommended).
* After the invoice is created, regenerate the label with the `UPDATE_SHIPMENT_LABEL_OF_THE_PACKAGE` command. The command runs while the package is in the `preparing`, `waiting_cargo_label`, `packed`, or `shipped` state.

## <mark style="color:red;">Troubleshooting</mark>

| Symptom                                                      | Possible cause                                                                     | Solution                                                               |
| ------------------------------------------------------------ | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------- |
| No code on the Akinon Shipment label, and the label is a PDF | `strategies.fetch_label` is not entered or is `true`                               | Set `fetch_label: false`                                               |
| The label is HTML but has no code                            | The invoice URL was empty when the label was generated                             | Regenerate the label with `UPDATE_SHIPMENT_LABEL_OF_THE_PACKAGE`       |
| The setting was saved but no label has the code              | `invoice_qr_code_enabled` was written at the wrong level                           | The field must be at the `shipper_info` level, not inside `strategies` |
| Label generation fails                                       | `fetch_defined_shipment_info: true` and the service query failed                   | Check the service or set `fetch_defined_shipment_info: false`          |
| The code cannot be scanned                                   | If code generation fails, OMS prints the label without the code and logs a warning | Check the OMS logs for the "Invoice code could not be created" entry   |


---

# 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.akinon.com/technical-guides/oms/invoice-code-on-the-cargo-label.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.
