UPDATE: Order Attachments

Attachments can now be added to orders using the API. They can also be queried:

mutation{
  order_add_attachment(data:{
    customer_account_id:"string"
    description:"string"
    file_type:"string"
    filename:"string"
    order_id:"string" This field is mandatory.
    url:"string" This field is mandatory.
  }){
   request_id
 }
}

The mutation won’t upload the file; it will point to the URL provided, so the URL sent must be available for as long as the file is needed to be reachable.

To query attachments in an order, you can use the following query:

query{
  order(id:"string"){
    data{
      attachments{
        edges{
          node{
            account_id
            created_at
            description
            file_size
            file_type
            filename
            id
            legacy_id
            order_id
            url
          }
        }
      }
    }
  }
}

The attachments connection is also available in the orders query.

2 Likes