Global Pricing Settings API
Overview
Manages restaurant-level price increase/decrease limits. Each restaurant has 4 records representing all combinations of limit_action_type × limit_value_type:
| # | limit_action_type | limit_value_type | Description |
|---|---|---|---|
| 1 | increase | percentage | Max % a price can increase |
| 2 | increase | fixed | Max fixed amount a price can increase |
| 3 | decrease | percentage | Max % a price can decrease |
| 4 | decrease | fixed | Max fixed amount a price can decrease |
A limit_value of 0 means no limit (any adjustment is allowed).
Authentication
All endpoints require a valid OAuth Bearer token via the Authorization header.
Authorization: Bearer <access_token>
Restaurant Context
The restaurant is identified via one of:
| Method | Priority | Example |
|---|---|---|
X-Restaurant-Id header | Highest | X-Restaurant-Id: rest_123 |
restaurant_id query param | Medium | ?restaurant_id=rest_123 |
| Token’s default restaurant | Lowest (fallback) | — |
Endpoints
1. GET /api/partner/v1/global_pricing_setting
Retrieves all 4 global pricing settings for the current restaurant. Auto-creates default records (all limit_value = 0) if they don’t exist yet.
Request
GET /api/partner/v1/global_pricing_setting
Authorization: Bearer <access_token>
X-Restaurant-Id: rest_123
Response 200 OK
{
"success": true,
"message": "",
"data": [
{
"id": 1,
"restaurant_id": "rest_123",
"limit_action_type": "increase",
"limit_value_type": "percentage",
"limit_value": "0.0",
"created_at": "2026-02-17T09:00:00.000Z",
"updated_at": "2026-02-17T09:00:00.000Z"
},
{
"id": 2,
"restaurant_id": "rest_123",
"limit_action_type": "increase",
"limit_value_type": "fixed",
"limit_value": "0.0",
"created_at": "2026-02-17T09:00:00.000Z",
"updated_at": "2026-02-17T09:00:00.000Z"
},
{
"id": 3,
"restaurant_id": "rest_123",
"limit_action_type": "decrease",
"limit_value_type": "percentage",
"limit_value": "0.0",
"created_at": "2026-02-17T09:00:00.000Z",
"updated_at": "2026-02-17T09:00:00.000Z"
},
{
"id": 4,
"restaurant_id": "rest_123",
"limit_action_type": "decrease",
"limit_value_type": "fixed",
"limit_value": "0.0",
"created_at": "2026-02-17T09:00:00.000Z",
"updated_at": "2026-02-17T09:00:00.000Z"
}
],
"meta": {
"api_version": "partner/v1"
}
}
Error Responses
| Status | Condition |
|---|---|
401 Unauthorized | Missing or invalid Bearer token |
400 Bad Request | No restaurant context provided |
403 Forbidden | Token doesn’t have access to the requested restaurant |
2. PATCH /api/partner/v1/global_pricing_setting
Updates a specific setting identified by limit_action_type + limit_value_type. Creates the record if it doesn’t exist yet (upsert behavior).
Request
PATCH /api/partner/v1/global_pricing_setting
Authorization: Bearer <access_token>
X-Restaurant-Id: rest_123
Content-Type: application/json
{
"global_pricing_setting": {
"limit_action_type": "increase",
"limit_value_type": "percentage",
"limit_value": 25.0
}
}
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
limit_action_type | string | Yes | "increase" or "decrease" — identifies which setting to update |
limit_value_type | string | Yes | "percentage" or "fixed" — identifies which setting to update |
limit_value | decimal | Yes | The new limit value. Use 0 for no limit. Must be >= 0 |
Note:
limit_action_typeandlimit_value_typeare used to identify the record. Onlylimit_valueis actually updated.
Response 200 OK
{
"success": true,
"message": "",
"data": {
"id": 1,
"restaurant_id": "rest_123",
"limit_action_type": "increase",
"limit_value_type": "percentage",
"limit_value": "25.0",
"created_at": "2026-02-17T09:00:00.000Z",
"updated_at": "2026-02-17T10:00:00.000Z"
},
"meta": {
"api_version": "partner/v1"
}
}
Error Responses
| Status | Condition | Example Response |
|---|---|---|
401 Unauthorized | Missing or invalid Bearer token | — |
400 Bad Request | No restaurant context provided | — |
403 Forbidden | Token doesn’t have access to the requested restaurant | — |
422 Unprocessable Entity | Invalid or missing limit_action_type / limit_value_type | See below |
422 Unprocessable Content | Validation failed (e.g., negative limit_value) | See below |
Invalid type combination:
{
"success": false,
"message": "Both limit_action_type ('increase'/'decrease') and limit_value_type ('percentage'/'fixed') are required",
"data": null
}
Validation error (negative value):
{
"success": false,
"message": "Validation failed",
"data": null,
"errors": ["Limit value must be greater than or equal to 0"],
"details": {
"limit_value": ["must be greater than or equal to 0"]
}
}
Data Model
global_pricing_settings table
| Column | Type | Constraints | Description |
|---|---|---|---|
id | bigint | PK | Auto-increment primary key |
restaurant_id | string | NOT NULL | Restaurant identifier |
limit_action_type | string | NOT NULL | "increase" or "decrease" |
limit_value_type | string | NOT NULL | "percentage" or "fixed" |
limit_value | decimal(10,2) | NOT NULL, DEFAULT 0 | Limit value (0 = no limit) |
created_at | datetime | NOT NULL | Record creation timestamp |
updated_at | datetime | NOT NULL | Last update timestamp |
Unique index: (restaurant_id, limit_action_type, limit_value_type)
Business Rules
- Auto-creation: GET automatically creates all 4 records for a restaurant if they don’t exist, with
limit_value = 0(no limit). - No limit = 0: A
limit_valueof0means the limit is disabled — any price adjustment is allowed. - Non-negative:
limit_valuemust be>= 0. Negative values are rejected. - Enforcement: These limits are checked when creating or updating pricing rules. A pricing rule that would exceed the configured limit will be rejected.
- 4 records per restaurant: Each restaurant always has exactly 4 records covering all combinations of action type and value type.