{
  "info": {
    "name": "Rinili Business API v1",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
    "description": "Business integration requests. Set api_key in a private local environment. Review order and notification mutations before sending."
  },
  "variable": [
    {
      "key": "base_url",
      "value": "https://api.rinili.com"
    },
    {
      "key": "api_key",
      "value": ""
    },
    {
      "key": "id",
      "value": "42"
    }
  ],
  "item": [
    {
      "name": "Orders",
      "item": [
        {
          "name": "List orders",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Authorization",
                "value": "Bearer {{api_key}}"
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/v1/orders",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "orders"
              ]
            },
            "description": "Newest first, scoped to the restaurant belonging to your key. Defaults to 25 orders per page. Follow links.next until null."
          },
          "response": []
        },
        {
          "name": "Retrieve an order",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Authorization",
                "value": "Bearer {{api_key}}"
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/v1/orders/{{id}}",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "orders",
                "{{id}}"
              ]
            },
            "description": "Returns a single restaurant-owned order. Missing orders and orders outside your restaurant return 404."
          },
          "response": []
        },
        {
          "name": "Create an order",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Authorization",
                "value": "Bearer {{api_key}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/v1/orders",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "orders"
              ]
            },
            "description": "Creates a pending order. Do not send restaurant_id: the key determines ownership. Reference must be globally unique; when omitted the server generates RN- followed by a random suffix. Currency defaults to the platform setting or JOD. Platform order-total limits also apply. No general Idempotency-Key support is implemented.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"branch_id\": 12,\n  \"customer_name\": \"Sample customer\",\n  \"total\": 12.5,\n  \"reference\": \"POS-1042\",\n  \"currency\": \"JOD\",\n  \"items\": [\n    {\n      \"name\": \"Lunch bowl\",\n      \"quantity\": 1,\n      \"unit_price\": 12.5\n    }\n  ]\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Update order status",
          "request": {
            "method": "PATCH",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Authorization",
                "value": "Bearer {{api_key}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/v1/orders/{{id}}/status",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "orders",
                "{{id}}",
                "status"
              ]
            },
            "description": "Read the current order first. Transitions: pending → accepted → preparing → ready → completed. Cancellation is allowed from non-terminal states only when platform settings permit. Completed and cancelled orders cannot reopen. Invalid transitions return 422; stale versions return 409.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"status\": \"accepted\",\n  \"version\": 1\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        }
      ]
    },
    {
      "name": "Branches",
      "item": [
        {
          "name": "List branches",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Authorization",
                "value": "Bearer {{api_key}}"
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/v1/branches",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "branches"
              ]
            },
            "description": "Returns all non-deleted branches belonging to your restaurant, including inactive branches. Use an active branch to create an order. This endpoint is not paginated. Create and edit branches in the Business Owner dashboard; the API exposes branch listing only."
          },
          "response": []
        }
      ]
    },
    {
      "name": "Notifications",
      "item": [
        {
          "name": "Queue a notification",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Authorization",
                "value": "Bearer {{api_key}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/v1/notifications",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "v1",
                "notifications"
              ]
            },
            "description": "Creates a campaign for your restaurant and queues delivery to eligible users. 202 means queued, not device display. Delivery depends on enabled channels, eligible recipients, registered devices and provider configuration. restaurant_id is prohibited.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"title\": \"Your order is ready\",\n  \"body\": \"Please collect at the counter.\",\n  \"channel\": \"in_app\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        }
      ]
    }
  ]
}
