Mahjoz Open API Documentation

Base URL: https://api.mahjoz.io/api/open/v1


Table of Contents


Changes

2026-10-24: inline payment scope

2026-10 (spec 148)

Every change is additive. Existing requests keep working and return the same fields.

2026-10 (spec 145)

Every change is additive. Existing requests keep working and return the same fields.

2026-10 (spec 141)

Every change is additive. A request that worked before still works and creates the same order. Every response field you read today keeps its name, type and meaning.


Getting Started

Authentication

The Open API uses OAuth2 Client Credentials flow.

Step 1: Obtain Credentials

Create an API client from your Mahjoz dashboard: Settings > API Integration

After creating a client, you will receive a client_id and client_secret. Save these immediately — the secret is only shown once.

Step 2: Get Access Token

POST /oauth/token
Content-Type: application/json

{
  "grant_type": "client_credentials",
  "client_id": "<client_id>",
  "client_secret": "<client_secret>",
  "scope": ""
}

Response:

{
  "token_type": "Bearer",
  "expires_in": 31536000,
  "access_token": "eyJ0eXAiOiJKV1Q..."
}

Step 3: Use Token

Include the token in all requests:

Authorization: Bearer <access_token>

Partner apps (Mahjoz Partners)

The client-credentials flow above is for a business's own integration. A company that serves many businesses (accounting, CRM, marketing, booking platforms) builds a partner app at partners.mahjoz.io instead. Each business then connects it with one approval, using OAuth 2.0 authorization code + PKCE. Every call made with a partner token acts for exactly one business (a connection), and only on the branches that business granted.

1. Send the business owner to Mahjoz from your system, with a PKCE pair and a state you generate:

GET https://api.mahjoz.io/oauth/authorize
  ?response_type=code
  &client_id=<your app's client id>
  &redirect_uri=<exactly one of your registered redirect URIs>
  &scope=orders:read orders:write customers:read
  &state=<opaque value you check on return>
  &code_challenge=<BASE64URL(SHA256(code_verifier))>
  &code_challenge_method=S256

The business owner signs in, picks the business and branches, reviews the permissions and approves. Mahjoz redirects to redirect_uri?code=…&state=…, or ?error=access_denied&state=… if they cancel. An unregistered redirect_uri, a missing PKCE challenge, or a scope your app was not approved for shows an error page on Mahjoz and never redirects.

2. Exchange the code from your server within 10 minutes:

POST /oauth/token
grant_type=authorization_code&client_id=…&client_secret=…&redirect_uri=…&code=…&code_verifier=…
{ "token_type": "Bearer", "expires_in": 3600, "access_token": "…", "refresh_token": "…", "connection_id": "<uuid>" }

Store the tokens per connection_id. Refresh with grant_type=refresh_token. After you rotate your client secret in the portal, the previous secret keeps working for 24 hours.

3. What a partner token sees:

4. Changing orders. A partner app can read every order in its granted branches, but it can cancel, reschedule and refund only the orders it created itself. Any other order answers 404 order_not_found, as if it did not exist. Orders stay with your app when the business disconnects and reconnects it.

When a partner app cancels an order or reschedules a line, the business's cancellation policy applies, the same one its customers see in the Store:

Policy Result
Anytime (the default) Allowed
Never 422 cancellation_policy_never
N hours before Allowed until N hours before the order's earliest booking start, rental start or admission visit. After that, 422 cancellation_policy_window with policy_hours: N

Refunds are not limited by the policy. A business's own API client (client credentials) is not bound by either rule: it can change any order of its business.


Rate Limiting

Requests are rate-limited per client. Default: 60 requests/minute. When exceeded, the API returns 429 Too Many Requests with a Retry-After header.


Scopes

Scope Description
orders:read Read orders, holds and cancel reasons
orders:write Create orders, create, confirm and release holds, change order status, reschedule lines and check service availability
customers:read Read customers
customers:write Create customers
items:read Read items (every type), their availability and calendar, and the store. Needed to receive item.* and availability.changed webhooks
staff:read Read staff (providers) and their services
branches:read Read branches
categories:read Read categories
payment_methods:read Read payment methods
payment_methods:write Create payment methods
transactions:read Read transactions and order refunds
transactions:write Record order payments and refunds
webhooks:read Read webhook registrations
webhooks:write Create, update and delete webhook registrations
customers:contact See customers' phone numbers and emails. Partner apps only receive contact data with it; a business's own API client always does
* All scopes

Pagination

List endpoints return paginated results.

Parameter Default Max Description
per_page 25 100 Items per page
page 1 - Page number

Response format:

{
  "data": [...],
  "links": { "first": "...", "last": "...", "prev": null, "next": "..." },
  "meta": { "current_page": 1, "last_page": 5, "per_page": 25, "total": 120 }
}

Error Handling

Errors raised by the API itself use this format:

{
  "error": "error_code",
  "message": "Human-readable description"
}

Field validation errors (422) use the field-error format instead, with one entry per field path:

{
  "message": "Please choose an option for this item.",
  "errors": {
    "items.0.option_id": ["Please choose an option for this item."]
  }
}
HTTP Code Error Code Description
401 authentication_failed Missing/invalid/expired token
403 insufficient_scope Token lacks required scope
403 feature_disabled Open API not available on current plan
422 (field errors) Invalid request data. An unavailable time slot is a field error on start
422 party_does_not_fit POST /orders: the group does not fit the requested time
409 STAFF_UNAVAILABLE (in error_code) POST /orders: the slot was taken between the check and the booking. POST /holds: the time is taken
500 order_creation_failed POST /orders: unexpected server error. Safe to retry with the same Idempotency-Key
401 connection_inactive Partner app: the business disconnected it
403 app_suspended Partner app: suspended by Mahjoz
403 branch_not_granted Partner app: the branch is outside what the business granted
404 order_not_found Partner app: cancelling, rescheduling or refunding an order it did not create
404 line_not_found Reschedule or refund: the line is not in the order, or cannot be rescheduled
422 cancellation_policy_never, cancellation_policy_window Partner app: the business's cancellation policy refuses the cancel or reschedule
422 availability_not_supported GET /items/{uuid}/availability on a type it does not cover
422 calendar_not_supported GET /items/{uuid}/calendar on a type it does not cover
404 item_not_found GET /items/{uuid}/calendar: no such item
404 hold_not_found No such hold, or (partner app) a hold another app created
409 slot_unavailable, rental_unavailable, quota_full, party_does_not_fit POST /holds: the place is not free. Nothing is held
409 hold_expired POST /holds/{uuid}/confirm: the hold ran out and the place was taken meanwhile
409 hold_released POST /holds/{uuid}/confirm: the hold was released
409 hold_confirmed POST /holds/{uuid}/release: the hold is already an order. Cancel the order instead
422 hold_not_supported POST /holds: a line that cannot be held (a team or several-provider service, a service line without a chosen provider, an admission line without a visit day)
422 payment_not_allowed POST /holds with a payment. Send it with the confirm
429 too_many_holds POST /holds: this connection already has 50 active holds at this business
500 hold_failed POST /holds: unexpected server error. Nothing was held
422 idempotency_key_reused The same Idempotency-Key was sent with a different body
429 - Rate limit exceeded
502 availability_check_failed Availability could not be checked

Idempotency

POST /orders, POST /customers, POST /orders/{uuid}/lines/{line_id}/reschedule, POST /orders/{uuid}/refunds, POST /holds, POST /holds/{uuid}/confirm and POST /holds/{uuid}/release accept an Idempotency-Key header (1–255 visible ASCII characters). Retrying with the same key and the same body within 24 hours returns the original response with Idempotent-Replayed: true, and nothing is created twice. The same key with a different body is 422 idempotency_key_reused. Use one key per logical create, and send it on every retry.

Only responses below 500 are stored. A 500 can be retried with the same key and runs again; a 4xx replays the same refusal, so after fixing the body send it with a new key.

Webhooks and signatures

Register endpoints with the Webhooks endpoints. Each webhook carries event, event_id, webhook_id, connection_id (the API client or partner connection it belongs to), timestamp and data. For order events, data is the order exactly as Get Order returns it; for item and availability events, see Webhook events. Headers: X-Mahjoz-Event, X-Mahjoz-Event-Id and Signature.

$valid = hash_equals(hash_hmac('sha256', $rawBody, $signingSecret), $request->header('Signature'));

Booking flow

A booking integration usually makes these calls, in this order:

  1. List what is sold. GET /branches, then GET /items and GET /items/{uuid} for options, add-ons, questions, providers and the per-type details. See Items.
  2. Check availability. For a service, POST /availability (with party_size for a group). For a rental, an event or an admission pass, GET /items/{uuid}/availability. See Availability. Nothing is held: a time can still be taken before you order it. To keep it while your customer pays, use a hold.
  3. Create the order. POST /orders with an Idempotency-Key. See Create Order. There is no price preview (quote) endpoint yet: the order's price is in the POST /orders response (total), and the full lines are on Get Order.
  4. Record the payment. Inline in POST /orders (payment), or later with POST /orders/{uuid}/payments. See Inline Payment and Place Order Payment.
  5. Change it later.

Subscribe to the order webhooks to hear about changes made in the dashboard or the Store. A partner app can cancel, reschedule and refund only the orders it created, within the business's cancellation policy: see Partner apps.


Marketplace flow

A marketplace takes the customer's payment on its own side. A hold keeps the place while that happens, so the time is not sold to someone else meanwhile:

  1. Show what is free. Get Store for the business's currency, time zone, cancellation policy and longest hold; Get Item for pictures (images) and options; Item Calendar for the month view, then Check Availability or Item Availability for the day.
  2. Hold the place. POST /holds with the same body as POST /orders, plus ttl_minutes (5–30, default 15). See Create Hold.
  3. Take the payment on your side.
  4. Confirm or release.
    • Paid: POST /holds/{uuid}/confirm, optionally with a payment object, creates the order. See Confirm Hold.
    • Not paid: POST /holds/{uuid}/release gives the place back at once. See Release Hold. A hold you neither confirm nor release runs out by itself at expires_at.

What a hold is, and is not:

Subscribe to availability.changed to hear when the free places of an item move, from any channel, holds included.


Holds

Every hold endpoint follows the partner rule of Partner apps: a partner app sees and changes only the holds it created; any other is 404 hold_not_found. A business's own API client sees every hold of its business.

Hold fields:

Field Type Description
id uuid Hold UUID
status string active, confirmed, released or expired. An active hold whose expires_at has passed reads expired
expires_at datetime When the hold runs out (ISO 8601)
quote null Always null for now
items array The held lines, as sent: id, type, quantity, and when given option_id, staff_id, start, start_at, end_at, visit_date, visit_slot_at, party_size. start is the order's start
order_id uuid | null The order, once confirmed
released_reason string | null partner (you released it), disconnected (the connection was disconnected) or expired (written within about a minute of running out)
created_at datetime

Create Hold

POST /holds

Scope: orders:write. Accepts an Idempotency-Key.

Request: the body of Create Order, plus:

Field Type Required Description
ttl_minutes integer No 5–30. Default 15. The longest is also max_hold_minutes on Get Store

payment is not accepted: send it with the confirm.

{
  "team_id": "9b1d7c2e-4f3a-4b8e-a1c6-2d5e8f9a0b11",
  "customer_id": "c4e8a2f1-6b3d-4c9e-8a7f-1b2c3d4e5f60",
  "start": "2026-11-05 16:00",
  "items": [
    { "id": "a1f3c5e7-2b4d-4f6a-8c1e-3d5f7a9b1c21", "type": "service", "quantity": 1, "staff_id": "e7c9a1b3-5d7f-4a2c-9e4b-6f8a0c2e4d31" }
  ],
  "ttl_minutes": 15
}

The request is checked as POST /orders checks it (Checks), then every place is held, all or none.

Response (201):

{
  "data": {
    "id": "0c2e4a6c-8e0a-4c2e-9a4c-6e8a0c2e4a71",
    "status": "active",
    "expires_at": "2026-11-05T15:45:00+03:00",
    "quote": null,
    "items": [
      { "id": "a1f3c5e7-2b4d-4f6a-8c1e-3d5f7a9b1c21", "type": "service", "quantity": 1, "staff_id": "e7c9a1b3-5d7f-4a2c-9e4b-6f8a0c2e4d31", "start": "2026-11-05 16:00" }
    ],
    "order_id": null,
    "released_reason": null,
    "created_at": "2026-11-05T15:30:00+03:00"
  }
}

Errors:

HTTP Error When
422 Field errors Any check of POST /orders, and ttl_minutes outside 5–30. Too few event seats is a field error on events
422 payment_not_allowed The body has a payment
422 hold_not_supported A team or several-provider service line, a service line without a chosen provider (staff_id), or an admission line without visit_date. Create the order directly
422 party_does_not_fit The group does not fit, as on POST /orders
403 branch_not_granted Partner app: outside the granted branches
409 STAFF_UNAVAILABLE (in error_code) The time is taken, by an order or another hold
409 slot_unavailable The provider's time was taken while the hold was being written
409 party_does_not_fit The group's seats were taken while the hold was being written. Carries nearest_fitting and available
409 rental_unavailable Not enough rental pieces for these dates
409 quota_full Not enough admission tickets left for this visit
429 too_many_holds This connection already has 50 active holds at this business. Confirm or release some first
500 hold_failed Unexpected error. Nothing was held

When a hold is refused, nothing is held.

Get Hold

GET /holds/{uuid}

Scope: orders:read

Returns the hold in the shape above. Once confirmed, order_id is set.

Confirm Hold

POST /holds/{uuid}/confirm

Scope: orders:write. Accepts an Idempotency-Key.

Creates the order from the body stored with the hold, through the same creation as POST /orders. The order is checked again when it is created. Notifications, coupon use, stock, the invoice and the order.created webhook follow, exactly as for POST /orders.

Request (optional): a payment object, the same as on POST /orders (see Inline Payment). Payment can also be recorded later with Place Order Payment.

{ "payment": { "amount": 150.00, "payment_method_type": "card", "reference_number": "mkt-77812" } }

Response (201 the first time, 200 on a repeat**):**

{
  "data": {
    "hold": {
      "id": "0c2e4a6c-8e0a-4c2e-9a4c-6e8a0c2e4a71",
      "status": "confirmed",
      "expires_at": "2026-11-05T15:45:00+03:00",
      "quote": null,
      "items": [ … ],
      "order_id": "7a9c1e3a-5c7e-4a9c-8e1a-3c5e7a9c1e81",
      "released_reason": null,
      "created_at": "2026-11-05T15:30:00+03:00"
    },
    "order": {
      "id": "7a9c1e3a-5c7e-4a9c-8e1a-3c5e7a9c1e81",
      "order_number": "ORD-043",
      "status": "confirmed",
      "payment_status": "paid",
      "currency": "SAR",
      "total": 150.00,
      "created_at": "2026-11-05T15:36:00+03:00",
      "transaction": { "id": "txn-uuid", "amount": "150.00", "currency": "SAR", "status": "confirmed", "reference_number": "mkt-77812", "date": "2026-11-05T15:36:00+03:00" },
      "pin_code": "4821"
    }
  }
}

order has the shape of the Create Order response. Read the full order with Get Order.

Behaviour:

Errors:

HTTP Error When
403 insufficient_scope A payment was sent without the transactions:write scope
404 hold_not_found No such hold, or (partner app) another app's hold
409 hold_expired The hold ran out and the place is no longer free
409 hold_released The hold was released
422 payment_method_not_found, payment_method_type_ambiguous, payment_method_required, payment_method_unavailable As on Inline Payment
422 (field errors payment.*) The payment is checked as on Inline Payment before anything is taken (an amount is required), and the amount may not be more than the order total
422 / 409 Any POST /orders refusal An active hold's order refused for another reason, as Create Order answers it
500 order_creation_failed Unexpected error. Nothing was created

Release Hold

POST /holds/{uuid}/release

Scope: orders:write. Accepts an Idempotency-Key. No body.

Gives the places back at once and returns the hold:

{ "data": { "id": "0c2e4a6c-8e0a-4c2e-9a4c-6e8a0c2e4a71", "status": "released", "released_reason": "partner", "order_id": null, … } }
HTTP Error When
404 hold_not_found No such hold, or (partner app) another app's hold
409 hold_confirmed The hold is already an order

Orders

List Orders

GET /orders

Scope: orders:read

Query Parameters:

Parameter Type Description
page integer Page number
per_page integer Items per page (max 100)
from date Filter orders from date (YYYY-MM-DD)
to date Filter orders to date (YYYY-MM-DD)
status string Filter by status

Response:

{
  "data": [
    {
      "id": "uuid",
      "order_number": "ORD-001",
      "status": "confirmed",
      "source": "api",
      "customer": { "id": "uuid", "first_name": "...", "last_name": "...", "phone": "..." },
      "branch": { "id": "uuid", "name": "Main Branch" },
      "items": [
        {
          "id": "uuid",
          "name": "Haircut",
          "type": "service",
          "price": 100.00,
          "quantity": 1,
          "discount_amount": 0,
          "total": 100.00
        }
      ],
      "currency": "SAR",
      "total": 150.00,
      "discount_amount": 0,
      "created_at": "2026-02-25T10:00:00.000000Z",
      "updated_at": "2026-02-25T10:00:00.000000Z"
    }
  ]
}

Get Order

GET /orders/{uuid}

Scope: orders:read

Returns the order with its customer, branch, lines (items), transactions, tax_amount, coupon and pin_code. Order webhooks send this same object as data.

For an order you created through the API, channel says how: { "type": "partner_app", "app": { "slug": "…", "name": "…" } } for a partner app, or { "type": "private_integration", "app": null } for a business's own API client. It is null on orders made elsewhere.

Response (abbreviated):

{
  "data": {
    "id": "uuid",
    "order_number": "ORD-042",
    "status": "confirmed",
    "source": "api",
    "channel": { "type": "private_integration", "app": null },
    "customer": { "id": "uuid", "first_name": "Sara", "last_name": "Ali", "email": "sara@example.com", "phone": "+966500000001" },
    "branch": { "id": "uuid", "name": "Main Branch" },
    "items": [
      {
        "id": "a1f3c5e7-2b4d-4f6a-8c1e-3d5f7a9b1c21",
        "name": "Haircut",
        "type": "service",
        "price": 120.00,
        "quantity": 1,
        "discount_amount": 12.00,
        "total": 124.20,
        "line_id": "5c7e9a1b-3d5f-4a7c-9e1b-2d4f6a8c0e12",
        "parent_line_id": null,
        "option": { "id": "b2d4f6a8-1c3e-4a5b-9d7f-0e2a4c6e8f41", "name": "Long hair" },
        "staff": { "id": "e7c9a1b3-5d7f-4a2c-9e4b-6f8a0c2e4d31", "name": "Ahmed Ali" },
        "start_at": "2026-11-05T13:00:00+00:00",
        "end_at": "2026-11-05T13:45:00+00:00",
        "party_size": null,
        "guests": null,
        "answers": [{ "question_id": 12, "value": "Sensitive scalp" }],
        "rental": null,
        "tickets_count": 0
      },
      {
        "id": "d3e5f7a9-2c4e-4b6d-8f1a-3c5e7a9c1e51",
        "name": "Hair mask",
        "type": "addon",
        "price": 30.00,
        "quantity": 1,
        "discount_amount": 0,
        "total": 34.50,
        "line_id": "7e9a1b3d-5f7a-4c9e-8b2d-4f6a8c0e2a34",
        "parent_line_id": "5c7e9a1b-3d5f-4a7c-9e1b-2d4f6a8c0e12",
        "option": null,
        "staff": null,
        "start_at": null,
        "end_at": null,
        "party_size": null,
        "guests": null,
        "answers": [],
        "rental": null,
        "tickets_count": 0
      }
    ],
    "transactions": [],
    "currency": "SAR",
    "total": 158.70,
    "discount_amount": 12.00,
    "tax_amount": 20.70,
    "coupon": { "code": "EID10", "discount_type": "percentage", "discount_value": "10.00" },
    "type": "sale",
    "refund_of": null,
    "cancel_reason": null,
    "pin_code": "4821",
    "created_at": "2026-10-22T10:30:00+00:00",
    "updated_at": "2026-10-22T10:30:00+00:00"
  }
}

Line fields (items[]):

Field Type Description
id uuid The item's UUID, as in GET /items. The same item can be on several lines
name string Item name
type string Item type. An add-on line is addon
price number Unit price on the line
quantity number Quantity
discount_amount number Discount on the line
total number Line total, VAT included
line_id uuid The line's own id, unique in the order
parent_line_id uuid | null On an add-on line: the line_id of the line it was added to. null otherwise
option object | null { id, name } of the chosen option or tier. id is an options[].id of the item
staff object | null { id, name } of the line's provider
start_at / end_at ISO 8601 | null The booking's start and end (services), or the rental window (rentals)
party_size integer | null For a group booking, the number of seats in the group. A group is stored as one line per seat, each with its own booking, so a group of 3 is 3 lines with party_size: 3
guests integer | null The guest count the line was priced for (items with guest pricing)
answers array Answers to the item's questions: [{ "question_id": 12, "value": "…" }]
rental object | null Rentals: { start_at, end_at, units, unit, duration_id }. duration_id is set when the rental was booked by duration
tickets_count integer Event or admission tickets issued for this line; 0 for other types

Order coupon: { code, discount_type, discount_value } is the coupon as configured on the order (for example percentage and 10.00), not the money it took off; that is in discount_amount. null when the order has no coupon.

Order type, refund_of and cancel_reason:

Field Type Description
type string sale, or refund for the order a refund creates
refund_of uuid | null On a refund order: the id of the order it refunds. null on a sale
cancel_reason object | null { id, name } of the reason the order was cancelled with (see List Cancel Reasons). null when none was given

GET /orders (the list) keeps its original seven line keys (id, name, type, price, quantity, discount_amount, total). The full lines above are on GET /orders/{uuid} and in every order webhook.

Contact masking (customers:contact) and branch grants apply to the order detail and to webhooks as everywhere else.


Create Order

POST /orders

Scope: orders:write (plus transactions:write for an inline payment). Accepts an Idempotency-Key.

Creates a confirmed order with source: "api", for any of the ten item types. The lines are built and priced by the same order engine as a dashboard order, so the same basket gives the same lines, prices, taxes, bookings and tickets. An order is created whole or not at all: if any line, check or payment is refused, nothing is created.

Minimal request:

{
  "team_id": "9b1d7c2e-4f3a-4b8e-a1c6-2d5e8f9a0b11",
  "customer_id": "c4e8a2f1-6b3d-4c9e-8a7f-1b2c3d4e5f60",
  "start": "2026-11-05 16:00",
  "items": [
    { "id": "a1f3c5e7-2b4d-4f6a-8c1e-3d5f7a9b1c21", "type": "service", "quantity": 1 },
    { "id": "f1a3c5e7-9b2d-4e6f-a8c1-4e6a8c0e2a61", "type": "product", "quantity": 2, "option_id": "a8c0e2f4-6b8d-4f1a-9c3e-5a7c9e1a3c71" }
  ],
  "note": "Optional note"
}

Order fields

Field Type Required Description
team_id uuid Yes Branch UUID (GET /branches). Archived branches are refused
customer_id uuid Yes Customer UUID
start datetime Yes, when a line has type service Appointment start in the business's local time, e.g. 2026-11-05 16:00. The order's service lines are booked one after another from this time
items array Yes At least one line. See Line fields by type
coupon_code string No A coupon code of the business. See Coupons
note string No Order note
payment object No See Inline Payment

Line fields by type

Fields on every line:

Field Type Required Description
items.*.id uuid Yes Item UUID from GET /items, of this business
items.*.type string Yes The item's type from GET /items. It must match the item, otherwise 422 on items.N.type
items.*.quantity number Yes More than 0. Decimals only for items sold by a unit of measurement. Package: N packages. Event and admission: number of tickets
items.*.option_id uuid Depends on the type An options[].id of the item: a variant, or an event or admission tier
items.*.addons array No Add-ons of this item (addons[] on GET /items/{id}): [{ "id": "<add-on uuid>", "quantity": 1 }]. Each add-on becomes its own line, linked by parent_line_id
items.*.question_answers array When the item has required questions [{ "question_id": 12, "value": "…" }], with ids from questions[] on GET /items/{id}
items.*.unit_amount number No Private API clients only. Overrides the unit price. See Partner price rule
items.*.discount_amount number No Private API clients only. Discount on the line
items.*.addons.*.unit_amount number No Private API clients only. Overrides an add-on's price

Fields by type:

Type Line fields Rules
service staff_id, option_id, addons, question_answers, party_size Needs the order-level start. staff_id is a provider UUID, or a staff label UUID for a team service; leave it out to have one assigned (see Provider assignment). option_id is required when the service has options. party_size (2 or more) books several people into the same slot: up to details.max_party_size, and only with quantity: 1
product option_id option_id is required when the product has options
digital_product - Download access is issued to the customer
package - quantity: 3 sells three packages
gift_card - One voucher per unit, issued to the customer who buys it. No recipient fields
course - Enrols the customer. Refused when enrolment is closed or the course is full
rental start_at, then either rental_duration_id + rental_count, or end_at; option_id, rental_inventory_id, guests start_at is always required. By duration: rental_duration_id is a details.durations[].id, rental_count (1 to 999, default 1) is how many blocks of it, and the end is computed. An item with durations must be booked by duration. By window: end_at must be after start_at. rental_inventory_id picks a unit; otherwise one is allocated. guests applies to items with guest_pricing, booked by duration, with quantity: 1
event option_id option_id (a details.tiers[].id) is required when the event has tiers and refused when it has none. quantity is the number of seats
admission visit_date, visit_slot_at, option_id visit_date (YYYY-MM-DD) is required. visit_slot_at (YYYY-MM-DD HH:mm) is required when details.requires_slot is true. option_id (a details.tiers[].id) is required when the pass has tiers and refused when it has none
service-subscription subscription_option_id, start_date subscription_option_id (a details.plans[].id) is required when the item has plans and refused when it has none. start_date (YYYY-MM-DD) is required and must be today or later

addons and question_answers work on every type that has add-ons or questions, not only services.

Pricing when no price is sent

A line without unit_amount is priced the way the Store prices it:

Type Price
service, product, digital_product, package, course, gift_card The chosen option's offer price, otherwise the item's offer price (or regular price when there is no offer)
Add-on The add-on's offer price, otherwise its price
service, rental, admission with day prices (pricing.varies_by_day) The price of the booking day (appointment day, rental window or visit day) replaces the list price
rental by window Units in the window (in the item's rental_unit) × the option's or item's price
rental by duration The duration's price × rental_count, plus the guest surcharge when the item has guest pricing: (guests − included) × extra_price per block
event, admission The tier's price, otherwise the item's price
service-subscription The plan's price
Group booking (party_size) One person's price for each seat. A group of 3 is 3 lines

VAT (and healthcare VAT, when the business has it on and the customer qualifies) is added as for any other order. A private client's unit_amount equal to the item's list price is treated as "no override", so the day price still applies.

Partner price rule

A partner app connection cannot set prices. If a partner line has unit_amount or discount_amount, or an add-on has unit_amount, the order is refused with 422 on that field (for example items.0.unit_amount), and nothing is created. Leave these fields out: the price comes from the catalogue, and a discount from a coupon.

A business's own API client (client credentials) keeps the override: unit_amount, discount_amount and addons[].unit_amount are applied as sent.

Coupons

Send coupon_code to apply one of the business's coupons, with the same rules as the dashboard: active and in its date range, under its total and per-customer usage limits, and only on the lines it covers. An unknown, expired or exhausted code, or a coupon that covers none of the lines, refuses the order with 422 on coupon_code. A private client's own discount_amount stays a line discount, and the coupon applies on top.

The order returns the coupon as coupon (see Get Order).

Checks

Each of these refuses the whole order with 422:

Check Error field
type is not the item's type (for example a rental sent as service) items.N.type
A required question is not answered items.N.question_answers
party_size on something that is not a service, above details.max_party_size, on a service that cannot be booked for a group, or with quantity above 1 items.N.party_size
A service or product with options sent without option_id items.N.option_id
An event or admission with tiers sent without option_id, or a tier that is not available items.N.option_id
An event closed for sale, or its sales window closed items.N.id
More seats than are left on an event or tier items.N.quantity
An admission line without visit_date, or without visit_slot_at when the pass has slots items.N.visit_date, items.N.visit_slot_at
A rental without start_at, without end_at or a duration, or with end_at not after start_at items.N.start_at, items.N.end_at
A rental duration that is not the item's, a missing duration on an item that has durations, rental_count outside the duration's limits rental_duration_id, rental_count
guests outside the item's guest_pricing min and max, or guests on a line with more than one unit guests, quantity
A subscription without a required plan, or a start_date before today items.N.subscription_option_id, items.N.start_date
An add-on that is not an add-on of the line's item items.N.addons.M.id
The provider is not free at start, or no provider is free start, error
An invalid coupon coupon_code
A partner line with a price or discount items.N.unit_amount, items.N.discount_amount, items.N.addons.M.unit_amount

The engine's rental and guest refusals (rental_duration_id, rental_count, guests, quantity) name the field without the items.N. prefix.

A partner app can order only items, add-ons, providers and rental units of the branches it was granted (items shared by every branch are allowed); anything else is 403 branch_not_granted.

Provider assignment

A service line without staff_id gets a provider who is free at start. Only providers of the order's branch are considered and, for a partner app, only those of its granted branches. If none is free, the order is refused with 422 (errors.error: "No available service providers at this time").

Examples by type

The ids are placeholders: take them from GET /items, GET /items/{id}, GET /branches and GET /customers. Every example works for a partner app, because none sends a price.

Service (option, add-on, answer):

{
  "team_id": "9b1d7c2e-4f3a-4b8e-a1c6-2d5e8f9a0b11",
  "customer_id": "c4e8a2f1-6b3d-4c9e-8a7f-1b2c3d4e5f60",
  "start": "2026-11-05 16:00",
  "items": [
    {
      "id": "a1f3c5e7-2b4d-4f6a-8c1e-3d5f7a9b1c21",
      "type": "service",
      "quantity": 1,
      "staff_id": "e7c9a1b3-5d7f-4a2c-9e4b-6f8a0c2e4d31",
      "option_id": "b2d4f6a8-1c3e-4a5b-9d7f-0e2a4c6e8f41",
      "addons": [{ "id": "d3e5f7a9-2c4e-4b6d-8f1a-3c5e7a9c1e51", "quantity": 1 }],
      "question_answers": [{ "question_id": 12, "value": "Sensitive scalp" }]
    }
  ]
}

For a group of three in the same slot, send "party_size": 3 with "quantity": 1 on the service line.

Product:

{
  "team_id": "9b1d7c2e-4f3a-4b8e-a1c6-2d5e8f9a0b11",
  "customer_id": "c4e8a2f1-6b3d-4c9e-8a7f-1b2c3d4e5f60",
  "items": [
    { "id": "f1a3c5e7-9b2d-4e6f-a8c1-4e6a8c0e2a61", "type": "product", "quantity": 2, "option_id": "a8c0e2f4-6b8d-4f1a-9c3e-5a7c9e1a3c71" }
  ]
}

Package:

{
  "team_id": "9b1d7c2e-4f3a-4b8e-a1c6-2d5e8f9a0b11",
  "customer_id": "c4e8a2f1-6b3d-4c9e-8a7f-1b2c3d4e5f60",
  "items": [
    { "id": "c6e8a0c2-4e6a-4c8e-b0d2-6a8c0e2a4c81", "type": "package", "quantity": 1 }
  ]
}

Rental (by duration, with guests):

{
  "team_id": "9b1d7c2e-4f3a-4b8e-a1c6-2d5e8f9a0b11",
  "customer_id": "c4e8a2f1-6b3d-4c9e-8a7f-1b2c3d4e5f60",
  "items": [
    {
      "id": "e2a4c6e8-0b2d-4a6c-8e0f-7b9d1f3b5d91",
      "type": "rental",
      "quantity": 1,
      "start_at": "2026-11-05 10:00",
      "rental_duration_id": "a4c6e8a0-2d4f-4b8a-9c1e-8d0f2b4d6fa1",
      "rental_count": 2,
      "guests": 6
    }
  ]
}

A rental without durations is booked by window instead: send "start_at": "2026-11-05 10:00" and "end_at": "2026-11-07 10:00", and optionally option_id and rental_inventory_id.

Event:

{
  "team_id": "9b1d7c2e-4f3a-4b8e-a1c6-2d5e8f9a0b11",
  "customer_id": "c4e8a2f1-6b3d-4c9e-8a7f-1b2c3d4e5f60",
  "items": [
    { "id": "b4d6f8a0-3c5e-4f7a-9b1d-0a2c4e6a8cc1", "type": "event", "quantity": 2, "option_id": "d6f8a0c2-5e7a-4b9c-8d1f-1b3d5f7b9dd1" }
  ]
}

Admission:

{
  "team_id": "9b1d7c2e-4f3a-4b8e-a1c6-2d5e8f9a0b11",
  "customer_id": "c4e8a2f1-6b3d-4c9e-8a7f-1b2c3d4e5f60",
  "items": [
    {
      "id": "f8a0c2e4-7a9c-4d1e-a3f5-2c4e6a8c0fe1",
      "type": "admission",
      "quantity": 2,
      "option_id": "a0c2e4f6-9c1e-4f3a-b5d7-3d5f7b9d1b01",
      "visit_date": "2026-11-05",
      "visit_slot_at": "2026-11-05 10:00"
    }
  ]
}

Course:

{
  "team_id": "9b1d7c2e-4f3a-4b8e-a1c6-2d5e8f9a0b11",
  "customer_id": "c4e8a2f1-6b3d-4c9e-8a7f-1b2c3d4e5f60",
  "items": [
    { "id": "c2e4f6a8-1e3a-4b5c-9d7f-4e6a8c0e2c11", "type": "course", "quantity": 1 }
  ]
}

Gift card:

{
  "team_id": "9b1d7c2e-4f3a-4b8e-a1c6-2d5e8f9a0b11",
  "customer_id": "c4e8a2f1-6b3d-4c9e-8a7f-1b2c3d4e5f60",
  "items": [
    { "id": "e4f6a8c0-3a5c-4d7e-8f9b-5f7b9d1f3d21", "type": "gift_card", "quantity": 1 }
  ]
}

Digital product:

{
  "team_id": "9b1d7c2e-4f3a-4b8e-a1c6-2d5e8f9a0b11",
  "customer_id": "c4e8a2f1-6b3d-4c9e-8a7f-1b2c3d4e5f60",
  "items": [
    { "id": "a6c8e0a2-5c7e-4f9a-b1d3-6a8c0e2a4e31", "type": "digital_product", "quantity": 1 }
  ]
}

Service subscription:

{
  "team_id": "9b1d7c2e-4f3a-4b8e-a1c6-2d5e8f9a0b11",
  "customer_id": "c4e8a2f1-6b3d-4c9e-8a7f-1b2c3d4e5f60",
  "items": [
    {
      "id": "c0e2a4c6-7e9a-4b1c-9d3f-7b9d1f3b5f41",
      "type": "service-subscription",
      "quantity": 1,
      "subscription_option_id": "e0a2c4e6-9a1c-4d3e-a5f7-8c0e2a4c6a51",
      "start_date": "2026-11-01"
    }
  ]
}

With a coupon:

{
  "team_id": "9b1d7c2e-4f3a-4b8e-a1c6-2d5e8f9a0b11",
  "customer_id": "c4e8a2f1-6b3d-4c9e-8a7f-1b2c3d4e5f60",
  "coupon_code": "EID10",
  "items": [
    { "id": "f1a3c5e7-9b2d-4e6f-a8c1-4e6a8c0e2a61", "type": "product", "quantity": 1, "option_id": "a8c0e2f4-6b8d-4f1a-9c3e-5a7c9e1a3c71" }
  ]
}

Private API client with a price override (refused for partner apps):

{
  "team_id": "9b1d7c2e-4f3a-4b8e-a1c6-2d5e8f9a0b11",
  "customer_id": "c4e8a2f1-6b3d-4c9e-8a7f-1b2c3d4e5f60",
  "start": "2026-11-05 16:00",
  "items": [
    { "id": "a1f3c5e7-2b4d-4f6a-8c1e-3d5f7a9b1c21", "type": "service", "quantity": 1, "unit_amount": 100.00, "discount_amount": 10.00 }
  ]
}

Inline Payment

Add a payment object to create a confirmed transaction in the same request — the order is marked paid atomically. Requires scope transactions:write.

The payment method is picked in this order (first match wins):

  1. payment.payment_method_id (UUID) — explicit.
  2. payment.payment_method_type (slug) — e.g. cash, card, bank_transfer, other, third-party, voucher.
  3. Otherwise, if your client has a linked integration app, its payment method is used.

Payment fields:

Field Type Required Description
payment.amount number Yes (if payment present) Must not exceed order total
payment.payment_method_id uuid No Tenant payment method UUID (discover via GET /payment-methods)
payment.payment_method_type string No Method type slug — resolved against the tenant's active methods
payment.reference_number string No External transaction reference
payment.date datetime No Payment timestamp (defaults to now)
payment.note string No Free-form note attached to the transaction

Example A — cash payment by type:

{ "team_id": "...", "customer_id": "...", "items": [...],
  "payment": { "amount": 150.00, "payment_method_type": "cash" } }

Example B — explicit method UUID:

{ "team_id": "...", "customer_id": "...", "items": [...],
  "payment": { "amount": 150.00, "payment_method_id": "f3a1...-uuid" } }

Payment-related errors:

HTTP Error Condition
422 payment_method_not_found UUID is not a method of this tenant, or type slug has no active method
422 payment_method_type_ambiguous Tenant has multiple active methods of that type — use payment_method_id instead
422 payment_method_required payment.amount was given but no method could be resolved
422 payment_method_unavailable Linked integration app was uninstalled by the tenant
422 (field error payment.amount) The amount is more than the order total

If the transaction fails validation, the order is also rolled back — you can safely retry.

Responses and errors

201 Created:

{
  "data": {
    "id": "uuid",
    "order_number": "ORD-042",
    "status": "confirmed",
    "payment_status": "paid",
    "currency": "SAR",
    "total": 150.00,
    "created_at": "2026-02-25T10:30:00.000000Z",
    "transaction": {
      "id": "txn-uuid",
      "amount": "150.00",
      "currency": "SAR",
      "status": "confirmed",
      "reference_number": null,
      "date": "2026-02-25T10:30:00+00:00"
    },
    "pin_code": "4821"
  }
}

When no payment is sent, transaction is null and payment_status will typically be unpaid. Read the full order with Get Order.

HTTP Error When
422 Field errors Any check above. One entry per field
422 party_does_not_fit The group does not fit the requested time
422 { "message": "…" } Sold out, at capacity or out of stock, with the reason in message (admission day or slot quota, subscription capacity, product stock)
409 STAFF_UNAVAILABLE The slot was taken between the check and the booking. Pick another time
403 branch_not_granted Partner app: the branch, or an item, add-on, provider or rental unit, is outside the granted branches
422 idempotency_key_reused The same Idempotency-Key was sent with a different body
500 order_creation_failed Unexpected error. Nothing was created

Field errors:

{
  "message": "The item type does not match the selected item. (and 1 more error)",
  "errors": {
    "items.0.type": ["The item type does not match the selected item."],
    "items.1.question_answers": ["Please answer the required question: Hair type"]
  }
}

Group does not fit:

{
  "error": "party_does_not_fit",
  "message": "This time cannot fit your whole group.",
  "nearest_fitting": "2026-11-05 17:30",
  "available": 2
}

nearest_fitting is the nearest time that day where the whole group fits (YYYY-MM-DD HH:mm, business local time), or null. available is the number of seats free at the requested time.

Sold out / out of stock:

{ "message": "Sorry, this item is out of stock." }

Slot taken:

{ "message": "Staff is not available at this particular time", "error_code": "STAFF_UNAVAILABLE" }

Branch not granted:

{ "error": "branch_not_granted", "message": "…" }

Unexpected error:

{ "error": "order_creation_failed", "message": "Something went wrong" }

What an order creates

An Open API order does exactly what a dashboard order for the same basket does:

Notifications to the customer and the provider, through the channels the business has set up: order-created, booking-created (each booking with a provider), rental-confirmed, admission-ticket-issued and digital-product-ready.

Webhooks: order.created, and order.payment_accepted when an inline payment was recorded. No order.updated is sent for the creation itself.


Change Order Status

POST /orders/{uuid}/status

Scope: orders:write

Request:

{
  "status": "completed",
  "note_for_status": "finished on-site"
}

Cancel with a reason:

{
  "status": "canceled",
  "cancel_reason_id": "3f5a7c9e-1b3d-4f5a-8c7e-9a1b3c5d7e91",
  "note_for_status": "Customer called to cancel"
}

Request Fields:

Field Type Required Description
status string Yes One of confirmed, in-progress, completed, canceled
note_for_status string No Free-text reason or note attached to the transition
cancel_reason_id uuid No An id from List Cancel Reasons. Stored on the order when status is canceled, and read back as cancel_reason. Any other id is 422 on cancel_reason_id

Behavior:

Response: Same shape as GET /orders/{uuid} (full order detail with customer, branch, items, and transactions).


List Cancel Reasons

GET /cancel-reasons

Scope: orders:read

The business's reasons for cancelling an order: the list the dashboard's cancel dialog shows. Send an id as cancel_reason_id on Change Order Status.

Response:

{
  "data": [
    { "id": "3f5a7c9e-1b3d-4f5a-8c7e-9a1b3c5d7e91", "name": "Customer request" },
    { "id": "5a7c9e1b-3d5f-4a7c-9e1b-3d5f7a9c1e02", "name": "Provider unavailable" }
  ]
}

The list is not paginated. It is empty when the business has set up no reasons.


Reschedule Order Line

POST /orders/{uuid}/lines/{line_id}/reschedule

Scope: orders:write. Accepts an Idempotency-Key.

Moves one line of an order to another time: a service booking, a rental, or admission tickets. line_id is the line's items[].line_id from Get Order. The body depends on the line's type.

Service:

{
  "start": "2026-11-06 17:00",
  "staff_id": "e7c9a1b3-5d7f-4a2c-9e4b-6f8a0c2e4d31",
  "notify_customer": true
}

Rental:

{
  "start_at": "2026-11-08 10:00",
  "end_at": "2026-11-10 10:00",
  "notify_customer": true
}

Admission:

{
  "visit_date": "2026-11-07",
  "visit_slot_at": "2026-11-07 10:00",
  "ticket_ids": ["8c0e2a4c-6e8a-4c0e-b2d4-6f8a0c2e4a71"]
}

Fields by type:

Type Field Required Description
service start Yes New start in the business's local time, e.g. 2026-11-06 17:00. The end keeps the booking's current length
service staff_id No A provider UUID to move the booking to. Leave it out to keep the current provider. A partner app can pick only providers of its granted branches
service notify_customer No Default true. false moves the booking without the booking-rescheduled message
rental start_at, end_at Yes The new window, business local time. It must have the same chargeable length as the current one, and the rental must not have started
rental notify_customer No Default true. false moves the rental without the rental-rescheduled message
admission visit_date Yes New visit day, YYYY-MM-DD
admission visit_slot_at When the pass has slots New slot, YYYY-MM-DD HH:mm
admission ticket_ids No The tickets to move. Leave it out to move every unused ticket of the line. Either all the tickets move or none

Any other line type answers 404 line_not_found. A service booking that is part of a multi-provider booking moves with the rest of its group.

What changes: only the time, and for a service, the provider. The price, payments, coupon use, invoice and order status stay as they were.

Notifications: booking-rescheduled (service) or rental-rescheduled (rental) to the customer, unless notify_customer is false. Admission tickets have no reschedule message.

Webhooks: one order.updated.

Response: 200 with the order, same shape as GET /orders/{uuid}, showing the new times.

Errors:

HTTP Error When
404 order_not_found Partner app: the order was not created by this app. An unknown order id is a plain 404
404 line_not_found The line is not in the order, its type cannot be rescheduled, or it has no active booking, rental or ticket to move
403 branch_not_granted Partner app: the provider is outside the granted branches
422 cancellation_policy_never Partner app: the business does not allow cancelling or rescheduling
422 cancellation_policy_window Partner app: too close to the order's earliest booked time. policy_hours gives the policy's hours
422 slot_unavailable The provider cannot take the new time. conflict explains why
422 rental_reschedule_refused The rental cannot move to that window. reason explains why
422 admission_reschedule_refused A ticket is used, the day is closed or outside the pass's validity, the quota is full, the slot is invalid or has passed. The reason is in message
422 (field errors) A missing or invalid field, or an unknown staff_id

Slot unavailable:

{
  "error": "slot_unavailable",
  "message": "Staff is not available at this particular time",
  "conflict": { "reason": "not_working", "message": "Staff is not available at this particular time" }
}

conflict.reason is on_leave, not_working, fully_booked or daily_limit_reached. Other customers' bookings are never returned.

Rental refused:

{
  "error": "rental_reschedule_refused",
  "message": "The new dates must keep the same rental length.",
  "reason": "length_changed",
  "expected_units": 2
}
reason Meaning
order_inactive The rental's order is no longer active
attached_extra The rental is an extra of a service booking. Reschedule the booking instead
already_started The rental has started
in_past The new window is in the past
length_changed The new window has a different chargeable length. expected_units is the length to keep, in the item's rental_unit
duration The length is outside the item's allowed range
closed The window is outside the rental's opening hours
blocked The business closed the rental for those dates
sold_out No unit is free for the new window

Cancellation policy:

{
  "error": "cancellation_policy_window",
  "message": "This business allows cancelling or rescheduling only up to 24 hours before the appointment.",
  "policy_hours": 24
}

Place Order Payment

POST /orders/{id}/payments

Scope: transactions:write

Records a payment (transaction) against a sale order. The amount cannot exceed the order's remaining unpaid amount and the order must not be in draft status.

Body:

Field Type Required Description
amount number yes Amount to pay (cannot exceed remaining)
payment_method_id uuid yes UUID of a tenant payment method
note string no Optional note
reference_number string no External reference
date datetime no Defaults to now

Behavior:

Response: 201 Created with the created transaction resource.


Refund Order

POST /orders/{uuid}/refunds

Scope: transactions:write. Accepts an Idempotency-Key.

Refunds some lines of an order, or some of their quantity. This is the dashboard's refund: the same calculation, credit note and releases.

Mahjoz records the refund. It does not send money back through any online payment gateway. Return the money to the customer yourself, in the gateway or by the method you name in payment_method_id.

Request:

{
  "payment_method_id": "f3a1c5e7-2b4d-4f6a-8c1e-3d5f7a9b1c99",
  "lines": [
    { "line_id": "5c7e9a1b-3d5f-4a7c-9e1b-2d4f6a8c0e12", "quantity": 1 }
  ],
  "reason": "refund",
  "note": "Customer returned the item"
}
Field Type Required Description
payment_method_id uuid Yes How the money goes back: an id from List Payment Methods. Any other value is 422 on payment_method_id
lines array Yes At least one line. Each line_id at most once
lines.*.line_id uuid Yes An items[].line_id from Get Order
lines.*.quantity number Yes More than 0, and no more than the line's quantity not yet refunded
reason string No The credit note's reason: refund, cancellation, price_adjustment, supply_change or party_details, or your own text (up to 255 characters)
note string No Up to 1000 characters

There is no amount field. Each line is refunded in proportion to what was charged for it: price, discount and VAT, divided by the line's quantity and multiplied by the refunded quantity.

What a refund does:

Refunds are not limited by the business's cancellation policy. A partner app can refund only the orders it created.

Webhooks: order.updated and order.status_changed for the original order, and order.updated for the refund order. Each goes out once.

Response (201):

{
  "data": {
    "id": "9e1b3d5f-7a9c-4e1b-8d3f-5a7c9e1b3d61",
    "refund_of": "0b2d4f6a-8c0e-4a2c-9e4b-6f8a0c2e4d10",
    "total": "57.50",
    "lines": [
      { "line_id": "5c7e9a1b-3d5f-4a7c-9e1b-2d4f6a8c0e12", "quantity": 1, "total": "57.50" }
    ],
    "credit_note": { "id": "1d3f5a7c-9e1b-4d3f-8a5c-7e9a1b3d5f81", "number": 12 },
    "order_status": "partial-refund",
    "created_at": "2026-11-06T09:15:00+00:00"
  }
}
Field Type Description
id uuid The refund order. Get Order reads it, with type: "refund"
refund_of uuid The original order
total string The refunded total, VAT included
lines[] array { line_id, quantity, total } per refunded line
credit_note object | null { id, number } of the credit note
order_status string The original order's status after the refund

Errors:

HTTP Error When
404 order_not_found Partner app: the order was not created by this app. An unknown order id is a plain 404
404 line_not_found A line_id is not in the order. field names it, e.g. lines.0.line_id
422 refund_exceeds_remaining A quantity is more than what is left to refund on the line
422 refund_not_allowed The order cannot be refunded, for example a draft. The reason is in message
422 credit_note_refused E-invoicing refused the credit note. Nothing was recorded
422 (field errors) A missing or invalid field

List Order Refunds

GET /orders/{uuid}/refunds

Scope: transactions:read

The refunds already recorded for an order, and what is left to refund.

Response:

{
  "data": {
    "refunds": [
      {
        "id": "9e1b3d5f-7a9c-4e1b-8d3f-5a7c9e1b3d61",
        "refund_of": "0b2d4f6a-8c0e-4a2c-9e4b-6f8a0c2e4d10",
        "total": "57.50",
        "lines": [{ "line_id": "<sale_service uuid>", "quantity": 1, "total": "57.50" }],
        "credit_note": { "id": "1d3f5a7c-9e1b-4d3f-8a5c-7e9a1b3d5f81", "number": 12 },
        "order_status": "partial-refund",
        "created_at": "2026-11-06T09:15:00+00:00"
      }
    ],
    "refundable": [
      {
        "line_id": "5c7e9a1b-3d5f-4a7c-9e1b-2d4f6a8c0e12",
        "id": "a1f3c5e7-2b4d-4f6a-8c1e-3d5f7a9b1c21",
        "name": "Haircut",
        "quantity": 1,
        "unit_amount": "57.50"
      }
    ]
  }
}

Availability

Check Availability

POST /availability

Scope: orders:write

Request:

{
  "service_id": "service-uuid",
  "date": "2026-02-25",
  "staff_id": "staff-uuid",
  "quantity": 1,
  "visible_days": 7,
  "next_availability": false,
  "party_size": 3
}

Request Fields:

Field Type Required Description
service_id uuid Yes Service to check
date date Yes Start date (YYYY-MM-DD)
staff_id uuid No Specific staff member
quantity integer No Default 1
visible_days integer No Days to check (1-30, default 7)
next_availability boolean No Find next available slot if none on given date
party_size integer No Default 1. With 2 or more, only times that seat the whole group are returned. Refused with 422 on party_size when the service cannot be booked for a group, or when it is above the service's details.max_party_size, with the same messages as Create Order

Send the same party_size on the order line to book the group. A preview: nothing is held, so a time can be taken before you order it.

Response:

{
  "data": {
    "slots": {
      "2026-02-25": ["09:00", "09:30", "10:00", "10:30"],
      "2026-02-26": ["09:00", "11:00", "14:00"]
    }
  }
}

Item Availability

GET /items/{uuid}/availability

Scope: items:read

What is free right now for a rental, an event or an admission pass, read the same way the dashboard's order form reads it. The query depends on the item's type. Any other type answers 422 availability_not_supported; for services, use Check Availability.

This is a preview: nothing is held. Ordering exactly what is reported free succeeds, and one more is refused, as long as nobody else orders in between. A partner app can check only items of its granted branches (and items shared by every branch); others are 403 branch_not_granted.

Rental

Query: start_at with either end_at or rental_duration_id.

Parameter Type Required Description
start_at datetime Yes Window start, business local time, e.g. 2026-11-05 10:00
end_at datetime Without rental_duration_id Window end. Must be after start_at
rental_duration_id uuid Without end_at A details.durations[].id of the item. The end is computed
rental_count integer No Blocks of the duration, 1 to 999. Default 1
option_id uuid No An options[].id of the item
quantity integer No Units wanted. Default 1
guests integer No Guest count, for items with guest_pricing
GET /items/e2a4c6e8-0b2d-4a6c-8e0f-7b9d1f3b5d91/availability?start_at=2026-11-05 10:00&rental_duration_id=a4c6e8a0-2d4f-4b8a-9c1e-8d0f2b4d6fa1&rental_count=1
{
  "data": {
    "type": "rental",
    "start_at": "2026-11-05T10:00:00+03:00",
    "end_at": "2026-11-07T10:00:00+03:00",
    "available_count": 3,
    "fits_quantity": true,
    "unavailable_reason": null,
    "units": [
      { "id": "c8e0a2c4-6e8a-4c0e-b2d4-8a0c2e4a6c11", "name": "Tent 1", "available_quantity": 1 }
    ]
  }
}
Field Description
start_at, end_at The window checked, ISO 8601
available_count Units free for the whole window
fits_quantity true when the requested quantity can be ordered for this window
unavailable_reason null, or closed (outside the rental's hours), blocked (closed by the business for these dates), sold_out, duration (window length outside the item's limits) or guests (outside the item's guest limits)
units[] The free units. Any id can be sent as rental_inventory_id on Create Order

A rental_duration_id of another item is 422 on rental_duration_id.

Event

No query parameters.

{
  "data": {
    "type": "event",
    "sales_open": true,
    "starts_at": "2026-11-20T19:00:00+03:00",
    "remaining": 45,
    "tiers": [
      { "id": "d6f8a0c2-5e7a-4b9c-8d1f-1b3d5f7b9dd1", "name": "VIP", "remaining": 5 },
      { "id": "e8a0c2e4-7a9c-4d1e-a3f5-2c4e6a8c0ee1", "name": "General", "remaining": 40 }
    ]
  }
}
Field Description
sales_open Whether tickets can be sold now
starts_at The event's start, ISO 8601
remaining Seats left. On an event with tiers, the sum of the tiers' remaining. null means no limit (on a tiered event: when any tier has no limit)
tiers[] { id, name, remaining } per tier. id goes in items[].option_id. remaining is null for a tier without a seat limit. Empty for an event without tiers

Admission

Parameter Type Required Description
date date Yes Visit day, YYYY-MM-DD
option_id uuid No A tier (details.tiers[].id). Limits the figures to that tier. An unknown tier is 422 on option_id
{
  "data": {
    "type": "admission",
    "date": "2026-11-05",
    "open": true,
    "within_validity": true,
    "requires_slot": true,
    "daily_quota": 200,
    "remaining_daily": 120,
    "tiers": [
      { "id": "a0c2e4f6-9c1e-4f3a-b5d7-3d5f7b9d1b01", "name": "Adult", "remaining_daily": 80 }
    ],
    "slots": [
      {
        "slot_at": "2026-11-05 10:00",
        "label": "10:00",
        "remaining": 18,
        "selectable": true,
        "passed": false,
        "tiers": [
          { "id": 41, "uuid": "a0c2e4f6-9c1e-4f3a-b5d7-3d5f7b9d1b01", "remaining": 10, "selectable": true }
        ]
      }
    ]
  }
}
Field Description
open The pass is open on that day
within_validity The day is inside the pass's validity dates
requires_slot An order needs visit_slot_at
daily_quota, remaining_daily The day's limit and what is left. null when there is no limit
tiers[] { id, name, remaining_daily } per tier. Empty when option_id is sent
slots[] The day's slots, empty when the pass has no slots. Send slot_at as visit_slot_at. Order only a slot with selectable: true; passed: true means the slot's time is over. remaining is null when the slot has no limit
slots[].tiers[] Per-tier figures for the slot, on a pass with tiers. uuid is the tier's id (items[].option_id); ignore the numeric id

Item Calendar

GET /items/{uuid}/calendar?from=2026-11-01&to=2026-11-30

Scope: items:read

Up to 60 days of availability for one service, rental, event or admission pass, one row per day, for a month view. Every figure comes from the same reads as Check Availability and Item Availability for that day. A preview: nothing is held. Answers are cached for up to a minute and refreshed when the item's availability changes.

Query parameters:

Parameter Type Required Description
from date Yes YYYY-MM-DD, today or later in the business's time zone
to date Yes YYYY-MM-DD, on or after from. At most 60 days from from to to, both included
party_size integer No Services: only days that seat the whole group
quantity integer No Default 1. Rentals: pieces. Events and admission: tickets. Services: the line quantity
option_id uuid No Event or admission tier (options[].id)
staff_id uuid No Services: one provider

Response:

{
  "data": {
    "item_id": "e2a4c6e8-0b2d-4a6c-8e0f-7b9d1f3b5d91",
    "type": "rental",
    "timezone": "Asia/Riyadh",
    "days": [
      { "date": "2026-11-01", "bookable": true, "remaining": 3, "reason": null },
      { "date": "2026-11-02", "bookable": false, "remaining": 0, "reason": "sold_out" }
    ]
  }
}

What a day means, by type:

Type bookable remaining reason when not bookable
service At least one free time that day (for party_size and staff_id) Always null no_slots
rental At least quantity pieces free for the whole day (check-in to check-out) Free pieces sold_out
event Only on the event's start date, while sales are open and at least quantity seats are left Seats left (of the tier, with option_id). null when unlimited not_scheduled (another day), sales_closed, sold_out
admission The pass is open and valid that day and at least quantity tickets are left Tickets left that day (of the tier, with option_id). null when there is no daily limit beyond_horizon (outside the validity dates), closed, sold_out

For an admission pass with slots, the calendar counts the day's quota only: read Item Availability for the slots of a day.

Errors:

HTTP Error When
422 Field errors from in the past or missing, to before from, more than 60 days, or an unknown admission option_id
422 calendar_not_supported Any other item type
404 item_not_found No such item
403 branch_not_granted Partner app: the item is in a branch it was not granted
502 availability_check_failed Service availability could not be read

Customers

List Customers

GET /customers

Scope: customers:read

Query Parameters:

Parameter Type Description
page integer Page number
per_page integer Items per page (max 100)
name string Filter by name
phone string Filter by phone number
email string Filter by email

Response item fields: id, first_name, last_name, email, phone, type, city, created_at, updated_at


Get Customer

GET /customers/{uuid}

Scope: customers:read

Returns customer with address, note, blocked, tax_registration_number, tags.


Find Customer by Phone

GET /customers/phone?phone=<phone>

Scope: customers:read

Parameter Type Required Description
phone string Yes Phone number in international format, with or without the leading + — +966500000001, 966500000001 and 00966500000001 all match the same customer. If you send the +, URL-encode it as %2B. Separators (spaces, dashes, dots, parentheses) are ignored on both sides of the comparison.

Matching is done on digits only, so the stored formatting does not matter. Local (national) formats such as 0500000001 are not resolved — send the country code.

Response (found):

{
  "data": {
    "id": "uuid",
    "first_name": "John",
    "last_name": "Doe",
    "email": "john@example.com",
    "phone": "+966500000001",
    "type": "individual",
    "city": "Riyadh",
    "address": "123 Main St",
    "note": "VIP customer",
    "blocked": false,
    "tax_registration_number": "300000000000003",
    "tags": [],
    "created_at": "2026-02-25T10:00:00.000000Z",
    "updated_at": "2026-02-25T10:00:00.000000Z"
  }
}

Response (not found):

{
  "data": null
}

Create Customer

POST /customers

Scope: customers:write

Request:

{
  "first_name": "John",
  "last_name": "Doe",
  "email": "john@example.com",
  "phone": "+966500000001",
  "phone_country": "SA",
  "type": "individual",
  "city": "Riyadh",
  "address": "123 Main St",
  "note": "VIP customer",
  "tax_registration_number": "300000000000003"
}

Request Fields:

Field Type Required Description
first_name string Yes Min 2 chars
last_name string No Min 2 chars
email string No Valid email (RFC + DNS)
phone string No Unique per tenant
phone_country string No Required with phone, 2-char country code (e.g., SA)
type string No individual or company (default: individual)
city string No Min 3 chars
address string No Min 3 chars
note string No Free text
tax_registration_number string No 15 digits

Response (201):

{
  "data": {
    "id": "uuid",
    "first_name": "John",
    "last_name": "Doe",
    "email": "john@example.com",
    "phone": "+966500000001",
    "type": "individual",
    "city": "Riyadh",
    "address": "123 Main St",
    "note": "VIP customer",
    "blocked": false,
    "tax_registration_number": "300000000000003",
    "tags": [],
    "created_at": "2026-02-25T10:30:00.000000Z",
    "updated_at": "2026-02-25T10:30:00.000000Z"
  }
}

Items

Items are everything a business sells. type is one of:

Type What it is
service An appointment with a provider
product A physical product, with stock
package A bundle of services or products, used over time
rental Something rented for a time window or a fixed duration
event A dated event with seats, optionally in ticket tiers
admission An admission pass for a visit day (and slot), optionally in tiers
course A course with sessions and limited seats
gift_card A gift card (an amount, or a set of services)
digital_product A downloadable product
service-subscription A subscription to a service for a period, optionally with plans

Add-ons and fee items are never listed on their own: add-ons appear under their item (addons on GET /items/{id}). Archived items are never listed. A partner app sees the items of the branches it was granted, plus the items shared by every branch.

Prices are the stored price and offer_price of the item (and of each option), before VAT. They are not the VAT-inclusive prices the Store shows. See Pricing when no price is sent for what an order line costs.

List Items

GET /items

Scope: items:read

Query Parameters:

Parameter Type Description
page integer Page number
per_page integer Items per page (max 100)
type string One of the ten types above. Any other value is 422
name string Filter by name

Response:

{
  "data": [
    {
      "id": "uuid",
      "type": "service",
      "sku": "SRV-001",
      "name": { "ar": "قص شعر", "en": "Haircut" },
      "slug": "haircut",
      "description": { "ar": "...", "en": "..." },
      "html_description": { "ar": "<p>...</p>", "en": "<p>...</p>" },
      "full_image": "https://...",
      "status": true,
      "price": 100.00,
      "offer_price": 80.00,
      "currency": "SAR",
      "duration": 30,
      "category": {
        "id": "uuid",
        "name": { "ar": "الشعر", "en": "Hair" },
        "status": true
      },
      "branch": { "id": "uuid", "name": "Main Branch" },
      "options": [
        {
          "id": "uuid",
          "name": { "ar": "شعر طويل", "en": "Long hair" },
          "price": 120.00,
          "offer_price": 100.00,
          "duration": 45,
          "is_active": true,
          "values": [
            { "option_value_id": "uuid", "option_name": "Length", "value": "Long" }
          ]
        }
      ],
      "visible_in_store": true,
      "cta_hidden": false,
      "details": {
        "booking_mode": "party",
        "max_party_size": 4,
        "max_quantity": null,
        "assignment_type": "single_provider",
        "requires_timeslot": true,
        "enable_location": false,
        "is_home_service": false,
        "extras": []
      },
      "created_at": "2026-02-25T10:00:00+00:00",
      "updated_at": "2026-02-25T10:00:00+00:00"
    },
    {
      "id": "uuid",
      "type": "product",
      "sku": "PRD-001",
      "name": { "ar": "شامبو", "en": "Shampoo" },
      "status": true,
      "price": 25.00,
      "offer_price": null,
      "currency": "SAR",
      "cost": 10.00,
      "stock": 50,
      "options": [
        {
          "id": "uuid",
          "name": { "ar": "500ml", "en": "500ml" },
          "price": 30.00,
          "offer_price": 30.00,
          "quantity": 20,
          "is_active": true,
          "values": [
            { "option_value_id": "uuid", "option_name": "Size", "value": "500ml" }
          ]
        }
      ],
      "visible_in_store": true,
      "cta_hidden": false,
      "details": { "stock": 50, "in_stock": true, "sku": "PRD-001" }
    }
  ]
}

Item fields:

Field Type Description
id uuid Item UUID. Send it as items[].id on POST /orders
type string Item type. Send it as items[].type on POST /orders
name, description, html_description {ar, en} Localised texts. description is plain text, html_description keeps the HTML
status boolean The item's own "show in store" flag
visible_in_store boolean Whether customers see the item in the Store: its own flag and, when it has a category, the category's
cta_hidden boolean The Store shows the item without its book / add-to-cart button and refuses it in the cart
price, offer_price number Stored price and offer price, before VAT. offer_price is null when there is no offer
duration integer Minutes. service and event only
cost, stock number product only
options array Variants and tiers. An option with no price of its own shows the item's price
details object Type-specific data. See Details by type
cancellation_policy object The business's cancellation policy, the same on every item: { kind, hours }. kind is anytime, never or hours; hours is the number of hours before the start, or null. Show it before the customer books. Partner apps are held to it when they cancel or reschedule (Partner apps)

Options: options[] keeps its existing shape: one entry per variant (a service or product variant, a rental option) or tier (event and admission tiers), with id, name, price, offer_price, is_active and the values that make it up (for example Color=Red, Size=Small). Services add duration, products add quantity. An order line's option_id is an options[].id.


Get Item

GET /items/{uuid}

Scope: items:read

Returns the item with every list field, plus:

Field Type Description
images array The item's pictures: [{ id, url, is_main }], the main picture first, then in upload order. Empty when the item has none. full_image (on the list too) stays the main picture
staff array Providers who offer the item: [{ id, name }]. Use id as staff_id
addons array [{ id, name, price, offer_price, duration_minutes, max_quantity }]. Use id in items[].addons[].id
questions array [{ id, title, help_text, type, is_required, options: [{ value, label }] }]. type is one of text, number, date, select, checkbox, location, file, image; options lists the choices of a select or checkbox. Answer with items[].question_answers[]; every is_required question must be answered
pricing object Booking-date prices: { varies_by_day, rules: [{ name, days_of_week, date_from, date_to, prices: [{ option_id, price }] }] }. days_of_week uses 0 = Sunday … 6 = Saturday. option_id is null for the item's own price
guest_pricing object | null { enabled, min, max, included, extra_price }, or null when guest-count pricing is off
deposit object | null { amount, type, percentage }, or null when the item takes no deposit. type is fixed or percentage; for percentage, percentage is the rate and amount is that share of price

images, addons, questions, pricing, guest_pricing and deposit are on the detail only, to keep the list light. staff, addons, questions and pricing are empty lists (or varies_by_day: false) when the item has none.

Example (rental, abbreviated):

{
  "data": {
    "id": "e2a4c6e8-0b2d-4a6c-8e0f-7b9d1f3b5d91",
    "type": "rental",
    "name": { "ar": "خيمة", "en": "Tent" },
    "price": 200.00,
    "offer_price": null,
    "options": [],
    "visible_in_store": true,
    "cta_hidden": false,
    "images": [
      { "id": "b6d8f0a2-4c6e-4a8c-9e0a-2c4e6a8c0b11", "url": "https://media.mahjoz.io/…/tent-main.jpg", "is_main": true },
      { "id": "c8e0a2c4-6e8a-4c0e-8a2c-4e6a8c0e2c21", "url": "https://media.mahjoz.io/…/tent-inside.jpg", "is_main": false }
    ],
    "cancellation_policy": { "kind": "hours", "hours": 24 },
    "staff": [],
    "addons": [],
    "questions": [
      { "id": 12, "title": { "ar": "الموقع", "en": "Location" }, "help_text": { "ar": null, "en": null }, "type": "text", "is_required": true, "options": [] }
    ],
    "pricing": { "varies_by_day": false, "rules": [] },
    "guest_pricing": { "enabled": true, "min": 1, "max": 10, "included": 4, "extra_price": 25.00 },
    "deposit": { "amount": 100.00, "type": "fixed", "percentage": null },
    "details": {
      "rental_unit": "day",
      "min_duration": 1,
      "max_duration": 7,
      "buffer_time_minutes": 0,
      "pickup_lead_minutes": 0,
      "return_lag_minutes": 0,
      "requires_deposit": false,
      "deposit_amount": 0,
      "deposit_collection": "on_pickup",
      "late_fee_per_unit": null,
      "durations": [
        { "id": "a4c6e8a0-2d4f-4b8a-9c1e-8d0f2b4d6fa1", "name": { "ar": "عطلة نهاية الأسبوع", "en": "Weekend" }, "length": 2, "unit": "day", "price": 350.00, "min_count": 1, "max_count": 4, "is_default": true }
      ],
      "units_count": 3,
      "extras": []
    }
  }
}

Details by type

details always has the full key set of its type. A value the item has no data for is null (or an empty list).

Type details keys
service booking_mode, max_party_size, max_quantity, assignment_type, requires_timeslot, enable_location, is_home_service, extras
product stock, in_stock, sku
package package_mode, is_flexible, flex_total, valid_period_days, max_available, is_sold_out, services[{ id, name, type, quantity, max_quantity }]
rental rental_unit, min_duration, max_duration, buffer_time_minutes, pickup_lead_minutes, return_lag_minutes, requires_deposit, deposit_amount, deposit_collection, late_fee_per_unit, durations[{ id, name, length, unit, price, min_count, max_count, is_default }], units_count, extras
event start_date, end_date, closed_at, address, location{ lat, lng }, capacity, allow_seats, available_tickets, unlimited_tickets, sales_open, has_tiers, tiers[{ id, name, price, offer_price, capacity, sold, remaining }], extras
admission validity_from, validity_until, valid_from_time, valid_until_time, requires_slot, slot_duration_minutes, slot_exclusive, is_multi_entry, max_entries, daily_quota, slot_quota, address, location{ lat, lng }, has_tiers, tiers[{ id, name, price, offer_price }]
course scheduling_mode, total_sessions, session_duration_minutes, capacity, enrolled_count, seats_left, enrollment_open, cohort_start_at, cohort_end_at, enrollment_close_at, sessions[{ id, number, title, start_at, end_at, location }]
gift_card gift_card_kind, includes[{ name, quantity }]
digital_product download_limit, expiry_days, files_count
service-subscription duration_value, duration_unit, days_type, days_count, max_pauses, max_pause_days, auto_renew, min_days_before_start, has_options, plans[{ id, name, price, offer_price, duration_value, duration_unit }]

Notes:

Get Store

GET /store

Scope: items:read

What a marketplace shows about the business beside its items.

Response:

{
  "data": {
    "name": "Salon Noor",
    "currency": "SAR",
    "timezone": "Asia/Riyadh",
    "cancellation_policy": { "kind": "hours", "hours": 24 },
    "max_hold_minutes": 30
  }
}
Field Type Description
name string The business's name
currency string ISO 4217 code. Default SAR
timezone string IANA time zone. Order times and calendar dates are in it
cancellation_policy object { kind, hours }, as on items
max_hold_minutes integer The longest ttl_minutes a hold may ask for

Staff (Providers)

List Staff

GET /staff

Scope: staff:read

Query Parameters:

Parameter Type Description
page integer Page number
per_page integer Items per page (max 100)
name string Filter by name
branch_id uuid Filter by branch UUID

Response:

{
  "data": [
    {
      "id": "uuid",
      "name": "Ahmed Ali",
      "phone": "+966500000001",
      "phone_country": "SA",
      "email": "ahmed@example.com",
      "image": "https://...",
      "branch": { "id": "uuid", "name": "Main Branch" },
      "services": [
        {
          "id": "uuid",
          "name": "Haircut",
          "price": 100.00,
          "duration": 30
        }
      ],
      "created_at": "2026-02-25T10:00:00.000000Z",
      "updated_at": "2026-02-25T10:00:00.000000Z"
    }
  ]
}

Get Staff

GET /staff/{uuid}

Scope: staff:read

Returns staff member with branch and full services list.


Get Staff Working Hour

GET /staff/{uuid}/working-hour

Scope: staff:read

Returns the staff member's default working hour with intervals. If the staff member has no working hour configured, returns the working hour of their branch (team) as a fallback. The source field indicates which one was returned.

Responds with 404 only when neither the staff nor their branch has a working hour.

Response:

{
  "data": {
    "id": "uuid",
    "source": "staff",
    "all_time": false,
    "active": true,
    "intervals": [
      {
        "id": "uuid",
        "day": "sun",
        "from": "09:00",
        "to": "17:00",
        "active": true
      }
    ]
  }
}
Field Type Description
source string staff if staff has a custom working hour, branch if falling back to the branch (team) working hour
intervals[].day string Lowercase three-letter day code (sun, mon, tue, wed, thu, fri, sat)
intervals[].from / intervals[].to string Time of day in HH:mm format, in the tenant's timezone

Branches

List Branches

GET /branches

Scope: branches:read

Query Parameters:

Parameter Type Description
page integer Page number
per_page integer Items per page (max 100)

Response:

{
  "data": [
    {
      "id": "uuid",
      "name": "Main Branch",
      "slug": "main-branch",
      "phone": "+966500000001",
      "phone_country": "SA",
      "address": "123 Main St, Riyadh",
      "latitude": 24.7136,
      "longitude": 46.6753,
      "location": "in-store",
      "status": true,
      "created_at": "2026-02-25T10:00:00.000000Z",
      "updated_at": "2026-02-25T10:00:00.000000Z"
    }
  ]
}

Categories

List Categories

GET /categories

Scope: categories:read

Query Parameters:

Parameter Type Description
page integer Page number
per_page integer Items per page (max 100)
branch_id uuid Filter by branch UUID

Response:

{
  "data": [
    {
      "id": "uuid",
      "name": { "ar": "خدمات الشعر", "en": "Hair Services" },
      "slug": "hair-services",
      "description": { "ar": "جميع خدمات الشعر", "en": "All hair-related services" },
      "status": true,
      "sort_order": 1,
      "branch": { "id": "uuid", "name": "Main Branch" },
      "created_at": "2026-02-25T10:00:00.000000Z",
      "updated_at": "2026-02-25T10:00:00.000000Z"
    }
  ]
}

Payment Methods

Use GET /payment-methods to discover which methods are available on a tenant (cash, card, bank transfer, and any installed app methods). The returned UUIDs can be passed as payment.payment_method_id on POST /orders.

POST /payment-methods still only supports creating cash and other types; other method types are managed by tenants in the Mahjoz dashboard.

List Payment Methods

GET /payment-methods

Scope: payment_methods:read

Query Parameters:

Parameter Type Description
per_page integer Items per page (default 25, max 100)
page integer Page number

Response:

{
  "data": [
    {
      "id": "uuid",
      "name": { "ar": "نقداً", "en": "Cash" },
      "slug": "on_arrival",
      "type": {
        "id": "uuid",
        "name": "Cash",
        "slug": "cash"
      },
      "created_at": "2026-02-25T10:00:00.000000Z",
      "updated_at": "2026-02-25T10:00:00.000000Z"
    }
  ]
}

Get Payment Method

GET /payment-methods/{id}

Scope: payment_methods:read

Returns a single payment method by UUID.


Transactions

List Transactions

GET /transactions

Scope: transactions:read

Query Parameters:

Parameter Type Description
status string Filter by transaction status (e.g. pending, confirmed, refused)
order_id uuid Filter by related order UUID
booking_id uuid Filter by related booking UUID
from date Start of date range (created_at)
to date End of date range (created_at)
per_page integer Items per page (default 25, max 100)
page integer Page number

Response:

{
  "data": [
    {
      "id": "uuid",
      "transaction_no": 1042,
      "amount": "150.00",
      "currency": "SAR",
      "status": "confirmed",
      "is_deposit": false,
      "note": null,
      "date": "2026-04-15T10:30:00+03:00",
      "payment_method": {
        "id": "uuid",
        "name": { "en": "Cash" },
        "slug": "on_arrival"
      },
      "order": { "id": "uuid", "order_number": 1015 },
      "booking": null,
      "created_at": "2026-04-15T10:30:00.000000Z",
      "updated_at": "2026-04-15T10:30:00.000000Z"
    }
  ]
}

Get Transaction

GET /transactions/{id}

Scope: transactions:read

Returns a single transaction by UUID.

Create Payment Method

POST /payment-methods

Scope: payment_methods:write

Creates a tenant-level payment method. Only the cash and other types are supported via the Open API.

Body:

Field Type Required Description
name string yes Display name
type string yes One of cash, other
status boolean no Defaults to true

Response: 201 Created with the created payment method.


Webhooks

Register an HTTPS endpoint to receive order, item and availability events. Webhooks belong to the API client (or partner connection) that registered them; each call below sees only its own. How to verify a delivery is in Webhooks and signatures.

Webhook events

Event Sent when
order.created An order is created through the Open API or the Mahjoz dashboard. An order created through the API sends no extra order.updated
order.updated An order changes, including a reschedule (one event per call) or a cancel. A refund sends it for the original order and for the new refund order (type: "refund", refund_of)
order.status_changed An order's status changes. Sent once per change, together with order.updated
order.payment_accepted A payment is recorded: an inline payment on POST /orders, or POST /orders/{id}/payments
order.invoice_created An invoice is issued for an order
order.deleted An order is deleted
item.created An item is added to the catalogue
item.updated An item, or its pictures, change
item.deleted An item is archived
availability.changed The free places of an item may have moved on some dates

For every order event, data is the order as Get Order returns it, with the full lines, type, refund_of and cancel_reason. A partner connection receives events only for orders in its granted branches, and contact fields follow its customers:contact scope.

Item and availability events

These four events are for marketplaces that mirror a business's items. They carry no item data: re-read Get Item or Item Calendar when one arrives.

item.created / item.updated / item.deleted:

{
  "event": "item.updated",
  "event_id": "…",
  "webhook_id": "…",
  "connection_id": "…",
  "timestamp": "2026-11-01T10:31:00+03:00",
  "data": { "id": "e2a4c6e8-0b2d-4a6c-8e0f-7b9d1f3b5d91", "type": "rental", "changes": ["details", "images"] }
}

changes says roughly what changed: details (the item itself) and images (its pictures). Within one run, item.created or item.deleted is sent instead of item.updated for the same item.

availability.changed:

{
  "event": "availability.changed",
  "event_id": "…",
  "webhook_id": "…",
  "connection_id": "…",
  "timestamp": "2026-11-01T10:31:00+03:00",
  "data": { "item_id": "a1f3c5e7-2b4d-4f6a-8c1e-3d5f7a9b1c21", "type": "service", "dates": ["2026-11-05", "2026-11-06"] }
}

dates lists the affected days (YYYY-MM-DD, business local time). It is sent for bookings and block times, rental reservations and holds, event and admission tickets and their holds, time off, working hours, and Open API holds (created, confirmed, released or expired). A change of working hours lists the next 60 days; a time off without an end lists 60 days from its start. A provider's change is sent for every item that provider delivers.

Known gap: a Store checkout hold that runs out without an order writes nothing, so it sends no availability.changed. Re-read availability before you hold or book.

List Webhooks

GET /webhooks

Scope: webhooks:read

Response:

{
  "data": [
    {
      "id": "uuid",
      "url": "https://example.com/mahjoz/webhooks",
      "events": ["order.created", "order.status_changed"],
      "is_active": true,
      "last_triggered_at": "2026-10-22T10:30:00+00:00",
      "created_at": "2026-10-01T09:00:00+00:00",
      "updated_at": "2026-10-01T09:00:00+00:00"
    }
  ]
}

Create Webhook

POST /webhooks

Scope: webhooks:write

Request:

{
  "url": "https://example.com/mahjoz/webhooks",
  "events": ["order.created", "order.updated", "order.status_changed", "order.payment_accepted"]
}
Field Type Required Description
url string Yes An https:// URL on a public host
events array Yes At least one event from Webhook events

Response (201): the webhook, with its secret.

{
  "data": {
    "id": "uuid",
    "url": "https://example.com/mahjoz/webhooks",
    "events": ["order.created", "order.updated", "order.status_changed", "order.payment_accepted"],
    "is_active": true,
    "last_triggered_at": null,
    "secret": "64-character secret",
    "created_at": "2026-10-22T10:30:00+00:00",
    "updated_at": "2026-10-22T10:30:00+00:00"
  }
}

The secret is shown only in this response. Store it: a business's own API client verifies the Signature header with it. (A partner app verifies with its app's webhook signing secret from the portal instead.)

Get Webhook

GET /webhooks/{uuid}

Scope: webhooks:read

Returns one webhook, without its secret.

Update Webhook

PUT /webhooks/{uuid}

Scope: webhooks:write

Send only the fields to change.

Field Type Required Description
url string No An https:// URL on a public host
events array No At least one event
is_active boolean No false pauses deliveries

Response: the updated webhook, without its secret.

Delete Webhook

DELETE /webhooks/{uuid}

Scope: webhooks:write

Response: 204 No Content.