Flavours API
OrderInvoice

Generate Order Invoice

POST
/api/v2/export/pdf/orders/{orderId}/invoice

Generate (or reuse a cached) invoice PDF for an order and return its file URL.

AuthorizationBearer <token>

You can retrieve your token by logging in.

In: header

Path Parameters

orderId*string

Header Parameters

X-API-Version*string

API contract version to target. See the Changelog for what changed in each version.

Default"2.0.0"
Value in"2.3.0" | "2.2.0" | "2.1.0" | "2.0.0"

Request Body

application/json

type*string
Value in"ORDER_INVOICE" | "ORDER_INVOICE_EN" | "ORDER_INVOICE_AR"
options*array<>
retry?|

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://api.flavours.sa/dev/api/v2/export/pdf/orders/blanditiis/invoice" \  -H "X-API-Version: 2.3.0" \  -H "Content-Type: application/json" \  -d '{    "type": "ORDER_INVOICE",    "options": [      "SHOW_MESSAGE"    ]  }'
{
  "meta": {
    "code": 200,
    "status": "success",
    "message": "Order invoice generated successfully."
  },
  "data": "https://flavours-files.s3.me-south-1.amazonaws.com/export/pdf/orders/invoices/9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d-order_invoice_en-show_customer-show_message.pdf"
}
{
  "meta": {
    "code": 401,
    "status": "error",
    "message": "Unauthenticated."
  },
  "data": null
}
{
  "meta": {
    "code": 403,
    "status": "error",
    "message": "Unauthorized."
  },
  "data": null
}
{
  "meta": {
    "code": 404,
    "status": "error",
    "message": "Resource not found."
  },
  "data": null
}
{
  "meta": {
    "code": 422,
    "status": "error",
    "message": "The selected type is invalid. (and 1 more error)"
  },
  "data": [
    {
      "code": 0,
      "message": "The selected type is invalid.",
      "field": "type"
    },
    {
      "code": 0,
      "message": "The selected options.0 is invalid.",
      "field": "options.0"
    }
  ]
}
{
  "meta": {
    "code": 500,
    "status": "error",
    "message": "Internal server error."
  },
  "data": null
}