---
title: "How to add an attachment to an order"
description: "Instructions on adding attachments to orders using GraphQL, including setting specific document types and handling file size limitations."
lang: en
languages:
  en: https://docs.vismasoftware.no/businessnxtapi/examples/howto/orderattachments/index.md
lastmod: 2026-07-10
---

> Documentation index: https://docs.vismasoftware.no/businessnxtapi/examples/howto/llms.txt


# How to add an attachment to an order

Last modified July 10, 2026

> Instructions on adding attachments to orders using GraphQL, including setting specific document types and handling file size limitations.


You can add an attachment to an order by runnning the `AddAttachment` processing on the `Order` table.

The following query adds an attachment to an existing order:

```graphql
mutation upload_invoice_attachment(
        $cid: Int!,
        $orderNo: Int!,
        $fileName: String!,
        $description: String!,
        $data: String!)
{
  useCompany(no: $cid) {
    order_processings {
      addAttachment(
        filter: { orderNo: { _eq: $orderNo } },
        args: { 
           description: $description, 
           fileName: $fileName, 
           fileBytes: $data,
           sendWithInvoicesAndCreditNotes : 1
        }
      )
      {
        succeeded
      }
    }
  }
}
```

> [!NOTE]
>
> The content of the attachment must be provided as a base64 encoded string.

The precence of the `sendWithInvoicesAndCreditNotes : 1` argument will set the order attachment processing to `Invoices/credit notes`. You can see this in the front-end, when you look at the `Order attachment processing` column of the `Order attachment` table.

![Order attachment processing](https://docs.vismasoftware.no/businessnxtapi/examples/howto/order_attachment_processing.png)

If you want to set any of the other available values, such as `Pick lists` or `Packing slips`, then you must use the `sendWithDocumentTypes` parameter instead. The following table shows the available values for this parameter:

| Value | Description |
| ----- | ----------- |
| 1 | Invoices/credit notes |
| 2 | Consignment notes |
| 4 | Packing slips |
| 8 | Pick lists |
| 16 | Order confirmations |
| 32 | Quotations |
| 64 | Purchase orders |
| 128 | Inquiries |
| 256 | Production orders |
| 512 | Order prints |
| 1024 | Approval requests |

The following example shows how to set the `sendWithDocumentTypes` parameter to `Packing slips`:

```graphql
mutation upload_packing_slip_attachment(
        $cid: Int!,
        $orderNo: Int!,
        $fileName: String!,
        $description: String!,
        $data: String!)
{
  useCompany(no: $cid) {
    order_processings {
      addAttachment(
        filter: { orderNo: { _eq: $orderNo } },
        args: { 
           description: $description, 
           fileName: $fileName, 
           fileBytes: $data,
           sendWithDocumentTypes : 4
        }
      )
      {
        succeeded
      }
    }
  }
}
```

> [!NOTE]
>
> Beware there is a limit to the raw size of a request. Currently, this is set at 15MB. This limit may be prone to future changes.


---

[View this page](https://docs.vismasoftware.no/businessnxtapi/examples/howto/orderattachments/)
