Flavours API Documentation
    Flavours API Documentation
    • Readme
    • Developer Guide
    • Authorization
    • Includables
    • Pagination
    • Sorting
    • Retrieve Market Information
    • Retrieve Branch Information
    • Me
      • Overview
      • Detail
        GET
    • Branches
      • Overview
      • List
        GET
      • Detail
        GET
      • Create
        POST
      • Update
        POST
      • Delete
        DELETE
    • Orders
      • Overview
      • List
        GET
      • Detail
        GET
      • Create
        POST
      • Calculate
        POST
      • Checkout
        POST
      • Update
        POST
      • Sync
        POST
    • Customers
      • Overview
      • List
        GET
      • Detail
        GET
      • Create
        POST
      • Update
        POST
    • Products
      • Overview
      • List
      • Detail
      • Create
      • Update
      • Delete
    • Product Categories
      • Overview
      • List
      • Detail
    • Discounts
      • Overview
      • List
      • Detail
      • Verify
    • Payment Methods
      • Overview
      • List
      • Detail
    • Table
      • Overview
      • List
      • Detail
      • Create
      • Update
      • Delete
    • Printer
    • Webhook
      • Orders Webhooks
        • Webhook Events
        • Payload
      • Product Webhooks
        • Webhook Events
        • Payload
      • Loyalty Webhooks
        • Promotional Coupon
      • Customers Webhooks
        • Webhook Events
        • Payload
      • Error Webhook
        • Stay Alert to Connectivity Issues
      • Third-Party
        • Ballurh
          • Install Ballurh
        • Loyapro
          • Loyalty
            • Check Reward
            • Redeem Reward
        • Bonat
          • Check Reward
          • Redeem Reward
        • Fai
          • Register Entity

    Includables

    For endpoints with List requests, the API supports including additional objects that are attached to the selected object, you can do it by adding includes parameter as an array
    You can find out what objects can be attached by hitConstants endpoint, this is for example if you want to know includes of orders
    GET : /api/constant/order-include
    For example if you want to get a list of orders with items and product information in it, You can do this by adding the includes parameter as followsincludes=products.product, This is the example
    GET : /api/v2/orders?includes=products.product
    {
      "id": "0001d3e0-a0c8-44db-8ecd-44553e89a303",
      "market_id": "4ba00eb3-46ba-4e4d-964b-58a9779faac7",
      "branch_id": "0b46bde4-e46c-4648-8887-239c671cd4a2",
      "number": "0017",
      "source": "ADMIN_APP",
      "type": "TAKE_AWAY",
      "status": "PROCESS",
      ...
      "products": [
        {
          "id": 10,
          "market_id": "4ba00eb3-46ba-4e4d-964b-58a9779faac7",
          "branch_id": "0b46bde4-e46c-4648-8887-239c671cd4a2",
          "order_id": "0001d3e0-a0c8-44db-8ecd-44553e89a303",
          "product_category_id": "72",
          "product_id": "5e4cdec9-7060-4660-acdb-794176c447bc",
          "qty": 1,
          "price": 7.83,
          "discount": 0.0,
          "tax": 1.17,
          "subtotal": 7.83,
          "total": 9.0,
          ...
          "product": {
            "id": "5e4cdec9-7060-4660-acdb-794176c447bc",
            "market_id": "4ba00eb3-46ba-4e4d-964b-58a9779faac7",
            "branch_id": "0b46bde4-e46c-4648-8887-239c671cd4a2",
            "product_category_id": "72",
            "name_en": "Cheese Burger",
            "name_ar": "Cheese Burger",
            "description_en": "Maiores id quas quia minus consectetur.",
            "description_ar": "Maiores id quas quia minus consectetur.",
            ...
          }
        }
      ]
    }
    
    products.product that means you want to attach a list of items and product information to it, so if you don't want to carry product information, just delete the product, and the includes will be products and this is the result
    GET : /api/v2/orders?includes=products
    {
      "id": "0001d3e0-a0c8-44db-8ecd-44553e89a303",
      "market_id": "4ba00eb3-46ba-4e4d-964b-58a9779faac7",
      "branch_id": "0b46bde4-e46c-4648-8887-239c671cd4a2",
      "number": "0017",
      "source": "ADMIN_APP",
      "type": "TAKE_AWAY",
      "status": "PROCESS",
      ...
      "products": [
        {
          "id": 10,
          "market_id": "4ba00eb3-46ba-4e4d-964b-58a9779faac7",
          "branch_id": "0b46bde4-e46c-4648-8887-239c671cd4a2",
          "order_id": "0001d3e0-a0c8-44db-8ecd-44553e89a303",
          "product_category_id": "72",
          "product_id": "5e4cdec9-7060-4660-acdb-794176c447bc",
          "qty": 1,
          "price": 7.83,
          "discount": 0.0,
          "tax": 1.17,
          "subtotal": 7.83,
          "total": 9.0,
          ...
        }
      ]
    }
    
    And if you don't want to attach anything, don't attach the includes into parameters
    GET : /api/v2/orders
    {
      "id": "0001d3e0-a0c8-44db-8ecd-44553e89a303",
      "market_id": "4ba00eb3-46ba-4e4d-964b-58a9779faac7",
      "branch_id": "0b46bde4-e46c-4648-8887-239c671cd4a2",
      "number": "0017",
      "source": "ADMIN_APP",
      "type": "TAKE_AWAY",
      "status": "PROCESS",
      ...
    }
    
    Modified at 2024-01-23 15:23:10
    Previous
    Authorization
    Next
    Pagination
    Built with