Add an attachment to a sales order

POST /salesorders/{id}/attachments

Add a new attachment to a specific sales order. The filename should be specified in the Content-Disposition header, and the Content-Type header must reflect the MIME type of the attachment being uploaded. The file itself should be included in the request body, and should be less than 4 MB in size.

Headers

  • Content-Disposition string
  • Content-Type string Required

    The Content-Type for the attachment

  • Authorization string Required

    Authorization header

Path parameters

  • id integer(int32) Required

Body

string(binary) string(binary)

Body

string(binary) string(binary)

Body

string(binary) string(binary)

Responses

  • 201 application/json

    Newly created attachment

    Hide headers attributes Show headers attributes
    • Access-Control-Allow-Origin string
    • Access-Control-Allow-Credentials string
    • X-Trace-Id string
    Hide response attributes Show response attributes object
    • fileId string

      The unique identifier for the file associated with the attachment.

    • orderId integer

      The unique identifier for the sales order to which the attachment belongs.

    • fileName string

      The name of the attached file.

    • mediaType string

      The media type (MIME type) of the attached file.

    • size integer(int64)

      The size of the attached file in bytes.

    • timestamp string(date-time)

      A timestamp for when the attachment was created, in ISO 8601 format.

    • tags array[string]

      Tags associated with the attachment for categorization or search purposes.

  • 403

    Order is already invoiced, cannot add attachments

    Hide headers attributes Show headers attributes
    • Access-Control-Allow-Origin string
    • Access-Control-Allow-Credentials string
    • X-Trace-Id string
POST /salesorders/{id}/attachments
curl \
 --request POST 'https://rest.api.24sevenoffice.com/v1/salesorders/{id}/attachments' \
 --header "Content-Disposition: filename="attachment.pdf"" \
 --header "Content-Type: application/pdf" \
 --header "Authorization: string" \
 --data-binary '@file'
curl \
 --request POST 'https://rest.api.24sevenoffice.com/v1/salesorders/{id}/attachments' \
 --header "Content-Disposition: filename="attachment.pdf"" \
 --header "Content-Type: application/pdf" \
 --header "Authorization: string" \
 --data-binary '@file'
curl \
 --request POST 'https://rest.api.24sevenoffice.com/v1/salesorders/{id}/attachments' \
 --header "Content-Disposition: filename="attachment.pdf"" \
 --header "Content-Type: application/pdf" \
 --header "Authorization: string"
Response examples (201)
# Headers
Access-Control-Allow-Origin: string
Access-Control-Allow-Credentials: string
X-Trace-Id: string

# Payload
{
  "fileId": "file-1234567890",
  "orderId": 1234,
  "fileName": "attachment.pdf",
  "mediaType": "application/pdf",
  "size": 2048000,
  "timestamp": "2023-06-01T12:00:00Z",
  "tags": [
    "invoice",
    "urgent"
  ]
}