Upload invoice for an order

POST /order/invoice/

Processes and uploads invoice data for a specific order using a base64-encoded PDF.

application/json

Body Required

  • order_id string Required

    Unique identifier of the order within the store system.

    Maximum length is 300.

  • invoice_number string Required

    Invoice number.

    Maximum length is 100.

  • total_amount number | null

    Total order amount including VAT, in the store's currency.

  • total_vat_amount number | null

    VAT portion of the total amount.

  • shipping_id string | null

    Identifier of the related shipping record, if available.

    Maximum length is 100.

  • transaction_id string | null

    Identifier of the payment transaction, if available.

    Maximum length is 100.

  • invoice_data string Required

    Base64-encoded string of the PDF invoice file.

Responses

  • 200 application/json

    Invoice successfully processed

    Hide headers attributes Show headers attributes
  • 400 application/json

    Bad request

    Hide headers attributes Show headers attributes
    Hide response attributes Show response attributes object
    • code string Required

      An error code that identifies the type of error that occurred.

    • message string Required

      A message that describes the error condition in a human-readable form.

    • data object | array Required

      Additional information that can help the caller understand or fix the issue.

  • 401 application/json

    Unauthorized

    Hide response attributes Show response attributes object
    • code string Required

      An error code that identifies the type of error that occurred.

    • message string Required

      A message that describes the error condition in a human-readable form.

    • data object | array Required

      Additional information that can help the caller understand or fix the issue.

  • 404 application/json

    Not found

    Hide response attributes Show response attributes object
    • code string Required

      An error code that identifies the type of error that occurred.

    • message string Required

      A message that describes the error condition in a human-readable form.

    • data object | array Required

      Additional information that can help the caller understand or fix the issue.

  • 429 application/json

    Too many requests

    Hide headers attributes Show headers attributes
    Hide response attributes Show response attributes object
    • code string Required

      An error code that identifies the type of error that occurred.

    • message string Required

      A message that describes the error condition in a human-readable form.

    • data object | array Required

      Additional information that can help the caller understand or fix the issue.

  • 500 application/json

    Internal server error

    Hide response attributes Show response attributes object
    • code string Required

      An error code that identifies the type of error that occurred.

    • message string Required

      A message that describes the error condition in a human-readable form.

    • data object | array Required

      Additional information that can help the caller understand or fix the issue.

POST /order/invoice/
curl \
 --request POST 'https://m2e.cloud/api/v1/api/order/invoice/' \
 --header "access-token: $API_KEY" \
 --header "Content-Type: application/json" \
 --data '{"order_id":"0002002","invoice_number":"113-00010001-0002002","total_amount":59.99,"total_vat_amount":9.99,"shipping_id":"113-00010001-0002002","transaction_id":"113-00010001-0002002","invoice_data":"string"}'
Request examples
{
  "order_id": "0002002",
  "invoice_number": "113-00010001-0002002",
  "total_amount": 59.99,
  "total_vat_amount": 9.99,
  "shipping_id": "113-00010001-0002002",
  "transaction_id": "113-00010001-0002002",
  "invoice_data": "string"
}
Response examples (400)
[
  {
    "code": null,
    "message": "All array items must match schema"
  },
  {
    "code": null,
    "message": "The required properties (currency) are missing"
  }
]
Response examples (401)
[
  {
    "code": 401,
    "message": "Unauthorized"
  }
]
Response examples (404)
[
  {
    "code": 404,
    "message": "Entity is not found."
  }
]
Response examples (429)
[
  {
    "code": 429,
    "message": "Too many requests."
  }
]
Response examples (500)
[
  {
    "code": 500,
    "message": "Internal server error."
  }
]