{
    "document": "market-apps-api",
    "version": "v1",
    "host": "market",
    "base_path": "/api/v1",
    "errors": {
        "conflict": {
            "request": [
                "not_a_draft",
                "not_open",
                "not_cancellable",
                "service_locked",
                "leg_cannot_move",
                "direct_not_copyable",
                "source_redacted",
                "auction_not_extendable",
                "not_an_auction",
                "bidding_over"
            ],
            "offer": [
                "leg_not_open",
                "offer_not_available",
                "carrier_unavailable",
                "not_submitted",
                "offer_exists",
                "auction_closed",
                "auction_still_bidding",
                "award_window_over",
                "auction_binding",
                "not_an_auction",
                "lowering_not_for_discounted_offer",
                "waiting_off",
                "commission_unavailable"
            ],
            "direct": [
                "request_gone",
                "already_waiting",
                "direct_not_offered",
                "listing_unavailable",
                "own_listing",
                "window_unavailable",
                "price_unavailable",
                "distance_unavailable",
                "price_changed",
                "snapshot_invalid"
            ],
            "direct_answer": [
                "request_gone",
                "rental_booking_unavailable",
                "snapshot_invalid",
                "vehicle_taken"
            ],
            "booking": [
                "cancel_not_allowed",
                "cancel_started",
                "cancel_order_ended",
                "cancel_try_again",
                "request_not_allowed",
                "request_open",
                "request_gone",
                "request_blocked",
                "dispute_not_allowed",
                "dispute_window_closed",
                "dispute_open",
                "dispute_decided",
                "dispute_not_yours_to_answer",
                "statement_limit",
                "look_only",
                "tracking_link_wait"
            ],
            "postponement": [
                "postpone_none_waiting",
                "postpone_answered",
                "postpone_expired",
                "postpone_booking_changed",
                "postpone_no_commitment",
                "postpone_vehicle_busy",
                "postpone_window_long",
                "postpone_started",
                "postpone_trip_shared",
                "postpone_window_past",
                "postpone_due",
                "postpone_conflict",
                "postpone_try_again",
                "postpone_unavailable"
            ],
            "rental": [
                "handover_not_due",
                "return_not_due",
                "extension_already_asked",
                "extension_closed",
                "extension_limit_reached",
                "extension_needs_day_hire",
                "extension_unpriceable",
                "extension_vehicle_busy",
                "extension_not_allowed",
                "early_return_needs_day_hire",
                "early_return_not_allowed",
                "return_mark_not_allowed"
            ],
            "transfer": [
                "not_allowed",
                "no_longer_open",
                "does_not_fit",
                "payout_changed",
                "booking_started",
                "already_offered",
                "offer_changed",
                "not_open",
                "window_too_near",
                "claim_closed",
                "approval_expired",
                "transfer_limit"
            ],
            "swap": [
                "swap_not_before_loading",
                "swap_limit_reached",
                "swap_no_commitment",
                "swap_same_vehicle",
                "swap_target_does_not_fit",
                "swap_target_busy",
                "swap_order_missing",
                "swap_trip_shared",
                "swap_trip_started",
                "swap_vehicle_refused",
                "swap_unavailable"
            ],
            "departure": [
                "departure_not_open",
                "departure_suspended",
                "departure_own",
                "departure_payment_window_short",
                "share_commission_unavailable",
                "departure_booking_closed",
                "share_token_reused",
                "departure_full",
                "not_enough_room",
                "dimension_not_carried",
                "hold_busy",
                "hold_blocked",
                "hold_trip_busy",
                "hold_not_ready",
                "hold_unavailable",
                "max_shares",
                "consent_version_stale"
            ],
            "trip": [
                "stale_version",
                "departure_frozen",
                "departure_has_shares",
                "not_a_draft",
                "awaiting_review",
                "not_awaiting_review",
                "publish_time_passed",
                "carrier_not_approved",
                "listing_not_published",
                "publish_refused",
                "cancel_with_shares",
                "cancel_suspended",
                "close_suspended",
                "plan_locked",
                "prices_locked",
                "imported_trip_unconfirmed",
                "hold_busy",
                "hold_blocked",
                "hold_trip_busy",
                "hold_not_ready",
                "hold_unavailable",
                "listing_archived",
                "listing_not_freight",
                "return_parent_state",
                "already_suspended",
                "not_suspended",
                "after_booking_closed",
                "times_move_without_bookings",
                "times_move_off",
                "times_moves_used",
                "times_notice_refused",
                "vehicle_replace_closed",
                "vehicle_replace_trip",
                "vehicle_notice_refused"
            ],
            "thread": [
                "thread_closed",
                "booking_ended",
                "thread_full"
            ],
            "place": [
                "place_label_taken",
                "place_in_use"
            ],
            "cargo_price": [
                "stale_version",
                "listing_archived",
                "listing_not_freight",
                "cargo_type_not_accepted"
            ],
            "cargo_agreement": [
                "listing_archived",
                "cargo_not_for_listing",
                "cargo_not_restricted"
            ],
            "extra": [
                "row_changed",
                "listing_archived",
                "service_not_for_category",
                "service_not_for_listing",
                "service_unavailable",
                "fact_not_held"
            ],
            "price_sheet": [
                "sheet_changed",
                "prices_overlap",
                "listing_archived",
                "listing_not_freight"
            ],
            "rental_terms": [
                "stale_version",
                "listing_archived",
                "listing_needs_no_rental_terms"
            ],
            "equipment_terms": [
                "stale_version",
                "listing_archived",
                "listing_not_equipment"
            ],
            "liquid_prices": [
                "stale_version",
                "listing_archived",
                "listing_not_liquid",
                "tanker_missing",
                "liquid_restrictions_undecided",
                "liquid_not_for_kind",
                "liquid_not_for_listing",
                "liquid_needs_opt_in"
            ],
            "item": [
                "item_archived",
                "stale_version",
                "quantity_below_held",
                "photo_public",
                "photo_item_closed"
            ],
            "availability": [
                "stale_version",
                "listing_archived"
            ],
            "coverage": [
                "stale_version",
                "listing_archived",
                "company_default_empty",
                "default_zone_in_use"
            ],
            "review": [
                "reviews_off",
                "not_finished",
                "window_closed",
                "already_reviewed",
                "not_settled",
                "same_identity",
                "already_replied",
                "review_hidden",
                "not_writer",
                "already_appealed",
                "not_withheld"
            ],
            "listing": [
                "listing_archived",
                "illegal_transition",
                "already_paused",
                "not_paused",
                "incomplete",
                "vehicle_unavailable",
                "stale_version",
                "make_not_matched",
                "withdraw_open_departures",
                "archive_open_departures",
                "archive_open_offers",
                "archive_bookings_under_way",
                "archive_vehicle_held",
                "vehicle_already_listed",
                "vehicle_not_market_kind",
                "vehicle_type_not_allowed",
                "vehicle_type_missing",
                "item_already_listed",
                "item_unavailable",
                "service_type_after_review",
                "service_type_priced",
                "listing_already_submitted"
            ],
            "photo": [
                "hidden_by_staff",
                "not_a_photo",
                "archived",
                "version_changed",
                "order_mismatch"
            ],
            "payment": [
                "payment_not_waiting",
                "payment_unavailable",
                "payment_no_billing_profile",
                "payment_amount_differs",
                "payment_invoice_rule",
                "payment_already_paid",
                "payment_in_flight",
                "payment_saved_cards_off",
                "payment_phone_required",
                "payment_choice_changed"
            ],
            "bank_transfer": [
                "transfer_not_waiting",
                "transfer_not_offered",
                "transfer_in_review",
                "transfer_period_closed",
                "transfer_unavailable"
            ],
            "payout": [
                "carrier_not_payable",
                "no_verified_destination",
                "exceeds_available",
                "not_waiting",
                "look_only"
            ],
            "parcel": [
                "booking_not_open",
                "carrier_does_not_offer",
                "final",
                "forward_only",
                "registered_only_at_registration",
                "link_epoch_ceiling",
                "link_unavailable",
                "code_not_free",
                "look_only"
            ],
            "recurrence": [
                "source_not_freight",
                "source_not_finished",
                "rule_exists",
                "rule_ended"
            ],
            "consolidation": [
                "no_feasible_route",
                "trip_order_state",
                "trip_order_branch",
                "trip_window_busy",
                "trip_window_committed",
                "trip_shared",
                "trip_shared_window",
                "trip_state",
                "stale"
            ],
            "verification": [
                "case_not_editable",
                "item_state"
            ],
            "waiting": [
                "waiting_claim_decided",
                "waiting_statement_written",
                "waiting_statement_closed"
            ],
            "booking_attachment": [
                "attachment_booking_closed",
                "attachment_not_ready"
            ]
        },
        "limit_reached": {
            "request": [
                "open_limit",
                "drafts_limit",
                "daily_limit"
            ],
            "offer": [
                "offers_limit_carrier",
                "offers_limit_leg",
                "hold_limit",
                "lowering_too_soon"
            ],
            "direct": [
                "too_many_waiting"
            ],
            "item": [
                "photo_limit"
            ],
            "departure": [
                "shares_per_departure_limit",
                "departure_bookings_limit"
            ],
            "thread": [
                "rate_limited"
            ],
            "place": [
                "places_limit"
            ],
            "favourite": [
                "favourites_limit"
            ],
            "availability": [
                "too_many_blocks",
                "too_many_company_blocks"
            ],
            "coverage": [
                "too_many_default_zones"
            ],
            "recurrence": [
                "too_many_rules"
            ],
            "booking_attachment": [
                "attachment_limit"
            ]
        },
        "not_found": {
            "finance": [
                "document_unavailable",
                "no_tax_document",
                "no_billing_profile"
            ],
            "listing": [
                "cargo_price_not_found",
                "sheet_not_found",
                "extra_not_found",
                "liquid_unknown",
                "price_missing"
            ]
        },
        "rate_limited": {
            "transfer": [
                "wait"
            ],
            "payout": [
                "too_many"
            ],
            "parcel": [
                "link_end_limit"
            ],
            "listing": [
                "pause_too_often"
            ],
            "direct": [
                "quote_limit",
                "discount_code_limit"
            ],
            "photo": [
                "rate_limited"
            ],
            "upload": [
                "hourly_uploads",
                "daily_quota"
            ]
        },
        "service_unavailable": {
            "finance": [
                "too_many_lines"
            ],
            "payout": [
                "settings_unreadable"
            ]
        },
        "forbidden": [
            "standing_suspended",
            "standing_not_activated",
            "standing_stopped",
            "standing_not_verified"
        ],
        "plan_feature_required": [
            "market.shipper",
            "market.carrier"
        ],
        "note": {
            "en": "A reason not listed here may still come back, and new reasons may be added to a conflict with time; treat a reason you do not know as a general conflict and act on the error code alone.",
            "ar": "قد يرد سبب غير مدرج في هذه القائمة، وقد تُضاف أسباب جديدة إلى التعارض مع الوقت؛ عامل السبب الذي لا تعرفه كتعارض عام واعتمد على رمز الخطأ وحده."
        }
    },
    "routes": [
        {
            "name": "market.api.agreed_prices.index",
            "example": {
                "request": null,
                "response": {
                    "items": [
                        {
                            "listing": "0193a2b7-6c41-7d3e-9a85-2f1e7b4c8d60",
                            "title": "شاحنة مسطحة ٢٢ طنًا، الرياض - جدة",
                            "carrier": {
                                "id": "0193a2b7-1f02-7a6b-8c3d-5e9a4b7d2c18",
                                "name": "نقل الوادي"
                            },
                            "state": "in_force",
                            "currency": "SAR",
                            "excludes_vat": true,
                            "method": "per_km",
                            "base_fee_halalas": 30000,
                            "rate_halalas": 450,
                            "minimum_halalas": 150000,
                            "weekend_bp": 1000,
                            "night_bp": 500,
                            "urgent_bp": 2000,
                            "estimated_duration_hours": 12,
                            "valid_from": "2026-09-01",
                            "valid_to": "2027-08-31"
                        },
                        {
                            "listing": "0193a2b8-0d55-7e12-b4a9-6c3f8e1d7a24",
                            "title": "ناقلة بضائع مبرّدة، الدمام - الرياض",
                            "carrier": {
                                "id": "0193a2b8-3a7c-7b90-a1d4-9e2f5c8b6d03",
                                "name": "مبرّدات الخليج"
                            },
                            "state": "upcoming",
                            "currency": "SAR",
                            "excludes_vat": true,
                            "method": "by_load",
                            "base_fee_halalas": 20000,
                            "rate_halalas": null,
                            "ton_rate_halalas": 9000,
                            "m3_rate_halalas": 4500,
                            "minimum_halalas": 120000,
                            "weekend_bp": 0,
                            "night_bp": 0,
                            "urgent_bp": 1500,
                            "estimated_duration_hours": 8,
                            "valid_from": "2026-12-01",
                            "valid_to": null
                        }
                    ],
                    "limit": 50
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/agreed-prices",
            "auth": "app_token",
            "scope": "market:requests:read",
            "apps": [
                "shipper"
            ],
            "idempotency_key": false,
            "limit": null,
            "summary": {
                "en": "Lists the prices the shipper's company has agreed with carriers: each carrier's private price for one listing, in force or starting later, soonest first, at most the number in limit, with the figures in halalas before VAT; never another company's price and never the carrier's note.",
                "ar": "يعرض الأسعار التي اتفقت عليها شركة الشاحن مع الناقلين: سعر الناقل الخاص بإعلان واحد، ساريًا أو يبدأ لاحقًا، الأقرب أولًا وبحد أقصى العدد المذكور في limit، والأرقام بالهللات قبل الضريبة؛ ولا يعرض سعر شركة أخرى ولا ملاحظة الناقل أبدًا."
            }
        },
        {
            "name": "market.api.agreed_prices.show",
            "example": {
                "request": null,
                "response": {
                    "listing": "0193a2b7-6c41-7d3e-9a85-2f1e7b4c8d60",
                    "title": "شاحنة مسطحة ٢٢ طنًا، الرياض - جدة",
                    "carrier": {
                        "id": "0193a2b7-1f02-7a6b-8c3d-5e9a4b7d2c18",
                        "name": "نقل الوادي"
                    },
                    "state": "in_force",
                    "currency": "SAR",
                    "excludes_vat": true,
                    "method": "per_km",
                    "base_fee_halalas": 30000,
                    "rate_halalas": 450,
                    "minimum_halalas": 150000,
                    "weekend_bp": 1000,
                    "night_bp": 500,
                    "urgent_bp": 2000,
                    "estimated_duration_hours": 12,
                    "valid_from": "2026-09-01",
                    "valid_to": "2027-08-31"
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/agreed-prices/{listing}",
            "auth": "app_token",
            "scope": "market:requests:read",
            "apps": [
                "shipper"
            ],
            "idempotency_key": false,
            "limit": null,
            "summary": {
                "en": "Answers the agreed price in force today on one listing, by its public uuid, with its figures in halalas before VAT; 404 when the company has none on it, when the agreement starts later, or when the listing is no longer published.",
                "ar": "يعيد السعر المتفق عليه الساري اليوم على إعلان واحد بمعرّفه العام وأرقامه بالهللات قبل الضريبة؛ ويعيد 404 إذا لم يكن للشركة سعر عليه أو كان الاتفاق يبدأ لاحقًا أو لم يعد الإعلان منشورًا."
            }
        },
        {
            "name": "market.api.availability.company_blocks.destroy",
            "example": {
                "request": null,
                "response": [],
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "DELETE",
            "path": "/market/availability/company-blocks/{block}",
            "auth": "app_token",
            "scope": "market:listings:write",
            "apps": [
                "carrier"
            ],
            "idempotency_key": true,
            "limit": "write",
            "summary": {
                "en": "Removes one of the company's own blocks; a block of a single listing, or of another company, is not_found, and the answer is empty (204). Send an Idempotency-Key header.",
                "ar": "يزيل حجبًا واحدًا من حجوب الشركة نفسها؛ وحجب إعلان واحد أو حجب شركة أخرى not_found، والجواب فارغ (204). أرسل ترويسة Idempotency-Key."
            }
        },
        {
            "name": "market.api.availability.company_blocks.index",
            "example": {
                "request": null,
                "response": [
                    {
                        "uuid": "0193a5e2-4b17-7c9a-8d63-1f5e9a3b7c20",
                        "date_from": "2026-12-20",
                        "date_to": "2026-12-21",
                        "reason": "leave",
                        "note": "إجازة الشركة"
                    }
                ],
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/availability/company-blocks",
            "auth": "app_token",
            "scope": "market:listings:read",
            "apps": [
                "carrier"
            ],
            "idempotency_key": false,
            "limit": null,
            "summary": {
                "en": "Lists the days the company blocks for all its listings, the earliest first, each with its dates, reason (leave, maintenance or other) and note; the same blocks come with a listing's availability as company_blocks.",
                "ar": "يسرد الأيام التي تحجبها الشركة لكل إعلاناتها، الأبكر أولًا، لكل منها تاريخاها وسببها (leave أو maintenance أو other) وملاحظتها؛ وهي نفسها تأتي مع توفر الإعلان باسم company_blocks."
            }
        },
        {
            "name": "market.api.availability.company_blocks.store",
            "example": {
                "request": {
                    "date_from": "2026-12-20",
                    "date_to": "2026-12-21",
                    "reason": "leave",
                    "note": "إجازة الشركة"
                },
                "response": {
                    "uuid": "0193a5e2-4b17-7c9a-8d63-1f5e9a3b7c20",
                    "date_from": "2026-12-20",
                    "date_to": "2026-12-21",
                    "reason": "leave",
                    "note": "إجازة الشركة"
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "limit_reached"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "block_period_invalid"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "block_too_long"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "note_invalid"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "note_too_long"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "POST",
            "path": "/market/availability/company-blocks",
            "auth": "app_token",
            "scope": "market:listings:write",
            "apps": [
                "carrier"
            ],
            "idempotency_key": true,
            "limit": "write",
            "summary": {
                "en": "Blocks the days date_from to date_to for every listing of the company, with a reason (leave, maintenance or other) and an optional note; the answer is the block, and a company has a limited number of them (409 limit_reached). Send an Idempotency-Key header.",
                "ar": "يحجب الأيام من date_from إلى date_to لكل إعلان في الشركة، بسبب (leave أو maintenance أو other) وملاحظة اختيارية؛ والجواب هو الحجب، وعدد ما للشركة منه محدود (409 بالسبب limit_reached). أرسل ترويسة Idempotency-Key."
            }
        },
        {
            "name": "market.api.board.index",
            "example": {
                "request": {
                    "query": {
                        "service": "freight",
                        "closing_soon": true,
                        "pickup_city_id": 1024,
                        "needs": [
                            "tracking"
                        ],
                        "limit": 30
                    }
                },
                "response": [
                    {
                        "leg_uuid": "0193a1c2-5d90-7a1b-b6f4-2c8e0d5a7f13",
                        "reference": "MR-0004217",
                        "service": "freight",
                        "route": "الرياض ← جدة",
                        "window": {
                            "starts_at": "2026-11-28T04:00:00Z",
                            "ends_at": "2026-11-29T20:00:00Z"
                        },
                        "vehicle_type": "truck_flatbed",
                        "min_tons": 22,
                        "needs": [
                            "tracking"
                        ],
                        "cargo": {
                            "type": "مواد بناء",
                            "amount": 22000,
                            "unit": "kg"
                        },
                        "offers_close_at": "2026-11-25T09:30:00Z",
                        "budget": {
                            "amount_halalas": 135000,
                            "currency": "SAR",
                            "excludes_vat": true
                        },
                        "live_offers": 2,
                        "my_offer_state": null,
                        "listing_uuids": [
                            "0193a0f7-3e42-7b18-9c6d-5a2e8f1b4d70"
                        ],
                        "offer_mode": "sealed",
                        "auction": null
                    }
                ],
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/board",
            "auth": "app_token",
            "scope": "market:board:read",
            "apps": [
                "carrier"
            ],
            "idempotency_key": false,
            "limit": "heavy",
            "summary": {
                "en": "The carrier's board: the open trucks of other companies' requests that one of its own published listings fits, soonest closing first, each with the route by city names, the window, what the truck needs, the cargo, the closing time, the budget only when the shipper shows it, the number of live offers and the carrier's own offer state; a carrier that may not sell gets an empty list; filters in the query (service, closing_soon, pickup_city_id, dropoff_city_id, cargo_type (the code the cargo-types read gives) or cargo_type_id, vehicle_type_code, needs), paged with limit and cursor.",
                "ar": "لوحة الناقل: الشاحنات المفتوحة في طلبات الشركات الأخرى التي تناسبها إحدى مركباته المنشورة، الأقرب إغلاقًا أولًا، مع المسار بأسماء المدن والفترة وما تحتاجه الشاحنة والحمولة ووقت الإغلاق والميزانية حين يُظهرها الشاحن وعدد العروض القائمة وحالة عرض الناقل نفسه؛ والناقل الذي لا يحق له البيع تصله قائمة فارغة؛ والمرشّحات في الاستعلام (service وclosing_soon وpickup_city_id وdropoff_city_id وcargo_type (الرمز الذي تعطيه قراءة أنواع الحمولة) أو cargo_type_id وvehicle_type_code وneeds)، والترقيم بـlimit وcursor."
            }
        },
        {
            "name": "market.api.board.offers.store",
            "example": {
                "request": {
                    "listing_uuid": "0193a0f7-3e42-7b18-9c6d-5a2e8f1b4d70",
                    "total_excl_vat_halalas": 128000,
                    "valid_until": "2026-11-26T12:00:00Z",
                    "earliest_pickup_at": "2026-11-28T05:00:00Z",
                    "price_note": "السعر شامل الرسوم على الطريق.",
                    "terms": "الدفع عند التسليم.",
                    "includes": [
                        {
                            "code": "loading_unloading"
                        },
                        {
                            "code": "waiting_time",
                            "quantity": 2
                        }
                    ]
                },
                "response": {
                    "uuid": "0193a1d4-02b8-7e35-a9c1-4f7b8d2e6a90",
                    "reference": "MR-0004217",
                    "route": "الرياض ← جدة",
                    "state": "submitted",
                    "total_excl_vat_halalas": 128000,
                    "currency": "SAR",
                    "valid_until": "2026-11-26T12:00:00Z",
                    "earliest_pickup_at": "2026-11-28T05:00:00Z",
                    "decline_reason": null,
                    "includes": [
                        {
                            "code": "loading_unloading",
                            "name": "تحميل وتنزيل",
                            "quantity": null,
                            "unit": null
                        },
                        {
                            "code": "waiting_time",
                            "name": "وقت انتظار",
                            "quantity": 2,
                            "unit": "hours"
                        }
                    ],
                    "thread_uuid": "0193a1d4-0391-7d02-8c5e-1a9f3b7c2e64",
                    "unread_messages": 0,
                    "offer_mode": "sealed",
                    "auction": null
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden",
                        "reason": "standing_not_verified"
                    },
                    {
                        "status": 403,
                        "code": "plan_feature_required",
                        "reason": "market.carrier"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "leg_not_open"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "offer_exists"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "carrier_unavailable"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "auction_binding"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "limit_reached"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "listing_not_matching"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "price_range"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "validity_range"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "pickup_in_past"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "pickup_after_window"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "inclusion_unknown"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "inclusion_quantity_not_allowed"
                    }
                ]
            },
            "method": "POST",
            "path": "/market/board/legs/{leg}/offers",
            "auth": "app_token",
            "scope": "market:offers:write",
            "apps": [
                "carrier"
            ],
            "idempotency_key": true,
            "limit": "write",
            "summary": {
                "en": "Sends the carrier's offer on one truck of its board: one of its own listings by uuid, the price in halalas before VAT, how long it stands, the earliest pickup and what the price includes as codes of the catalogue; an open auction sets the validity itself. The answer is the offer as the carrier's own offers list reads it; a second offer on the same truck is a conflict.",
                "ar": "يرسل عرض الناقل على شاحنة من لوحته: إحدى مركباته المنشورة بمعرّفها، والسعر بالهللات قبل الضريبة، ومدة سريان العرض، وأقرب تحميل، وما يشمله السعر برموز الكتالوج؛ والمزاد المفتوح يحدد المدة بنفسه. الجواب هو العرض كما تقرؤه قائمة عروض الناقل؛ وعرض ثانٍ على الشاحنة نفسها تعارض."
            }
        },
        {
            "name": "market.api.board.show",
            "example": {
                "request": null,
                "response": {
                    "leg_uuid": "0193a1c2-5d90-7a1b-b6f4-2c8e0d5a7f13",
                    "reference": "MR-0004217",
                    "service": "freight",
                    "route": "الرياض ← جدة",
                    "window": {
                        "starts_at": "2026-11-28T04:00:00Z",
                        "ends_at": "2026-11-29T20:00:00Z"
                    },
                    "vehicle_type": "truck_flatbed",
                    "min_tons": 22,
                    "needs": [
                        "tracking"
                    ],
                    "cargo": {
                        "type": "مواد بناء",
                        "amount": 22000,
                        "unit": "kg"
                    },
                    "offers_close_at": "2026-11-25T09:30:00Z",
                    "budget": {
                        "amount_halalas": 135000,
                        "currency": "SAR",
                        "excludes_vat": true
                    },
                    "live_offers": 2,
                    "my_offer_state": null,
                    "listing_uuids": [
                        "0193a0f7-3e42-7b18-9c6d-5a2e8f1b4d70"
                    ],
                    "offer_mode": "sealed",
                    "auction": null
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/board/legs/{leg}",
            "auth": "app_token",
            "scope": "market:board:read",
            "apps": [
                "carrier"
            ],
            "idempotency_key": false,
            "limit": "heavy",
            "summary": {
                "en": "One truck of the carrier's board by its uuid, in the shape of the list; a truck that is not on its board is the same 404 as one that does not exist.",
                "ar": "شاحنة واحدة من لوحة الناقل بمعرّفها وبشكل القائمة نفسه؛ والشاحنة التي ليست على لوحته هي 404 نفسه لشاحنة لا وجود لها."
            }
        },
        {
            "name": "market.api.booking_requests.accept",
            "example": {
                "request": null,
                "response": {
                    "request_uuid": "0193a1c2-5d7e-7c4a-8f21-9b3d6e1a4c07",
                    "accepted": true
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "request_gone"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "vehicle_taken"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "snapshot_invalid"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "rental_booking_unavailable"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "POST",
            "path": "/market/booking-requests/{uuid}/accept",
            "auth": "app_token",
            "scope": "market:booking_requests:write",
            "apps": [
                "carrier"
            ],
            "idempotency_key": true,
            "limit": "heavy",
            "summary": {
                "en": "Accepts a waiting booking request at the price frozen with it; the booking then stands, and the call takes no money.",
                "ar": "يقبل طلب حجز منتظرًا بالسعر المجمَّد معه؛ فيقوم الحجز، ولا يأخذ الاستدعاء مالًا."
            }
        },
        {
            "name": "market.api.booking_requests.decline",
            "example": {
                "request": {
                    "reason": "not_available"
                },
                "response": {
                    "request_uuid": "0193a1c2-5d7e-7c4a-8f21-9b3d6e1a4c07",
                    "declined": true
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "request_gone"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "POST",
            "path": "/market/booking-requests/{uuid}/decline",
            "auth": "app_token",
            "scope": "market:booking_requests:write",
            "apps": [
                "carrier"
            ],
            "idempotency_key": true,
            "limit": "write",
            "summary": {
                "en": "Declines a waiting booking request with one reason of a closed set: not_available, cannot_serve or other.",
                "ar": "يرفض طلب حجز منتظرًا بسبب واحد من مجموعة مغلقة: not_available أو cannot_serve أو other."
            }
        },
        {
            "name": "market.api.booking_requests.index",
            "example": {
                "request": null,
                "response": [
                    {
                        "request_uuid": "0193a1c2-5d7e-7c4a-8f21-9b3d6e1a4c07",
                        "reference": "MR-0004217",
                        "route": "الرياض ← جدة",
                        "window": {
                            "starts_at": "2026-11-24T05:00:00Z",
                            "ends_at": "2026-11-24T11:00:00Z"
                        },
                        "vehicle_type": "شاحنة مسطحة",
                        "min_tons": 22,
                        "needs": [
                            "tracking"
                        ],
                        "cargo": {
                            "type": "مواد بناء",
                            "amount": 21.5,
                            "unit": "tonne"
                        },
                        "answer_by": "2026-11-22T12:00:00Z",
                        "total_excl_vat_halalas": 118000,
                        "currency": "SAR",
                        "shipper_name": "شركة الراجحي للحديد والصلب"
                    }
                ],
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/booking-requests",
            "auth": "app_token",
            "scope": "market:booking_requests:read",
            "apps": [
                "carrier"
            ],
            "idempotency_key": false,
            "limit": null,
            "summary": {
                "en": "The booking requests addressed to the carrier's own vehicles that still wait for its answer: the route, the loading period, what the truck needs, the cargo, the price frozen with the request and the time to answer by.",
                "ar": "طلبات الحجز الموجَّهة إلى مركبات الناقل نفسه التي ما زالت تنتظر ردّه: المسار وفترة التحميل وما تحتاجه الشاحنة والحمولة والسعر المجمَّد مع الطلب وموعد الرد."
            }
        },
        {
            "name": "market.api.booking_requests.show",
            "example": {
                "request": null,
                "response": {
                    "request_uuid": "0193a1c2-5d7e-7c4a-8f21-9b3d6e1a4c07",
                    "reference": "MR-0004217",
                    "route": "الرياض ← جدة",
                    "window": {
                        "starts_at": "2026-11-24T05:00:00Z",
                        "ends_at": "2026-11-24T11:00:00Z"
                    },
                    "vehicle_type": "شاحنة مسطحة",
                    "min_tons": 22,
                    "needs": [
                        "tracking"
                    ],
                    "cargo": {
                        "type": "مواد بناء",
                        "amount": 21.5,
                        "unit": "tonne"
                    },
                    "answer_by": "2026-11-22T12:00:00Z",
                    "total_excl_vat_halalas": 118000,
                    "currency": "SAR",
                    "shipper_name": "شركة الراجحي للحديد والصلب"
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/booking-requests/{uuid}",
            "auth": "app_token",
            "scope": "market:booking_requests:read",
            "apps": [
                "carrier"
            ],
            "idempotency_key": false,
            "limit": null,
            "summary": {
                "en": "One waiting booking request, with the same fields as the list.",
                "ar": "طلب حجز واحد منتظر، بحقول القائمة نفسها."
            }
        },
        {
            "name": "market.api.bookings.attachments.download",
            "example": {
                "request": null,
                "response": {
                    "content_type": "application/pdf",
                    "disposition": "attachment",
                    "cache_control": "no-store, private"
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "attachment_not_ready"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/bookings/{uuid}/attachments/{number}",
            "auth": "app_token",
            "scope": "market:bookings:read",
            "apps": [
                "shipper",
                "carrier"
            ],
            "idempotency_key": false,
            "limit": "heavy",
            "summary": {
                "en": "Downloads one file of a booking by its number, for either company of the booking, always as an attachment of the type Documents recorded; a file that was archived is a 404 and one not yet scanned clean is a 409 (attachment_not_ready).",
                "ar": "ينزّل ملفًا واحدًا من ملفات الحجز برقمه لأي من شركتَي الحجز، مرفقًا دائمًا بالنوع الذي سجّلته المستندات؛ والملف المؤرشف 404 والذي لم يُفحص نظيفًا بعد 409 (attachment_not_ready)."
            }
        },
        {
            "name": "market.api.bookings.attachments.index",
            "example": {
                "request": null,
                "response": [
                    {
                        "no": 1,
                        "name": "قائمة الشحنة.pdf",
                        "type": "application/pdf",
                        "size_bytes": 183422,
                        "added_at": "2026-11-24T08:12:40Z",
                        "available": true
                    },
                    {
                        "no": 2,
                        "name": "صورة التحميل.png",
                        "type": "image/png",
                        "size_bytes": 902114,
                        "added_at": "2026-11-24T09:03:11Z",
                        "available": true
                    }
                ],
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/bookings/{uuid}/attachments",
            "auth": "app_token",
            "scope": "market:bookings:read",
            "apps": [
                "shipper",
                "carrier"
            ],
            "idempotency_key": false,
            "limit": null,
            "summary": {
                "en": "Lists the files the shipper attached to a booking of the caller's company, on either side: the number the download takes, the name, the type and size Documents recorded, when it was added and whether it can be read now; no address is given.",
                "ar": "يسرد الملفات التي أرفقها الشاحن بحجز من حجوزات شركة المتصل، لأي من الطرفين: رقم الملف الذي يأخذه التنزيل واسمه ونوعه وحجمه كما سجّلتهما المستندات ووقت إضافته وهل يُقرأ الآن؛ ولا يُعطى عنوان."
            }
        },
        {
            "name": "market.api.bookings.attachments.store",
            "example": {
                "request": {
                    "file": "(the file, sent as multipart/form-data)"
                },
                "response": {
                    "no": 3,
                    "name": "تصريح الدخول.pdf",
                    "type": "application/pdf",
                    "size_bytes": 241007,
                    "added_at": "2026-11-24T10:20:05Z",
                    "available": true
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "attachment_booking_closed"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "limit_reached"
                    },
                    {
                        "status": 413,
                        "code": "payload_too_large"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "attachment_refused"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "POST",
            "path": "/market/bookings/{uuid}/attachments",
            "auth": "app_token",
            "scope": "market:bookings:write",
            "apps": [
                "shipper",
                "carrier"
            ],
            "idempotency_key": true,
            "limit": "write",
            "summary": {
                "en": "The shipper of an open booking attaches one file (jpg, jpeg, png or pdf, up to 10 MB), at most ten per booking; the file is stored as the shipper company's private document, and its name is shown to the carrier of the booking as typed, less control and direction characters.",
                "ar": "يرفق شاحن حجز مفتوح ملفًا واحدًا (jpg أو jpeg أو png أو pdf حتى 10 ميغابايت) بما لا يزيد على عشرة ملفات للحجز؛ ويُخزَّن الملف مستندًا خاصًا بشركة الشاحن، ويظهر اسمه لناقل الحجز كما كُتب بعد تجريده من محارف التحكم والاتجاه."
            }
        },
        {
            "name": "market.api.bookings.bank_transfer.show",
            "example": {
                "request": null,
                "response": {
                    "booking": "0193a1e7-4c20-7b91-a3d5-8e2f6c1b9d40",
                    "invoice": "INV-2026-000184",
                    "currency": "SAR",
                    "amount_minor": 11500,
                    "amount_text": "115.00",
                    "receipt": {
                        "required": true,
                        "max_kilobytes": 10240,
                        "types": [
                            "application/pdf",
                            "image/jpeg",
                            "image/png"
                        ]
                    },
                    "accounts": [
                        {
                            "bank": "Al Rajhi Bank",
                            "account_name": "Tawasul Co.",
                            "iban": "SA0380000000608010167519",
                            "swift": "RJHISARI",
                            "note": "Write the invoice number in the transfer note"
                        }
                    ],
                    "pending_transfer": null,
                    "transfer": {
                        "state": "not_sent",
                        "receipt_sent": false,
                        "reference": null,
                        "received_on": null,
                        "amount_minor": null,
                        "currency": null,
                        "sent_at": null,
                        "decided_at": null
                    }
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 403,
                        "code": "forbidden",
                        "reason": "transfer_not_allowed"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "transfer_not_waiting"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "transfer_not_offered"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "transfer_unavailable"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/bookings/{uuid}/bank-transfer",
            "auth": "app_token",
            "scope": "market:bookings:pay",
            "apps": [
                "shipper"
            ],
            "idempotency_key": false,
            "limit": null,
            "summary": {
                "en": "Reads what the shipper needs to pay a booking's invoice by bank transfer: the invoice number to write in the transfer note, the exact amount (amount_minor in halalas and amount_text as plain digits to copy), whether the receipt is required and its allowed types and size, the platform's own bank accounts for the invoice's currency, pending_transfer, the transfer already sent that waits for review (reference, date, amount and sending time only), or null, and transfer, where the newest bank transfer of the invoice stands: state is not_sent, in_review, accepted or rejected (unknown for a booking that is not the person's), with receipt_sent, reference, received_on, amount_minor, currency, sent_at and decided_at, and never the reviewer's reason; a rejected transfer leaves the invoice open, so a new one may be sent. Once the invoice is no longer open (paid, for one) and a transfer was sent, the answer is only booking and transfer, so an accepted transfer is still told.",
                "ar": "يقرأ ما يحتاجه الشاحن ليدفع فاتورة حجز بتحويل بنكي: رقم الفاتورة ليكتبه في ملاحظة التحويل، والمبلغ الدقيق (amount_minor بالهللات وamount_text أرقامًا بسيطة للنسخ)، وهل الإيصال مطلوب وأنواعه وحجمه المسموحان، والحسابات البنكية للمنصة نفسها بعملة الفاتورة، وpending_transfer وهو التحويل المرسل الذي ينتظر المراجعة (المرجع والتاريخ والمبلغ ووقت الإرسال فقط) أو null، وtransfer وهو موضع أحدث تحويل بنكي للفاتورة: state أحد not_sent أو in_review أو accepted أو rejected (وunknown لحجز ليس للشخص)، ومعه receipt_sent وreference وreceived_on وamount_minor وcurrency وsent_at وdecided_at، ولا يُذكر سبب المراجع أبدًا؛ والتحويل المرفوض يُبقي الفاتورة مفتوحة فيجوز إرسال تحويل جديد. وإذا لم تعد الفاتورة مفتوحة (سُدّدت مثلًا) وكان قد أُرسل تحويل فالجواب booking وtransfer فقط، فيبقى المقبول ظاهرًا."
            }
        },
        {
            "name": "market.api.bookings.bank_transfer.store",
            "example": {
                "request": {
                    "reference": "TRX-778",
                    "received_on": "2026-11-24",
                    "notes": "Paid from the company account",
                    "receipt": "(the receipt file, sent as multipart/form-data)"
                },
                "response": {
                    "booking": "0193a1e7-4c20-7b91-a3d5-8e2f6c1b9d40",
                    "pending_transfer": {
                        "reference": "TRX-778",
                        "received_on": "2026-11-24",
                        "amount_minor": 11500,
                        "currency": "SAR",
                        "sent_at": "2026-11-24T09:30:00Z"
                    }
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 403,
                        "code": "forbidden",
                        "reason": "transfer_not_allowed"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "transfer_not_waiting"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "transfer_not_offered"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "transfer_in_review"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "transfer_period_closed"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "transfer_unavailable"
                    },
                    {
                        "status": 413,
                        "code": "payload_too_large"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "transfer_receipt_required"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "transfer_receipt_refused"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "transfer_date_in_future"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "POST",
            "path": "/market/bookings/{uuid}/bank-transfer",
            "auth": "app_token",
            "scope": "market:bookings:pay",
            "apps": [
                "shipper"
            ],
            "idempotency_key": true,
            "limit": "write",
            "summary": {
                "en": "Sends the shipper's bank transfer for the whole balance of the booking's invoice as multipart/form-data: reference, received_on (a date, not in the future), optional notes and the receipt file; the amount is never sent, the server reads it and the transfer waits for review by other people. The receipt is required unless the platform allows a transfer without one; the answer is the pending transfer and the file never comes back.",
                "ar": "يرسل تحويل الشاحن البنكي عن كامل رصيد فاتورة الحجز بصيغة multipart/form-data: reference وreceived_on (تاريخ لا يتجاوز اليوم) وnotes اختيارية وملف الإيصال؛ ولا يُرسل المبلغ أبدًا، فالخادم يقرؤه ويبقى التحويل ينتظر مراجعة أشخاص آخرين. الإيصال مطلوب ما لم تسمح المنصة بتحويل بلا إيصال؛ والجواب هو التحويل المنتظر ولا يعود الملف."
            }
        },
        {
            "name": "market.api.bookings.breakdown",
            "example": {
                "request": null,
                "response": {
                    "breakdown": {
                        "case": {
                            "state": "resolved",
                            "from": "2026-11-28T05:00:00Z",
                            "until": "2026-11-29T05:00:00Z"
                        },
                        "decision": {
                            "option": "postpone",
                            "decided_at": "2026-11-27T10:15:00Z",
                            "outcome": "postponed"
                        },
                        "new_date": {
                            "state": "accepted",
                            "starts_at": "2026-11-30T05:00:00Z",
                            "ends_at": "2026-11-30T09:00:00Z",
                            "answer_by": "2026-11-27T12:00:00Z"
                        }
                    }
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/bookings/{uuid}/breakdown",
            "auth": "app_token",
            "scope": "market:bookings:read",
            "apps": [
                "shipper",
                "carrier"
            ],
            "idempotency_key": false,
            "limit": null,
            "summary": {
                "en": "Returns what a breakdown did to the carrier's own booking: the case state and its window, what staff decided and how it ended once the case is resolved, and the newest new date with its state; breakdown is null when no case cut the booking, and a shipper finds the booking missing (404).",
                "ar": "يعيد ما فعله عطلٌ بحجز الناقل نفسه: حالة ملف العطل ونافذته، وما قرّره الموظفون وكيف انتهى متى حُلّت الحالة، وأحدث موعد جديد مع حالته؛ وتكون قيمة breakdown فارغة (null) إذا لم تقطع أي حالة الحجز، ويجد الشاحن الحجز غير موجود (404)."
            }
        },
        {
            "name": "market.api.bookings.cancel",
            "example": {
                "request": {
                    "reason": "changed_plans",
                    "note": "تأجل موعد التحميل إلى الأسبوع القادم"
                },
                "response": {
                    "booking_uuid": "0193a1e7-4c20-7b91-a3d5-8e2f6c1b9d40",
                    "side": "shipper",
                    "state": "cancelled",
                    "cancellation_request": null,
                    "dispute": null,
                    "cancellation": {
                        "asked_by": "shipper",
                        "kind": "direct",
                        "reason": "changed_plans",
                        "fee_rule": "after_confirm",
                        "fee_excl_vat_halalas": 11800,
                        "refund_excl_vat_halalas": 106200,
                        "currency": "SAR",
                        "at": "2026-11-26T09:15:00Z"
                    }
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "cancel_not_allowed"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "cancel_started"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "cancel_order_ended"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "cancel_try_again"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "note_length"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "note_contact"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "fee_claim_limit"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "POST",
            "path": "/market/bookings/{uuid}/cancel",
            "auth": "app_token",
            "scope": "market:bookings:write",
            "apps": [
                "shipper",
                "carrier"
            ],
            "idempotency_key": true,
            "limit": "write",
            "summary": {
                "en": "Ends the shipper's own booking before loading with a reason from the closed list and an optional note; the answer is how the booking may end now, with the cancellation fee and the refund in halalas before VAT.",
                "ar": "ينهي الشاحن حجزه قبل التحميل بسبب من القائمة المغلقة وملاحظة اختيارية؛ والجواب هو كيف يمكن أن ينتهي الحجز الآن، مع رسم الإلغاء والمبلغ المسترد بالهللات قبل الضريبة."
            }
        },
        {
            "name": "market.api.bookings.cancellation_answer",
            "example": {
                "request": {
                    "answer": "accept"
                },
                "response": {
                    "booking_uuid": "0193a1e7-4c20-7b91-a3d5-8e2f6c1b9d40",
                    "side": "shipper",
                    "state": "cancelled",
                    "cancellation_request": null,
                    "dispute": null,
                    "cancellation": {
                        "asked_by": "carrier",
                        "kind": "request",
                        "reason": "vehicle_breakdown",
                        "fee_rule": "none",
                        "fee_excl_vat_halalas": 0,
                        "refund_excl_vat_halalas": 118000,
                        "currency": "SAR",
                        "at": "2026-11-26T10:40:00Z"
                    }
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "request_gone"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "request_not_allowed"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "cancel_not_allowed"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "cancel_order_ended"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "cancel_try_again"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "POST",
            "path": "/market/bookings/{uuid}/cancellation-answer",
            "auth": "app_token",
            "scope": "market:bookings:write",
            "apps": [
                "shipper",
                "carrier"
            ],
            "idempotency_key": true,
            "limit": "write",
            "summary": {
                "en": "The other side answers the waiting request to cancel with accept (the booking ends), reject, or the asking side takes it back with withdraw; the answer is how the booking may end now.",
                "ar": "يجيب الطرف الآخر على طلب الإلغاء المنتظر بـ accept (فينتهي الحجز) أو reject، ويسحبه الطرف الطالب بـ withdraw؛ والجواب هو كيف يمكن أن ينتهي الحجز الآن."
            }
        },
        {
            "name": "market.api.bookings.cancellation_request",
            "example": {
                "request": {
                    "reason": "changed_plans",
                    "note": "العميل النهائي ألغى الشحنة",
                    "fee_bp": 2000
                },
                "response": {
                    "booking_uuid": "0193a1e7-4c20-7b91-a3d5-8e2f6c1b9d40",
                    "side": "shipper",
                    "state": "in_transit",
                    "cancellation_request": {
                        "uuid": "0193a1e7-8a31-7d62-b0c4-5f19e3a72d86",
                        "asked_by_me": true,
                        "reason": "changed_plans",
                        "answer_by": "2026-11-27T09:15:00Z",
                        "fee_excl_vat_halalas": 23600,
                        "fee_bp": 2000,
                        "refund_excl_vat_halalas": 94400,
                        "currency": "SAR"
                    },
                    "dispute": null,
                    "cancellation": null
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "request_not_allowed"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "request_open"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "request_blocked"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "request_reason"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "fee_bp_exceeds"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "note_length"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "note_contact"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "POST",
            "path": "/market/bookings/{uuid}/cancellation-request",
            "auth": "app_token",
            "scope": "market:bookings:write",
            "apps": [
                "shipper",
                "carrier"
            ],
            "idempotency_key": true,
            "limit": "write",
            "summary": {
                "en": "Either side asks the other to cancel a booking with a reason and an optional note; a shipper may offer a fee in basis points (fee_bp) up to the ceiling in force, and only one request waits at a time.",
                "ar": "يطلب أحد الطرفين من الطرف الآخر إلغاء الحجز بسبب وملاحظة اختيارية؛ وللشاحن أن يعرض رسمًا بالنقاط الأساسية (fee_bp) حتى السقف المعمول به، ولا ينتظر إلا طلب واحد في كل مرة."
            }
        },
        {
            "name": "market.api.bookings.counts",
            "example": {
                "request": null,
                "response": {
                    "tabs": {
                        "all": 14,
                        "awaiting_payment": 1,
                        "in_progress": 4,
                        "awaiting_you": 2,
                        "flagged": 1,
                        "disputes": 0,
                        "completed": 6,
                        "cancelled": 1
                    }
                },
                "errors": []
            },
            "method": "GET",
            "path": "/market/bookings/counts",
            "auth": "app_token",
            "scope": "market:bookings:read",
            "apps": [
                "shipper",
                "carrier"
            ],
            "idempotency_key": false,
            "limit": null,
            "summary": {
                "en": "How many of the shipper's own bookings each tab of its list holds, the eight values of the tab filter of bookings_index (all, awaiting_payment, in_progress, awaiting_you, flagged, disputes, completed, cancelled) as counts under tabs, so the app shows its tab badges without fetching a list; counted in the query on the same readers the list uses, only the caller's company, no body and no filter.",
                "ar": "كم حجزًا من حجوزات الشاحن نفسه يحمل كل تبويب من قائمته، أي القيم الثماني لمرشح tab في bookings_index (all وawaiting_payment وin_progress وawaiting_you وflagged وdisputes وcompleted وcancelled) أعدادًا تحت tabs، فيعرض التطبيق شارات تبويباته دون جلب قائمة؛ تُعدّ في الاستعلام على القرّاء نفسها التي تقرؤها القائمة، لشركة المتصل وحدها، بلا جسم ولا مرشح."
            }
        },
        {
            "name": "market.api.bookings.dispute",
            "example": {
                "request": {
                    "category": "damaged",
                    "statement": "وصلت بعض المواسير متضررة عند التسليم"
                },
                "response": {
                    "booking_uuid": "0193a1e7-4c20-7b91-a3d5-8e2f6c1b9d40",
                    "side": "shipper",
                    "state": "disputed",
                    "cancellation_request": null,
                    "dispute": {
                        "uuid": "0193a1e9-1b47-7a08-9c3e-2d6f8b405a17",
                        "category": "damaged",
                        "opened_by": "shipper",
                        "opened_by_me": true,
                        "state": "open",
                        "answer_by": "2026-11-28T14:20:00Z",
                        "answered": false,
                        "statements": [
                            {
                                "party": "shipper",
                                "mine": true,
                                "at": "2026-11-26T14:20:00Z",
                                "body": "وصلت بعض المواسير متضررة عند التسليم"
                            }
                        ],
                        "outcome": null,
                        "refund_excl_vat_halalas": 0,
                        "compensation_excl_vat_halalas": 0,
                        "currency": "SAR",
                        "decided_at": null,
                        "under_correction": false
                    },
                    "cancellation": null
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "dispute_not_allowed"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "dispute_window_closed"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "dispute_open"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "note_length"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "note_contact"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "POST",
            "path": "/market/bookings/{uuid}/dispute",
            "auth": "app_token",
            "scope": "market:bookings:write",
            "apps": [
                "shipper",
                "carrier"
            ],
            "idempotency_key": true,
            "limit": "write",
            "summary": {
                "en": "Either side opens a dispute on a booking that is loading, on the road, at the door or delivered within its dispute window, with a category (not_delivered, damaged, partial, late, extra_charge, wrong_route, driver_behaviour or other) and a first statement of up to 2000 characters; one dispute stands at a time.",
                "ar": "يفتح أحد الطرفين نزاعًا على حجز في التحميل أو على الطريق أو عند الباب أو سُلّم ضمن مهلة النزاع، بفئة (not_delivered أو damaged أو partial أو late أو extra_charge أو wrong_route أو driver_behaviour أو other) وإفادة أولى لا تزيد على 2000 حرف؛ ولا يقوم إلا نزاع واحد في كل مرة."
            }
        },
        {
            "name": "market.api.bookings.dispute_answer",
            "example": {
                "request": {
                    "statement": "حُمّلت المواسير سليمة وموثقة بصور قبل المغادرة"
                },
                "response": {
                    "booking_uuid": "0193a1e7-4c20-7b91-a3d5-8e2f6c1b9d40",
                    "side": "carrier",
                    "state": "disputed",
                    "cancellation_request": null,
                    "dispute": {
                        "uuid": "0193a1e9-1b47-7a08-9c3e-2d6f8b405a17",
                        "category": "damaged",
                        "opened_by": "shipper",
                        "opened_by_me": false,
                        "state": "answered",
                        "answer_by": "2026-11-28T14:20:00Z",
                        "answered": true,
                        "statements": [
                            {
                                "party": "shipper",
                                "mine": false,
                                "at": "2026-11-26T14:20:00Z",
                                "body": "وصلت بعض المواسير متضررة عند التسليم"
                            },
                            {
                                "party": "carrier",
                                "mine": true,
                                "at": "2026-11-26T16:05:00Z",
                                "body": "حُمّلت المواسير سليمة وموثقة بصور قبل المغادرة"
                            }
                        ],
                        "outcome": null,
                        "refund_excl_vat_halalas": 0,
                        "compensation_excl_vat_halalas": 0,
                        "currency": "SAR",
                        "decided_at": null,
                        "under_correction": false
                    },
                    "cancellation": null
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "dispute_decided"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "dispute_not_yours_to_answer"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "statement_limit"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "note_length"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "note_contact"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "POST",
            "path": "/market/bookings/{uuid}/dispute-answer",
            "auth": "app_token",
            "scope": "market:bookings:write",
            "apps": [
                "shipper",
                "carrier"
            ],
            "idempotency_key": true,
            "limit": "write",
            "summary": {
                "en": "The side a dispute was opened against gives its one answer as a statement of up to 2000 characters, which keeps the dispute open for staff; the answer shows the statements of both sides.",
                "ar": "يعطي الطرف الذي فُتح النزاع ضده جوابه الوحيد في إفادة لا تزيد على 2000 حرف، فيبقى النزاع مفتوحًا للموظفين؛ والجواب يعرض إفادات الطرفين."
            }
        },
        {
            "name": "market.api.bookings.dispute_statements",
            "example": {
                "request": {
                    "statement": "أرفقت صور التفريغ في الموقع وأطلب المعاينة"
                },
                "response": {
                    "booking_uuid": "0193a1e7-4c20-7b91-a3d5-8e2f6c1b9d40",
                    "side": "shipper",
                    "state": "disputed",
                    "cancellation_request": null,
                    "dispute": {
                        "uuid": "0193a1e9-1b47-7a08-9c3e-2d6f8b405a17",
                        "category": "damaged",
                        "opened_by": "shipper",
                        "opened_by_me": true,
                        "state": "answered",
                        "answer_by": "2026-11-28T14:20:00Z",
                        "answered": true,
                        "statements": [
                            {
                                "party": "shipper",
                                "mine": true,
                                "at": "2026-11-26T14:20:00Z",
                                "body": "وصلت بعض المواسير متضررة عند التسليم"
                            },
                            {
                                "party": "carrier",
                                "mine": false,
                                "at": "2026-11-26T16:05:00Z",
                                "body": "حُمّلت المواسير سليمة وموثقة بصور قبل المغادرة"
                            },
                            {
                                "party": "shipper",
                                "mine": true,
                                "at": "2026-11-26T17:30:00Z",
                                "body": "أرفقت صور التفريغ في الموقع وأطلب المعاينة"
                            }
                        ],
                        "outcome": null,
                        "refund_excl_vat_halalas": 0,
                        "compensation_excl_vat_halalas": 0,
                        "currency": "SAR",
                        "decided_at": null,
                        "under_correction": false
                    },
                    "cancellation": null
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "dispute_decided"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "statement_limit"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "note_length"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "note_contact"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "POST",
            "path": "/market/bookings/{uuid}/dispute-statements",
            "auth": "app_token",
            "scope": "market:bookings:write",
            "apps": [
                "shipper",
                "carrier"
            ],
            "idempotency_key": true,
            "limit": "write",
            "summary": {
                "en": "Either side adds a further statement of up to 2000 characters to a dispute that is not decided yet, at most 10 per side; the answer shows the statements of both sides.",
                "ar": "يضيف أحد الطرفين إفادة أخرى لا تزيد على 2000 حرف إلى نزاع لم يُحسم بعد، بحد أقصى 10 لكل طرف؛ والجواب يعرض إفادات الطرفين."
            }
        },
        {
            "name": "market.api.bookings.early_return",
            "example": {
                "request": null,
                "response": {
                    "booking_uuid": "0193a2b4-7c10-7e53-9d2a-6b4f8a1c3e75",
                    "starts_at": "2026-11-24T06:00:00Z",
                    "ends_at": "2026-11-29T06:00:00Z",
                    "priced_halalas": 275000,
                    "with_driver": false,
                    "handover": {
                        "recorded_at": "2026-11-24T06:12:40Z",
                        "odometer_km": 48210,
                        "fuel_percent": 100,
                        "note": "خدوش خفيفة في الصدّام الخلفي."
                    },
                    "return": null,
                    "late_seconds": 0,
                    "late_fee_halalas": 0,
                    "damage_claim_halalas": 0,
                    "early_return_requested_at": "2026-11-26T09:15:00Z",
                    "used_halalas": null,
                    "refund_halalas": 0,
                    "extension": null,
                    "declined_extension": null,
                    "renter_returned_at": null,
                    "mark_answer": null,
                    "collectable_after": null,
                    "can_ask_extension": true,
                    "can_ask_early_return": false,
                    "can_mark_returned": true,
                    "early_return_refunds_extra_hours": null
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "early_return_not_allowed"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "early_return_needs_day_hire"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "POST",
            "path": "/market/bookings/{uuid}/early-return",
            "auth": "app_token",
            "scope": "market:rentals:rent",
            "apps": [
                "shipper"
            ],
            "idempotency_key": true,
            "limit": "write",
            "summary": {
                "en": "The renter says it wants to bring the vehicle back before the end of a day-priced hire that is out and on time, with no body and marked once; the answer is the hire as it now stands, and the carrier's recorded return is what settles it.",
                "ar": "يقول المستأجر إنه يريد إعادة المركبة قبل نهاية إيجار مُسعَّر بالأيام وهي خارجة وفي وقتها، دون جسم ويُسجَّل مرة واحدة؛ والجواب هو الإيجار كما صار، والإرجاع الذي يسجّله الناقل هو الذي يحسم الأمر."
            }
        },
        {
            "name": "market.api.bookings.ending",
            "example": {
                "request": null,
                "response": {
                    "booking_uuid": "0193a1e0-7b14-7d2a-9c63-5e8a1f4b0d27",
                    "side": "shipper",
                    "state": "confirmed",
                    "cancellation_request": {
                        "uuid": "0193a1f2-4c08-7a93-b5e1-9d2f7c6a1e84",
                        "asked_by_me": true,
                        "reason": "changed_plans",
                        "answer_by": "2026-11-26T12:00:00Z",
                        "fee_excl_vat_halalas": 11800,
                        "fee_bp": 1000,
                        "refund_excl_vat_halalas": 106200,
                        "currency": "SAR"
                    },
                    "dispute": null,
                    "cancellation": null
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/bookings/{uuid}/ending",
            "auth": "app_token",
            "scope": "market:bookings:read",
            "apps": [
                "shipper",
                "carrier"
            ],
            "idempotency_key": false,
            "limit": null,
            "summary": {
                "en": "Says how a booking may end, as the asking side reads it: the cancellation request waiting for an answer, the dispute with both sides' statements and its outcome, and the cancellation that ended it, each null when there is none; amounts are in halalas before VAT.",
                "ar": "يبيّن كيف يمكن إنهاء الحجز كما يراه الطرف السائل: طلب الإلغاء المنتظر الجواب، والنزاع مع إفادات الطرفين ونتيجته، والإلغاء الذي أنهى الحجز، وكل منها فارغ (null) إن لم يوجد؛ والمبالغ بالهللات قبل الضريبة."
            }
        },
        {
            "name": "market.api.bookings.extension.approve",
            "example": {
                "request": null,
                "response": {
                    "booking_uuid": "0193a2b4-7c10-7e53-9d2a-6b4f8a1c3e75",
                    "uuid": "0193a2c9-1e47-7a86-b3d5-8f2c6e0a9d14",
                    "state": "approved",
                    "old_ends_at": "2026-11-29T06:00:00Z",
                    "new_ends_at": "2026-12-02T06:00:00Z",
                    "difference_halalas": 165000,
                    "requested_at": "2026-11-26T09:10:00Z",
                    "decided_at": "2026-11-26T10:02:30Z",
                    "decision_reason": null
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "extension_closed"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "extension_not_allowed"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "extension_vehicle_busy"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "extension_not_later"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "extension_too_long"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "POST",
            "path": "/market/bookings/{uuid}/extension/approve",
            "auth": "app_token",
            "scope": "market:rentals:decide",
            "apps": [
                "carrier"
            ],
            "idempotency_key": true,
            "limit": "write",
            "summary": {
                "en": "Approves the longer-hire request waiting on one of the carrier's own bookings at the price shown to the renter, with no body and the rentals decide scope; with no difference to pay the end of the hire moves at once, otherwise it waits for the difference to be paid, and a vehicle that is not free for the longer period is a conflict.",
                "ar": "يوافق الناقل على طلب الإيجار الأطول المنتظر على أحد حجوزاته بالسعر الذي رآه المستأجر، دون جسم ويحتاج نطاق قرارات الإيجار؛ فإن لم يكن هناك فرق يُدفع انتقلت نهاية الإيجار فورًا، وإلا انتظر دفع الفرق، والمركبة غير المتاحة للفترة الأطول تعارض."
            }
        },
        {
            "name": "market.api.bookings.extension.ask",
            "example": {
                "request": {
                    "new_ends_at": "2026-12-02T06:00:00Z"
                },
                "response": {
                    "booking_uuid": "0193a2b4-7c10-7e53-9d2a-6b4f8a1c3e75",
                    "uuid": "0193a2c9-1e47-7a86-b3d5-8f2c6e0a9d14",
                    "state": "requested",
                    "old_ends_at": "2026-11-29T06:00:00Z",
                    "new_ends_at": "2026-12-02T06:00:00Z",
                    "difference_halalas": 165000,
                    "requested_at": "2026-11-26T09:10:00Z",
                    "decided_at": null,
                    "decision_reason": null
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "extension_not_allowed"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "extension_already_asked"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "extension_limit_reached"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "extension_needs_day_hire"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "extension_unpriceable"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "extension_not_later"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "extension_too_long"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "POST",
            "path": "/market/bookings/{uuid}/extension",
            "auth": "app_token",
            "scope": "market:rentals:rent",
            "apps": [
                "shipper"
            ],
            "idempotency_key": true,
            "limit": "write",
            "summary": {
                "en": "The renter asks to keep the vehicle longer with new_ends_at (at most 366 days past the current end and a year from today), a hire priced by the day that has not been extended yet and has no request waiting; the longer hire is priced from the terms of the hire, the difference is fixed now, and the answer, status 201, is the extension as requested.",
                "ar": "يطلب المستأجر إبقاء المركبة مدة أطول بـnew_ends_at (لا تزيد على 366 يومًا بعد النهاية الحالية ولا على سنة من اليوم) لإيجار مُسعَّر بالأيام لم يُمدَّد بعد وليس عليه طلب منتظر؛ ويُسعَّر الإيجار الأطول من شروطه ويُثبَّت الفرق الآن، والجواب بالحالة 201 هو التمديد مطلوبًا."
            }
        },
        {
            "name": "market.api.bookings.extension.cancel",
            "example": {
                "request": null,
                "response": {
                    "booking_uuid": "0193a2b4-7c10-7e53-9d2a-6b4f8a1c3e75",
                    "uuid": "0193a2c9-1e47-7a86-b3d5-8f2c6e0a9d14",
                    "state": "cancelled",
                    "old_ends_at": "2026-11-29T06:00:00Z",
                    "new_ends_at": "2026-12-02T06:00:00Z",
                    "difference_halalas": 165000,
                    "requested_at": "2026-11-26T09:10:00Z",
                    "decided_at": "2026-11-26T09:45:00Z",
                    "decision_reason": null
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "extension_closed"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "POST",
            "path": "/market/bookings/{uuid}/extension/cancel",
            "auth": "app_token",
            "scope": "market:rentals:rent",
            "apps": [
                "shipper"
            ],
            "idempotency_key": true,
            "limit": "write",
            "summary": {
                "en": "The renter takes back its longer-hire request, open or approved and not yet paid for, with no body; the answer is the extension as cancelled, and a request that is already answered or applied is a conflict.",
                "ar": "يسحب المستأجر طلب الإيجار الأطول، مفتوحًا كان أو موافَقًا عليه ولم يُدفع، دون جسم؛ والجواب هو التمديد ملغى، وطلب سبق الرد عليه أو تطبيقه تعارض."
            }
        },
        {
            "name": "market.api.bookings.extension.decline",
            "example": {
                "request": {
                    "reason": "المركبة محجوزة لعميل آخر في هذه الفترة."
                },
                "response": {
                    "booking_uuid": "0193a2b4-7c10-7e53-9d2a-6b4f8a1c3e75",
                    "uuid": "0193a2c9-1e47-7a86-b3d5-8f2c6e0a9d14",
                    "state": "declined",
                    "old_ends_at": "2026-11-29T06:00:00Z",
                    "new_ends_at": "2026-12-02T06:00:00Z",
                    "difference_halalas": 165000,
                    "requested_at": "2026-11-26T09:10:00Z",
                    "decided_at": "2026-11-26T10:02:30Z",
                    "decision_reason": "المركبة محجوزة لعميل آخر في هذه الفترة."
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "extension_closed"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "decline_reason_required"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "POST",
            "path": "/market/bookings/{uuid}/extension/decline",
            "auth": "app_token",
            "scope": "market:rentals:decide",
            "apps": [
                "carrier"
            ],
            "idempotency_key": true,
            "limit": "write",
            "summary": {
                "en": "Declines the longer-hire request waiting on one of the carrier's own bookings with a reason of 3 to 500 characters in reason, using the rentals decide scope; the answer is the extension as declined, with the time of the decision and the reason.",
                "ar": "يرفض الناقل طلب الإيجار الأطول المنتظر على أحد حجوزاته بسبب من 3 إلى 500 حرف في reason، ويحتاج نطاق قرارات الإيجار؛ والجواب هو التمديد مرفوضًا مع وقت القرار والسبب."
            }
        },
        {
            "name": "market.api.bookings.extension.show",
            "example": {
                "request": null,
                "response": {
                    "booking_uuid": "0193a2b4-7c10-7e53-9d2a-6b4f8a1c3e75",
                    "uuid": "0193a2c9-1e47-7a86-b3d5-8f2c6e0a9d14",
                    "state": "requested",
                    "old_ends_at": "2026-11-29T06:00:00Z",
                    "new_ends_at": "2026-12-02T06:00:00Z",
                    "difference_halalas": 165000,
                    "requested_at": "2026-11-26T09:10:00Z",
                    "decided_at": null,
                    "decision_reason": null
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/bookings/{uuid}/extension",
            "auth": "app_token",
            "scope": "market:rentals:write",
            "apps": [
                "carrier"
            ],
            "idempotency_key": false,
            "limit": null,
            "summary": {
                "en": "Reads the longer-hire request waiting for the carrier's answer on one of its own bookings: the end it would move to, the difference in halalas before VAT and when it was asked; a booking of another company, or one with nothing waiting, is a 404.",
                "ar": "يقرأ الناقل طلب الإيجار الأطول المنتظر ردّه على أحد حجوزاته: النهاية التي سينتقل إليها والفرق بالهللات قبل الضريبة ووقت الطلب؛ وحجز شركة أخرى أو حجز لا ينتظر شيئًا هو 404."
            }
        },
        {
            "name": "market.api.bookings.extra_amounts",
            "example": {
                "request": null,
                "response": {
                    "booking": "0193a1e0-7b14-7d2a-9c63-5e8a1f4b0d27",
                    "amounts": [
                        {
                            "kind": "extension",
                            "ref": "0193a1f8-6e21-7c5d-9b04-1a8f3d7e2c65",
                            "amount_halalas": 25000,
                            "vat_halalas": 3750,
                            "gross_halalas": 28750,
                            "currency": "SAR",
                            "payable_from": null,
                            "payable_until": "2026-12-03T08:00:00Z",
                            "paid": false,
                            "payable": true
                        },
                        {
                            "kind": "late_fee",
                            "ref": "0193a1e0-7b14-7d2a-9c63-5e8a1f4b0d27",
                            "amount_halalas": 40000,
                            "vat_halalas": 6000,
                            "gross_halalas": 46000,
                            "currency": "SAR",
                            "payable_from": "2026-12-05T08:00:00Z",
                            "payable_until": null,
                            "paid": false,
                            "payable": false
                        }
                    ]
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/bookings/{uuid}/extra-amounts",
            "auth": "app_token",
            "scope": "market:bookings:read",
            "apps": [
                "shipper",
                "carrier"
            ],
            "idempotency_key": false,
            "limit": null,
            "summary": {
                "en": "Lists what a renter owes on a hire beyond its booking price (an extension's difference, a late fee, a damage fee), each with its price, VAT and total in halalas (VAT and total null when they cannot be worked now), when it may be paid and whether it is paid or payable; only the hire's renter reads it.",
                "ar": "يعرض ما يدين به المستأجر على الإيجار فوق سعر حجزه (فرق التمديد، وغرامة التأخير، ورسوم التلف)، ولكل مبلغ سعره والضريبة والإجمالي بالهللات (وتكون الضريبة والإجمالي فارغين إن تعذّر حسابهما الآن) ومتى يمكن دفعه وهل دُفع أو يمكن دفعه؛ ولا يقرؤه إلا مستأجر الإيجار."
            }
        },
        {
            "name": "market.api.bookings.extra_amounts_payment",
            "example": {
                "request": {
                    "kind": "late_fee",
                    "ref": "0193a1ea-93c1-7e5b-8a27-d4f06b3c1e58"
                },
                "response": {
                    "booking": "0193a1e7-4c20-7b91-a3d5-8e2f6c1b9d40",
                    "kind": "late_fee",
                    "ref": "0193a1ea-93c1-7e5b-8a27-d4f06b3c1e58",
                    "payment_url": "https://pay.example.com/p/4b8e1d06"
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 403,
                        "code": "forbidden",
                        "reason": "payment_not_allowed"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "payment_unavailable"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "payment_no_billing_profile"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "payment_amount_differs"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "payment_invoice_rule"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "payment_already_paid"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "payment_in_flight"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "payment_saved_cards_off"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "payment_phone_required"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "payment_choice_changed"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "payment_card_unavailable"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "POST",
            "path": "/market/bookings/{uuid}/extra-amounts/payment",
            "auth": "app_token",
            "scope": "market:bookings:pay",
            "apps": [
                "shipper"
            ],
            "idempotency_key": true,
            "limit": "write",
            "summary": {
                "en": "Pays one extra amount owed on a hire (kind extension, late_fee or damage, with its ref) on the gateway's hosted page returned as payment_url, once the amount is payable; save_card and card work as in a booking payment.",
                "ar": "يدفع مبلغًا إضافيًا مستحقًا على إيجار (kind بقيمة extension أو late_fee أو damage مع ref) في صفحة البوابة المستضافة التي تعود في payment_url، متى صار المبلغ قابلًا للدفع؛ ويعمل save_card وcard كما في دفع الحجز."
            }
        },
        {
            "name": "market.api.bookings.favourite_carrier",
            "example": {
                "request": null,
                "response": {
                    "carrier": "0193a1a8-2d95-7c36-b1e4-7a8f0d3c6b52",
                    "name": "شركة النقل السريع",
                    "added_at": "2026-11-26T11:05:00Z"
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "limit_reached"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "own_company"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "POST",
            "path": "/market/bookings/{uuid}/favourite-carrier",
            "auth": "app_token",
            "scope": "market:requests:write",
            "apps": [
                "shipper"
            ],
            "idempotency_key": true,
            "limit": "write",
            "summary": {
                "en": "The shipper adds the carrier of one of its own bookings to its favourites, at most 50; the answer (201) is the carrier's public id, public name and the time it was added, and the same row again when it is already kept.",
                "ar": "يضيف الشاحن ناقل أحد حجوزاته إلى مفضّلته، بحد أقصى 50؛ والجواب (201) هو المعرّف العام للناقل واسمه العام ووقت الإضافة، ويعود الصف نفسه إذا كان محفوظًا من قبل."
            }
        },
        {
            "name": "market.api.bookings.handover",
            "example": {
                "request": {
                    "latitude": 24.71355,
                    "longitude": 46.67529,
                    "odometer_km": 48210,
                    "fuel_percent": 100,
                    "note": "خدوش خفيفة في الصدّام الخلفي."
                },
                "response": {
                    "booking_uuid": "0193a2b4-7c10-7e53-9d2a-6b4f8a1c3e75",
                    "handover": {
                        "recorded_at": "2026-11-24T06:12:40Z",
                        "latitude": 24.71355,
                        "longitude": 46.67529,
                        "odometer_km": 48210,
                        "fuel_percent": 100,
                        "note": "خدوش خفيفة في الصدّام الخلفي."
                    },
                    "return": null,
                    "late_seconds": 0,
                    "late_fee_halalas": 0,
                    "damage_claim_halalas": 0,
                    "renter_mark_state": null,
                    "collectable_after": null
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "handover_not_due"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "place_incomplete"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "place_out_of_range"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "odometer_negative"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "fuel_out_of_range"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "note_too_long"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "POST",
            "path": "/market/bookings/{uuid}/handover",
            "auth": "app_token",
            "scope": "market:rentals:write",
            "apps": [
                "carrier"
            ],
            "idempotency_key": true,
            "limit": "write",
            "summary": {
                "en": "Records the hand-over of a confirmed hire by a person of the carrier's company: an optional place (latitude and longitude together), odometer_km, fuel_percent from 0 to 100 and a note up to 500 characters; the answer is what was recorded, and a second call returns the first record unchanged.",
                "ar": "يسجّل شخص من شركة الناقل تسليم إيجار مؤكَّد: المكان اختياريًا (خط العرض وخط الطول معًا) وodometer_km وfuel_percent من 0 إلى 100 وملاحظة حتى 500 حرف؛ والجواب هو ما سُجِّل، والاستدعاء الثاني يعيد السجل الأول دون تغيير."
            }
        },
        {
            "name": "market.api.bookings.hire",
            "example": {
                "request": null,
                "response": {
                    "booking_uuid": "0193a2b4-7c10-7e53-9d2a-6b4f8a1c3e75",
                    "starts_at": "2026-11-24T06:00:00Z",
                    "ends_at": "2026-11-29T06:00:00Z",
                    "priced_halalas": 275000,
                    "with_driver": false,
                    "handover": {
                        "recorded_at": "2026-11-24T06:12:40Z",
                        "odometer_km": 48210,
                        "fuel_percent": 100,
                        "note": "خدوش خفيفة في الصدّام الخلفي."
                    },
                    "return": null,
                    "late_seconds": 0,
                    "late_fee_halalas": 0,
                    "damage_claim_halalas": 0,
                    "early_return_requested_at": null,
                    "used_halalas": null,
                    "refund_halalas": 0,
                    "extension": {
                        "uuid": "0193a2c9-1e47-7a86-b3d5-8f2c6e0a9d14",
                        "state": "requested",
                        "new_ends_at": "2026-12-02T06:00:00Z",
                        "difference_halalas": 165000
                    },
                    "declined_extension": null,
                    "renter_returned_at": null,
                    "mark_answer": null,
                    "collectable_after": null,
                    "can_ask_extension": false,
                    "can_ask_early_return": true,
                    "can_mark_returned": true,
                    "early_return_refunds_extra_hours": null
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/bookings/{uuid}/hire",
            "auth": "app_token",
            "scope": "market:rentals:rent",
            "apps": [
                "shipper"
            ],
            "idempotency_key": false,
            "limit": null,
            "summary": {
                "en": "The renter's reading of its own hire: the window in force, the agreed price in halalas before VAT, what the carrier recorded at hand-over and at return, the late fee and damage claim, the early return asked for, the open extension and the last declined one, the carrier's answer to a return mark and what the renter may do now (can_ask_extension, can_ask_early_return, can_mark_returned); a booking of another company, or one that is no hire, is a 404.",
                "ar": "قراءة المستأجر لإيجاره: الفترة السارية والسعر المتفق عليه بالهللات قبل الضريبة وما سجّله الناقل عند التسليم وعند الإرجاع ورسم التأخير ومطالبة الضرر والإرجاع المبكر المطلوب والتمديد المفتوح وآخر تمديد مرفوض وردّ الناقل على تعليم الإرجاع، وما يحق للمستأجر فعله الآن؛ وحجز شركة أخرى أو حجز ليس إيجارًا هو 404."
            }
        },
        {
            "name": "market.api.bookings.hire.early_return_quote",
            "example": {
                "request": null,
                "response": {
                    "booking_uuid": "0193a2b4-7c10-7e53-9d2a-6b4f8a1c3e75",
                    "used_halalas": 110000,
                    "refund_halalas": 165000
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/bookings/{uuid}/hire/early-return-quote",
            "auth": "app_token",
            "scope": "market:rentals:rent",
            "apps": [
                "shipper"
            ],
            "idempotency_key": false,
            "limit": "heavy",
            "summary": {
                "en": "Prices an early return before it is asked: the days used (used_halalas) and the refund (refund_halalas) in halalas if the vehicle came back now, before any damage claim; both are null when the hire has no days to give back, nothing is saved, and the heavy limit applies.",
                "ar": "يسعّر الإرجاع المبكر قبل طلبه: الأيام المستعملة والمبلغ المردود بالهللات لو عادت المركبة الآن، قبل أي مطالبة ضرر؛ وكلاهما فارغ (null) حين لا يكون للإيجار أيام تُرَدّ، ولا يُحفظ شيء، ويسري الحد الثقيل."
            }
        },
        {
            "name": "market.api.bookings.hire.extension_quote",
            "example": {
                "request": {
                    "new_ends_at": "2026-12-02T06:00:00Z"
                },
                "response": {
                    "booking_uuid": "0193a2b4-7c10-7e53-9d2a-6b4f8a1c3e75",
                    "new_ends_at": "2026-12-02T06:00:00Z",
                    "difference_halalas": 165000
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "extension_not_allowed"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "extension_already_asked"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "extension_limit_reached"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "extension_needs_day_hire"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "extension_unpriceable"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "extension_not_later"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "extension_too_long"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/bookings/{uuid}/hire/extension-quote",
            "auth": "app_token",
            "scope": "market:rentals:rent",
            "apps": [
                "shipper"
            ],
            "idempotency_key": false,
            "limit": "heavy",
            "summary": {
                "en": "Prices a longer hire before it is asked, with the new end in the query as new_ends_at; the answer is the difference in halalas before VAT that the longer hire would add, nothing is saved, only a hire priced by the day can be extended, and the heavy limit applies.",
                "ar": "يسعّر الإيجار الأطول قبل طلبه، والنهاية الجديدة في الاستعلام باسم new_ends_at؛ والجواب هو الفرق بالهللات قبل الضريبة الذي يضيفه الإيجار الأطول، ولا يُحفظ شيء، ولا يُمدَّد إلا إيجار مُسعَّر بالأيام، ويسري الحد الثقيل."
            }
        },
        {
            "name": "market.api.bookings.history",
            "example": {
                "request": null,
                "response": {
                    "booking_uuid": "0193a1e0-7b14-7d2a-9c63-5e8a1f4b0d27",
                    "timeline": [
                        {
                            "event": "created",
                            "at": "2026-11-24T08:05:00+00:00",
                            "source": "you"
                        },
                        {
                            "event": "state_confirmed",
                            "at": "2026-11-24T08:12:00+00:00",
                            "source": "system"
                        },
                        {
                            "event": "state_loading",
                            "at": "2026-11-28T05:20:00+00:00",
                            "source": "vehicle_position"
                        },
                        {
                            "event": "state_in_transit",
                            "at": "2026-11-28T06:45:00+00:00",
                            "source": "vehicle_position"
                        },
                        {
                            "event": "state_awaiting_customer",
                            "at": "2026-11-28T16:10:00+00:00",
                            "source": "vehicle_position"
                        },
                        {
                            "event": "code_sent",
                            "at": "2026-11-28T16:11:00+00:00",
                            "source": "system"
                        },
                        {
                            "event": "code_failed",
                            "at": "2026-11-28T16:30:00+00:00",
                            "source": "you"
                        },
                        {
                            "event": "code_redeemed",
                            "at": "2026-11-28T16:35:00+00:00",
                            "source": "you"
                        },
                        {
                            "event": "state_delivered",
                            "at": "2026-11-28T16:35:00+00:00",
                            "source": "you"
                        }
                    ],
                    "delivery": {
                        "arrived_at": "2026-11-28T16:10:00+00:00",
                        "arrival_evidence": "observed",
                        "delivered_at": "2026-11-28T16:35:00+00:00",
                        "delivered_via": "code",
                        "delay_minutes": 15
                    },
                    "receipt_code": {
                        "events": [
                            {
                                "event": "code_sent",
                                "at": "2026-11-28T16:11:00+00:00",
                                "source": "system"
                            },
                            {
                                "event": "code_redeemed",
                                "at": "2026-11-28T16:35:00+00:00",
                                "source": "you"
                            }
                        ],
                        "wrong_codes": 1
                    }
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/bookings/{uuid}/history",
            "auth": "app_token",
            "scope": "market:bookings:read",
            "apps": [
                "shipper",
                "carrier"
            ],
            "idempotency_key": false,
            "limit": null,
            "summary": {
                "en": "Returns what happened on a booking of the caller's company in time order: the state changes (a cancellation or a dispute included), the receipt code's life with the count of wrong codes, a started window and a changed truck, each line with its source, and the proof of delivery once the truck reached the drop-off; never a person, a note or a flag.",
                "ar": "يعيد ما جرى على حجز شركة المتصل بترتيب الزمن: تغيّرات الحالة (ومنها الإلغاء والنزاع)، وحياة رمز الاستلام مع عدد الرموز الخاطئة، وبدء الموعد وتغيير الشاحنة، ولكل سطر مصدره، ثم إثبات التسليم متى بلغت الشاحنة نقطة التفريغ؛ دون اسم شخص أو ملاحظة أو تنبيه."
            }
        },
        {
            "name": "market.api.bookings.index",
            "example": {
                "request": {
                    "query": {
                        "role": "shipper",
                        "tab": "in_progress",
                        "limit": 50
                    }
                },
                "response": [
                    {
                        "uuid": "0193a1e0-7b14-7d2a-9c63-5e8a1f4b0d27",
                        "request_uuid": "0193a1c2-5d7e-7c4a-8f21-9b3d6e1a4c07",
                        "departure_uuid": null,
                        "state": "in_transit",
                        "arrived_pickup_at": "2026-11-28T05:10:00Z",
                        "left_pickup_at": "2026-11-28T06:40:00Z",
                        "arrived_dropoff_at": null,
                        "delivered_at": null,
                        "delivered_via": null,
                        "loading_evidence": "observed",
                        "transit_evidence": "observed",
                        "arrival_evidence": null,
                        "reference": "MR-0004217",
                        "route": "الرياض ← جدة",
                        "trips": 1,
                        "kind": "freight",
                        "leg_position": 1,
                        "attempt": 1,
                        "pickup_delay_minutes": 10,
                        "dropoff_delay_minutes": null,
                        "waiting_for": "awaiting_customer",
                        "flags": [
                            {
                                "kind": "unverified_step",
                                "step": "in_transit",
                                "raised_at": "2026-11-28T07:05:00Z",
                                "carrier_note": null
                            }
                        ],
                        "carrier": {
                            "name": "نقل الوادي",
                            "vehicle": {
                                "vehicle_type": "truck_flatbed",
                                "tons": 12,
                                "year": 2022
                            },
                            "photo_uuid": "0193a1a4-6c2e-7d18-b5f3-8a1d7e4c9b62"
                        },
                        "transfer": null
                    },
                    {
                        "uuid": "0193a1e0-7b9c-7f31-a4d8-2b6c9e3f1a58",
                        "request_uuid": null,
                        "departure_uuid": "0193a1b8-91c3-7e52-8d04-7a2f6c1e5b39",
                        "state": "confirmed",
                        "arrived_pickup_at": null,
                        "left_pickup_at": null,
                        "arrived_dropoff_at": null,
                        "delivered_at": null,
                        "delivered_via": null,
                        "loading_evidence": null,
                        "transit_evidence": null,
                        "arrival_evidence": null,
                        "reference": "—",
                        "route": "الدمام ← الرياض",
                        "trips": 1,
                        "kind": "freight",
                        "leg_position": 0,
                        "attempt": 1,
                        "pickup_delay_minutes": null,
                        "dropoff_delay_minutes": null,
                        "waiting_for": null,
                        "flags": [],
                        "carrier": null,
                        "transfer": null
                    }
                ],
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/bookings",
            "auth": "app_token",
            "scope": "market:bookings:read",
            "apps": [
                "shipper",
                "carrier"
            ],
            "idempotency_key": false,
            "limit": null,
            "summary": {
                "en": "Lists the bookings of the caller's company, newest first, as shipper by default (with tab: all, awaiting_payment, in_progress, awaiting_you, flagged, disputes, completed or cancelled) or as carrier with role=carrier (with state, kind or listing); each row is a card with the booking's reference, route, kind, state, road times and how each step was evidenced, the step it waits for, its open flags, transfer (the booking's live urgent offer as the booking's own carrier reads it, open or claimed, or a claimed one as its shipper, with its uuid, status, expiry, version and the shipper's approval time, as the booking's transfer read gives it; null when there is none or the caller may not see it) and, for the shipper, the carrier's public name, vehicle and photo, never a price or a contact. limit takes 1 to 100 (50 at most for the shipper) and the earlier pages of either side follow the cursor in meta.page.next_cursor, passed as older_than.",
                "ar": "يعرض حجوزات شركة المتصل من الأحدث إلى الأقدم، بصفة الشاحن افتراضيًا (مع tab: all أو awaiting_payment أو in_progress أو awaiting_you أو flagged أو disputes أو completed أو cancelled) أو بصفة الناقل مع role=carrier (مع state أو kind أو listing)؛ وكل صف بطاقة فيها مرجع الطلب والمسار ونوع الحجز وحالته وأوقات الطريق وكيف أُثبتت كل خطوة والخطوة المنتظَرة والتنبيهات المفتوحة وtransfer (العرض العاجل الحي للحجز كما يقرؤه ناقل الحجز نفسه مفتوحًا أو مأخوذًا، أو المأخوذ وحده لشاحنه، بمعرّفه وحالته وانتهائه ونسخته ووقت موافقة الشاحن كما تعطيها قراءة تحويل الحجز؛ وnull إن لم يوجد أو لم يكن للمتصل أن يراه)، وللشاحن اسم الناقل العام ومركبته وصورتها، دون سعر أو بيانات تواصل. ويقبل limit من 1 إلى 100 (50 كحد أقصى للشاحن)، وتتبع الصفحات الأقدم للجهتين مؤشرَ الصفحة التالية في الرد وتُمرَّر عبر older_than."
            }
        },
        {
            "name": "market.api.bookings.page",
            "example": {
                "request": null,
                "response": {
                    "booking_uuid": "0193a1e0-7b14-7d2a-9c63-5e8a1f4b0d27",
                    "role": "shipper",
                    "state": "confirmed",
                    "primary_action": "share_tracking_link",
                    "money": [
                        {
                            "code": "price",
                            "halalas": 120000,
                            "is_total": false
                        },
                        {
                            "code": "shipper_commission",
                            "halalas": 6000,
                            "is_total": false
                        },
                        {
                            "code": "vat",
                            "halalas": 18900,
                            "is_total": false
                        },
                        {
                            "code": "total",
                            "halalas": 144900,
                            "is_total": true
                        }
                    ],
                    "held_until_delivery": true,
                    "held_after_delivery": false,
                    "cancel_now": {
                        "fee_bp": 1000,
                        "fee_excl_vat_halalas": 12000,
                        "refund_excl_vat_halalas": 108000,
                        "currency": "SAR"
                    },
                    "details": [
                        {
                            "code": "pickup",
                            "text": "الرياض، المدينة الصناعية الثانية"
                        },
                        {
                            "code": "dropoff",
                            "text": "جدة، ميناء جدة الإسلامي"
                        },
                        {
                            "code": "load",
                            "text": "مواد بناء · 12 طن"
                        },
                        {
                            "code": "includes",
                            "text": "التحميل والتنزيل ضمن السعر"
                        }
                    ],
                    "crew": {
                        "plate_tail": "412",
                        "plate": null,
                        "driver_first_name": "خالد"
                    },
                    "invoice_bookings": 0,
                    "carrier": {
                        "rating": {
                            "average": 4.6,
                            "count": 38
                        },
                        "record": {
                            "completed": 120,
                            "on_time_percent": 94,
                            "on_time_without_breakdown_percent": 91
                        },
                        "record_shown": true
                    }
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/bookings/{uuid}/page",
            "auth": "app_token",
            "scope": "market:bookings:read",
            "apps": [
                "shipper",
                "carrier"
            ],
            "idempotency_key": false,
            "limit": null,
            "summary": {
                "en": "Returns a booking's page for the side that opens it, as the screen reads it: the code of its main button, the money of that side in halalas, what cancelling would cost the shipper now, the load's details in words, the crew's facts (the shipper reads the plate's last digits and the driver's first name, the carrier its own plate and driver) and, for the shipper, the carrier's stars and public record. The truck's place and the history are read from position and history, and another company's booking is a 404.",
                "ar": "يعيد صفحة الحجز للجهة التي تفتحه كما تقرؤها الشاشة: رمز زرّه الرئيسي ومال جهته بالهللات وما يكلّفه الإلغاء الآن للشاحن وتفاصيل الحمولة بالكلمات وبيانات الطاقم (يقرأ الشاحن آخر أرقام اللوحة والاسم الأول للسائق، ويقرأ الناقل لوحته وسائقه) وللشاحن نجوم الناقل وسجله العام. أما مكان الشاحنة والتاريخ فيُقرآن من position وhistory، وحجز شركة أخرى يُعامل كأنه غير موجود (404)."
            }
        },
        {
            "name": "market.api.bookings.payment",
            "example": {
                "request": {
                    "method": "card",
                    "save_card": true
                },
                "response": {
                    "booking": "0193a1e7-4c20-7b91-a3d5-8e2f6c1b9d40",
                    "method": "card",
                    "payment_url": "https://pay.example.com/p/9f3c2a71"
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 403,
                        "code": "forbidden",
                        "reason": "payment_not_allowed"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "payment_not_waiting"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "payment_unavailable"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "payment_no_billing_profile"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "payment_amount_differs"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "payment_invoice_rule"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "payment_already_paid"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "payment_in_flight"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "payment_saved_cards_off"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "payment_phone_required"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "payment_choice_changed"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "payment_card_unavailable"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "POST",
            "path": "/market/bookings/{uuid}/payment",
            "auth": "app_token",
            "scope": "market:bookings:pay",
            "apps": [
                "shipper"
            ],
            "idempotency_key": true,
            "limit": "write",
            "summary": {
                "en": "Pays a booking that waits for payment: the invoice is issued and the answer is the page to pay it on (payment_url) with the method used: card (the default), the gateway's hosted page where the card is paid, with save_card to keep the card or card with a saved card's uuid, never both; or method invoice, the invoice's own page for the other ways of paying, which takes no card choice; no card figure passes through the API.",
                "ar": "يدفع حجزًا ينتظر الدفع: تصدر الفاتورة والجواب هو الصفحة التي يُدفع عليها (payment_url) مع الطريقة المستعملة method: card (الافتراضية) وهي صفحة البوابة المستضافة التي تُدفع فيها البطاقة، ومعها save_card لحفظ البطاقة أو card بمعرّف بطاقة محفوظة ولا تُرسل الاثنين معًا؛ أو method بقيمة invoice وهي صفحة الفاتورة نفسها لطرق الدفع الأخرى ولا تأخذ اختيار بطاقة؛ ولا تمر أي بيانات بطاقة عبر الواجهة."
            }
        },
        {
            "name": "market.api.bookings.position",
            "example": {
                "request": null,
                "response": {
                    "booking_uuid": "0193a1e0-7b14-7d2a-9c63-5e8a1f4b0d27",
                    "state": "in_transit",
                    "pickup": {
                        "lat": 24.6877,
                        "lng": 46.7219
                    },
                    "dropoff": {
                        "lat": 21.4858,
                        "lng": 39.1925
                    },
                    "position": {
                        "lat": 23.2104,
                        "lng": 43.8851,
                        "observed_at": "2026-11-28T09:41:00+00:00"
                    },
                    "eta": {
                        "earliest": "2026-11-28T15:30:00+00:00",
                        "latest": "2026-11-28T16:30:00+00:00",
                        "stopped": false
                    },
                    "remaining_km": 612.4,
                    "delivered_at": null,
                    "unavailable": false
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/bookings/{uuid}/position",
            "auth": "app_token",
            "scope": "market:bookings:read",
            "apps": [
                "shipper",
                "carrier"
            ],
            "idempotency_key": false,
            "limit": null,
            "summary": {
                "en": "Returns where the truck of the shipper's own booking is: its state, the pickup and drop-off points, the live position with the time it was seen, the arrival window, the distance left and the delivery time, each null when not known, and unavailable true when the place could not be read just now; a booking where the caller is the carrier is a 404.",
                "ar": "يعيد موضع شاحنة حجز الشاحن نفسه: حالته ونقطتا التحميل والتفريغ والموضع الحي مع وقت رصده ونافذة الوصول والمسافة المتبقية ووقت التسليم، وكل منها فارغ (null) إن لم يُعرف، ويكون unavailable بقيمة true إن تعذّرت قراءة الموضع الآن؛ وحجز يكون المتصل فيه الناقل يُعامل كأنه غير موجود (404)."
            }
        },
        {
            "name": "market.api.bookings.postponement",
            "example": {
                "request": null,
                "response": {
                    "postponement": {
                        "uuid": "0193a1f6-2d19-7b40-8a57-3e9c1d6f0b72",
                        "current_from": "2026-11-28T05:00:00+00:00",
                        "current_until": "2026-11-28T09:00:00+00:00",
                        "new_from": "2026-11-30T05:00:00+00:00",
                        "new_until": "2026-11-30T09:00:00+00:00",
                        "answer_by": "2026-11-27T12:00:00+00:00",
                        "may_accept": true,
                        "may_refuse": true
                    }
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/bookings/{uuid}/postponement",
            "auth": "app_token",
            "scope": "market:bookings:read",
            "apps": [
                "shipper",
                "carrier"
            ],
            "idempotency_key": false,
            "limit": null,
            "summary": {
                "en": "Returns the new date the market proposed for the shipper's own booking after a breakdown while it waits for an answer, with the current and the proposed windows, the time to answer by and which answers the caller may give; postponement is null when none waits.",
                "ar": "يعيد الموعد الجديد الذي اقترحته المنصة لحجز الشاحن نفسه بعد عطل ما دام ينتظر جوابًا، مع الموعد الحالي والمقترح ووقت الإجابة والأجوبة المتاحة للمتصل؛ وتكون قيمة postponement فارغة (null) إذا لم ينتظر شيء."
            }
        },
        {
            "name": "market.api.bookings.postponement_accept",
            "example": {
                "request": null,
                "response": {
                    "postponement": null
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "postpone_none_waiting"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "postpone_answered"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "postpone_expired"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "postpone_booking_changed"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "postpone_no_commitment"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "postpone_vehicle_busy"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "postpone_window_long"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "postpone_started"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "postpone_trip_shared"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "postpone_window_past"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "postpone_due"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "postpone_conflict"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "postpone_try_again"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "postpone_unavailable"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "POST",
            "path": "/market/bookings/{uuid}/postponement/accept",
            "auth": "app_token",
            "scope": "market:bookings:write",
            "apps": [
                "shipper",
                "carrier"
            ],
            "idempotency_key": true,
            "limit": "write",
            "summary": {
                "en": "The shipper accepts the new date the market proposed for its booking after a breakdown, which moves the vehicle's hold, the order and the trip; the answer carries the proposal still waiting, which is null once answered.",
                "ar": "يقبل الشاحن الموعد الجديد الذي اقترحته السوق لحجزه بعد عطل، فيُنقل حجز المركبة والأمر والرحلة؛ والجواب فيه الاقتراح الذي ما زال منتظرًا، وهو null بعد الجواب."
            }
        },
        {
            "name": "market.api.bookings.postponement_refuse",
            "example": {
                "request": null,
                "response": {
                    "postponement": null
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "postpone_none_waiting"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "postpone_answered"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "postpone_expired"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "POST",
            "path": "/market/bookings/{uuid}/postponement/refuse",
            "auth": "app_token",
            "scope": "market:bookings:write",
            "apps": [
                "shipper",
                "carrier"
            ],
            "idempotency_key": true,
            "limit": "write",
            "summary": {
                "en": "The shipper refuses the new date proposed for its booking, which sends the booking to be ended or to staff; the answer carries the proposal still waiting, which is null once answered.",
                "ar": "يرفض الشاحن الموعد الجديد المقترح لحجزه، فيذهب الحجز إلى الإنهاء أو إلى الموظفين؛ والجواب فيه الاقتراح الذي ما زال منتظرًا، وهو null بعد الجواب."
            }
        },
        {
            "name": "market.api.bookings.return",
            "example": {
                "request": {
                    "latitude": 24.71355,
                    "longitude": 46.67529,
                    "odometer_km": 48980,
                    "fuel_percent": 60,
                    "condition": "كسر في المرآة الجانبية اليمنى.",
                    "damage_claim_halalas": 35000
                },
                "response": {
                    "booking_uuid": "0193a2b4-7c10-7e53-9d2a-6b4f8a1c3e75",
                    "handover": {
                        "recorded_at": "2026-11-24T06:12:40Z",
                        "latitude": 24.71355,
                        "longitude": 46.67529,
                        "odometer_km": 48210,
                        "fuel_percent": 100,
                        "note": "خدوش خفيفة في الصدّام الخلفي."
                    },
                    "return": {
                        "recorded_at": "2026-11-29T08:05:10Z",
                        "latitude": 24.71355,
                        "longitude": 46.67529,
                        "odometer_km": 48980,
                        "fuel_percent": 60,
                        "condition": "كسر في المرآة الجانبية اليمنى."
                    },
                    "late_seconds": 7510,
                    "late_fee_halalas": 9000,
                    "damage_claim_halalas": 35000,
                    "renter_mark_state": null,
                    "collectable_after": "2026-12-01T08:05:10Z"
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "return_not_due"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "place_incomplete"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "place_out_of_range"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "odometer_negative"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "odometer_below_handover"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "fuel_out_of_range"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "claim_out_of_range"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "claim_above_price"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "condition_too_long"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "claim_needs_condition"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "mark_needs_answer"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "mark_answer_without_mark"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "POST",
            "path": "/market/bookings/{uuid}/return",
            "auth": "app_token",
            "scope": "market:rentals:write",
            "apps": [
                "carrier"
            ],
            "idempotency_key": true,
            "limit": "write",
            "summary": {
                "en": "Records the return of a hire that is out by a person of the carrier's company: an optional place, odometer_km (not below the hand-over reading), fuel_percent, the condition of the vehicle and damage_claim_halalas before VAT (it needs a condition of at least 10 characters and cannot exceed the hire price), plus mark_answer (accepted or contested) when the renter has marked the vehicle as returned; the platform works out the late seconds and fee, collection opens after the dispute window (never while a mark is contested), and a second call returns the first record unchanged.",
                "ar": "يسجّل شخص من شركة الناقل إرجاع إيجار خارج بالإيجار: المكان اختياريًا وodometer_km (لا تقل عن قراءة التسليم) وfuel_percent وحالة المركبة وdamage_claim_halalas بالهللات قبل الضريبة (تحتاج وصف حالة من 10 أحرف على الأقل ولا تزيد على سعر الإيجار)، مع mark_answer (accepted أو contested) حين يكون المستأجر قد علّم المركبة مُرجَعة؛ وتحسب المنصة ثواني التأخير ورسمه، ويُفتح التحصيل بعد مهلة الاعتراض (ولا يُفتح ما دام التعليم معترَضًا عليه)، والاستدعاء الثاني يعيد السجل الأول دون تغيير."
            }
        },
        {
            "name": "market.api.bookings.returned",
            "example": {
                "request": null,
                "response": {
                    "booking_uuid": "0193a2b4-7c10-7e53-9d2a-6b4f8a1c3e75",
                    "starts_at": "2026-11-24T06:00:00Z",
                    "ends_at": "2026-11-29T06:00:00Z",
                    "priced_halalas": 275000,
                    "with_driver": false,
                    "handover": {
                        "recorded_at": "2026-11-24T06:12:40Z",
                        "odometer_km": 48210,
                        "fuel_percent": 100,
                        "note": "خدوش خفيفة في الصدّام الخلفي."
                    },
                    "return": null,
                    "late_seconds": 0,
                    "late_fee_halalas": 0,
                    "damage_claim_halalas": 0,
                    "early_return_requested_at": null,
                    "used_halalas": null,
                    "refund_halalas": 0,
                    "extension": null,
                    "declined_extension": null,
                    "renter_returned_at": "2026-11-29T08:20:00Z",
                    "mark_answer": null,
                    "collectable_after": null,
                    "can_ask_extension": false,
                    "can_ask_early_return": false,
                    "can_mark_returned": false,
                    "early_return_refunds_extra_hours": null
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "return_not_due"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "return_mark_not_allowed"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "POST",
            "path": "/market/bookings/{uuid}/returned",
            "auth": "app_token",
            "scope": "market:rentals:rent",
            "apps": [
                "shipper"
            ],
            "idempotency_key": true,
            "limit": "write",
            "summary": {
                "en": "The renter says the vehicle is back with the carrier before the carrier has recorded it, with no body; it is stamped once with the server's time, moves nothing by itself because the carrier answers it when recording the return, and the answer is the hire as it now stands.",
                "ar": "يقول المستأجر إن المركبة عادت إلى الناقل قبل أن يسجّل الناقل ذلك، دون جسم؛ ويُختم مرة واحدة بوقت الخادم ولا يحرّك شيئًا بنفسه لأن الناقل يجيب عنه عند تسجيل الإرجاع، والجواب هو الإيجار كما صار."
            }
        },
        {
            "name": "market.api.bookings.review.appeal",
            "example": {
                "request": null,
                "response": {
                    "stars": 2,
                    "aspects": {
                        "communication": 2
                    },
                    "comment": null,
                    "comment_state": "appealed",
                    "comment_reason": "off_topic",
                    "may_appeal": false,
                    "reply": null,
                    "is_hidden": false,
                    "created_at": "2026-11-26T12:30:00Z"
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "not_writer"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "not_withheld"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "already_appealed"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "POST",
            "path": "/market/bookings/{uuid}/review/comment/appeal",
            "auth": "app_token",
            "scope": "market:reviews:write",
            "apps": [
                "shipper"
            ],
            "idempotency_key": true,
            "limit": "write",
            "summary": {
                "en": "The shipper user who wrote a comment that staff did not show appeals it, once; no body is sent, another staff member decides and that decision is final, and the answer is the review as the read gives it, with the comment now appealed. A colleague of the writer, a comment that was not withheld and a second appeal are refused with a 409.",
                "ar": "يعترض مستخدم الشاحن الذي كتب تعليقًا لم يعرضه الموظفون مرة واحدة؛ بلا جسم، ويقرر موظف آخر وقراره نهائي، والجواب هو التقييم كما تقرؤه القراءة وقد صار تعليقه معترَضًا عليه. ويُرفض بـ409 زميل الكاتب، وتعليق لم يُحجب، واعتراض ثانٍ."
            }
        },
        {
            "name": "market.api.bookings.review.show",
            "example": {
                "request": null,
                "response": {
                    "can_write": false,
                    "reason": "already_reviewed",
                    "review": {
                        "stars": 5,
                        "aspects": {
                            "timeliness": 5,
                            "communication": 4
                        },
                        "comment": "التزام بالموعد وتعامل ممتاز",
                        "comment_state": "passed",
                        "comment_reason": null,
                        "may_appeal": false,
                        "reply": null,
                        "is_hidden": false,
                        "created_at": "2026-11-26T12:30:00Z"
                    }
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/bookings/{uuid}/review",
            "auth": "app_token",
            "scope": "market:reviews:write",
            "apps": [
                "shipper"
            ],
            "idempotency_key": false,
            "limit": null,
            "summary": {
                "en": "Where the shipper's review of one finished booking stands: can_write, the rule that stops it when it cannot be written now (reason), and the review already written with where its comment stands, or null.",
                "ar": "أين وصل تقييم الشاحن لحجز منتهٍ: can_write، والقاعدة التي تمنع كتابته الآن إن لم يجز (reason)، والتقييم المكتوب مع حال تعليقه، أو null."
            }
        },
        {
            "name": "market.api.bookings.review.store",
            "example": {
                "request": {
                    "stars": 5,
                    "aspects": {
                        "timeliness": 5,
                        "communication": 4
                    },
                    "comment": "التزام بالموعد وتعامل ممتاز"
                },
                "response": {
                    "stars": 5,
                    "aspects": {
                        "timeliness": 5,
                        "communication": 4
                    },
                    "comment": "التزام بالموعد وتعامل ممتاز",
                    "comment_state": "waiting",
                    "comment_reason": null,
                    "may_appeal": false,
                    "reply": null,
                    "is_hidden": false,
                    "created_at": "2026-11-26T12:30:00Z"
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "reviews_off"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "not_finished"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "window_closed"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "already_reviewed"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "not_settled"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "same_identity"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "comment_long"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "comment_unsafe"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "comment_contact"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "POST",
            "path": "/market/bookings/{uuid}/review",
            "auth": "app_token",
            "scope": "market:reviews:write",
            "apps": [
                "shipper"
            ],
            "idempotency_key": true,
            "limit": "write",
            "summary": {
                "en": "The shipper writes its one review of a finished, settled booking within the review window: stars from 1 to 5, optional aspects and an optional comment; the answer (201) is the review with where its comment stands.",
                "ar": "يكتب الشاحن تقييمه الوحيد لحجز منتهٍ ومسوّى ضمن مهلة التقييم: نجوم من 1 إلى 5 وجوانب اختيارية وتعليق اختياري؛ والجواب (201) هو التقييم مع حال تعليقه."
            }
        },
        {
            "name": "market.api.bookings.show",
            "example": {
                "request": null,
                "response": {
                    "uuid": "0193a1e0-7b14-7d2a-9c63-5e8a1f4b0d27",
                    "request_uuid": "0193a1c2-5d7e-7c4a-8f21-9b3d6e1a4c07",
                    "departure_uuid": null,
                    "state": "delivered",
                    "arrived_pickup_at": "2026-11-28T05:10:00Z",
                    "left_pickup_at": "2026-11-28T06:40:00Z",
                    "arrived_dropoff_at": "2026-11-28T16:10:00Z",
                    "delivered_at": "2026-11-28T16:35:00Z",
                    "delivered_via": "code",
                    "loading_evidence": "observed",
                    "transit_evidence": "observed",
                    "arrival_evidence": "observed",
                    "reference": "MR-0004217",
                    "route": "الرياض ← جدة",
                    "trips": 1,
                    "kind": "freight",
                    "leg_position": 1,
                    "attempt": 1,
                    "pickup_delay_minutes": 10,
                    "dropoff_delay_minutes": 0,
                    "waiting_for": null,
                    "flags": [],
                    "carrier": {
                        "name": "نقل الوادي",
                        "vehicle": {
                            "vehicle_type": "truck_flatbed",
                            "tons": 12,
                            "year": 2022
                        },
                        "photo_uuid": "0193a1a4-6c2e-7d18-b5f3-8a1d7e4c9b62"
                    },
                    "transfer": {
                        "uuid": "0193a2f0-4b6d-7a39-8c1e-5d7b2a9f3e48",
                        "status": "claimed",
                        "expires_at": "2026-12-02T09:00:00Z",
                        "version": 3,
                        "shipper_approved_at": null
                    }
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/bookings/{uuid}",
            "auth": "app_token",
            "scope": "market:bookings:read",
            "apps": [
                "shipper",
                "carrier"
            ],
            "idempotency_key": false,
            "limit": null,
            "summary": {
                "en": "Returns one booking of the caller's company, as its shipper or its carrier, as the same card a row of the list is, transfer included; a booking of another company is a 404.",
                "ar": "يعيد حجزًا واحدًا من حجوزات شركة المتصل، سواء كانت شاحنه أو ناقله، في البطاقة نفسها التي في صف القائمة ومعها transfer؛ وحجز شركة أخرى يُعامل كأنه غير موجود (404)."
            }
        },
        {
            "name": "market.api.bookings.tracking_link",
            "example": {
                "request": null,
                "response": {
                    "url": "https://example.com/track/0193a1e0-7b14-7d2a-9c63-5e8a1f4b0d27?link=0193a1fa-3b52-7e08-a6c9-4d1f8b2e7a30&expires=1796000000&signature=example"
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "look_only"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "tracking_link_wait"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "POST",
            "path": "/market/bookings/{uuid}/tracking-link",
            "auth": "app_token",
            "scope": "market:bookings:write",
            "apps": [
                "shipper",
                "carrier"
            ],
            "idempotency_key": true,
            "limit": "write",
            "summary": {
                "en": "Issues a signed tracking-page address for the shipper's own booking, from confirmed to delivered, and answers it as url (null when no link can exist for the booking now); the address is a credential to keep private, and asking is limited per person and per booking.",
                "ar": "يصدر عنوانًا موقّعًا لصفحة التتبع لحجز الشاحن نفسه من حالة التأكيد حتى التسليم، ويعيده في الحقل url (فارغ إن تعذّر وجود رابط للحجز الآن)؛ والعنوان بمثابة مفتاح دخول يجب حفظه سرًّا، وطلبه محدود لكل شخص ولكل حجز."
            }
        },
        {
            "name": "market.api.bookings.tracking_link_end",
            "example": {
                "request": null,
                "response": {
                    "ended": 1
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "look_only"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "tracking_link_wait"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "POST",
            "path": "/market/bookings/{uuid}/tracking-link/end",
            "auth": "app_token",
            "scope": "market:bookings:write",
            "apps": [
                "shipper",
                "carrier"
            ],
            "idempotency_key": true,
            "limit": "write",
            "summary": {
                "en": "Ends every open tracking link of the shipper's own booking at once and answers how many were open as ended; the same person and limit rules apply as for asking a link.",
                "ar": "ينهي كل روابط التتبع المفتوحة لحجز الشاحن نفسه دفعة واحدة ويعيد عدد ما كان مفتوحًا في الحقل ended؛ وتسري عليه قواعد الشخص والحد نفسها المطبقة على طلب الرابط."
            }
        },
        {
            "name": "market.api.bookings.transfer",
            "example": {
                "request": null,
                "response": {
                    "transfer": {
                        "uuid": "0193a2b8-5e07-7c13-9d41-6b8f2a0c4e95",
                        "status": "claimed",
                        "expires_at": "2026-11-27T18:00:00Z",
                        "version": 3,
                        "shipper_approved_at": null,
                        "approval": {
                            "due_at": "2026-11-24T14:00:00Z",
                            "carrier": "نقل الوادي",
                            "figures": {
                                "currency": "SAR",
                                "refund_halalas": 287500,
                                "total_excl_vat_halalas": 250000,
                                "vat_bp": 1500,
                                "vat_halalas": 37500,
                                "shipper_commission_halalas": 0,
                                "total_incl_vat_halalas": 287500
                            }
                        }
                    }
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/bookings/{uuid}/transfer",
            "auth": "app_token",
            "scope": "market:bookings:read",
            "apps": [
                "shipper",
                "carrier"
            ],
            "idempotency_key": false,
            "limit": null,
            "summary": {
                "en": "Returns the live urgent offer of one of the caller's own bookings: its carrier sees an open or a claimed one, its shipper only a claimed one it may answer (with transfers:approve, POST /market/transfers/{uuid}/approve and POST /market/transfers/{uuid}/decline); transfer carries uuid, status, expires_at, version, shipper_approved_at and approval, and approval is null except for that shipper while a claim waits within its time: due_at, the claimer's public name in carrier, and figures (refund_halalas, what the current booking was paid with its VAT or null when unpaid; total_excl_vat_halalas, vat_bp, vat_halalas, shipper_commission_halalas, the shipper's part of the platform's commission under the new carrier's terms and zero when none, and total_incl_vat_halalas, the sum of the three, of the new booking at the VAT of the loading day), figures being null when they cannot be worked out now; never the other carrier's company, its vehicle or the payout, and transfer is null when no offer is live or the person may not see it; a booking of another company is not_found.",
                "ar": "يعيد العرض العاجل الحي لأحد حجوزات المتصل: يرى ناقله العرض المفتوح أو المأخوذ، ولا يرى شاحنه إلا المأخوذ الذي يحق له الرد عليه (بنطاق transfers:approve وPOST /market/transfers/{uuid}/approve وPOST /market/transfers/{uuid}/decline)؛ يحمل transfer المعرّف uuid والحالة status وexpires_at وversion وshipper_approved_at وapproval، وapproval يكون null إلا للشاحن نفسه ما دام طلب ناقل ينتظر رده ضمن مهلته: due_at وcarrier اسم الناقل العام وfigures (refund_halalas ما دُفع للحجز الحالي بضريبته أو null إن لم يُدفع، وtotal_excl_vat_halalas وvat_bp وvat_halalas وshipper_commission_halalas وهو حصة الشاحن من عمولة المنصة بحسب شروط الناقل الجديد وصفر إن لم تكن، وtotal_incl_vat_halalas وهو مجموع الثلاثة، للحجز الجديد بضريبة يوم التحميل) وتكون figures بقيمة null حين يتعذّر حسابها الآن؛ ولا يحمل شركة الناقل الآخر ولا مركبته ولا مستحقاته، ويكون transfer بقيمة null حين لا يوجد عرض حي أو لا يحق للشخص رؤيته؛ وحجز شركة أخرى جوابه not_found."
            }
        },
        {
            "name": "market.api.bookings.vehicle_candidates",
            "example": {
                "request": null,
                "response": {
                    "swappable": true,
                    "swaps_left": 2,
                    "candidates": [
                        {
                            "listing": "0193a1b3-6e52-7f14-a8d9-3c0b7e1d5a29",
                            "vehicle": {
                                "vehicle_type": "truck_flatbed",
                                "tons": 12,
                                "year": 2022
                            },
                            "bookable": true
                        },
                        {
                            "listing": "0193a1b3-8a40-7c05-b2e7-4d9f1a6c0e83",
                            "vehicle": {
                                "vehicle_type": "truck_flatbed",
                                "tons": 10,
                                "year": 2020
                            },
                            "bookable": false
                        }
                    ]
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/bookings/{booking}/vehicle-candidates",
            "auth": "app_token",
            "scope": "market:bookings:read",
            "apps": [
                "shipper",
                "carrier"
            ],
            "idempotency_key": false,
            "limit": null,
            "summary": {
                "en": "What the carrier can move one of its own confirmed bookings to now, by the rules the vehicle move applies: swappable says whether the booking can be moved at all (a freight booking before loading with a vehicle held for it and a move left), swaps_left how many moves it has left (two in all), and candidates the carrier's own listings that fit the booking's leg on another vehicle, twenty at most and the lowest ids first, each with its listing id (what the move takes as listing), its vehicle (type, tons, year) and bookable, whether that vehicle is free for the booking's span; empty when the booking cannot be moved. A booking of another company is not_found, and a person who may not move a booking's vehicle is forbidden.",
                "ar": "ما يستطيع الناقل نقل أحد حجوزاته المؤكدة إليه الآن، بقواعد نقل المركبة نفسها: swappable هل يمكن نقل الحجز أصلًا (حجز شحن قبل التحميل وله مركبة محجوزة وبقيت له نقلة)، وswaps_left كم نقلة بقيت له (اثنتان في المجموع)، وcandidates إعلانات الناقل نفسه التي تناسب مرحلة الحجز على مركبة أخرى، عشرون كحد أقصى وأدنى المعرّفات أولًا، لكل منها معرّف إعلانها (وهو ما يأخذه النقل بوصفه listing) ومركبتها (النوع والحمولة بالطن والسنة) وbookable: هل مركبتها حرة في مدة الحجز؛ وهي فارغة إن تعذّر نقل الحجز. وحجز شركة أخرى not_found، ومن ليس له أن ينقل مركبة حجز forbidden."
            }
        },
        {
            "name": "market.api.bookings.vehicle_swap",
            "example": {
                "request": {
                    "listing": "0193a1b3-6e52-7f14-a8d9-3c0b7e1d5a29"
                },
                "response": {
                    "uuid": "0193a1e7-4c20-7b91-a3d5-8e2f6c1b9d40",
                    "request_uuid": "0193a1c2-5d7e-7c4a-8f21-9b3d6e1a4c07",
                    "departure_uuid": null,
                    "state": "confirmed",
                    "arrived_pickup_at": null,
                    "left_pickup_at": null,
                    "arrived_dropoff_at": null,
                    "delivered_at": null,
                    "delivered_via": null,
                    "loading_evidence": null,
                    "transit_evidence": null,
                    "arrival_evidence": null
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "swap_not_before_loading"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "swap_limit_reached"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "swap_no_commitment"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "swap_same_vehicle"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "swap_target_does_not_fit"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "swap_target_busy"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "swap_order_missing"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "swap_trip_shared"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "swap_trip_started"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "swap_vehicle_refused"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "swap_unavailable"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "swap_target_not_yours"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "POST",
            "path": "/market/bookings/{booking}/vehicle",
            "auth": "app_token",
            "scope": "market:bookings:swap_vehicle",
            "apps": [
                "carrier"
            ],
            "idempotency_key": true,
            "limit": "write",
            "summary": {
                "en": "The carrier moves its own confirmed booking, before loading, to another listing of its own that fits the load, named by listing; at most 2 swaps per booking and 10 an hour per company; the answer is the booking.",
                "ar": "ينقل الناقل حجزه المؤكد، قبل التحميل، إلى إعلان آخر له يناسب الحمولة ويسمّيه listing؛ بحد أقصى تبديلان لكل حجز و10 في الساعة لكل شركة؛ والجواب هو الحجز."
            }
        },
        {
            "name": "market.api.bookings.waiting",
            "example": {
                "request": null,
                "response": {
                    "role": "shipper",
                    "terms": {
                        "free_minutes": 120,
                        "hourly_rate_halalas": 30000,
                        "max_billable_hours": 6
                    },
                    "stops": [
                        {
                            "stop": "pickup",
                            "address": "المدينة الصناعية الثانية، الرياض",
                            "window_start": "2026-11-28T05:00:00Z",
                            "visits": [
                                {
                                    "arrived_at": "2026-11-28T05:10:00Z",
                                    "left_at": "2026-11-28T09:40:00Z"
                                }
                            ],
                            "counted_seconds": 16200,
                            "free_seconds": 7200,
                            "billable_seconds": 9000,
                            "amount_halalas": 75000,
                            "claim": {
                                "uuid": "0193a2b7-6c41-7e08-b3d5-9a1f4c7e2d60",
                                "state": "proposed",
                                "amount_halalas": 75000,
                                "payable_by_shipper_halalas": 86250,
                                "commission_halalas": null,
                                "carrier_net_halalas": null,
                                "statement": null,
                                "statement_at": null,
                                "statement_closes_at": "2026-11-30T09:40:00Z",
                                "may_write_statement": true,
                                "decision_note": null,
                                "proposed_at": "2026-11-28T10:00:00Z",
                                "decided_at": null,
                                "payable_from": null,
                                "paid_at": null,
                                "vehicle": "شاحنة 4123 ر س ب",
                                "driver": null
                            }
                        },
                        {
                            "stop": "dropoff",
                            "address": "ميناء جدة الإسلامي",
                            "window_start": "2026-11-29T20:00:00Z",
                            "visits": [],
                            "counted_seconds": 0,
                            "free_seconds": 7200,
                            "billable_seconds": 0,
                            "amount_halalas": 0,
                            "claim": null
                        }
                    ]
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/bookings/{uuid}/waiting",
            "auth": "app_token",
            "scope": "market:bookings:read",
            "apps": [
                "shipper",
                "carrier"
            ],
            "idempotency_key": false,
            "limit": null,
            "summary": {
                "en": "Each side of a freight booking reads the waiting at its booking's stops as its own side sees it: the terms frozen with the offer, each stop's visits with the counted, free and billable time and the amount, and the waiting claim with its state; the shipper sees neither the platform commission nor the carrier's net, and the panel is empty (role null) when the booking carries no waiting terms or the charge is off.",
                "ar": "يقرأ كل طرف في حجز شحن لوحة الانتظار عند محطات حجزه بما يخصّ جانبه: الشروط المجمّدة مع العرض، وزيارات كل محطة والمدة المحسوبة والمجانية والمفوترة والمبلغ، ومطالبة الانتظار بحالتها، ولا يرى الشاحن عمولة المنصة ولا صافي الناقل؛ وتكون اللوحة فارغة (الدور null) إن لم يحمل الحجز شروط انتظار أو كان رسم الانتظار موقوفًا."
            }
        },
        {
            "name": "market.api.bookings.waiting_statement",
            "example": {
                "request": {
                    "statement": "كانت بوابة المصنع مغلقة حتى الظهر ولم نستطع التحميل قبلها."
                },
                "response": {
                    "role": "shipper",
                    "terms": {
                        "free_minutes": 120,
                        "hourly_rate_halalas": 30000,
                        "max_billable_hours": 6
                    },
                    "stops": [
                        {
                            "stop": "pickup",
                            "address": "المدينة الصناعية الثانية، الرياض",
                            "window_start": "2026-11-28T05:00:00Z",
                            "visits": [
                                {
                                    "arrived_at": "2026-11-28T05:10:00Z",
                                    "left_at": "2026-11-28T09:40:00Z"
                                }
                            ],
                            "counted_seconds": 16200,
                            "free_seconds": 7200,
                            "billable_seconds": 9000,
                            "amount_halalas": 75000,
                            "claim": {
                                "uuid": "0193a2b7-6c41-7e08-b3d5-9a1f4c7e2d60",
                                "state": "proposed",
                                "amount_halalas": 75000,
                                "payable_by_shipper_halalas": 86250,
                                "commission_halalas": null,
                                "carrier_net_halalas": null,
                                "statement": "كانت بوابة المصنع مغلقة حتى الظهر ولم نستطع التحميل قبلها.",
                                "statement_at": "2026-11-28T11:30:00Z",
                                "statement_closes_at": "2026-11-30T09:40:00Z",
                                "may_write_statement": false,
                                "decision_note": null,
                                "proposed_at": "2026-11-28T10:00:00Z",
                                "decided_at": null,
                                "payable_from": null,
                                "paid_at": null,
                                "vehicle": "شاحنة 4123 ر س ب",
                                "driver": null
                            }
                        },
                        {
                            "stop": "dropoff",
                            "address": "ميناء جدة الإسلامي",
                            "window_start": "2026-11-29T20:00:00Z",
                            "visits": [],
                            "counted_seconds": 0,
                            "free_seconds": 7200,
                            "billable_seconds": 0,
                            "amount_halalas": 0,
                            "claim": null
                        }
                    ]
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "waiting_claim_decided"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "waiting_statement_written"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "waiting_statement_closed"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "note_length"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "note_contact"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "POST",
            "path": "/market/bookings/{uuid}/waiting/{claim}/statement",
            "auth": "app_token",
            "scope": "market:bookings:write",
            "apps": [
                "shipper",
                "carrier"
            ],
            "idempotency_key": true,
            "limit": "write",
            "summary": {
                "en": "The shipper writes its one statement on a proposed waiting claim of its booking while the statement window is open, even before the claim is decided; text of 3 to 1000 characters with no contact details, and the answer is the same panel with the statement in it; once the claim is decided, a statement is written or the window has closed, a 409 names the reason.",
                "ar": "يكتب الشاحن إفادته الوحيدة على مطالبة انتظار مقترحة لحجزه، خلال نافذة الإفادة ولو لم تُقرَّر بعد؛ نص من 3 إلى 1000 حرف بلا بيانات اتصال، والجواب هو اللوحة نفسها وفيها الإفادة؛ وبعد قرار المطالبة أو كتابة إفادة أو انتهاء النافذة يرد 409 بسببه."
            }
        },
        {
            "name": "market.api.calendar.index",
            "example": {
                "request": null,
                "response": {
                    "month": "2026-12",
                    "company_days": [
                        {
                            "date": "2026-12-20",
                            "kinds": [
                                "blocked"
                            ]
                        },
                        {
                            "date": "2026-12-21",
                            "kinds": [
                                "blocked"
                            ]
                        }
                    ],
                    "listings": [
                        {
                            "listing_uuid": "0193a2f1-b3c4-7e51-8a02-6d9c4f1e7b35",
                            "days": [
                                {
                                    "date": "2026-12-03",
                                    "kinds": [
                                        "booked"
                                    ]
                                },
                                {
                                    "date": "2026-12-20",
                                    "kinds": [
                                        "blocked"
                                    ]
                                },
                                {
                                    "date": "2026-12-21",
                                    "kinds": [
                                        "blocked"
                                    ]
                                }
                            ]
                        },
                        {
                            "listing_uuid": "0193a2f8-9a02-7d4e-b8c1-5e3a7f0d2b64",
                            "days": [
                                {
                                    "date": "2026-12-20",
                                    "kinds": [
                                        "blocked"
                                    ]
                                },
                                {
                                    "date": "2026-12-21",
                                    "kinds": [
                                        "blocked"
                                    ]
                                }
                            ]
                        }
                    ]
                },
                "errors": [
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/calendar",
            "auth": "app_token",
            "scope": "market:bookings:read",
            "apps": [
                "shipper",
                "carrier"
            ],
            "idempotency_key": false,
            "limit": null,
            "summary": {
                "en": "Reads one month of all the company's listings in Saudi days, a page at a time (month=YYYY-MM, page, per_page up to 25; meta.calendar says the page, the size and the total): company_days are the days the company blocks for everything, and each listing has its own days as the single-listing calendar gives them (the company's blocked days included). It needs the right to read bookings.",
                "ar": "يقرأ شهرًا واحدًا لكل إعلانات الشركة بالأيام السعودية، صفحةً صفحة (month=YYYY-MM، وpage، وper_page حتى 25؛ وmeta.calendar تقول الصفحة والحجم والمجموع): company_days أيام تحجبها الشركة لكل شيء، ولكل إعلان أيامه كما يعطيها تقويم الإعلان الواحد (وفيها أيام حجب الشركة). ويحتاج حق قراءة الحجوزات."
            }
        },
        {
            "name": "market.api.carrier.workshops.index",
            "example": {
                "request": null,
                "response": [
                    {
                        "uuid": "0193a2f4-2d61-7b08-9c47-5e1a3f8b6d20",
                        "name": {
                            "ar": "ورشة 1",
                            "en": "Workshop 1"
                        },
                        "branch_uuid": null
                    },
                    {
                        "uuid": "0193a2f4-3e72-7c19-ad58-6f2b4a9c7e31",
                        "name": {
                            "ar": "ورشة الرياض",
                            "en": "Riyadh workshop"
                        },
                        "branch_uuid": "0193a2c0-8b25-7f74-83e9-6dae2f5b7c41"
                    }
                ],
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/carrier/workshops",
            "auth": "app_token",
            "scope": "market:workshops:read",
            "apps": [
                "carrier"
            ],
            "idempotency_key": false,
            "limit": null,
            "summary": {
                "en": "The caller's own company's active workshops as their access context sees them, the ones brought over from the previous market among them: uuid, the name in Arabic and English and branch_uuid; never an address, an ownership or a contact. The company is the token user's own, never taken from the call, and only for a person who may view the branches and places. At most 200; meta.truncated says more were cut.",
                "ar": "ورش شركة المتصل النشطة كما يراها سياق دخوله، ومنها الورش المنقولة من السوق السابق: uuid والاسم بالعربية والإنجليزية وbranch_uuid، ولا عنوان ولا ملكية ولا جهة اتصال. الشركة هي شركة مستخدم الرمز لا من الاستدعاء، ولمن يحق له عرض الفروع والأماكن فقط. حتى 200 ورشة، وmeta.truncated تقول إن الأكثر قُطع."
            }
        },
        {
            "name": "market.api.carriers.whatsapp",
            "example": {
                "request": null,
                "response": {
                    "url": "https://wa.me/966500000000"
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/carriers/{uuid}/whatsapp",
            "auth": "app_token",
            "scope": "market:carriers:contact:read",
            "apps": [
                "shipper"
            ],
            "idempotency_key": false,
            "limit": "heavy",
            "summary": {
                "en": "The WhatsApp link of one carrier by its public id, for a signed-in shipper account only: the link and nothing else, never the number in another field, never cached. A carrier that does not publish a number, is not approved, is the caller's own company or does not exist is the same 404; the answers per account and per carrier are limited each day (429).",
                "ar": "رابط واتساب لناقل واحد بمعرّفه العام، لحساب شاحن مسجّل الدخول فقط: الرابط وحده، ولا يخرج الرقم في أي حقل آخر ولا يُخزَّن مؤقتًا. والناقل الذي لا ينشر رقمًا أو غير المعتمد أو شركة المتصل نفسها أو غير الموجود هو 404 نفسه؛ وعدد الكشوف لكل حساب ولكل ناقل محدود كل يوم (429)."
            }
        },
        {
            "name": "market.api.consolidation.orders",
            "example": {
                "request": null,
                "response": [
                    {
                        "uuid": "5b0a2c1e-7d34-4a8f-9c61-2e8d4f7a1b30",
                        "reference": "MKT-MR-0004217-1",
                        "from_city": "الرياض",
                        "to_city": "مكة المكرمة",
                        "quantity": "8",
                        "quantity_unit": "t",
                        "weight_kg": "8000"
                    },
                    {
                        "uuid": "9f3e6d2a-1c58-4b70-8a94-6d1e0c2b7f45",
                        "reference": "MKT-MR-0004233-1",
                        "from_city": "الرياض",
                        "to_city": "جدة",
                        "quantity": null,
                        "quantity_unit": null,
                        "weight_kg": null
                    },
                    {
                        "uuid": "c41d7a90-3e62-4f18-b5a7-0d9e2c6f8a13",
                        "reference": "MKT-MR-0004251-1",
                        "from_city": "الدمام",
                        "to_city": "الرياض",
                        "quantity": "12",
                        "quantity_unit": "pallet",
                        "weight_kg": "6400"
                    }
                ],
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/consolidation/orders",
            "auth": "app_token",
            "scope": "market:consolidation:read",
            "apps": [
                "carrier"
            ],
            "idempotency_key": false,
            "limit": null,
            "summary": {
                "en": "The carrier's confirmed orders that wait for a trip: reference, the two cities, quantity and weight, never a point, a name or a price.",
                "ar": "الطلبات المؤكدة للناقل التي تنتظر رحلة: المرجع والمدينتان والكمية والوزن، بلا نقطة ولا اسم ولا سعر."
            }
        },
        {
            "name": "market.api.consolidation.route",
            "example": {
                "request": {
                    "query": {
                        "orders": [
                            "5b0a2c1e-7d34-4a8f-9c61-2e8d4f7a1b30",
                            "9f3e6d2a-1c58-4b70-8a94-6d1e0c2b7f45"
                        ]
                    }
                },
                "response": {
                    "method": "exact",
                    "distance_km": 929.4,
                    "stops": [
                        {
                            "position": 1,
                            "side": "pickup",
                            "order_uuid": "5b0a2c1e-7d34-4a8f-9c61-2e8d4f7a1b30",
                            "reference": "MKT-MR-0004217-1",
                            "city": "الرياض",
                            "km": 0
                        },
                        {
                            "position": 2,
                            "side": "pickup",
                            "order_uuid": "9f3e6d2a-1c58-4b70-8a94-6d1e0c2b7f45",
                            "reference": "MKT-MR-0004233-1",
                            "city": "الرياض",
                            "km": 6.2
                        },
                        {
                            "position": 3,
                            "side": "dropoff",
                            "order_uuid": "5b0a2c1e-7d34-4a8f-9c61-2e8d4f7a1b30",
                            "reference": "MKT-MR-0004217-1",
                            "city": "مكة المكرمة",
                            "km": 842.7
                        },
                        {
                            "position": 4,
                            "side": "dropoff",
                            "order_uuid": "9f3e6d2a-1c58-4b70-8a94-6d1e0c2b7f45",
                            "reference": "MKT-MR-0004233-1",
                            "city": "جدة",
                            "km": 929.4
                        }
                    ]
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "need_two_orders"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "order_not_waiting"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "missing_point"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "no_feasible_route"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/consolidation/route",
            "auth": "app_token",
            "scope": "market:consolidation:read",
            "apps": [
                "carrier"
            ],
            "idempotency_key": false,
            "limit": "heavy",
            "summary": {
                "en": "The shortest route that collects and hands over two to twelve of those orders, each pickup before its drop-off; nothing is written.",
                "ar": "أقصر مسار يجمع من اثنين إلى اثني عشر من تلك الطلبات ويسلّمها، كل استلام قبل تسليمه؛ ولا يُكتب شيء."
            }
        },
        {
            "name": "market.api.consolidation.trips.store",
            "example": {
                "request": {
                    "orders": [
                        "5b0a2c1e-7d34-4a8f-9c61-2e8d4f7a1b30",
                        "9f3e6d2a-1c58-4b70-8a94-6d1e0c2b7f45"
                    ],
                    "from": "2026-11-22T04:00:00Z",
                    "until": "2026-11-22T20:00:00Z",
                    "notes": "تحميل مشترك"
                },
                "response": {
                    "trip_reference": "TRP-20261122-0007",
                    "route": {
                        "method": "exact",
                        "distance_km": 929.4,
                        "stops": [
                            {
                                "position": 1,
                                "side": "pickup",
                                "order_uuid": "5b0a2c1e-7d34-4a8f-9c61-2e8d4f7a1b30",
                                "reference": "MKT-MR-0004217-1",
                                "city": "الرياض",
                                "km": 0
                            },
                            {
                                "position": 2,
                                "side": "pickup",
                                "order_uuid": "9f3e6d2a-1c58-4b70-8a94-6d1e0c2b7f45",
                                "reference": "MKT-MR-0004233-1",
                                "city": "الرياض",
                                "km": 6.2
                            },
                            {
                                "position": 3,
                                "side": "dropoff",
                                "order_uuid": "5b0a2c1e-7d34-4a8f-9c61-2e8d4f7a1b30",
                                "reference": "MKT-MR-0004217-1",
                                "city": "مكة المكرمة",
                                "km": 842.7
                            },
                            {
                                "position": 4,
                                "side": "dropoff",
                                "order_uuid": "9f3e6d2a-1c58-4b70-8a94-6d1e0c2b7f45",
                                "reference": "MKT-MR-0004233-1",
                                "city": "جدة",
                                "km": 929.4
                            }
                        ]
                    }
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "need_two_orders"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "order_not_waiting"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "trip_window"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "trip_order_state"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "trip_window_busy"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "no_feasible_route"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "POST",
            "path": "/market/consolidation/trips",
            "auth": "app_token",
            "scope": "market:consolidation:plan",
            "apps": [
                "carrier"
            ],
            "idempotency_key": true,
            "limit": "heavy",
            "summary": {
                "en": "Plans the chosen orders as one trip on the route the planner found, with its time window and a note; the trip is planned exactly as a dispatcher plans one.",
                "ar": "يخطّط الطلبات المختارة رحلة واحدة على المسار الذي وجده المخطِّط، مع نافذتها الزمنية وملاحظة؛ وتُخطَّط الرحلة تمامًا كما يخطّطها المرسِل."
            }
        },
        {
            "name": "market.api.coverage.default_zones.destroy",
            "example": {
                "request": null,
                "response": [],
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "default_zone_in_use"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "DELETE",
            "path": "/market/coverage/default-zones/{zone}",
            "auth": "app_token",
            "scope": "market:listings:write",
            "apps": [
                "carrier"
            ],
            "idempotency_key": true,
            "limit": "write",
            "summary": {
                "en": "Removes one default area of the company by its uuid; the last area stays while a live listing still uses the company areas; the answer is 204 with no body.",
                "ar": "يحذف منطقة افتراضية واحدة للشركة بمعرّفها uuid؛ وتبقى آخر منطقة ما دام إعلان منشور يستعمل مناطق الشركة؛ والجواب 204 بلا جسم."
            }
        },
        {
            "name": "market.api.coverage.default_zones.index",
            "example": {
                "request": null,
                "response": [
                    {
                        "uuid": "0193a2f1-6c4d-7b38-9e15-3a7d5c8f1b24",
                        "name": "الرياض الكبرى",
                        "colour": "#1A7F5A",
                        "shape": "circle",
                        "centre": {
                            "lat": 24.7136,
                            "lng": 46.6753
                        },
                        "radius_km": 50,
                        "vertices": null
                    },
                    {
                        "uuid": "0193a2f1-8e02-7d6a-a4c9-5b1e7f3a9d68",
                        "name": "مدينة جدة",
                        "colour": "#2F6FB5",
                        "shape": "polygon",
                        "centre": null,
                        "radius_km": null,
                        "vertices": [
                            [
                                21.75,
                                39.05
                            ],
                            [
                                21.75,
                                39.35
                            ],
                            [
                                21.3,
                                39.35
                            ],
                            [
                                21.3,
                                39.05
                            ]
                        ]
                    }
                ],
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/coverage/default-zones",
            "auth": "app_token",
            "scope": "market:listings:read",
            "apps": [
                "carrier"
            ],
            "idempotency_key": false,
            "limit": null,
            "summary": {
                "en": "Lists the company's own default service areas, the ones every listing in company-default mode uses; the answer is the whole list, each area with its exact shape.",
                "ar": "يعرض مناطق الخدمة الافتراضية للشركة نفسها، وهي التي يستعملها كل إعلان يختار «مناطق الشركة الافتراضية»؛ والجواب القائمة كلها، لكل منطقة شكلها الدقيق."
            }
        },
        {
            "name": "market.api.coverage.default_zones.replace",
            "example": {
                "request": {
                    "name": "مدينة جدة",
                    "colour": "#2F6FB5",
                    "shape": "polygon",
                    "vertices": [
                        [
                            21.75,
                            39.05
                        ],
                        [
                            21.75,
                            39.35
                        ],
                        [
                            21.3,
                            39.35
                        ],
                        [
                            21.3,
                            39.05
                        ]
                    ]
                },
                "response": {
                    "uuid": "0193a2f1-8e02-7d6a-a4c9-5b1e7f3a9d68",
                    "name": "مدينة جدة",
                    "colour": "#2F6FB5",
                    "shape": "polygon",
                    "centre": null,
                    "radius_km": null,
                    "vertices": [
                        [
                            21.75,
                            39.05
                        ],
                        [
                            21.75,
                            39.35
                        ],
                        [
                            21.3,
                            39.35
                        ],
                        [
                            21.3,
                            39.05
                        ]
                    ]
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "zone_name_required"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "zone_name_invalid"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "zone_name_too_long"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "zone_name_contact"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "zone_colour_invalid"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "bad_radius"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "too_few_vertices"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "too_many_vertices"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "repeated_points"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "self_crossing"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "area_too_small"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "area_too_large"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "outside_permitted_area"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "public_shape_invalid"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "PUT",
            "path": "/market/coverage/default-zones/{zone}",
            "auth": "app_token",
            "scope": "market:listings:write",
            "apps": [
                "carrier"
            ],
            "idempotency_key": true,
            "limit": "write",
            "summary": {
                "en": "Replaces one default area of the company, by its uuid, with a new name, colour and shape; listings that use the company areas see the change at once and none goes back to review.",
                "ar": "يستبدل منطقة افتراضية واحدة للشركة، بمعرّفها uuid، باسم ولون وشكل جديدة؛ وترى الإعلانات التي تستعمل مناطق الشركة التغيير فورًا ولا يعود أي إعلان إلى المراجعة."
            }
        },
        {
            "name": "market.api.coverage.default_zones.store",
            "example": {
                "request": {
                    "name": "الرياض الكبرى",
                    "colour": "#1A7F5A",
                    "shape": "circle",
                    "centre": {
                        "lat": 24.7136,
                        "lng": 46.6753
                    },
                    "radius_km": 50
                },
                "response": {
                    "uuid": "0193a2f1-6c4d-7b38-9e15-3a7d5c8f1b24",
                    "name": "الرياض الكبرى",
                    "colour": "#1A7F5A",
                    "shape": "circle",
                    "centre": {
                        "lat": 24.7136,
                        "lng": 46.6753
                    },
                    "radius_km": 50,
                    "vertices": null
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "limit_reached"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "zone_name_required"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "zone_name_invalid"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "zone_name_too_long"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "zone_name_contact"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "zone_colour_invalid"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "bad_radius"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "too_few_vertices"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "too_many_vertices"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "repeated_points"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "self_crossing"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "area_too_small"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "area_too_large"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "outside_permitted_area"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "public_shape_invalid"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "POST",
            "path": "/market/coverage/default-zones",
            "auth": "app_token",
            "scope": "market:listings:write",
            "apps": [
                "carrier"
            ],
            "idempotency_key": true,
            "limit": "write",
            "summary": {
                "en": "Adds a default service area to the company: a circle (a centre and a radius in kilometres) or a polygon (its vertices as latitude and longitude pairs); the name, the colour and the shape are checked before it is saved, and the company may keep a limited number of areas.",
                "ar": "يضيف منطقة خدمة افتراضية إلى الشركة: دائرة (مركز ونصف قطر بالكيلومتر) أو مضلّع (رؤوسه أزواج خط عرض وخط طول)؛ ويُفحص الاسم واللون والشكل قبل الحفظ، وللشركة عدد محدود من المناطق."
            }
        },
        {
            "name": "market.api.departures.bookings.store",
            "example": {
                "request": {
                    "pickup": 0,
                    "dropoff": 2,
                    "lines": [
                        {
                            "unit": "ton",
                            "quantity": "1.5"
                        }
                    ],
                    "consent": true,
                    "consent_version": "departure-booking-2026-11"
                },
                "response": {
                    "uuid": "0193d0b9-7e03-7a58-9d24-6c1f3b8e5a47",
                    "request_uuid": null,
                    "departure_uuid": "0193d0a1-2c58-7e41-b6a9-4f1d8c3e7a02",
                    "state": "awarded",
                    "arrived_pickup_at": null,
                    "left_pickup_at": null,
                    "arrived_dropoff_at": null,
                    "delivered_at": null,
                    "delivered_via": null,
                    "loading_evidence": null,
                    "transit_evidence": null,
                    "arrival_evidence": null
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "departure_not_open"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "departure_suspended"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "departure_own"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "departure_booking_closed"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "departure_full"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "not_enough_room"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "dimension_not_carried"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "departure_payment_window_short"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "share_commission_unavailable"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "share_token_reused"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "consent_version_stale"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "limit_reached"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "share_lines_invalid"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "share_not_priced"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "share_stops_invalid"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "share_load_invalid"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "share_type_not_accepted"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "consent_required"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "POST",
            "path": "/market/departures/{uuid}/bookings",
            "auth": "app_token",
            "scope": "market:departures:book",
            "apps": [
                "shipper"
            ],
            "idempotency_key": true,
            "limit": "write",
            "summary": {
                "en": "Books a share of a shared trip for the caller's company with the same body as the price (the lines, or the load by weight and volume) and the consent (consent: true with the consent_version the price named; a call that did not agree is 422 consent_required, and one naming a version that is no longer current is 409 consent_version_stale carrying the current words in consent, and the booking records the version, the time and the app session that agreed); one share for each Idempotency-Key, a retry answers the first booking, and the first answer is 201; while payment is required the share is booked as awaiting_payment, holds its room for the payment window (the shorter of the governed window and the time left before the trip closes) and is paid through the booking's payment route, and a trip that closes too soon to pay for it answers 409 departure_payment_window_short.",
                "ar": "يحجز حصة في رحلة مشتركة لشركة المتصل بالجسم نفسه الذي سُعّرت به (البنود أو الحمولة بالوزن والحجم) ومعه الموافقة (consent: true مع consent_version الذي سمّاه السعر؛ ومن لم يوافق يُجاب 422 consent_required، ومن سمّى نسخة لم تعد الحالية يُجاب 409 consent_version_stale ومعه الكلمات الحالية في consent، ويسجّل الحجز النسخة والوقت وجلسة التطبيق التي وافقت)؛ حصة واحدة لكل Idempotency-Key، والإعادة تُجاب بالحجز الأول، وأول جواب 201؛ وما دام الدفع مطلوبًا تُحجز الحصة بحالة awaiting_payment وتحجز مساحتها طوال نافذة الدفع (الأقصر من النافذة المحكومة والوقت الباقي قبل إغلاق الرحلة) وتُدفع عبر مسار دفع الحجز، ورحلة تُغلق قريبًا بما لا يكفي للدفع تُجاب 409 departure_payment_window_short."
            }
        },
        {
            "name": "market.api.departures.index",
            "example": {
                "request": {
                    "query": {
                        "from_city_id": 1024,
                        "to_city_id": 1118,
                        "day": "2026-11-26",
                        "weight": "2.5",
                        "max_price_halalas": 25000,
                        "cargo_type": "building_materials",
                        "sort": "cheapest"
                    }
                },
                "response": [
                    {
                        "id": "0193d0a1-2c58-7e41-b6a9-4f1d8c3e7a02",
                        "from_city": "الرياض",
                        "to_city": "الدمام",
                        "departs_at": "2026-11-26T04:00:00+00:00",
                        "arrives_at": "2026-11-26T09:30:00+00:00",
                        "booking_cutoff_at": "2026-11-25T16:00:00+00:00",
                        "remaining": [
                            {
                                "dimension": "weight",
                                "remaining": 18500
                            },
                            {
                                "dimension": "count:pallet",
                                "remaining": 14
                            }
                        ],
                        "price_from": {
                            "amount_halalas": 12000,
                            "currency": "SAR",
                            "basis": "ton",
                            "excludes_vat": true
                        },
                        "carrier": {
                            "name": "شركة الطريق للنقل",
                            "public_id": "0193b0e7-5a14-7d92-8c3f-9e6b2a4d1f50"
                        },
                        "vehicle_category": {
                            "code": "flatbed_trucks",
                            "label": "سطحة"
                        }
                    }
                ],
                "errors": [
                    {
                        "status": 422,
                        "code": "validation_failed"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/departures",
            "auth": "app_token",
            "scope": "market:departures:read",
            "apps": [
                "shipper"
            ],
            "idempotency_key": false,
            "limit": null,
            "summary": {
                "en": "Lists the shared trips open for booking, a page at a time (the cursor of meta.page.next_cursor), filtered by from_city_id, to_city_id and day (with day_onwards=true the list starts at that day instead of holding only it) and, each optional, by weight (tons) and volume (m³) as plain decimals of up to three places that the trip must still have room for over its whole span, by min_price_halalas and max_price_halalas (the lowest price the carrier set on the trip on any basis, a unit's, the whole truck's or a ton or cubic-metre load rate, before VAT, both ends included and the least not above the greatest; prices on different bases are not comparable with each other, so the two bounds are not the price of one thing), by cargo_type (a code the trip's listing takes) and by carrier (a carrier's public id), in the order of sort (soonest, the default, latest, cheapest by that same lowest price and with the same caution, or largest, the most room left): city names, times, the room left, the price from, the category of the truck (vehicle_category with code and label, null when its listing has none) and the carrier's public name. Only soonest pages by departure time; the other orders rank one scan of the 500 soonest matching trips, so a list longer than that ranks its soonest trips only. A cursor made for one search is refused for another. Each card carries first_unit_price: the first unit the carrier priced, in the order the trip page lists them and in the shape of unit_prices, null when the carrier priced no unit.",
                "ar": "يعرض الرحلات المشتركة المفتوحة للحجز، صفحةً صفحة (مؤشر meta.page.next_cursor)، ويُرشَّح بـ from_city_id وto_city_id وday (ومعه day_onwards=true لتبدأ القائمة من ذلك اليوم لا تقتصر عليه)، وبما يشاء الطلب اختياريًا: weight (بالطن) وvolume (بالمتر المكعب) كعددين عشريين عاديين حتى ثلاث منازل تبقى للرحلة مساحتهما على مداها كله، وmin_price_halalas وmax_price_halalas (أدنى سعر من أي أساس وضعه الناقل على الرحلة، لوحدة أو للشاحنة كاملة أو سعر طن أو متر مكعب لحمولة، قبل الضريبة وكلا الطرفين داخل، والأدنى لا يزيد على الأعلى؛ وأسعار الأسس المختلفة لا تُقارَن ببعضها فليس الحدّان سعرًا لشيء واحد)، وcargo_type (رمز نوع يقبله إعلان الرحلة)، وcarrier (المعرّف العام للناقل)، بترتيب sort (soonest وهو الافتراضي، أو latest أو cheapest بأدنى السعر نفسه وبالتحفظ نفسه، أو largest أي الأكثر مساحة متبقية): أسماء المدن والأوقات والمساحة المتبقية والسعر ابتداءً من وفئة الشاحنة (vehicle_category برمزها واسمها، وnull إن لم تكن لإعلانها فئة) واسم الناقل العلني. وحدها soonest تُرقَّم بوقت المغادرة؛ والترتيبات الأخرى ترتّب مسحًا واحدًا لأقرب 500 رحلة مطابقة، فالقائمة الأطول منه ترتّب أقرب رحلاتها فقط. ومؤشر صُنع لبحث يُرفض لبحث آخر. وكل بطاقة تحمل first_unit_price: أول وحدة سعّرها الناقل بترتيب صفحة الرحلة بالشكل الذي في unit_prices، وnull حين لم يسعّر الناقل وحدة."
            }
        },
        {
            "name": "market.api.departures.preview",
            "example": {
                "request": {
                    "pickup": 0,
                    "dropoff": 2,
                    "lines": [
                        {
                            "unit": "ton",
                            "quantity": "1.5"
                        }
                    ]
                },
                "response": {
                    "subtotal_halalas": 18000,
                    "excludes_vat": true,
                    "shipper_commission_halalas": 0,
                    "vat_halalas": 2700,
                    "total_halalas": 20700,
                    "notice": null,
                    "room": [
                        {
                            "label": "الوزن",
                            "shown": "18.5 طن"
                        }
                    ],
                    "room_later": false,
                    "consent": {
                        "version": "departure-booking-2026-11",
                        "statement": "بتأكيد الحجز توافق على أن الحجز ملزم: تُحجز حصتك في الرحلة بالسعر المعروض ريثما تدفع، وقد يترتب على إلغائه لاحقًا رسم إلغاء."
                    }
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "POST",
            "path": "/market/departures/{uuid}/preview",
            "auth": "app_token",
            "scope": "market:departures:read",
            "apps": [
                "shipper"
            ],
            "idempotency_key": true,
            "limit": "heavy",
            "summary": {
                "en": "Prices a share of a shared trip before it is booked: the position of the stop where the load is picked up and the one where it is dropped, and either the lines (a unit and a plain quantity) or, for a trip that prices a load (load in the trip read), the load: weight in tons and/or volume in cubic metres as plain decimals with up to three places, and optionally the cargo_type code, never both forms in one body and only a measure the trip prices by (by_weight, by_volume), another is refused 422 share_load_invalid on its own field; the answer is the price before VAT, the shipper's part of the commission, the VAT and the total the booking will freeze, any notice, the room the share takes (room, a list of figures; room_later is true instead when this person's reads of the room are used up for the minute, so an empty room then does not mean there is none) and the consent statement a booking must agree to (consent: its version and its words).",
                "ar": "يسعّر حصة في رحلة مشتركة قبل حجزها: موضع محطة الاستلام والمحطة التي يُنزَل فيها، وإما البنود (وحدة وكمية عادية) وإما، لرحلة تسعّر الحمولة (load في قراءة الرحلة)، الحمولة: الوزن بالطن و/أو الحجم بالمتر المكعب كأعداد عشرية عادية حتى ثلاث منازل، ورمز cargo_type اختياريًا، ولا يجتمع الشكلان في جسم واحد ولا يُقبل إلا مقياس تسعّر الرحلة به (by_weight وby_volume) وغيره يُرفض 422 share_load_invalid على حقله؛ والجواب السعر قبل الضريبة وحصة الشاحن من العمولة والضريبة والإجمالي التي سيجمّدها الحجز وأي تنبيه والمساحة التي تأخذها الحصة (room قائمة أرقام، وroom_later تكون true بدلها حين تُستنفد قراءات هذا الشخص للمساحة في الدقيقة، فالقائمة الفارغة حينئذ لا تعني أنه لا مساحة) وبيان الموافقة الذي يلزم الحجزَ أن يوافق عليه (consent: نسخته وكلماته)."
            }
        },
        {
            "name": "market.api.departures.show",
            "example": {
                "request": null,
                "response": {
                    "id": "0193d0a1-2c58-7e41-b6a9-4f1d8c3e7a02",
                    "from_city": "الرياض",
                    "to_city": "الدمام",
                    "departs_at": "2026-11-26T04:00:00+00:00",
                    "arrives_at": "2026-11-26T09:30:00+00:00",
                    "booking_cutoff_at": "2026-11-25T16:00:00+00:00",
                    "remaining": [
                        {
                            "dimension": "weight",
                            "remaining": 18500
                        },
                        {
                            "dimension": "count:pallet",
                            "remaining": 14
                        }
                    ],
                    "price_from": {
                        "amount_halalas": 12000,
                        "currency": "SAR",
                        "basis": "ton",
                        "excludes_vat": true
                    },
                    "carrier": {
                        "name": "شركة الطريق للنقل",
                        "public_id": "0193b0e7-5a14-7d92-8c3f-9e6b2a4d1f50"
                    },
                    "vehicle_category": {
                        "code": "flatbed_trucks",
                        "label": "سطحة"
                    },
                    "trip_days": 1,
                    "estimated_driving_minutes": 410,
                    "return_trip": {
                        "uuid": "0193d0a1-9e17-7c52-b3a6-1d4f8e2c5a60",
                        "turnaround_hours": 8
                    },
                    "stops": [
                        {
                            "position": 0,
                            "city": "الرياض",
                            "loading_allowed": true,
                            "type": "load_only",
                            "lat": 24.7136,
                            "lng": 46.6753,
                            "planned_arrival_at": "2026-11-26T03:30:00+00:00",
                            "planned_departure_at": "2026-11-26T04:00:00+00:00"
                        },
                        {
                            "position": 1,
                            "city": "الهفوف",
                            "loading_allowed": true,
                            "type": "both",
                            "lat": 25.3647,
                            "lng": 49.5878,
                            "planned_arrival_at": "2026-11-26T07:10:00+00:00",
                            "planned_departure_at": "2026-11-26T07:40:00+00:00"
                        },
                        {
                            "position": 2,
                            "city": "الدمام",
                            "loading_allowed": false,
                            "type": "unload_only",
                            "lat": 26.4207,
                            "lng": 50.0888,
                            "planned_arrival_at": "2026-11-26T09:30:00+00:00",
                            "planned_departure_at": "2026-11-26T09:30:00+00:00"
                        }
                    ],
                    "unit_prices": [
                        {
                            "unit": "ton",
                            "name": "طن",
                            "symbol": "طن",
                            "size_mm": null,
                            "price_halalas": 12000,
                            "basis": "route_fraction",
                            "cargo_type": null,
                            "excludes_vat": true
                        },
                        {
                            "unit": "pallet",
                            "name": "طبلية قياسية",
                            "symbol": "طبلية",
                            "size_mm": {
                                "length": 1200,
                                "width": 1000,
                                "height": null
                            },
                            "price_halalas": 18000,
                            "basis": "route_fraction",
                            "cargo_type": {
                                "code": "building_materials",
                                "name": "مواد بناء"
                            },
                            "excludes_vat": true
                        },
                        {
                            "unit": "m3",
                            "name": "متر مكعب",
                            "symbol": "م³",
                            "size_mm": null,
                            "price_halalas": 4500,
                            "basis": "by_load",
                            "cargo_type": null,
                            "excludes_vat": true
                        }
                    ],
                    "units": [
                        {
                            "code": "ton",
                            "symbol": "طن"
                        },
                        {
                            "code": "m3",
                            "symbol": "م³"
                        }
                    ],
                    "load": {
                        "for_every_type": false,
                        "by_weight": true,
                        "by_volume": false,
                        "cargo_types": [
                            {
                                "code": "building_materials",
                                "name": "مواد بناء"
                            }
                        ]
                    },
                    "stretches": [
                        {
                            "from_city": "الرياض",
                            "to_city": "الهفوف",
                            "remaining": [
                                {
                                    "dimension": "weight",
                                    "remaining": 18500
                                }
                            ]
                        },
                        {
                            "from_city": "الهفوف",
                            "to_city": "الدمام",
                            "remaining": [
                                {
                                    "dimension": "weight",
                                    "remaining": 20000
                                }
                            ]
                        }
                    ]
                },
                "errors": [
                    {
                        "status": 404,
                        "code": "not_found"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/departures/{uuid}",
            "auth": "app_token",
            "scope": "market:departures:read",
            "apps": [
                "shipper"
            ],
            "idempotency_key": false,
            "limit": null,
            "summary": {
                "en": "Reads one shared trip: its named stops, each with the position a share names it by (a rest stop takes a position and is not listed, so positions can skip), whether a load can be picked up there (loading_allowed; a share is picked up at a stop that allows it and dropped at a later one), its type (load_only, unload_only or both), and the centre of its city as lat and lng for a map (never the carrier's own point, null when the city has none), the trip's length in whole days rounded up (trip_days), an estimate of its driving time in minutes (estimated_driving_minutes, the legs the carrier typed without the waits; null when there are none), the category of its truck (vehicle_category with code and label; never a plate; null when it has none), the prices the carrier set (unit_prices, only for a trip open to book: each with the unit's code, name and symbol, its size in millimetres when it has one, the price in halalas before VAT with excludes_vat true, how it is counted as route_fraction for the whole route, per_km for each kilometre or by_load for a ton or cubic-metre load rate, and the cargo type it is for or null for every type; no quantity, no minimum, no discount and no room, the whole-truck price being the card's price_from, and a unit nobody priced has no row), its return trip (return_trip with uuid and turnaround_hours, only while that trip is itself offered; null otherwise), the room left on each stretch, the units a line may name (code and symbol in the language of Accept-Language) and, when the trip prices a load, load: whether one price is for every cargo type, whether it is priced by weight and by volume, and the cargo types a load may name (code and name); load is null otherwise.",
                "ar": "يقرأ رحلة مشتركة واحدة: محطاتها المسمّاة، لكلٍّ منها الموضع الذي تُسمّى به الحصة (محطة الاستراحة تأخذ موضعًا ولا تُعرض فقد تُترك أرقام) وهل يجوز التحميل منها (loading_allowed؛ تُحمَّل الحصة من محطة تسمح به وتُنزَّل في محطة لاحقة)، ونوعها (load_only أو unload_only أو both)، ومركز مدينتها lat وlng لخريطة (لا نقطة الناقل نفسه، وnull إن لم يكن للمدينة مركز)، وطول الرحلة بأيام كاملة مقرّبة للأعلى (trip_days)، وتقدير زمن القيادة بالدقائق (estimated_driving_minutes، أي مجموع المقاطع التي كتبها الناقل بلا فترات التوقف؛ وnull إن لم توجد)، وفئة الشاحنة (vehicle_category برمزها واسمها؛ لا لوحة؛ وnull إن لم تكن لها فئة)، والأسعار التي وضعها الناقل (unit_prices، لرحلة مفتوحة للحجز فقط: لكلٍّ رمز الوحدة واسمها ورمزها المعروض وحجمها بالمليمتر إن كان لها وسعرها بالهللات قبل الضريبة مع excludes_vat صحيح وكيف يُحتسب: route_fraction للمسار كاملًا أو per_km لكل كيلومتر أو by_load لسعر طن أو متر مكعب لحمولة ونوع الحمولة الذي له أو null لكل الأنواع؛ بلا كمية ولا حد أدنى ولا خصم ولا مساحة، وسعر الشاحنة كاملة هو price_from في البطاقة، ووحدة لم يسعّرها أحد لا صف لها)، ورحلة عودتها (return_trip بمعرّفها وturnaround_hours، ما دامت تلك الرحلة نفسها معروضة؛ وإلا null)، والمساحة المتبقية على كل مقطع، والوحدات التي يجوز أن يسمّيها السطر (الرمز والرمز المعروض بلغة Accept-Language)، وحين تسعّر الرحلة الحمولة يأتي load: هل سعر واحد لكل أنواع الحمولة، وهل التسعير بالوزن وبالحجم، وأنواع الحمولة التي يجوز أن تسمّيها (الرمز والاسم)؛ ويكون load بقيمة null وإلا."
            }
        },
        {
            "name": "market.api.earnings.show",
            "example": {
                "request": {
                    "query": {
                        "from": "2026-11-01",
                        "to": "2026-11-21",
                        "by": "day"
                    }
                },
                "response": {
                    "currency": "SAR",
                    "from": "2026-11-01",
                    "to": "2026-11-21",
                    "by": "day",
                    "bookings": 6,
                    "price_halalas": 4200000,
                    "commission_halalas": 420000,
                    "net_halalas": 3780000,
                    "earned_halalas": 3780000,
                    "paid_out_halalas": 2250000,
                    "held_now_halalas": 480000,
                    "adjustments_halalas": 0,
                    "buckets": [
                        {
                            "key": "2026-11-03",
                            "bookings": 2,
                            "price_halalas": 1500000,
                            "commission_halalas": 150000,
                            "net_halalas": 1350000,
                            "earned_halalas": 1350000,
                            "paid_out_halalas": 750000
                        },
                        {
                            "key": "2026-11-18",
                            "bookings": 4,
                            "price_halalas": 2700000,
                            "commission_halalas": 270000,
                            "net_halalas": 2430000,
                            "earned_halalas": 2430000,
                            "paid_out_halalas": 1500000
                        }
                    ]
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/earnings",
            "auth": "app_token",
            "scope": "market:wallet:read",
            "apps": [
                "carrier"
            ],
            "idempotency_key": false,
            "limit": "heavy",
            "summary": {
                "en": "The company's earnings from the bookings the market first released in a period, per Saudi day or month: price before VAT, the carrier-borne commission, the net, what was paid out and what is held now.",
                "ar": "أرباح الشركة من الحجوزات التي حرّرها السوق أول مرة في فترة، لكل يوم أو شهر سعودي: السعر قبل الضريبة وعمولة الناقل وصافيه وما دُفع وما هو محجوز الآن."
            }
        },
        {
            "name": "market.api.favourites.destroy",
            "example": {
                "request": null,
                "response": [],
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "DELETE",
            "path": "/market/favourites/{carrier}",
            "auth": "app_token",
            "scope": "market:requests:write",
            "apps": [
                "shipper"
            ],
            "idempotency_key": true,
            "limit": "write",
            "summary": {
                "en": "Takes a carrier out of the shipper company's favourites by its public id and answers 204 with no body; an id that is no favourite of the company changes nothing and says nothing. The carrier is not told.",
                "ar": "يزيل ناقلًا من مفضّلة شركة الشاحن بمعرّفه العام ويجيب 204 بلا جسم؛ ومعرّف ليس من مفضّلة الشركة لا يغيّر شيئًا ولا يقول شيئًا. ولا يُخبَر الناقل."
            }
        },
        {
            "name": "market.api.favourites.index",
            "example": {
                "request": null,
                "response": {
                    "items": [
                        {
                            "carrier": "0193a1e0-6b32-7c8d-9a4f-3e1d5b7c9a21",
                            "name": "شركة المسار للنقل",
                            "added_at": "2026-11-12T09:30:00Z",
                            "verified": true,
                            "rating": {
                                "average": 4.8,
                                "count": 211
                            },
                            "history": {
                                "count": 3,
                                "last_booking": "0193a1d8-4e10-7b2a-8c63-5f9d1a3e7b42",
                                "last_request": "0193a1c2-5d7e-7c4a-8f21-9b3d6e1a4c07",
                                "last_route": "الدمام ← الرياض",
                                "last_at": "2026-11-20T06:00:00Z"
                            }
                        },
                        {
                            "carrier": "0193a1e0-9c41-7d05-a2b7-6e8f0c4d1a53",
                            "name": "أسطول الجسر",
                            "added_at": "2026-11-18T14:05:00Z",
                            "verified": true,
                            "rating": null,
                            "history": null
                        }
                    ],
                    "limit": 50
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/favourites",
            "auth": "app_token",
            "scope": "market:requests:read",
            "apps": [
                "shipper"
            ],
            "idempotency_key": false,
            "limit": null,
            "summary": {
                "en": "Lists the shipper company's own favourite carriers, newest first, up to the limit the answer states: for each, the carrier's public id and name, whether it still stands approved to sell, its average stars and number of reviews once they reach the minimum, and what the company's own bookings with it come to (their number and the latest one with its request, route and time); never the company behind the public id.",
                "ar": "يسرد الناقلين المفضّلين لدى شركة الشاحن نفسها، الأحدث إضافة أولًا حتى الحدّ الذي يذكره الجواب: لكل ناقل معرّف صفحته العامة واسمه، وهل ما زال معتمدًا للبيع، ومتوسط نجومه وعدد تقييماته متى بلغت الحدّ الأدنى، وما تبلغه حجوزات الشركة معه (عددها وآخر حجز بطلبه ومساره ووقته)؛ ولا تظهر الشركة وراء المعرّف العام أبدًا."
            }
        },
        {
            "name": "market.api.favourites.store",
            "example": {
                "request": {
                    "carrier": "0193a1e0-6b32-7c8d-9a4f-3e1d5b7c9a21"
                },
                "response": {
                    "carrier": "0193a1e0-6b32-7c8d-9a4f-3e1d5b7c9a21",
                    "name": "شركة المسار للنقل",
                    "added_at": "2026-11-21T10:15:00Z"
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "limit_reached"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "own_company"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "POST",
            "path": "/market/favourites",
            "auth": "app_token",
            "scope": "market:requests:write",
            "apps": [
                "shipper"
            ],
            "idempotency_key": true,
            "limit": "write",
            "summary": {
                "en": "Adds a carrier to the shipper company's favourites by the public id of its page and answers 201 with the favourite; adding a carrier already kept changes nothing, a company cannot keep itself, and the list holds at most the limit the list states. The carrier is not told.",
                "ar": "يضيف ناقلًا إلى مفضّلة شركة الشاحن بمعرّف صفحته العامة ويجيب 201 بالمفضّل؛ وإضافة ناقل محفوظ لا تغيّر شيئًا، ولا تحتفظ الشركة بنفسها، ولا تزيد القائمة عن الحدّ الذي تذكره. ولا يُخبَر الناقل."
            }
        },
        {
            "name": "market.api.finance.credit_notes.document",
            "example": {
                "request": {
                    "query": {
                        "format": "pdf"
                    }
                },
                "response": {
                    "content_type": "application/pdf",
                    "disposition": "attachment",
                    "cache_control": "no-store, private"
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found",
                        "reason": "document_unavailable"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/credit-notes/{uuid}/document",
            "auth": "app_token",
            "scope": "market:finance:read",
            "apps": [
                "shipper"
            ],
            "idempotency_key": false,
            "limit": "heavy",
            "summary": {
                "en": "Gives one credit note as a printable file (html or pdf) attached to the answer, never cached.",
                "ar": "يعطي الإشعار الدائن ملفًا للطباعة (html أو pdf) مرفقًا بالجواب، بلا تخزين مؤقت."
            }
        },
        {
            "name": "market.api.finance.credit_notes.index",
            "example": {
                "request": {
                    "query": {
                        "invoice": "0193b1f3-7d08-7a64-8e19-0c5b3d9a4f26",
                        "limit": 20
                    }
                },
                "response": [
                    {
                        "uuid": "0193b4d2-9e14-7c36-a7b5-3f8d0e6a2c71",
                        "number": "CN-2026-000031",
                        "invoice_uuid": "0193b1f3-7d08-7a64-8e19-0c5b3d9a4f26",
                        "invoice_number": "MKT-2026-000398",
                        "issue_date": "2026-10-28",
                        "currency": "SAR",
                        "subtotal_halalas": 10000,
                        "tax_halalas": 1500,
                        "total_halalas": 11500
                    }
                ],
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/credit-notes",
            "auth": "app_token",
            "scope": "market:finance:read",
            "apps": [
                "shipper"
            ],
            "idempotency_key": false,
            "limit": null,
            "summary": {
                "en": "Lists the credit notes on the company's market invoices, newest first, a page at a time, filtered by from, until or invoice.",
                "ar": "يعرض الإشعارات الدائنة على فواتير السوق لشركة المتصل، الأحدث أولًا، صفحةً صفحة، ويُرشَّح بـ from وuntil وinvoice."
            }
        },
        {
            "name": "market.api.finance.credit_notes.show",
            "example": {
                "request": null,
                "response": {
                    "uuid": "0193b4d2-9e14-7c36-a7b5-3f8d0e6a2c71",
                    "number": "CN-2026-000031",
                    "invoice_uuid": "0193b1f3-7d08-7a64-8e19-0c5b3d9a4f26",
                    "invoice_number": "MKT-2026-000398",
                    "issue_date": "2026-10-28",
                    "currency": "SAR",
                    "subtotal_halalas": 10000,
                    "tax_halalas": 1500,
                    "total_halalas": 11500
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/credit-notes/{uuid}",
            "auth": "app_token",
            "scope": "market:finance:read",
            "apps": [
                "shipper"
            ],
            "idempotency_key": false,
            "limit": null,
            "summary": {
                "en": "Reads one credit note on a market invoice of the company.",
                "ar": "يقرأ إشعارًا دائنًا واحدًا على فاتورة سوق للشركة."
            }
        },
        {
            "name": "market.api.finance.credit_notes.xml",
            "example": {
                "request": null,
                "response": {
                    "content_type": "application/xml",
                    "disposition": "attachment",
                    "cache_control": "no-store, private"
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found",
                        "reason": "no_tax_document"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/credit-notes/{uuid}/xml",
            "auth": "app_token",
            "scope": "market:finance:read",
            "apps": [
                "shipper"
            ],
            "idempotency_key": false,
            "limit": "heavy",
            "summary": {
                "en": "Gives the credit note's e-invoice XML as an attachment; the answer is 404 no_tax_document when it has none.",
                "ar": "يعطي XML الإشعار الدائن الإلكتروني مرفقًا؛ والجواب 404 no_tax_document إن لم يكن له."
            }
        },
        {
            "name": "market.api.finance.invoices.carriers",
            "example": {
                "request": null,
                "response": [
                    {
                        "public_id": "0193b0e7-5a14-7d92-8c3f-9e6b2a4d1f50",
                        "name": "شركة الطريق للنقل"
                    }
                ],
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/invoices/carriers",
            "auth": "app_token",
            "scope": "market:finance:read",
            "apps": [
                "shipper"
            ],
            "idempotency_key": false,
            "limit": null,
            "summary": {
                "en": "Lists the carriers of the company's most recent market bookings, each with its public id and name and by name, to choose the carrier filter of the invoices from; kept for a few minutes per company; needs the scope only a payer of the company holds.",
                "ar": "يسرد ناقلي أحدث حجوزات السوق للشركة، لكلٍّ معرّفه العام واسمه ومرتبين بالاسم، لتختار منهم مرشّح الناقل في الفواتير؛ ويُحفظ دقائق لكل شركة؛ ويحتاج النطاق الذي لا يملكه إلا من يدفع فواتير الشركة."
            }
        },
        {
            "name": "market.api.finance.invoices.document",
            "example": {
                "request": {
                    "query": {
                        "format": "pdf"
                    }
                },
                "response": {
                    "content_type": "application/pdf",
                    "disposition": "attachment",
                    "cache_control": "no-store, private"
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found",
                        "reason": "document_unavailable"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/invoices/{uuid}/document",
            "auth": "app_token",
            "scope": "market:finance:read",
            "apps": [
                "shipper"
            ],
            "idempotency_key": false,
            "limit": "heavy",
            "summary": {
                "en": "Gives one invoice as a printable file (html or pdf) attached to the answer, never cached.",
                "ar": "يعطي الفاتورة ملفًا للطباعة (html أو pdf) مرفقًا بالجواب، بلا تخزين مؤقت."
            }
        },
        {
            "name": "market.api.finance.invoices.index",
            "example": {
                "request": {
                    "query": {
                        "status": "partially_paid",
                        "from": "2026-11-01",
                        "until": "2026-11-30",
                        "limit": 20
                    }
                },
                "response": [
                    {
                        "uuid": "0193b4a1-6c2e-7d18-9a4f-5e3b1c7d0f92",
                        "number": "MKT-2026-000412",
                        "status": "partially_paid",
                        "kind": "bookings",
                        "currency": "SAR",
                        "issue_date": "2026-11-20",
                        "due_date": "2026-12-04",
                        "subtotal_halalas": 100000,
                        "tax_halalas": 15000,
                        "total_halalas": 115000,
                        "balance_halalas": 65000,
                        "credited_halalas": 0,
                        "transfer_under_review": false,
                        "live_bookings": 1,
                        "booking_uuids": [
                            "0193b49e-1f70-7a53-b8c2-6d4e9a0f3b15"
                        ],
                        "bookings": [
                            {
                                "uuid": "0193b49e-1f70-7a53-b8c2-6d4e9a0f3b15",
                                "reference": "K7Q2M9XD",
                                "from": "الرياض — منطقة الرياض",
                                "to": "جدة — منطقة مكة المكرمة",
                                "carrier": {
                                    "public_id": "0193b0e7-5a14-7d92-8c3f-9e6b2a4d1f50",
                                    "name": "شركة الطريق للنقل"
                                }
                            }
                        ]
                    }
                ],
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/invoices",
            "auth": "app_token",
            "scope": "market:finance:read",
            "apps": [
                "shipper"
            ],
            "idempotency_key": false,
            "limit": null,
            "summary": {
                "en": "Lists the market invoices of the caller's company, newest first, a page at a time (limit up to 50; after takes the cursor of meta.page.next_cursor), filtered by status, from, until, booking, number, service or carrier (the public id the carriers read gives); each invoice names its bookings with the reference, the two places and the carrier's public name; needs the scope only a payer of the company holds.",
                "ar": "يعرض فواتير السوق لشركة المتصل، الأحدث أولًا، صفحةً صفحة (limit حتى 50، وafter يأخذ مؤشر meta.page.next_cursor)، ويُرشَّح بـ status وfrom وuntil وbooking وnumber وservice وcarrier (المعرّف العام الذي تعطيه قراءة الناقلين)؛ وتسمّي كل فاتورة حجوزاتها بالمرجع والمكانين والاسم العام للناقل؛ ويحتاج النطاق الذي لا يملكه إلا من يدفع فواتير الشركة."
            }
        },
        {
            "name": "market.api.finance.invoices.show",
            "example": {
                "request": null,
                "response": {
                    "uuid": "0193b4a1-6c2e-7d18-9a4f-5e3b1c7d0f92",
                    "number": "MKT-2026-000412",
                    "status": "partially_paid",
                    "kind": "bookings",
                    "currency": "SAR",
                    "issue_date": "2026-11-20",
                    "due_date": "2026-12-04",
                    "subtotal_halalas": 100000,
                    "tax_halalas": 15000,
                    "total_halalas": 115000,
                    "balance_halalas": 65000,
                    "credited_halalas": 0,
                    "transfer_under_review": false,
                    "live_bookings": 1,
                    "booking_uuids": [
                        "0193b49e-1f70-7a53-b8c2-6d4e9a0f3b15"
                    ],
                    "bookings": [
                        {
                            "uuid": "0193b49e-1f70-7a53-b8c2-6d4e9a0f3b15",
                            "reference": "K7Q2M9XD",
                            "from": "الرياض — منطقة الرياض",
                            "to": "جدة — منطقة مكة المكرمة",
                            "carrier": {
                                "public_id": "0193b0e7-5a14-7d92-8c3f-9e6b2a4d1f50",
                                "name": "شركة الطريق للنقل"
                            }
                        }
                    ],
                    "lines": [
                        {
                            "booking_uuid": "0193b49e-1f70-7a53-b8c2-6d4e9a0f3b15",
                            "description": "نقل من الرياض إلى جدة",
                            "net_halalas": 100000,
                            "tax_halalas": 15000,
                            "live": true
                        }
                    ]
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/invoices/{uuid}",
            "auth": "app_token",
            "scope": "market:finance:read",
            "apps": [
                "shipper"
            ],
            "idempotency_key": false,
            "limit": null,
            "summary": {
                "en": "Reads one market invoice of the caller's company with its lines and its bookings (reference, places, carrier).",
                "ar": "يقرأ فاتورة سوق واحدة لشركة المتصل مع بنودها وحجوزاتها (المرجع والمكانان والناقل)."
            }
        },
        {
            "name": "market.api.finance.invoices.xml",
            "example": {
                "request": null,
                "response": {
                    "content_type": "application/xml",
                    "disposition": "attachment",
                    "cache_control": "no-store, private"
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found",
                        "reason": "no_tax_document"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/invoices/{uuid}/xml",
            "auth": "app_token",
            "scope": "market:finance:read",
            "apps": [
                "shipper"
            ],
            "idempotency_key": false,
            "limit": "heavy",
            "summary": {
                "en": "Gives the invoice's e-invoice XML as an attachment; the answer is 404 no_tax_document when it has none.",
                "ar": "يعطي XML الفاتورة الإلكترونية مرفقًا؛ والجواب 404 no_tax_document إن لم يكن لها."
            }
        },
        {
            "name": "market.api.finance.money",
            "example": {
                "request": null,
                "response": {
                    "year": 2026,
                    "currency": "SAR",
                    "days_elapsed": 21,
                    "month_to_date_halalas": 100000,
                    "last_month_same_days_halalas": 98000,
                    "trend": [
                        {
                            "month": "2025-12",
                            "net_halalas": 0
                        },
                        {
                            "month": "2026-01",
                            "net_halalas": 0
                        },
                        {
                            "month": "2026-02",
                            "net_halalas": 0
                        },
                        {
                            "month": "2026-03",
                            "net_halalas": 0
                        },
                        {
                            "month": "2026-04",
                            "net_halalas": 0
                        },
                        {
                            "month": "2026-05",
                            "net_halalas": 0
                        },
                        {
                            "month": "2026-06",
                            "net_halalas": 0
                        },
                        {
                            "month": "2026-07",
                            "net_halalas": 0
                        },
                        {
                            "month": "2026-08",
                            "net_halalas": 0
                        },
                        {
                            "month": "2026-09",
                            "net_halalas": 85000
                        },
                        {
                            "month": "2026-10",
                            "net_halalas": 210000
                        },
                        {
                            "month": "2026-11",
                            "net_halalas": 100000
                        }
                    ],
                    "awaiting": {
                        "halalas": 65000,
                        "count": 1,
                        "oldest_on": "2026-11-20",
                        "next_expiry_at": "2026-12-04T20:59:59Z"
                    },
                    "paid_year_halalas": 50000,
                    "refunded_year_halalas": 0,
                    "tax": {
                        "year": 2026,
                        "platform_invoices_halalas": 15000,
                        "carrier_invoices_halalas": 0,
                        "carrier_invoices_bookings": 0,
                        "unknown_halalas": 0
                    }
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 503,
                        "code": "service_unavailable",
                        "reason": "too_many_lines"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/money",
            "auth": "app_token",
            "scope": "market:finance:read",
            "apps": [
                "shipper"
            ],
            "idempotency_key": false,
            "limit": "heavy",
            "summary": {
                "en": "The headline figures of the company's money page: the month so far against last month, a twelve-month trend, what awaits payment, and the year's paid, refunded and tax totals.",
                "ar": "الأرقام الرئيسة لصفحة مال الشركة: الشهر حتى اليوم مقابل الشهر الماضي، واتجاه اثني عشر شهرًا، وما ينتظر الدفع، ومجاميع السنة من مدفوع ومسترد وضريبة."
            }
        },
        {
            "name": "market.api.finance.receipts.document",
            "example": {
                "request": {
                    "query": {
                        "format": "pdf"
                    }
                },
                "response": {
                    "content_type": "application/pdf",
                    "disposition": "attachment",
                    "cache_control": "no-store, private"
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found",
                        "reason": "document_unavailable"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/receipts/{uuid}/document",
            "auth": "app_token",
            "scope": "market:finance:read",
            "apps": [
                "shipper"
            ],
            "idempotency_key": false,
            "limit": "heavy",
            "summary": {
                "en": "Gives one receipt as a printable file (html or pdf) attached to the answer, never cached.",
                "ar": "يعطي الإيصال ملفًا للطباعة (html أو pdf) مرفقًا بالجواب، بلا تخزين مؤقت."
            }
        },
        {
            "name": "market.api.finance.receipts.index",
            "example": {
                "request": {
                    "query": {
                        "invoice": "0193b4a1-6c2e-7d18-9a4f-5e3b1c7d0f92",
                        "limit": 20
                    }
                },
                "response": [
                    {
                        "uuid": "0193b4c7-3a95-7f21-8d60-2b9e5c1a7e48",
                        "invoice_uuid": "0193b4a1-6c2e-7d18-9a4f-5e3b1c7d0f92",
                        "invoice_number": "MKT-2026-000412",
                        "amount_halalas": 50000,
                        "currency": "SAR",
                        "received_on": "2026-11-21",
                        "confirmed_at": "2026-11-21T09:14:22Z",
                        "method": "card",
                        "reference": "RC-2026-000188",
                        "card": {
                            "brand": "mada",
                            "last_four": "4821"
                        }
                    }
                ],
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/receipts",
            "auth": "app_token",
            "scope": "market:finance:read",
            "apps": [
                "shipper"
            ],
            "idempotency_key": false,
            "limit": null,
            "summary": {
                "en": "Lists the receipts of the company's confirmed market payments, newest first, a page at a time, filtered by from, until or invoice; each carries card as one receipt does.",
                "ar": "يعرض إيصالات مدفوعات السوق المؤكدة لشركة المتصل، الأحدث أولًا، صفحةً صفحة، ويُرشَّح بـ from وuntil وinvoice، ولكل إيصال فيها card كما في الإيصال الواحد."
            }
        },
        {
            "name": "market.api.finance.receipts.show",
            "example": {
                "request": null,
                "response": {
                    "uuid": "0193b4c7-3a95-7f21-8d60-2b9e5c1a7e48",
                    "invoice_uuid": "0193b4a1-6c2e-7d18-9a4f-5e3b1c7d0f92",
                    "invoice_number": "MKT-2026-000412",
                    "amount_halalas": 50000,
                    "currency": "SAR",
                    "received_on": "2026-11-21",
                    "confirmed_at": "2026-11-21T09:14:22Z",
                    "method": "card",
                    "reference": "RC-2026-000188",
                    "card": {
                        "brand": "mada",
                        "last_four": "4821"
                    }
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/receipts/{uuid}",
            "auth": "app_token",
            "scope": "market:finance:read",
            "apps": [
                "shipper"
            ],
            "idempotency_key": false,
            "limit": null,
            "summary": {
                "en": "Reads one receipt: our own reference, never the payment provider's charge; a card payment carries card, the brand and last_four of the saved card that paid it, or null for an offline payment and for a card that was not saved.",
                "ar": "يقرأ إيصالًا واحدًا: مرجعنا نحن، لا رقم عملية مزوّد الدفع؛ ودفعة البطاقة معها card وفيه brand وlast_four للبطاقة المحفوظة التي دفعت بها، أو null لدفعة غير بطاقة ولبطاقة لم تُحفظ."
            }
        },
        {
            "name": "market.api.finance.spend",
            "example": {
                "request": {
                    "query": {
                        "from": "2026-11-01",
                        "until": "2026-11-30",
                        "group": "month"
                    }
                },
                "response": {
                    "group": "month",
                    "from": "2026-11-01",
                    "until": "2026-11-30",
                    "currency": "SAR",
                    "net_halalas": 100000,
                    "tax_halalas": 15000,
                    "rows": [
                        {
                            "month": "2026-11",
                            "net_halalas": 100000,
                            "tax_halalas": 15000,
                            "by_service_halalas": {
                                "between_cities": 100000,
                                "within_city": 0,
                                "rental": 0,
                                "equipment": 0
                            },
                            "other_halalas": 0
                        }
                    ],
                    "kpis": {
                        "bookings": 1,
                        "average_net_halalas": 100000,
                        "cost_per_km_halalas": 105,
                        "km_bookings": 1,
                        "km_approximate": false,
                        "most_used_route": {
                            "pickup_city_id": 1024,
                            "dropoff_city_id": 1301,
                            "pickup_city": "الرياض",
                            "dropoff_city": "جدة",
                            "bookings": 1,
                            "net_halalas": 100000
                        },
                        "most_used_carrier": {
                            "carrier_public_id": "0193b0e7-5a14-7d92-8c3f-9e6b2a4d1f50",
                            "carrier_name": "شركة الطريق للنقل",
                            "bookings": 1,
                            "net_halalas": 100000,
                            "own_stars": 4.5,
                            "rated_bookings": 1
                        }
                    }
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/spend",
            "auth": "app_token",
            "scope": "market:finance:read",
            "apps": [
                "shipper"
            ],
            "idempotency_key": false,
            "limit": "heavy",
            "summary": {
                "en": "What the platform invoiced the company for its market bookings over a period, grouped by month, route, carrier or service, in halalas before VAT, with the key figures of the money page.",
                "ar": "ما فوترته المنصة على الشركة عن حجوزات السوق في فترة، مجمّعًا بالشهر أو المسار أو الناقل أو الخدمة (group)، بالهللات قبل الضريبة، مع المؤشرات الرئيسة لصفحة المال."
            }
        },
        {
            "name": "market.api.finance.statement",
            "example": {
                "request": {
                    "query": {
                        "from": "2026-11-01",
                        "until": "2026-11-30",
                        "format": "json"
                    }
                },
                "response": {
                    "from": "2026-11-01",
                    "until": "2026-11-30",
                    "currency": "SAR",
                    "opening_halalas": 0,
                    "closing_halalas": 65000,
                    "debits_halalas": 115000,
                    "credits_halalas": 50000,
                    "entries": [
                        {
                            "date": "2026-11-20",
                            "kind": "invoice",
                            "number": "MKT-2026-000412",
                            "debit_halalas": 115000,
                            "credit_halalas": 0,
                            "balance_halalas": 115000
                        },
                        {
                            "date": "2026-11-21",
                            "kind": "payment",
                            "number": "RC-2026-000188",
                            "debit_halalas": 0,
                            "credit_halalas": 50000,
                            "balance_halalas": 65000
                        }
                    ]
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found",
                        "reason": "document_unavailable"
                    },
                    {
                        "status": 404,
                        "code": "not_found",
                        "reason": "no_billing_profile"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "period"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "too_many_rows"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/statement",
            "auth": "app_token",
            "scope": "market:finance:read",
            "apps": [
                "shipper"
            ],
            "idempotency_key": false,
            "limit": "heavy",
            "summary": {
                "en": "The statement of the company's market invoices and what settled them over a period (from and until, one day each), as figures or, with format, as an html, pdf or xlsx file; a period the statement is not kept for or one too long to give whole is refused, never cut.",
                "ar": "كشف حساب فواتير السوق لشركة المتصل وما سدّدها في فترة (from وuntil، يوم لكل منهما)، أرقامًا أو ملف html أو pdf أو xlsx بمعامل format؛ وفترة لا يحفظ الكشف لها أو أطول من أن يُعطى كاملًا تُرفض ولا تُقصّ."
            }
        },
        {
            "name": "market.api.fleet.drivers",
            "example": {
                "request": null,
                "response": [
                    {
                        "driver_uuid": "0193a2d4-1c52-7a83-b6e1-9d3f0a5c2e84",
                        "name": "سالم العتيبي",
                        "vehicle": "شاحنة مسطحة — أ ب ج 1234",
                        "readiness": "ready",
                        "nearest_document": {
                            "kind": "identity",
                            "ends_on": "2026-12-05"
                        }
                    },
                    {
                        "driver_uuid": "0193a2d4-2d63-7b94-a7f2-0e4a1b6d3f95",
                        "name": null,
                        "vehicle": null,
                        "readiness": "no_vehicle",
                        "nearest_document": null
                    },
                    {
                        "driver_uuid": "0193a2d4-3e74-7ca5-b8a3-1f5b2c7e4a06",
                        "name": "عمر الدوسري",
                        "vehicle": "قلاب — د هـ و 5678",
                        "readiness": "driving_licence",
                        "nearest_document": {
                            "kind": "driving_licence",
                            "ends_on": "2026-11-19"
                        }
                    }
                ],
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/fleet/drivers",
            "auth": "app_token",
            "scope": "market:fleet:drivers:read",
            "apps": [
                "carrier"
            ],
            "idempotency_key": false,
            "limit": "heavy",
            "summary": {
                "en": "The carrier's own active drivers: the vehicle each is on now, whether he can be given a market job or the one reason he cannot, and the nearest ending document (both only for a person who may read licences); the name only for a driver whose page the person may open. At most 500; meta.truncated says a larger list was cut.",
                "ar": "سائقو الناقل العاملون: المركبة التي يقودها كل منهم الآن، وهل يمكن إسناد عمل في السوق إليه أو السبب الوحيد الذي يمنع ذلك، وأقرب وثيقة تنتهي (كلاهما لمن يحق له قراءة التراخيص فقط)؛ والاسم لسائق يحق للشخص فتح صفحته فقط. حتى 500 سائق، وmeta.truncated تقول إن القائمة الأكبر قُطعت."
            }
        },
        {
            "name": "market.api.fleet.vehicles",
            "example": {
                "request": {
                    "query": {
                        "listed": "0"
                    }
                },
                "response": [
                    {
                        "vehicle_uuid": "0193a2e8-5f10-7c3d-9b64-2a8e1d7f0c52",
                        "label": "شاحنة مسطحة — أ ب ج 1234",
                        "listing": {
                            "uuid": "0193a2f1-b3c4-7e51-8a02-6d9c4f1e7b35",
                            "state": "published",
                            "visible": true
                        },
                        "price": "من 1,800 ريال للرحلة",
                        "nearest_document": {
                            "type": "insurance",
                            "ends_on": "2026-12-14"
                        }
                    },
                    {
                        "vehicle_uuid": "0193a2e8-6a27-7d84-8c15-3b9f0e2a7d61",
                        "label": "قلاب — د هـ و 5678",
                        "listing": {
                            "uuid": "0193a2f2-c4d5-7f62-9b13-7e0a5d2f8c46",
                            "state": "draft",
                            "visible": false
                        },
                        "price": null,
                        "nearest_document": {
                            "type": "registration",
                            "ends_on": "2027-03-02"
                        }
                    },
                    {
                        "vehicle_uuid": "0193a2e8-7b38-7e95-a026-4c0a1f3b8e72",
                        "label": "صهريج — ز ح ط 9012",
                        "listing": null,
                        "price": null,
                        "nearest_document": null
                    }
                ],
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/fleet/vehicles",
            "auth": "app_token",
            "scope": "market:fleet:vehicles:read",
            "apps": [
                "carrier"
            ],
            "idempotency_key": false,
            "limit": "heavy",
            "summary": {
                "en": "The carrier's own vehicles that are or can be in the market, each with its label and its listing (state and whether shippers see it); listed=1 keeps the listed ones, listed=0 the ones with no listing (the picker of a new listing). The price words come only for a person who may read prices and the nearest ending document only for a person who may read licences; meta says which. At most 1,000; meta.truncated says a larger fleet was cut.",
                "ar": "مركبات الناقل التي في السوق أو يمكن أن تكون فيه، لكل منها اسمها وإعلانها (الحالة وهل يراه الشاحنون)؛ listed=1 يُبقي المعروضة وlisted=0 يُبقي التي بلا إعلان (منتقي الإعلان الجديد). كلمات السعر لمن يحق له قراءة الأسعار فقط، وأقرب وثيقة تنتهي لمن يحق له قراءة التراخيص فقط، وmeta تقول أيهما. حتى 1000 مركبة، وmeta.truncated تقول إن الأسطول الأكبر قُطع."
            }
        },
        {
            "name": "market.api.items.archive",
            "example": {
                "request": {
                    "version": 3
                },
                "response": {
                    "uuid": "5f8c2f0e-6b1d-4a54-9d37-0a1e4c7b9a10",
                    "kind": "container",
                    "name_ar": "حاوية 40 قدمًا",
                    "name_en": "40 ft container",
                    "description_ar": null,
                    "description_en": null,
                    "size_text": "40 ft, open top",
                    "measure_milli": null,
                    "measure_unit": null,
                    "reference_number": "MSKU 123456",
                    "city_id": 1,
                    "quantity": 6,
                    "is_active": false,
                    "archived_at": "2026-11-22T09:30:00Z",
                    "listing_uuid": null,
                    "version": 4,
                    "created_at": "2026-11-18T09:00:00Z",
                    "updated_at": "2026-11-22T09:30:00Z"
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "stale_version"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "item_archived"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "POST",
            "path": "/market/items/{uuid}/archive",
            "auth": "app_token",
            "scope": "market:listings:write",
            "apps": [
                "carrier"
            ],
            "idempotency_key": true,
            "limit": "write",
            "summary": {
                "en": "Archives one of the carrier's items for good under the version it read (version): it is switched off, its live listing is archived with it and its public pictures are withdrawn; an archived item stays archived. 409 stale_version or item_archived otherwise.",
                "ar": "يؤرشف إحدى معدّات الناقل إلى الأبد تحت النسخة التي قرأها (version): تُوقَف ويُؤرشف إعلانها الحيّ معها وتُسحب صورها العامة؛ والمؤرشفة تبقى مؤرشفة. وإلا 409 stale_version أو item_archived."
            }
        },
        {
            "name": "market.api.items.index",
            "example": {
                "request": null,
                "response": [
                    {
                        "uuid": "5f8c2f0e-6b1d-4a54-9d37-0a1e4c7b9a10",
                        "kind": "container",
                        "name_ar": "حاوية 40 قدمًا",
                        "name_en": "40 ft container",
                        "description_ar": null,
                        "description_en": null,
                        "size_text": "40 ft, open top",
                        "measure_milli": null,
                        "measure_unit": null,
                        "reference_number": "MSKU 123456",
                        "city_id": 1,
                        "quantity": 6,
                        "is_active": true,
                        "archived_at": null,
                        "listing_uuid": "9b2d7e41-3c58-4f06-a1d2-7e6c0b5f8a33",
                        "version": 2,
                        "created_at": "2026-11-18T09:00:00Z",
                        "updated_at": "2026-11-21T12:30:00Z"
                    }
                ],
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/items",
            "auth": "app_token",
            "scope": "market:listings:read",
            "apps": [
                "carrier"
            ],
            "idempotency_key": false,
            "limit": null,
            "summary": {
                "en": "Lists the carrier's own market-only items (a container, a generator: equipment it rents out with no vehicle in the fleet), a page at a time (limit up to 50; after takes the cursor of meta.page.next_cursor), the archived ones left out unless status=archived is asked for; each row has its kind (the code that item-kinds gives), its name and description in both languages, its size text and measure (measure_milli in thousandths with measure_unit, both or neither), its equipment number (reference_number), its city (city_id), how many identical units it offers (quantity), whether it is on (is_active), when it was archived (archived_at, null while it is not), the live listing it is offered through (listing_uuid, null while there is none) and the version a later change must send. Another company's items are never listed.",
                "ar": "يعرض معدّات الناقل نفسه المعروضة في السوق وحده (حاوية، مولّد: معدّات يؤجّرها بلا مركبة في أسطوله) صفحةً صفحة (limit حتى 50، وafter يأخذ مؤشر meta.page.next_cursor)، وتُترك المؤرشفة ما لم يُطلب status=archived؛ ولكل صف نوعه (الرمز الذي تعطيه item-kinds) واسمه ووصفه باللغتين ونص حجمه وقياسه (measure_milli بالأجزاء من ألف مع measure_unit، معًا أو لا شيء) ورقم معدّته (reference_number) ومدينته (city_id) وعدد الوحدات المتماثلة التي يعرضها (quantity) وهل هي مفعّلة (is_active) ومتى أُرشفت (archived_at، وnull ما دامت لم تُرشف) والإعلان الحيّ الذي تُعرض به (listing_uuid، وnull ما دام لا إعلان) والنسخة التي يجب أن يرسلها أي تغيير لاحق. ولا تُعرض معدّات شركة أخرى."
            }
        },
        {
            "name": "market.api.items.kinds",
            "example": {
                "request": null,
                "response": [
                    {
                        "code": "container",
                        "name": "حاوية شحن"
                    },
                    {
                        "code": "generator",
                        "name": "مولد كهرباء"
                    }
                ],
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/item-kinds",
            "auth": "app_token",
            "scope": "market:listings:read",
            "apps": [
                "carrier"
            ],
            "idempotency_key": false,
            "limit": null,
            "summary": {
                "en": "Lists the kinds of item staff offer, in staff's order, each as a code and a name in the caller's language: the code a new item names as its kind.",
                "ar": "يعرض أنواع المعدّات التي يقدّمها الموظفون بترتيبهم، كلٌّ برمز واسم بلغة المتصل: الرمز الذي تسمّيه المعدّة الجديدة نوعًا لها."
            }
        },
        {
            "name": "market.api.items.listing",
            "example": {
                "request": {
                    "service_type": "equipment"
                },
                "response": {
                    "uuid": "0193a2f1-b3c4-7e51-8a02-6d9c4f1e7b35",
                    "state": "draft",
                    "state_reason": null,
                    "state_changed_at": "2026-11-22T09:40:00Z",
                    "service_type": "equipment",
                    "load_mode": null,
                    "vehicle_uuid": null,
                    "item_uuid": "5f8c2f0e-6b1d-4a54-9d37-0a1e4c7b9a10",
                    "rental_enabled": false,
                    "over_capacity_policy": "refuse",
                    "over_capacity_max_trips": null,
                    "is_visible": false,
                    "hidden_reasons": [
                        "not_published"
                    ],
                    "paused_at": null,
                    "archived_at": null,
                    "imported_prices_unconfirmed": false,
                    "version": 1,
                    "created_at": "2026-11-22T09:40:00Z",
                    "updated_at": "2026-11-22T09:40:00Z",
                    "completeness": {
                        "can_submit": false,
                        "required": [
                            {
                                "code": "equipment.no_terms",
                                "message": "حدّد شروط وأسعار هذه المعدّة في تبويب «أسعار المعدّات» قبل إرسال الإعلان للمراجعة."
                            }
                        ],
                        "recommended": []
                    }
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "item_unavailable"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "item_already_listed"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "item_service_not_allowed"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "POST",
            "path": "/market/items/{uuid}/listing",
            "auth": "app_token",
            "scope": "market:listings:write",
            "apps": [
                "carrier"
            ],
            "idempotency_key": true,
            "limit": "write",
            "summary": {
                "en": "Opens the rental or equipment listing of one of the carrier's items (service_type, rental or equipment only; 422 item_service_not_allowed otherwise): a draft listing that the carrier then fills in through the listing routes; the answer is the listing, 201. 409 item_unavailable for an item that is off or archived and item_already_listed when it already has a live listing.",
                "ar": "يفتح إعلان التأجير أو المعدّات لإحدى معدّات الناقل (service_type، التأجير أو المعدّات فقط؛ وإلا 422 item_service_not_allowed): مسودة إعلان يكمل الناقل بياناتها بمسارات الإعلان؛ والجواب الإعلان، 201. و409 item_unavailable لمعدّة موقوفة أو مؤرشفة وitem_already_listed إن كان لها إعلان حيّ."
            }
        },
        {
            "name": "market.api.items.photos",
            "example": {
                "request": null,
                "response": [
                    {
                        "photo_no": 1,
                        "is_public": true,
                        "ready": true
                    },
                    {
                        "photo_no": 2,
                        "is_public": false,
                        "ready": true
                    },
                    {
                        "photo_no": 3,
                        "is_public": false,
                        "ready": false
                    }
                ],
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/items/{uuid}/photos",
            "auth": "app_token",
            "scope": "market:listings:read",
            "apps": [
                "carrier"
            ],
            "idempotency_key": false,
            "limit": null,
            "summary": {
                "en": "Lists the pictures of one of the carrier's own items, in order: the number that names each (photo_no, 1 to 6), whether it is shown to the public (is_public) and whether the file is ready (ready, false while it is still being scanned); no document id and no link leaves. Another company's item is the one 404.",
                "ar": "يعرض صور إحدى معدّات الناقل نفسه بالترتيب: الرقم الذي يسمّي كل صورة (photo_no من 1 إلى 6) وهل هي معروضة للعامة (is_public) وهل الملف جاهز (ready، وfalse ما دام قيد الفحص)؛ ولا يخرج معرّف مستند ولا رابط. ومعدّة شركة أخرى هي الـ404 الواحد."
            }
        },
        {
            "name": "market.api.items.photos.destroy",
            "example": {
                "request": null,
                "response": [],
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "photo_public"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "DELETE",
            "path": "/market/items/{uuid}/photos/{photo}",
            "auth": "app_token",
            "scope": "market:listings:write",
            "apps": [
                "carrier"
            ],
            "idempotency_key": true,
            "limit": "write",
            "summary": {
                "en": "Removes one private picture of an item by its number and answers empty (204); a picture shown to the public cannot be removed by the company (409 photo_public: withdraw it first), and an unknown number is the one 404.",
                "ar": "يزيل صورة خاصة واحدة من المعدّة برقمها ويجيب فارغًا (204)؛ والصورة المعروضة للعامة لا تزيلها الشركة (409 photo_public: اسحبها أولًا)، والرقم المجهول هو الـ404 الواحد."
            }
        },
        {
            "name": "market.api.items.photos.store",
            "example": {
                "request": {
                    "file": "(the picture, sent as multipart/form-data)"
                },
                "response": {
                    "photo_no": 4,
                    "is_public": false,
                    "ready": false
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "limit_reached"
                    },
                    {
                        "status": 413,
                        "code": "payload_too_large"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "photo_type"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "photo_refused"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "POST",
            "path": "/market/items/{uuid}/photos",
            "auth": "app_token",
            "scope": "market:listings:write",
            "apps": [
                "carrier"
            ],
            "idempotency_key": true,
            "limit": "write",
            "summary": {
                "en": "Adds one picture to one of the carrier's items: a multipart form with one file field (file), a JPEG or a PNG, at most six pictures an item; it is kept as a private file of the company and answers the picture as the list reads it, 201. A file the store refuses is 422 photo_refused and another type 422 photo_type, both on file; a seventh picture is 409 limit_reached. The upload limiter and the picture class's size cap apply (413 above it); send an Idempotency-Key header.",
                "ar": "يضيف صورة واحدة إلى إحدى معدّات الناقل: نموذج multipart بحقل ملف واحد (file)، JPEG أو PNG، وبحد ست صور للمعدّة؛ وتُحفظ ملفًّا خاصًّا للشركة ويجيب الصورة كما تقرؤها القائمة، 201. وملف يرفضه المخزن 422 photo_refused ونوع آخر 422 photo_type، كلاهما على file؛ وصورة سابعة 409 limit_reached. وينطبق محدّد الرفع وسقف حجم صنف الصورة (413 فوقه)؛ وأرسل ترويسة Idempotency-Key."
            }
        },
        {
            "name": "market.api.items.photos.withdraw",
            "example": {
                "request": null,
                "response": {
                    "photo_no": 1,
                    "is_public": false,
                    "ready": true
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "POST",
            "path": "/market/items/{uuid}/photos/{photo}/withdraw",
            "auth": "app_token",
            "scope": "market:listings:write",
            "apps": [
                "carrier"
            ],
            "idempotency_key": true,
            "limit": "write",
            "summary": {
                "en": "Takes one of the item's pictures back from the public by its number and answers the picture as the list reads it; staff alone put a picture on show. A picture that was not public changes nothing; another company's item is the one 404.",
                "ar": "يسحب إحدى صور المعدّة من العامة برقمها ويجيب الصورة كما تقرؤها القائمة؛ والموظفون وحدهم يعرضون صورة. والصورة غير المعروضة لا يتغيّر شيء فيها؛ ومعدّة شركة أخرى هي الـ404 الواحد."
            }
        },
        {
            "name": "market.api.items.show",
            "example": {
                "request": null,
                "response": {
                    "uuid": "5f8c2f0e-6b1d-4a54-9d37-0a1e4c7b9a10",
                    "kind": "container",
                    "name_ar": "حاوية 40 قدمًا",
                    "name_en": "40 ft container",
                    "description_ar": null,
                    "description_en": null,
                    "size_text": "40 ft, open top",
                    "measure_milli": null,
                    "measure_unit": null,
                    "reference_number": "MSKU 123456",
                    "city_id": 1,
                    "quantity": 6,
                    "is_active": true,
                    "archived_at": null,
                    "listing_uuid": "9b2d7e41-3c58-4f06-a1d2-7e6c0b5f8a33",
                    "version": 2,
                    "created_at": "2026-11-18T09:00:00Z",
                    "updated_at": "2026-11-21T12:30:00Z"
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/items/{uuid}",
            "auth": "app_token",
            "scope": "market:listings:read",
            "apps": [
                "carrier"
            ],
            "idempotency_key": false,
            "limit": null,
            "summary": {
                "en": "Reads one of the carrier's own items with the same fields as the list; another company's item and an unknown one are the same 404.",
                "ar": "يقرأ إحدى معدّات الناقل نفسه بحقول القائمة نفسها؛ ومعدّة شركة أخرى ومجهولة هما الـ404 الواحد."
            }
        },
        {
            "name": "market.api.items.store",
            "example": {
                "request": {
                    "kind": "container",
                    "name_ar": "حاوية 40 قدمًا",
                    "name_en": "40 ft container",
                    "description_ar": null,
                    "description_en": null,
                    "size_text": "40 ft, open top",
                    "measure_milli": null,
                    "measure_unit": null,
                    "reference_number": "MSKU 123456",
                    "city_id": 1,
                    "quantity": 6,
                    "is_active": true
                },
                "response": {
                    "uuid": "5f8c2f0e-6b1d-4a54-9d37-0a1e4c7b9a10",
                    "kind": "container",
                    "name_ar": "حاوية 40 قدمًا",
                    "name_en": "40 ft container",
                    "description_ar": null,
                    "description_en": null,
                    "size_text": "40 ft, open top",
                    "measure_milli": null,
                    "measure_unit": null,
                    "reference_number": "MSKU 123456",
                    "city_id": 1,
                    "quantity": 6,
                    "is_active": true,
                    "archived_at": null,
                    "listing_uuid": null,
                    "version": 1,
                    "created_at": "2026-11-18T09:00:00Z",
                    "updated_at": "2026-11-21T12:30:00Z"
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "reference_taken"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "POST",
            "path": "/market/items",
            "auth": "app_token",
            "scope": "market:listings:write",
            "apps": [
                "carrier"
            ],
            "idempotency_key": true,
            "limit": "write",
            "summary": {
                "en": "Creates one of the carrier's market-only items from its body (kind, name_ar, name_en, description_ar and description_en or null, size_text or null, measure_milli with measure_unit or neither, reference_number which must be given, city_id, quantity from 1, is_active); the answer is the item with its version, 201. The kind is a code from item-kinds and the unit of size a length, weight or volume unit code from the catalogue units; the English name takes Latin letters only and the equipment number is free in the company among the live items (409 is not used for it: 422 reference_taken). It answers 422 with the rule as reason for a value the writer refuses, naming the body key.",
                "ar": "ينشئ إحدى معدّات الناقل المعروضة في السوق وحده من جسم الطلب (kind وname_ar وname_en وdescription_ar وdescription_en أو null وsize_text أو null وmeasure_milli مع measure_unit أو لا شيء منهما وreference_number وهو مطلوب وcity_id وquantity من 1 وis_active)؛ والجواب المعدّة بنسختها، 201. النوع رمز من item-kinds ووحدة الحجم رمز وحدة طول أو وزن أو حجم من وحدات الكتالوج؛ والاسم الإنجليزي بحروف لاتينية فقط، ورقم المعدّة غير مأخوذ في الشركة بين المعدّات الحيّة (لا 409 له: 422 reference_taken). ويجيب 422 والقاعدة سببًا لقيمة يرفضها الكاتب مسمّيًا مفتاح الجسم."
            }
        },
        {
            "name": "market.api.items.update",
            "example": {
                "request": {
                    "kind": "container",
                    "name_ar": "حاوية 40 قدمًا",
                    "name_en": "40 ft container",
                    "description_ar": null,
                    "description_en": null,
                    "size_text": "40 ft, open top",
                    "measure_milli": null,
                    "measure_unit": null,
                    "reference_number": "MSKU 123456",
                    "city_id": 1,
                    "quantity": 8,
                    "is_active": true,
                    "version": 2
                },
                "response": {
                    "uuid": "5f8c2f0e-6b1d-4a54-9d37-0a1e4c7b9a10",
                    "kind": "container",
                    "name_ar": "حاوية 40 قدمًا",
                    "name_en": "40 ft container",
                    "description_ar": null,
                    "description_en": null,
                    "size_text": "40 ft, open top",
                    "measure_milli": null,
                    "measure_unit": null,
                    "reference_number": "MSKU 123456",
                    "city_id": 1,
                    "quantity": 8,
                    "is_active": true,
                    "archived_at": null,
                    "listing_uuid": "9b2d7e41-3c58-4f06-a1d2-7e6c0b5f8a33",
                    "version": 3,
                    "created_at": "2026-11-18T09:00:00Z",
                    "updated_at": "2026-11-22T08:00:00Z"
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "stale_version"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "item_archived"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "quantity_below_held"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "PUT",
            "path": "/market/items/{uuid}",
            "auth": "app_token",
            "scope": "market:listings:write",
            "apps": [
                "carrier"
            ],
            "idempotency_key": true,
            "limit": "write",
            "summary": {
                "en": "Replaces everything the carrier set on one of its items (the same body as the creation) under the version it read (version); a change that alters nothing writes nothing and answers the item as it is. A count below the units booked or held is 409 quantity_below_held, a stale version 409 stale_version, an archived item 409 item_archived; switching an item off withdraws its public pictures.",
                "ar": "يستبدل كل ما ضبطه الناقل على إحدى معدّاته (الجسم نفسه كالإنشاء) تحت النسخة التي قرأها (version)؛ وتغيير لا يبدّل شيئًا لا يكتب شيئًا ويجيب المعدّة كما هي. وعدد أقل من الوحدات المحجوزة أو الموقوفة 409 quantity_below_held، ونسخة سابقة 409 stale_version، ومعدّة مؤرشفة 409 item_archived؛ وإيقاف المعدّة يسحب صورها العامة."
            }
        },
        {
            "name": "market.api.listings.about",
            "example": {
                "request": null,
                "response": {
                    "version": 3,
                    "description_ar": "شاحنة مبرّدة نظيفة تعمل بين المدن، مع رافعة خلفية.",
                    "description_en": "A clean refrigerated truck working between cities, with a tail lift.",
                    "base_city_id": 1301,
                    "base_city_name": "الرياض — منطقة الرياض"
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/listings/{uuid}/about",
            "auth": "app_token",
            "scope": "market:listings:read",
            "apps": [
                "carrier"
            ],
            "idempotency_key": false,
            "limit": null,
            "summary": {
                "en": "Reads the listing's description in Arabic and English and its base city with its name (null where none is written), with the version a later replace must send.",
                "ar": "يقرأ وصف الإعلان بالعربية وبالإنجليزية ومدينة أساسه باسمها (null لما لم يُكتب)، مع النسخة التي يجب أن يرسلها الاستبدال التالي."
            }
        },
        {
            "name": "market.api.listings.about.replace",
            "example": {
                "request": {
                    "version": 2,
                    "description_ar": "شاحنة مبرّدة نظيفة تعمل بين المدن، مع رافعة خلفية.",
                    "description_en": "A clean refrigerated truck working between cities, with a tail lift.",
                    "base_city_id": 1301
                },
                "response": {
                    "version": 3,
                    "description_ar": "شاحنة مبرّدة نظيفة تعمل بين المدن، مع رافعة خلفية.",
                    "description_en": "A clean refrigerated truck working between cities, with a tail lift.",
                    "base_city_id": 1301,
                    "base_city_name": "الرياض — منطقة الرياض",
                    "listing_state": "submitted"
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "stale_version"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "listing_archived"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "description_too_long"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "description_markup"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "description_contact"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "base_city_not_listed"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "about_for_vehicles_only"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "PUT",
            "path": "/market/listings/{uuid}/about",
            "auth": "app_token",
            "scope": "market:listings:write",
            "apps": [
                "carrier"
            ],
            "idempotency_key": true,
            "limit": "write",
            "summary": {
                "en": "Replaces the listing's description and base city under the version the caller read: all three fields are sent, and null clears one. Plain text up to 20000 characters, without tags, phone numbers, e-mail addresses or links, and a city that is active. A change on an approved or published listing sends it back to review; a save that changes nothing moves nothing. Vehicle listings only. The answer is the section with its new version and the listing's state.",
                "ar": "يستبدل وصف الإعلان ومدينة أساسه بحسب النسخة التي قرأها المتصل: تُرسل الحقول الثلاثة، وnull يمسح الحقل. نص عادي حتى 20000 حرف، بلا وسوم ولا أرقام هاتف ولا بريد ولا روابط، والمدينة من المدن المفعّلة. تغيير في إعلان معتمد أو منشور يعيده إلى المراجعة، والحفظ بلا تغيير لا يحرّك شيئًا. لإعلانات المركبات وحدها. الجواب هو القسم بنسخته الجديدة وحالة الإعلان."
            }
        },
        {
            "name": "market.api.listings.archive",
            "example": {
                "request": {
                    "version": 11
                },
                "response": {
                    "uuid": "0193a2f1-b3c4-7e51-8a02-6d9c4f1e7b35",
                    "state": "published",
                    "state_reason": null,
                    "state_changed_at": "2026-11-20T09:15:00Z",
                    "service_type": "freight",
                    "load_mode": "ftl",
                    "vehicle_uuid": "0193a2e8-5f10-7c3d-9b64-2a8e1d7f0c52",
                    "item_uuid": null,
                    "rental_enabled": false,
                    "over_capacity_policy": "accept",
                    "over_capacity_max_trips": 2,
                    "is_visible": false,
                    "hidden_reasons": [
                        "archived"
                    ],
                    "paused_at": null,
                    "archived_at": null,
                    "imported_prices_unconfirmed": false,
                    "version": 12,
                    "created_at": "2026-11-18T11:02:40Z",
                    "updated_at": "2026-11-21T10:00:00Z",
                    "completeness": {
                        "can_submit": true,
                        "required": [],
                        "recommended": [
                            {
                                "code": "pricing.no_estimated_duration",
                                "message": "أضف مدة الرحلة التقديرية ليستفيد منها الشاحنون والتقويم."
                            }
                        ]
                    }
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "stale_version"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "archive_open_departures"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "archive_open_offers"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "archive_bookings_under_way"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "archive_vehicle_held"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "POST",
            "path": "/market/listings/{uuid}/archive",
            "auth": "app_token",
            "scope": "market:listings:write",
            "apps": [
                "carrier"
            ],
            "idempotency_key": true,
            "limit": "write",
            "summary": {
                "en": "Archives the listing under the version the caller read, once nothing is open on it (no trip, offer, booking under way or held vehicle); an archived listing is no longer shown.",
                "ar": "يؤرشف الإعلان بحسب النسخة التي قرأها المتصل متى لم يبقَ عليه شيء مفتوح (لا رحلة ولا عرض ولا حجز جارٍ ولا مركبة محجوزة)؛ والإعلان المؤرشف لا يُعرض بعدها."
            }
        },
        {
            "name": "market.api.listings.availability",
            "example": {
                "request": null,
                "response": {
                    "version": 2,
                    "mode": "weekly_schedule",
                    "turnaround_buffer_minutes": 60,
                    "instant_accept": false,
                    "instant_accept_at": null,
                    "days": [
                        {
                            "weekday": 0,
                            "is_active": true,
                            "start_minute": 360,
                            "end_minute": 1080
                        },
                        {
                            "weekday": 1,
                            "is_active": true,
                            "start_minute": 360,
                            "end_minute": 1080
                        },
                        {
                            "weekday": 2,
                            "is_active": true,
                            "start_minute": 360,
                            "end_minute": 1080
                        },
                        {
                            "weekday": 3,
                            "is_active": true,
                            "start_minute": 360,
                            "end_minute": 1080
                        },
                        {
                            "weekday": 4,
                            "is_active": true,
                            "start_minute": 360,
                            "end_minute": 1080
                        }
                    ],
                    "blocks": [
                        {
                            "uuid": "0193a2f5-7c20-7e49-a1d6-3b8f5c0e9a24",
                            "date_from": "2026-12-20",
                            "date_to": "2026-12-27",
                            "reason": "maintenance",
                            "note": "صيانة دورية للمركبة"
                        }
                    ],
                    "company_blocks": []
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/listings/{uuid}/availability",
            "auth": "app_token",
            "scope": "market:listings:read",
            "apps": [
                "carrier"
            ],
            "idempotency_key": false,
            "limit": null,
            "summary": {
                "en": "Reads when the listing can be booked: the mode, the turnaround buffer, whether it accepts instantly, the weekly days and the blocked periods, with the version a later replace must send; the days the company blocks for all its listings come as company_blocks.",
                "ar": "يقرأ متى يمكن حجز الإعلان: النمط والمهلة بين رحلتين وهل يقبل فورًا وأيام الأسبوع وفترات الحجب وأيام تحجبها الشركة لكل إعلاناتها باسم company_blocks، مع النسخة التي يجب أن يرسلها الاستبدال اللاحق."
            }
        },
        {
            "name": "market.api.listings.availability.blocks.destroy",
            "example": {
                "request": null,
                "response": [],
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "DELETE",
            "path": "/market/listings/{uuid}/availability/blocks/{block}",
            "auth": "app_token",
            "scope": "market:listings:write",
            "apps": [
                "carrier"
            ],
            "idempotency_key": true,
            "limit": "write",
            "summary": {
                "en": "Removes one blocked period of the listing; the answer is empty (204).",
                "ar": "يزيل فترة حجب واحدة من الإعلان؛ والجواب فارغ (204)."
            }
        },
        {
            "name": "market.api.listings.availability.blocks.store",
            "example": {
                "request": {
                    "date_from": "2026-12-20",
                    "date_to": "2026-12-27",
                    "reason": "maintenance",
                    "note": "صيانة دورية للمركبة"
                },
                "response": {
                    "uuid": "0193a2f5-7c20-7e49-a1d6-3b8f5c0e9a24",
                    "date_from": "2026-12-20",
                    "date_to": "2026-12-27",
                    "reason": "maintenance",
                    "note": "صيانة دورية للمركبة"
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "listing_archived"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "limit_reached"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "block_period_invalid"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "block_too_long"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "note_invalid"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "note_too_long"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "POST",
            "path": "/market/listings/{uuid}/availability/blocks",
            "auth": "app_token",
            "scope": "market:listings:write",
            "apps": [
                "carrier"
            ],
            "idempotency_key": true,
            "limit": "write",
            "summary": {
                "en": "Blocks the listing for a period (date_from to date_to, a reason of leave, maintenance or other, and an optional note); the answer is the block.",
                "ar": "يحجب الإعلان لفترة (date_from إلى date_to، والسبب leave أو maintenance أو other، وملاحظة اختيارية)؛ والجواب هو الحجب."
            }
        },
        {
            "name": "market.api.listings.availability.replace",
            "example": {
                "request": {
                    "version": 1,
                    "mode": "weekly_schedule",
                    "turnaround_buffer_minutes": 60,
                    "instant_accept": false,
                    "days": [
                        {
                            "weekday": 0,
                            "is_active": true,
                            "start_minute": 360,
                            "end_minute": 1080
                        },
                        {
                            "weekday": 1,
                            "is_active": true,
                            "start_minute": 360,
                            "end_minute": 1080
                        },
                        {
                            "weekday": 2,
                            "is_active": true,
                            "start_minute": 360,
                            "end_minute": 1080
                        },
                        {
                            "weekday": 3,
                            "is_active": true,
                            "start_minute": 360,
                            "end_minute": 1080
                        },
                        {
                            "weekday": 4,
                            "is_active": true,
                            "start_minute": 360,
                            "end_minute": 1080
                        }
                    ]
                },
                "response": {
                    "version": 2,
                    "mode": "weekly_schedule",
                    "turnaround_buffer_minutes": 60,
                    "instant_accept": false,
                    "instant_accept_at": null,
                    "days": [
                        {
                            "weekday": 0,
                            "is_active": true,
                            "start_minute": 360,
                            "end_minute": 1080
                        },
                        {
                            "weekday": 1,
                            "is_active": true,
                            "start_minute": 360,
                            "end_minute": 1080
                        },
                        {
                            "weekday": 2,
                            "is_active": true,
                            "start_minute": 360,
                            "end_minute": 1080
                        },
                        {
                            "weekday": 3,
                            "is_active": true,
                            "start_minute": 360,
                            "end_minute": 1080
                        },
                        {
                            "weekday": 4,
                            "is_active": true,
                            "start_minute": 360,
                            "end_minute": 1080
                        }
                    ],
                    "blocks": [
                        {
                            "uuid": "0193a2f5-7c20-7e49-a1d6-3b8f5c0e9a24",
                            "date_from": "2026-12-20",
                            "date_to": "2026-12-27",
                            "reason": "maintenance",
                            "note": "صيانة دورية للمركبة"
                        }
                    ],
                    "company_blocks": [],
                    "listing_state": "draft"
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "stale_version"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "listing_archived"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "buffer_invalid"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "weekday_invalid"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "hours_invalid"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "duplicate_weekday"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "consent_company_level"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "PUT",
            "path": "/market/listings/{uuid}/availability",
            "auth": "app_token",
            "scope": "market:listings:write",
            "apps": [
                "carrier"
            ],
            "idempotency_key": true,
            "limit": "write",
            "summary": {
                "en": "Replaces the listing's availability (mode, turnaround buffer, weekly days and, where the company allows it, instant accept) under the version the caller read; the answer is the new availability with listing_state.",
                "ar": "يستبدل توفر الإعلان (النمط والمهلة بين رحلتين وأيام الأسبوع، والقبول الفوري حيث تسمح به الشركة) بحسب النسخة التي قرأها المتصل؛ والجواب هو التوفر الجديد مع listing_state."
            }
        },
        {
            "name": "market.api.listings.bookings.store",
            "example": {
                "request": {
                    "pickup": {
                        "city_id": 1024,
                        "city": "الرياض",
                        "district_id": null,
                        "lat": 24.6877,
                        "lng": 46.7219,
                        "address": "المدينة الصناعية الثانية، الرياض",
                        "note": null
                    },
                    "dropoff": {
                        "city_id": 1301,
                        "city": "جدة",
                        "district_id": null,
                        "lat": 21.4858,
                        "lng": 39.1925,
                        "address": "ميناء جدة الإسلامي",
                        "note": null
                    },
                    "window_starts_at": "2026-11-28T04:00:00Z",
                    "window_ends_at": "2026-11-29T20:00:00Z",
                    "cargo_type_id": 7,
                    "cargo_weight_kg": 22000,
                    "urgent": false,
                    "extras": [
                        {
                            "code": "loading_unloading",
                            "quantity": 1
                        }
                    ],
                    "expected_total_halalas": 436500,
                    "consent": true,
                    "consent_version": "direct-booking-2026-11"
                },
                "response": {
                    "uuid": "0193a2fa-4d18-7c6b-9e03-7a5f2b8d1c46",
                    "reference": "MR-0004230",
                    "state": "open",
                    "service_type": "freight",
                    "title": null,
                    "load_mode": null,
                    "cargo": {
                        "type": "مواد بناء",
                        "type_code": "building_materials",
                        "note": null,
                        "weight_kg": 22000,
                        "volume_m3": null,
                        "length_cm": null,
                        "width_cm": null,
                        "height_cm": null,
                        "value_halalas": null
                    },
                    "liquid": {
                        "type": null,
                        "type_code": null,
                        "quantity": null,
                        "unit": null
                    },
                    "answers": [],
                    "rental": {
                        "model": null,
                        "hours": null,
                        "with_driver": null
                    },
                    "pickup": {
                        "city_id": 1024,
                        "city": "الرياض",
                        "district_id": null,
                        "lat": 24.6877,
                        "lng": 46.7219,
                        "address": "المدينة الصناعية الثانية، الرياض",
                        "note": null
                    },
                    "dropoff": {
                        "city_id": 1301,
                        "city": "جدة",
                        "district_id": null,
                        "lat": 21.4858,
                        "lng": 39.1925,
                        "address": "ميناء جدة الإسلامي",
                        "note": null
                    },
                    "window": {
                        "starts_at": "2026-11-28T04:00:00Z",
                        "ends_at": "2026-11-29T20:00:00Z"
                    },
                    "offers_close_at": "2026-11-22T09:30:00Z",
                    "budget": null,
                    "live_offers_count": 0,
                    "direct": true,
                    "legs": [
                        {
                            "uuid": "0193a2fa-4d2c-7e15-8b70-3c9a1f5e6d82",
                            "position": 1,
                            "state": "open",
                            "vehicle_type": null,
                            "body_type": null,
                            "category": null,
                            "min_tons": null,
                            "min_m3": null,
                            "needs": {
                                "refrigerated": false,
                                "tanker": false,
                                "crane": false,
                                "tracking": false
                            },
                            "weight_kg": null,
                            "volume_m3": null,
                            "cancel_reason": null
                        }
                    ],
                    "cancel_reason": null,
                    "opened_at": "2026-11-21T09:30:00Z",
                    "created_at": "2026-11-21T09:30:00Z",
                    "updated_at": "2026-11-21T09:30:00Z",
                    "offer_mode": "sealed",
                    "award_ends_at": null,
                    "auction_extensions": null,
                    "bidding_closed_early_at": null
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 403,
                        "code": "plan_feature_required",
                        "reason": "market.shipper"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 409,
                        "code": "idempotency_conflict"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "already_waiting"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "own_listing"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "listing_unavailable"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "window_unavailable"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "price_unavailable"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "distance_unavailable"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "direct_not_offered"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "price_changed"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "request_gone"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "limit_reached"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "consent_required"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "over_capacity"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "one_truck_only"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "unit_not_offered"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "units_unavailable"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "extra_unavailable"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "verification_incomplete"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited",
                        "reason": "discount_code_limit"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "POST",
            "path": "/market/listings/{uuid}/bookings",
            "auth": "app_token",
            "scope": "market:requests:write",
            "apps": [
                "shipper"
            ],
            "idempotency_key": true,
            "limit": "write",
            "summary": {
                "en": "Asks the carrier of one listed vehicle for it: the load as in the quote, the total the caller expects (expected_total_halalas) and the consent (consent: true with its consent_version); a price changed since the quote is 409 price_changed with the new quote; the answer is the booking request, and a repeat with the same Idempotency-Key answers the first.",
                "ar": "يطلب من ناقل مركبة معروضة حجزها: الحمولة كما في التسعير والإجمالي الذي يتوقعه المتصل (expected_total_halalas) والموافقة (consent: true مع consent_version)؛ والسعر الذي تغيّر منذ التسعير 409 بالسبب price_changed مع التسعير الجديد؛ والجواب هو طلب الحجز، والتكرار بمفتاح Idempotency-Key نفسه يعيد جواب الأول."
            }
        },
        {
            "name": "market.api.listings.calendar",
            "example": {
                "request": null,
                "response": {
                    "month": "2026-12",
                    "days": [
                        {
                            "date": "2026-12-03",
                            "kinds": [
                                "booked"
                            ]
                        },
                        {
                            "date": "2026-12-04",
                            "kinds": [
                                "booked",
                                "blocked"
                            ]
                        },
                        {
                            "date": "2026-12-10",
                            "kinds": [
                                "locked"
                            ]
                        },
                        {
                            "date": "2026-12-20",
                            "kinds": [
                                "blocked"
                            ]
                        },
                        {
                            "date": "2026-12-21",
                            "kinds": [
                                "blocked"
                            ]
                        }
                    ]
                },
                "errors": [
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/listings/{uuid}/calendar",
            "auth": "app_token",
            "scope": "market:bookings:read",
            "apps": [
                "shipper",
                "carrier"
            ],
            "idempotency_key": false,
            "limit": null,
            "summary": {
                "en": "Reads one month of the listing's vehicle in Saudi days (month=YYYY-MM, this month when omitted): each day that is taken is a line with its date and what takes it, kinds being booked (a booking), locked (a short hold) or blocked (a day the listing or the company blocked); a day nothing takes is not listed. It needs the right to read bookings; a listing of another company, or a person without that right, is not_found.",
                "ar": "يقرأ شهرًا واحدًا من مركبة الإعلان بالأيام السعودية (month=YYYY-MM، وهذا الشهر إن حُذف): كل يوم مأخوذ سطر بتاريخه وما يأخذه، والأنواع booked (حجز) وlocked (حجز مؤقت قصير) وblocked (يوم حجبه الإعلان أو الشركة)؛ واليوم الذي لا يأخذه شيء لا يُذكر. ويحتاج حق قراءة الحجوزات؛ وإعلان شركة أخرى أو شخص بلا هذا الحق not_found."
            }
        },
        {
            "name": "market.api.listings.cargo_agreements",
            "example": {
                "request": null,
                "response": [
                    {
                        "cargo_type": "cars",
                        "kind": "goods",
                        "agreed": false,
                        "under_review": true,
                        "requires_hazmat": false,
                        "requires_permit": false,
                        "needs_dedicated_vehicle": false
                    },
                    {
                        "cargo_type": "hazmat",
                        "kind": "goods",
                        "agreed": true,
                        "under_review": false,
                        "requires_hazmat": true,
                        "requires_permit": true,
                        "needs_dedicated_vehicle": false
                    }
                ],
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/listings/{uuid}/cargo-agreements",
            "auth": "app_token",
            "scope": "market:listings:read",
            "apps": [
                "carrier"
            ],
            "idempotency_key": false,
            "limit": null,
            "summary": {
                "en": "Reads the restricted cargo kinds that suit the listing (hazardous, permit-bound, needing a vehicle of its own, or one of the four kinds the market holds for staff review while their restrictions are undecided), each with whether the carrier agreed to it; a listing takes such a kind only when the carrier agreed.",
                "ar": "يقرأ أنواع الحمولة المقيّدة التي تناسب الإعلان (الخطرة أو التي تحتاج تصريحًا أو مركبة مخصصة، أو أحد الأنواع الأربعة التي يمسكها السوق لمراجعة الموظف ما دامت قيودها لم تُحسم)، ومع كل نوع هل وافق الناقل عليه؛ ولا يقبل الإعلان نوعًا كهذا إلا إذا وافق الناقل."
            }
        },
        {
            "name": "market.api.listings.cargo_agreements.agree",
            "example": {
                "request": null,
                "response": {
                    "cargo_type": "cars",
                    "kind": "goods",
                    "agreed": true,
                    "under_review": true,
                    "requires_hazmat": false,
                    "requires_permit": false,
                    "needs_dedicated_vehicle": false,
                    "listing_state": "draft"
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "listing_archived"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "cargo_not_for_listing"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "cargo_not_restricted"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "PUT",
            "path": "/market/listings/{uuid}/cargo-agreements/{cargo_type}",
            "auth": "app_token",
            "scope": "market:listings:write",
            "apps": [
                "carrier"
            ],
            "idempotency_key": true,
            "limit": "write",
            "summary": {
                "en": "Records the carrier's agreement to one restricted cargo kind (named by its code in the path) on the listing; repeating it changes nothing; an approved or published listing goes back to review; refused when the kind does not suit the listing or needs no agreement; the request sends no body and the answer is the row with listing_state.",
                "ar": "يسجّل موافقة الناقل على نوع حمولة مقيّد واحد (باسمه في المسار) في الإعلان؛ وتكرارها لا يغيّر شيئًا؛ ويعود الإعلان المعتمد أو المنشور إلى المراجعة؛ ويُرفض إن لم يناسب النوعُ الإعلانَ أو لم يحتج موافقة؛ ولا يرسل الطلب جسمًا والجواب هو الصف مع listing_state."
            }
        },
        {
            "name": "market.api.listings.cargo_agreements.withdraw",
            "example": {
                "request": null,
                "response": {
                    "cargo_type": "cars",
                    "kind": "goods",
                    "agreed": false,
                    "under_review": true,
                    "requires_hazmat": false,
                    "requires_permit": false,
                    "needs_dedicated_vehicle": false,
                    "listing_state": "draft"
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "listing_archived"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "DELETE",
            "path": "/market/listings/{uuid}/cargo-agreements/{cargo_type}",
            "auth": "app_token",
            "scope": "market:listings:write",
            "apps": [
                "carrier"
            ],
            "idempotency_key": true,
            "limit": "write",
            "summary": {
                "en": "Takes the carrier's agreement to one restricted cargo kind back; repeating it changes nothing; an approved or published listing goes back to review; the request sends no body and the answer is the row with listing_state.",
                "ar": "يسحب موافقة الناقل على نوع حمولة مقيّد واحد؛ وتكرار السحب لا يغيّر شيئًا؛ ويعود الإعلان المعتمد أو المنشور إلى المراجعة؛ ولا يرسل الطلب جسمًا والجواب هو الصف مع listing_state."
            }
        },
        {
            "name": "market.api.listings.cargo_limits",
            "example": {
                "request": null,
                "response": {
                    "version": 3,
                    "weight_kg": 24000,
                    "volume_l": 90000,
                    "length_mm": 13600,
                    "width_mm": 2550,
                    "height_mm": 3000
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/listings/{uuid}/cargo-limits",
            "auth": "app_token",
            "scope": "market:listings:read",
            "apps": [
                "carrier"
            ],
            "idempotency_key": false,
            "limit": null,
            "summary": {
                "en": "Reads the largest load the listing takes (weight in kg, volume in litres, length, width and height in mm; null where none is set), with the version a later replace must send.",
                "ar": "يقرأ أكبر حمولة يقبلها الإعلان (الوزن بالكيلوجرام والحجم باللتر والطول والعرض والارتفاع بالمليمتر؛ وnull حيث لا حد)، مع النسخة التي يجب أن يرسلها الاستبدال اللاحق."
            }
        },
        {
            "name": "market.api.listings.cargo_limits.replace",
            "example": {
                "request": {
                    "version": 2,
                    "weight_kg": 24000,
                    "volume_l": 90000,
                    "length_mm": 13600,
                    "width_mm": 2550,
                    "height_mm": 3000
                },
                "response": {
                    "uuid": "0193a2f1-b3c4-7e51-8a02-6d9c4f1e7b35",
                    "state": "draft",
                    "state_reason": null,
                    "state_changed_at": "2026-11-18T11:02:40Z",
                    "service_type": "freight",
                    "load_mode": "ftl",
                    "vehicle_uuid": "0193a2e8-5f10-7c3d-9b64-2a8e1d7f0c52",
                    "item_uuid": null,
                    "rental_enabled": false,
                    "over_capacity_policy": "accept",
                    "over_capacity_max_trips": 2,
                    "is_visible": false,
                    "hidden_reasons": [
                        "not_published"
                    ],
                    "paused_at": null,
                    "archived_at": null,
                    "imported_prices_unconfirmed": false,
                    "version": 3,
                    "created_at": "2026-11-18T11:02:40Z",
                    "updated_at": "2026-11-18T11:31:05Z",
                    "completeness": {
                        "can_submit": false,
                        "required": [
                            {
                                "code": "coverage.no_scope",
                                "message": "حدد أين تخدم: اختر أنواع الرحلات والمنطقة قبل إرسال الإعلان للمراجعة."
                            },
                            {
                                "code": "pricing.no_active_sheet",
                                "message": "أضف قائمة أسعار قبل إرسال الإعلان للمراجعة."
                            }
                        ],
                        "recommended": [
                            {
                                "code": "pricing.no_estimated_duration",
                                "message": "أضف مدة الرحلة التقديرية ليستفيد منها الشاحنون والتقويم."
                            }
                        ]
                    }
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "stale_version"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "listing_archived"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "limit_exceeds_vehicle"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "PUT",
            "path": "/market/listings/{uuid}/cargo-limits",
            "auth": "app_token",
            "scope": "market:listings:write",
            "apps": [
                "carrier"
            ],
            "idempotency_key": true,
            "limit": "write",
            "summary": {
                "en": "Replaces the largest load the listing takes under the version the caller read; a limit above what the vehicle is registered for is refused with limit_exceeds_vehicle; the answer is the listing.",
                "ar": "يستبدل أكبر حمولة يقبلها الإعلان بحسب النسخة التي قرأها المتصل؛ والحد الأكبر مما سُجّلت له المركبة يُرفض بالسبب limit_exceeds_vehicle؛ والجواب هو الإعلان."
            }
        },
        {
            "name": "market.api.listings.cargo_options",
            "example": {
                "request": null,
                "response": [
                    {
                        "cargo_type": "building_materials",
                        "kind": "freight",
                        "name": "مواد بناء",
                        "accepted": true,
                        "priced": true,
                        "units": [
                            {
                                "unit": "ton",
                                "name": "طن",
                                "unit_type": "weight",
                                "is_default": true,
                                "usual_default_quantity_milli": 10000,
                                "usual_min_quantity_milli": 1000,
                                "usual_max_quantity_milli": 30000,
                                "priced": true,
                                "is_active": true
                            },
                            {
                                "unit": "pallet_std",
                                "name": "منصة نقالة",
                                "unit_type": "count",
                                "is_default": false,
                                "usual_default_quantity_milli": null,
                                "usual_min_quantity_milli": null,
                                "usual_max_quantity_milli": null,
                                "priced": false,
                                "is_active": null
                            }
                        ]
                    },
                    {
                        "cargo_type": "frozen_food",
                        "kind": "freight",
                        "name": "أغذية مجمدة",
                        "accepted": false,
                        "priced": true,
                        "units": []
                    }
                ],
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/listings/{uuid}/cargo-options",
            "auth": "app_token",
            "scope": "market:listings:read",
            "apps": [
                "carrier"
            ],
            "idempotency_key": false,
            "limit": null,
            "summary": {
                "en": "Reads what the cargo prices screen offers the carrier to price on its own listing, with no amount in it and no price permission needed: the cargo types the listing takes, then those it still holds a price for (accepted false), each with its name in the caller's language, its kind, whether a price row exists (priced), and its units in the staff's order with the usual quantities in thousandths where staff gave them (usual_default_quantity_milli, usual_min_quantity_milli, usual_max_quantity_milli, null where none), whether a unit is the type's default and whether the carrier has priced it (priced, and is_active of that row, null when there is none). Another company's listing is the one 404.",
                "ar": "يقرأ ما تعرضه شاشة أسعار البضائع على الناقل ليسعّره في إعلانه نفسه، بلا أي مبلغ وبلا صلاحية أسعار: أنواع الحمولة التي يقبلها الإعلان ثم التي ما زال يحمل لها سعرًا (accepted false)، ولكل نوع اسمه بلغة المتصل ونوعه (kind) وهل له صف سعر (priced) ووحداته بترتيب الموظفين مع الكميات المعتادة بالأجزاء من ألف حيث وضعها الموظفون (usual_default_quantity_milli وusual_min_quantity_milli وusual_max_quantity_milli، وnull حيث لا شيء) وهل الوحدة هي الافتراضية للنوع وهل سعّرها الناقل (priced وis_active لذلك الصف، وnull إن لا صف). وإعلان شركة أخرى هو الـ404 الواحد."
            }
        },
        {
            "name": "market.api.listings.cargo_prices",
            "example": {
                "request": null,
                "response": [
                    {
                        "cargo_type": "building_materials",
                        "version": 2,
                        "is_enabled": true,
                        "has_own_price": true,
                        "method": "per_km",
                        "base_fee_halalas": 30000,
                        "km_rate_halalas": 450,
                        "hour_rate_halalas": null,
                        "ton_rate_halalas": null,
                        "m3_rate_halalas": null,
                        "minimum_halalas": 60000,
                        "currency": "SAR",
                        "units": [
                            {
                                "unit": "pallet",
                                "is_active": true,
                                "min_quantity_milli": 1000,
                                "max_quantity_milli": 24000,
                                "base_amount_halalas": 0,
                                "unit_price_halalas": 5000,
                                "km_price_halalas": 0,
                                "multiplies_by_km": false
                            }
                        ]
                    }
                ],
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/listings/{uuid}/cargo-prices",
            "auth": "app_token",
            "scope": "market:listings:read",
            "apps": [
                "carrier"
            ],
            "idempotency_key": false,
            "limit": null,
            "summary": {
                "en": "Reads the listing's price per cargo type with its unit prices and the version of each row; needs the right to view prices.",
                "ar": "يقرأ سعر الإعلان لكل نوع حمولة مع أسعار وحداته ونسخة كل صف؛ ويحتاج حق عرض الأسعار."
            }
        },
        {
            "name": "market.api.listings.cargo_prices.disable",
            "example": {
                "request": {
                    "version": 2
                },
                "response": {
                    "cargo_type": "building_materials",
                    "version": 3,
                    "is_enabled": false,
                    "has_own_price": true,
                    "method": "per_km",
                    "base_fee_halalas": 30000,
                    "km_rate_halalas": 450,
                    "hour_rate_halalas": null,
                    "ton_rate_halalas": null,
                    "m3_rate_halalas": null,
                    "minimum_halalas": 60000,
                    "currency": "SAR",
                    "units": [
                        {
                            "unit": "pallet",
                            "is_active": true,
                            "min_quantity_milli": 1000,
                            "max_quantity_milli": 24000,
                            "base_amount_halalas": 0,
                            "unit_price_halalas": 5000,
                            "km_price_halalas": 0,
                            "multiplies_by_km": false
                        }
                    ],
                    "listing_state": "draft"
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 404,
                        "code": "not_found",
                        "reason": "cargo_price_not_found"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "stale_version"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "listing_archived"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "DELETE",
            "path": "/market/listings/{uuid}/cargo-prices/{cargo_type}",
            "auth": "app_token",
            "scope": "market:listings:prices:write",
            "apps": [
                "carrier"
            ],
            "idempotency_key": true,
            "limit": "write",
            "summary": {
                "en": "Turns off the listing's price for one cargo type under the version the caller read; the answer is the row with listing_state.",
                "ar": "يوقف سعر الإعلان لنوع حمولة واحد بحسب النسخة التي قرأها المتصل؛ والجواب هو الصف مع listing_state."
            }
        },
        {
            "name": "market.api.listings.cargo_prices.save",
            "example": {
                "request": {
                    "version": 1,
                    "has_own_price": true,
                    "method": "per_km",
                    "base_fee_halalas": 30000,
                    "km_rate_halalas": 450,
                    "minimum_halalas": 60000,
                    "units": [
                        {
                            "unit": "pallet",
                            "is_active": true,
                            "min_quantity_milli": 1000,
                            "max_quantity_milli": 24000,
                            "base_amount_halalas": 0,
                            "unit_price_halalas": 5000,
                            "km_price_halalas": 0,
                            "multiplies_by_km": false
                        }
                    ]
                },
                "response": {
                    "cargo_type": "building_materials",
                    "version": 2,
                    "is_enabled": true,
                    "has_own_price": true,
                    "method": "per_km",
                    "base_fee_halalas": 30000,
                    "km_rate_halalas": 450,
                    "hour_rate_halalas": null,
                    "ton_rate_halalas": null,
                    "m3_rate_halalas": null,
                    "minimum_halalas": 60000,
                    "currency": "SAR",
                    "units": [
                        {
                            "unit": "pallet",
                            "is_active": true,
                            "min_quantity_milli": 1000,
                            "max_quantity_milli": 24000,
                            "base_amount_halalas": 0,
                            "unit_price_halalas": 5000,
                            "km_price_halalas": 0,
                            "multiplies_by_km": false
                        }
                    ],
                    "listing_state": "draft"
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "stale_version"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "listing_archived"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "listing_not_freight"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "cargo_type_not_accepted"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "method_required"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "base_required"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "km_rate_required"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "hour_rate_required"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "load_rate_required"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "invalid_amount"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "invalid_quantity"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "min_above_max"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "duplicate_unit"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "too_many_units"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "unit_not_of_type"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "unit_unpriced"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "km_multiplier_needs_km_price"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "PUT",
            "path": "/market/listings/{uuid}/cargo-prices/{cargo_type}",
            "auth": "app_token",
            "scope": "market:listings:prices:write",
            "apps": [
                "carrier"
            ],
            "idempotency_key": true,
            "limit": "write",
            "summary": {
                "en": "Saves the listing's price for one cargo type (named by its code in the path) with its unit prices under the version the caller read (0 for a first save); a price change sends an approved listing back to review, so the answer carries listing_state.",
                "ar": "يحفظ سعر الإعلان لنوع حمولة واحد (يُسمّى برمزه في المسار) مع أسعار وحداته بحسب النسخة التي قرأها المتصل (0 للحفظ الأول)؛ وتغيير السعر يعيد الإعلان المعتمد إلى المراجعة، فيحمل الجواب listing_state."
            }
        },
        {
            "name": "market.api.listings.cargo_types",
            "example": {
                "request": null,
                "response": {
                    "own_list": true,
                    "cargo_types": [
                        "general",
                        "containers"
                    ],
                    "choices": [
                        {
                            "cargo_type": "general",
                            "kind": "goods",
                            "restricted": false,
                            "selected": true
                        },
                        {
                            "cargo_type": "building_materials",
                            "kind": "goods",
                            "restricted": false,
                            "selected": false
                        },
                        {
                            "cargo_type": "containers",
                            "kind": "goods",
                            "restricted": false,
                            "selected": true
                        },
                        {
                            "cargo_type": "hazmat",
                            "kind": "goods",
                            "restricted": true,
                            "selected": false
                        }
                    ],
                    "effective": [
                        "general",
                        "containers"
                    ]
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/listings/{uuid}/cargo-types",
            "auth": "app_token",
            "scope": "market:listings:read",
            "apps": [
                "carrier"
            ],
            "idempotency_key": false,
            "limit": null,
            "summary": {
                "en": "Reads the truck's own cargo-type list: whether it has one (own_list), the codes on it, every type the truck may take with whether the list names it and whether it is restricted, and the types the truck is offered and found for now (effective); with no list the truck is offered everything it may take.",
                "ar": "يقرأ قائمة أنواع البضاعة الخاصة بالشاحنة: هل لها قائمة (own_list)، والرموز التي فيها، وكل نوع يجوز أن تحمله الشاحنة مع هل تسمّيه القائمة وهل هو مقيّد، والأنواع التي تُعرض لها الشاحنة ويُعثر عليها بها الآن (effective)؛ وبلا قائمة تُعرض الشاحنة لكل ما يجوز أن تحمله."
            }
        },
        {
            "name": "market.api.listings.cargo_types.replace",
            "example": {
                "request": {
                    "cargo_types": [
                        "general",
                        "containers"
                    ]
                },
                "response": {
                    "own_list": true,
                    "cargo_types": [
                        "general",
                        "containers"
                    ],
                    "choices": [
                        {
                            "cargo_type": "general",
                            "kind": "goods",
                            "restricted": false,
                            "selected": true
                        },
                        {
                            "cargo_type": "building_materials",
                            "kind": "goods",
                            "restricted": false,
                            "selected": false
                        },
                        {
                            "cargo_type": "containers",
                            "kind": "goods",
                            "restricted": false,
                            "selected": true
                        },
                        {
                            "cargo_type": "hazmat",
                            "kind": "goods",
                            "restricted": true,
                            "selected": false
                        }
                    ],
                    "effective": [
                        "general",
                        "containers"
                    ]
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "listing_archived"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "cargo_not_for_listing"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "cargo_unknown"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "PUT",
            "path": "/market/listings/{uuid}/cargo-types",
            "auth": "app_token",
            "scope": "market:listings:write",
            "apps": [
                "carrier"
            ],
            "idempotency_key": true,
            "limit": "write",
            "summary": {
                "en": "Replaces the truck's own cargo-type list with the codes sent (cargo_types, at most 100; an empty list clears it and the truck is offered everything it may take again); every code must be a type the truck may take, else the answer is 409 cargo_not_for_listing, or 422 cargo_unknown for a code that does not exist; a duplicate is ignored; it narrows what the truck is found and matched for and never what it may be priced for, and it does not send the listing back to review; the answer is the same as the read.",
                "ar": "يستبدل قائمة أنواع البضاعة الخاصة بالشاحنة بالرموز المرسلة (cargo_types، مئة على الأكثر؛ وقائمة فارغة تمحوها فتُعرض الشاحنة لكل ما يجوز أن تحمله من جديد)؛ ويجب أن يكون كل رمز نوعًا يجوز للشاحنة أن تحمله وإلا كان الجواب 409 cargo_not_for_listing، أو 422 cargo_unknown لرمز غير موجود؛ والمكرَّر يُهمل؛ وهو يضيّق ما تُعرض به الشاحنة ويُطابَق عليها ولا يضيّق ما يجوز تسعيره لها، ولا يُرجع الإعلان إلى المراجعة؛ والجواب هو الجواب نفسه كالقراءة."
            }
        },
        {
            "name": "market.api.listings.coverage",
            "example": {
                "request": null,
                "response": {
                    "version": 3,
                    "mode": "radius",
                    "local": true,
                    "national": false,
                    "international": false,
                    "zones": [
                        {
                            "uuid": "0193a2f6-2b97-7a30-8c1d-9e4f6b0a3d58",
                            "name": "الرياض الكبرى",
                            "colour": "#1A7F5A",
                            "shape": "circle",
                            "centre": {
                                "lat": 24.7136,
                                "lng": 46.6753
                            },
                            "radius_km": 50,
                            "vertices": null
                        }
                    ],
                    "places": [
                        {
                            "kind": "city",
                            "id": 1301,
                            "country_code": "SA"
                        }
                    ],
                    "routes": [
                        {
                            "origin_city_id": 1024,
                            "destination_city_id": 1301,
                            "transit_hours": 10
                        }
                    ]
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/listings/{uuid}/coverage",
            "auth": "app_token",
            "scope": "market:listings:read",
            "apps": [
                "carrier"
            ],
            "idempotency_key": false,
            "limit": null,
            "summary": {
                "en": "Reads where the listing serves: the mode, the local, national and international scopes, its areas, served places and lanes, with the version a later replace must send (0 when never written).",
                "ar": "يقرأ أين يخدم الإعلان: النمط ونطاقات الرحلات المحلية والوطنية والدولية ومناطقه والأماكن التي يخدمها ومساراته، مع النسخة التي يجب أن يرسلها الاستبدال اللاحق (0 إن لم تُكتب قط)."
            }
        },
        {
            "name": "market.api.listings.coverage.replace",
            "example": {
                "request": {
                    "version": 2,
                    "mode": "radius",
                    "local": true,
                    "national": false,
                    "international": false,
                    "zones": [
                        {
                            "name": "الرياض الكبرى",
                            "colour": "#1A7F5A",
                            "shape": "circle",
                            "centre": {
                                "lat": 24.7136,
                                "lng": 46.6753
                            },
                            "radius_km": 50
                        }
                    ],
                    "places": [
                        {
                            "kind": "city",
                            "id": 1301,
                            "country_code": "SA"
                        }
                    ],
                    "routes": [
                        {
                            "origin_city_id": 1024,
                            "destination_city_id": 1301,
                            "transit_hours": 10
                        }
                    ]
                },
                "response": {
                    "version": 3,
                    "mode": "radius",
                    "local": true,
                    "national": false,
                    "international": false,
                    "zones": [
                        {
                            "uuid": "0193a2f6-2b97-7a30-8c1d-9e4f6b0a3d58",
                            "name": "الرياض الكبرى",
                            "colour": "#1A7F5A",
                            "shape": "circle",
                            "centre": {
                                "lat": 24.7136,
                                "lng": 46.6753
                            },
                            "radius_km": 50,
                            "vertices": null
                        }
                    ],
                    "places": [
                        {
                            "kind": "city",
                            "id": 1301,
                            "country_code": "SA"
                        }
                    ],
                    "routes": [
                        {
                            "origin_city_id": 1024,
                            "destination_city_id": 1301,
                            "transit_hours": 10
                        }
                    ],
                    "listing_state": "draft"
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "stale_version"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "listing_archived"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "company_default_empty"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "limit_reached"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "no_scope"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "default_mode_has_no_zones"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "radius_needs_one_circle"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "polygon_needs_areas"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "unknown_shape"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "zone_name_required"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "zone_name_invalid"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "zone_name_too_long"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "zone_name_contact"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "zone_colour_invalid"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "bad_radius"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "too_few_vertices"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "too_many_vertices"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "repeated_points"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "self_crossing"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "area_too_small"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "area_too_large"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "outside_permitted_area"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "public_shape_invalid"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "too_many_places"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "duplicate_place"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "place_not_available"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "too_many_routes"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "duplicate_route"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "route_same_city"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "PUT",
            "path": "/market/listings/{uuid}/coverage",
            "auth": "app_token",
            "scope": "market:listings:write",
            "apps": [
                "carrier"
            ],
            "idempotency_key": true,
            "limit": "write",
            "summary": {
                "en": "Replaces where the listing serves (mode, scopes, its own areas, places and lanes) under the version the caller read; the geometry and the catalogue are checked and a refusal names the rule; the answer is the new coverage with listing_state.",
                "ar": "يستبدل أين يخدم الإعلان (النمط والنطاقات ومناطقه وأماكنه ومساراته) بحسب النسخة التي قرأها المتصل؛ وتُفحص الهندسة والفهرس ويسمّي الرفض القاعدة؛ والجواب هو التغطية الجديدة مع listing_state."
            }
        },
        {
            "name": "market.api.listings.draft_inputs.index",
            "example": {
                "request": null,
                "response": {
                    "tabs": [
                        {
                            "tab": "terms",
                            "input": {
                                "description_ar": "شاحنة مبرّدة نظيفة تعمل بين المدن، مع رافعة خلفية."
                            },
                            "version": 2,
                            "updated_at": "2026-11-27T09:00:00+00:00"
                        }
                    ]
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "listing_archived"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "listing_already_submitted"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/listings/{uuid}/draft-inputs",
            "auth": "app_token",
            "scope": "market:listings:read",
            "apps": [
                "carrier"
            ],
            "idempotency_key": false,
            "limit": null,
            "summary": {
                "en": "Reads what was typed in the tabs of a draft never sent for review and not yet saved into it: for each tab its input, version and time. It needs the right to change the listing; another company's listing is not_found, and a submitted one is 409 listing_already_submitted.",
                "ar": "يقرأ ما كُتب في تبويبات إعلان مسودة لم يُرسل للمراجعة قط ولم يُحفظ فيه بعد: لكل تبويب مدخلاته ونسختها ووقتها. يلزمه حق تعديل الإعلان، وإعلان شركة أخرى not_found، وما أُرسل 409 listing_already_submitted."
            }
        },
        {
            "name": "market.api.listings.draft_inputs.replace",
            "example": {
                "request": {
                    "version": 0,
                    "input": {
                        "weight_kg": 24000
                    }
                },
                "response": {
                    "tab": "limits",
                    "input": {
                        "weight_kg": 24000
                    },
                    "version": 1,
                    "updated_at": "2026-11-27T09:00:00+00:00"
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "stale_version"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "listing_archived"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "listing_already_submitted"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "draft_input_invalid"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "draft_input_too_large"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "PUT",
            "path": "/market/listings/{uuid}/draft-inputs/{tab}",
            "auth": "app_token",
            "scope": "market:listings:write",
            "apps": [
                "carrier"
            ],
            "idempotency_key": true,
            "limit": "write",
            "summary": {
                "en": "Keeps one tab's input as typed, under the field names of that section's write body, never checked or applied: version is 0 for a first save, and input is a JSON object, or null to discard it. A version behind is 409 stale_version, and saving the section itself removes what was kept. Tabs of many items keep one input for each: cargo_prices under cargo_types by cargo type code; pricing under sheets by sheet id, or new for a sheet not yet created; liquid with the tanker fields at the top and each liquid price under prices by its code, with offered (switching a liquid off is its own call). Saving one item through the app removes that item's input alone.",
                "ar": "يحفظ مدخلات تبويب واحد كما كُتبت، بأسماء حقول طلب الكتابة لذلك القسم ودون فحصها ولا تطبيقها: version صفر لأول حفظ، وinput كائن JSON أو null لتجاهلها. النسخة المتأخرة 409 stale_version، وحفظ القسم نفسه يمحو ما حُفظ. وتبويبات البنود تحفظ مدخلًا لكل بند: cargo_prices تحت cargo_types بشيفرة نوع البضاعة، وpricing تحت sheets بمعرّف الجدول أو new للجدول الذي لم يُنشأ، وliquid بحقول الصهريج في أعلاه وسعر كل سائل تحت prices بشيفرته ومعه offered (إيقاف السائل طلب مستقل). وحفظ بند من التطبيق يمحو مدخل ذلك البند وحده."
            }
        },
        {
            "name": "market.api.listings.equipment_terms",
            "example": {
                "request": null,
                "response": {
                    "version": 2,
                    "equipment_type": "crane",
                    "lifting_capacity_kg": 25000,
                    "max_lifting_height_cm": 3200,
                    "max_reach_cm": 2400,
                    "pricing_model": "hour",
                    "hourly_rate_halalas": 35000,
                    "daily_rate_halalas": 240000,
                    "fixed_price_halalas": null,
                    "min_booking_half_hours": 8,
                    "max_booking_half_hours": null,
                    "operator_included": true,
                    "transport_included": false,
                    "currency": "SAR",
                    "is_active": true
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/listings/{uuid}/equipment-terms",
            "auth": "app_token",
            "scope": "market:listings:read",
            "apps": [
                "carrier"
            ],
            "idempotency_key": false,
            "limit": null,
            "summary": {
                "en": "Reads the listing's equipment terms (equipment_type, the lifting capacity in kilograms, the lifting height and the reach in centimetres, pricing_model, the hourly, daily and fixed prices in halalas before VAT, the shortest and the longest booking in half hours, whether an operator and the transport are included, and whether the terms are on) with the version a save must send; terms never saved read version 0 with nothing offered. It needs the right to view prices.",
                "ar": "يقرأ شروط معدّة الإعلان (equipment_type وسعة الرفع بالكيلوغرام وارتفاع الرفع والمدى بالسنتيمتر وpricing_model وأسعار الساعة واليوم والمقطوع بالهللات قبل الضريبة وأقصر حجز وأطوله بنصف الساعة، وهل المشغّل والنقل مشمولان وهل الشروط مفعّلة) مع النسخة التي يجب أن يرسلها الحفظ؛ والشروط التي لم تُحفظ قط تُقرأ بالنسخة 0 بلا شيء معروض. ويحتاج حق عرض الأسعار."
            }
        },
        {
            "name": "market.api.listings.equipment_terms.save",
            "example": {
                "request": {
                    "version": 1,
                    "equipment_type": "crane",
                    "lifting_capacity_kg": 25000,
                    "max_lifting_height_cm": 3200,
                    "max_reach_cm": 2400,
                    "pricing_model": "hour",
                    "hourly_rate_halalas": 35000,
                    "daily_rate_halalas": 240000,
                    "min_booking_half_hours": 8,
                    "operator_included": true,
                    "transport_included": false,
                    "is_active": true
                },
                "response": {
                    "version": 2,
                    "equipment_type": "crane",
                    "lifting_capacity_kg": 25000,
                    "max_lifting_height_cm": 3200,
                    "max_reach_cm": 2400,
                    "pricing_model": "hour",
                    "hourly_rate_halalas": 35000,
                    "daily_rate_halalas": 240000,
                    "fixed_price_halalas": null,
                    "min_booking_half_hours": 8,
                    "max_booking_half_hours": null,
                    "operator_included": true,
                    "transport_included": false,
                    "currency": "SAR",
                    "is_active": true,
                    "listing_state": "draft"
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "stale_version"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "listing_archived"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "listing_not_equipment"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "capacity_out_of_range"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "dimension_out_of_range"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "rate_out_of_range"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "price_required"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "limits_out_of_range"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "item_without_operator"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "PUT",
            "path": "/market/listings/{uuid}/equipment-terms",
            "auth": "app_token",
            "scope": "market:listings:prices:write",
            "apps": [
                "carrier"
            ],
            "idempotency_key": true,
            "limit": "write",
            "summary": {
                "en": "Saves the listing's equipment terms under the version the caller read (0 for a first save): every key of the terms is sent, a price, a height or a longest booking left out or null is not offered; the rules between fields are refused with their reason (the price the model needs, a bound, an operator on equipment that is not attached to a vehicle); a change sends an approved listing back to review, so the answer is the terms with listing_state. Only for an equipment listing.",
                "ar": "يحفظ شروط معدّة الإعلان بحسب النسخة التي قرأها المتصل (0 للحفظ الأول): تُرسل كل مفاتيح الشروط، والسعر أو الارتفاع أو أطول حجز المحذوف أو null غير معروض؛ وتُرفض القواعد بين الحقول بسببها (السعر الذي يحتاجه النموذج، أو حد، أو مشغّل لمعدّة غير مرتبطة بمركبة)؛ والتغيير يعيد الإعلان المعتمد إلى المراجعة، فالجواب هو الشروط مع listing_state. ولإعلان معدّات فقط."
            }
        },
        {
            "name": "market.api.listings.extra_options",
            "example": {
                "request": null,
                "response": [
                    {
                        "service": "loading_help",
                        "name": "مساعدة في التحميل",
                        "description": null,
                        "requires_duration": true,
                        "required_fact": null,
                        "fact_held": true,
                        "can_enable": true,
                        "is_enabled": true,
                        "version": 3,
                        "price_halalas": null,
                        "hourly_halalas": 6000,
                        "half_day_halalas": 20000,
                        "full_day_halalas": 35000
                    },
                    {
                        "service": "tail_lift",
                        "name": "رافعة خلفية",
                        "description": "رفع الحمولة من الشاحنة إلى الأرض",
                        "requires_duration": false,
                        "required_fact": "رافعة خلفية مسجلة في المركبة",
                        "fact_held": false,
                        "can_enable": false,
                        "is_enabled": false,
                        "version": 0,
                        "price_halalas": null,
                        "hourly_halalas": null,
                        "half_day_halalas": null,
                        "full_day_halalas": null
                    }
                ],
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/listings/{uuid}/extra-options",
            "auth": "app_token",
            "scope": "market:listings:read",
            "apps": [
                "carrier"
            ],
            "idempotency_key": false,
            "limit": null,
            "summary": {
                "en": "Reads the extra services the carrier may offer on its own listing, as the add-on screen lists them: those that suit the listing's service and category and the records of its vehicle and that staff still offer or the carrier already has on, in staff's order, each with its service code, its name and description in the caller's language, whether it is priced by a duration (requires_duration), the vehicle fact it needs (required_fact) and whether that fact holds (fact_held), whether the carrier may switch it on (can_enable), whether it is on (is_enabled), the carrier's own saved amounts in halalas before VAT (price_halalas, hourly_halalas, half_day_halalas, full_day_halalas, null where none) and the version a later save must send (0 when never saved). It answers only a person who may view prices; another company's listing is the one 404.",
                "ar": "يقرأ الخدمات الإضافية التي يجوز للناقل أن يعرضها في إعلانه نفسه كما تسردها شاشة الإضافات: التي تناسب خدمة الإعلان وتصنيفه وسجلات مركبته ولا يزال الموظفون يعرضونها أو يكون الناقل قد فعّلها، بترتيب الموظفين، ولكل منها رمز الخدمة واسمها ووصفها بلغة المتصل وهل تُسعَّر بمدة (requires_duration) والحقيقة التي تتطلبها من المركبة (required_fact) وهل تتحقق (fact_held) وهل يجوز للناقل تفعيلها (can_enable) وهل هي مفعّلة (is_enabled) ومبالغ الناقل نفسه المحفوظة بالهللات قبل الضريبة (price_halalas وhourly_halalas وhalf_day_halalas وfull_day_halalas، وnull حيث لا شيء) والنسخة التي يجب أن يرسلها الحفظ اللاحق (0 إن لم تُحفظ قط). ولا يجيبها إلا من يجوز له رؤية الأسعار؛ وإعلان شركة أخرى هو الـ404 الواحد."
            }
        },
        {
            "name": "market.api.listings.extras",
            "example": {
                "request": null,
                "response": [
                    {
                        "service": "loading_unloading",
                        "version": 1,
                        "is_enabled": true,
                        "price_halalas": 15000,
                        "hourly_halalas": null,
                        "half_day_halalas": null,
                        "full_day_halalas": null,
                        "currency": "SAR"
                    }
                ],
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/listings/{uuid}/extras",
            "auth": "app_token",
            "scope": "market:listings:read",
            "apps": [
                "carrier"
            ],
            "idempotency_key": false,
            "limit": null,
            "summary": {
                "en": "Reads the prices of the extra services the listing offers, with the version of each row; needs the right to view prices.",
                "ar": "يقرأ أسعار الخدمات الإضافية التي يقدمها الإعلان مع نسخة كل صف؛ ويحتاج حق عرض الأسعار."
            }
        },
        {
            "name": "market.api.listings.extras.disable",
            "example": {
                "request": {
                    "version": 1
                },
                "response": {
                    "service": "loading_unloading",
                    "version": 2,
                    "is_enabled": false,
                    "price_halalas": 15000,
                    "hourly_halalas": null,
                    "half_day_halalas": null,
                    "full_day_halalas": null,
                    "currency": "SAR",
                    "listing_state": "draft"
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 404,
                        "code": "not_found",
                        "reason": "extra_not_found"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "row_changed"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "listing_archived"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "DELETE",
            "path": "/market/listings/{uuid}/extras/{service}",
            "auth": "app_token",
            "scope": "market:listings:prices:write",
            "apps": [
                "carrier"
            ],
            "idempotency_key": true,
            "limit": "write",
            "summary": {
                "en": "Turns off the listing's price for one extra service under the version the caller read; the answer is the row with listing_state.",
                "ar": "يوقف سعر الإعلان لخدمة إضافية واحدة بحسب النسخة التي قرأها المتصل؛ والجواب هو الصف مع listing_state."
            }
        },
        {
            "name": "market.api.listings.extras.save",
            "example": {
                "request": {
                    "version": 0,
                    "price_halalas": 15000
                },
                "response": {
                    "service": "loading_unloading",
                    "version": 1,
                    "is_enabled": true,
                    "price_halalas": 15000,
                    "hourly_halalas": null,
                    "half_day_halalas": null,
                    "full_day_halalas": null,
                    "currency": "SAR",
                    "listing_state": "draft"
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "row_changed"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "listing_archived"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "service_not_for_category"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "service_not_for_listing"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "service_unavailable"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "fact_not_held"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "duration_price_required"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "duration_price_not_used"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "invalid_price"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "service_unknown"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "PUT",
            "path": "/market/listings/{uuid}/extras/{service}",
            "auth": "app_token",
            "scope": "market:listings:prices:write",
            "apps": [
                "carrier"
            ],
            "idempotency_key": true,
            "limit": "write",
            "summary": {
                "en": "Saves the listing's price for one extra service (named by its code in the path) under the version the caller read (0 for a first save); the answer is the row with listing_state.",
                "ar": "يحفظ سعر الإعلان لخدمة إضافية واحدة (تُسمّى برمزها في المسار) بحسب النسخة التي قرأها المتصل (0 للحفظ الأول)؛ والجواب هو الصف مع listing_state."
            }
        },
        {
            "name": "market.api.listings.history",
            "example": {
                "request": null,
                "response": [
                    {
                        "at": "2026-11-23T10:05:00Z",
                        "kind": "staff_edited",
                        "from_state": null,
                        "to_state": null,
                        "reason": null,
                        "reason_text": null
                    },
                    {
                        "at": "2026-11-22T08:00:00Z",
                        "kind": "resumed",
                        "from_state": null,
                        "to_state": null,
                        "reason": null,
                        "reason_text": null
                    },
                    {
                        "at": "2026-11-21T18:30:00Z",
                        "kind": "paused",
                        "from_state": null,
                        "to_state": null,
                        "reason": null,
                        "reason_text": null
                    },
                    {
                        "at": "2026-11-20T09:15:00Z",
                        "kind": "moved",
                        "from_state": "approved",
                        "to_state": "published",
                        "reason": null,
                        "reason_text": null
                    },
                    {
                        "at": "2026-11-19T10:40:00Z",
                        "kind": "moved",
                        "from_state": "submitted",
                        "to_state": "approved",
                        "reason": null,
                        "reason_text": null
                    },
                    {
                        "at": "2026-11-18T13:05:00Z",
                        "kind": "moved",
                        "from_state": "approved",
                        "to_state": "submitted",
                        "reason": "content_edited",
                        "reason_text": "عُدّل محتوى الإعلان بعد اعتماده"
                    },
                    {
                        "at": "2026-11-17T11:20:00Z",
                        "kind": "moved",
                        "from_state": "submitted",
                        "to_state": "rejected",
                        "reason": "الصور لا تُظهر المركبة كاملة",
                        "reason_text": "الصور لا تُظهر المركبة كاملة"
                    },
                    {
                        "at": "2026-11-16T07:45:00Z",
                        "kind": "created",
                        "from_state": null,
                        "to_state": null,
                        "reason": null,
                        "reason_text": null
                    }
                ],
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/listings/{uuid}/history",
            "auth": "app_token",
            "scope": "market:listings:read",
            "apps": [
                "carrier"
            ],
            "idempotency_key": false,
            "limit": null,
            "summary": {
                "en": "Reads what happened to the carrier's own listing, newest first and at most fifty lines: its creation, each move between states with the reason that was given (reason, and reason_text, the market's sentence for a known reason or the text as it was written), a pause and a resume, the archiving, and an edit made by platform staff (staff_edited), with no reason and no name; any other edit that moved nothing is not a line, and the person who acted is never named. Another company's listing is not_found.",
                "ar": "يقرأ ما جرى للإعلان نفسه من أحدثه إلى أقدمه وبخمسين سطرًا كحد أقصى: إنشاؤه وكل انتقال بين الحالات مع السبب المعطى (reason، وreason_text وهو جملة السوق لسبب معروف أو النص كما كُتب) والإيقاف المؤقت والاستئناف والأرشفة وتعديل أجراه موظفو المنصة (staff_edited) بلا سبب ولا اسم؛ وما سواه من تعديل لم ينقل شيئًا ليس سطرًا، ولا يُسمّى من فعل. وإعلان شركة أخرى not_found."
            }
        },
        {
            "name": "market.api.listings.index",
            "example": {
                "request": null,
                "response": [
                    {
                        "uuid": "0193a2f1-b3c4-7e51-8a02-6d9c4f1e7b35",
                        "state": "published",
                        "state_reason": null,
                        "state_changed_at": "2026-11-20T09:15:00Z",
                        "service_type": "freight",
                        "load_mode": "ftl",
                        "vehicle_uuid": "0193a2e8-5f10-7c3d-9b64-2a8e1d7f0c52",
                        "item_uuid": null,
                        "rental_enabled": false,
                        "over_capacity_policy": "accept",
                        "over_capacity_max_trips": 2,
                        "is_visible": true,
                        "hidden_reasons": [],
                        "paused_at": null,
                        "archived_at": null,
                        "imported_prices_unconfirmed": false,
                        "version": 11,
                        "created_at": "2026-11-18T11:02:40Z",
                        "updated_at": "2026-11-20T09:15:00Z"
                    },
                    {
                        "uuid": "0193a2f8-9a02-7d4e-b8c1-5e3a7f0d2b64",
                        "state": "draft",
                        "state_reason": null,
                        "state_changed_at": "2026-11-20T14:05:12Z",
                        "service_type": "rental",
                        "load_mode": null,
                        "vehicle_uuid": "0193a2e8-5f10-7c3d-9b64-2a8e1d7f0c52",
                        "item_uuid": null,
                        "rental_enabled": true,
                        "over_capacity_policy": "refuse",
                        "over_capacity_max_trips": null,
                        "is_visible": false,
                        "hidden_reasons": [
                            "not_published"
                        ],
                        "paused_at": null,
                        "archived_at": null,
                        "imported_prices_unconfirmed": false,
                        "version": 1,
                        "created_at": "2026-11-20T14:05:12Z",
                        "updated_at": "2026-11-20T14:05:12Z"
                    }
                ],
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/listings",
            "auth": "app_token",
            "scope": "market:listings:read",
            "apps": [
                "carrier"
            ],
            "idempotency_key": false,
            "limit": null,
            "summary": {
                "en": "Lists the carrier's own listings, a page at a time (limit up to 50; after takes the cursor of meta.page.next_cursor), filtered by status (the listing's state), vehicle (a vehicle id), service_type (freight, rental, liquid or equipment), archived (1 for the archived ones only, 0 for the live ones only; both come when it is left out) or updated_since; each row names the vehicle (vehicle_uuid) or the market-only item (item_uuid) it offers, one of the two, and says when it was paused (paused_at) or archived (archived_at), null when it was not.",
                "ar": "يعرض إعلانات الناقل نفسه صفحةً صفحة (limit حتى 50، وafter يأخذ مؤشر meta.page.next_cursor)، ويُرشَّح بـ status (حالة الإعلان) وvehicle (معرّف مركبة) وservice_type (freight أو rental أو liquid أو equipment) وarchived (1 للمؤرشفة وحدها و0 للحيّة وحدها، والاثنتان معًا إن تُرك) وupdated_since؛ وكل صف يسمّي المركبة (vehicle_uuid) أو المعدّة المعروضة في السوق وحده (item_uuid)، أحدهما، ويذكر متى أُوقف (paused_at) أو أُرشف (archived_at)، وnull إن لم يحدث."
            }
        },
        {
            "name": "market.api.listings.liquid_prices",
            "example": {
                "request": null,
                "response": {
                    "tanker": {
                        "version": 2,
                        "tanker_kind": "water",
                        "origin_city_id": 7,
                        "origin_place_uuid": null
                    },
                    "prices": [
                        {
                            "uuid": "0193a1c2-5d90-7a1b-b6f4-2c8e0d5a7f61",
                            "version": 3,
                            "liquid": "drinking_water",
                            "unit": "cubic_metre_liquid",
                            "unit_price_e4": 450000,
                            "min_quantity_milli": 5000,
                            "max_quantity_milli": 30000,
                            "delivery_model": "tiers",
                            "delivery_fee_halalas": 0,
                            "per_km_e4": 0,
                            "free_radius_m": 5000,
                            "fee_min_halalas": null,
                            "fee_max_halalas": null,
                            "difficulty_fee_halalas": 5000,
                            "is_active": true,
                            "quantity_tiers": [
                                {
                                    "from_quantity_milli": 0,
                                    "to_quantity_milli": 10000,
                                    "unit_price_e4": 450000
                                },
                                {
                                    "from_quantity_milli": 10000,
                                    "to_quantity_milli": null,
                                    "unit_price_e4": 400000
                                }
                            ],
                            "distance_tiers": [
                                {
                                    "from_m": 0,
                                    "to_m": 20000,
                                    "fee_halalas": 10000
                                },
                                {
                                    "from_m": 20000,
                                    "to_m": null,
                                    "fee_halalas": 25000
                                }
                            ]
                        }
                    ]
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/listings/{uuid}/liquid-prices",
            "auth": "app_token",
            "scope": "market:listings:read",
            "apps": [
                "carrier"
            ],
            "idempotency_key": false,
            "limit": null,
            "summary": {
                "en": "Reads the tanker of a liquid listing (its version, the kind of tanker and the starting point of its distance, a city id or one of the company's saved places) and the price of each liquid with its version, its unit, the unit price in ten-thousandths of a riyal, the quantity limits in thousandths of the unit, the delivery model and fees (halalas, and the price per km in ten-thousandths of a riyal, the free radius in metres), whether it is on, and its quantity and distance tiers; a tanker never saved reads version 0 with no kind. It needs the right to view prices.",
                "ar": "يقرأ صهريج إعلان السوائل (نسخته ونوع الصهريج ونقطة بدء مسافته، وهي معرّف مدينة أو مكان محفوظ للشركة) وسعر كل سائل بنسخته ووحدته وسعر الوحدة بعشرات آلاف الريال وحدّي الكمية بآلاف الوحدة ونموذج التوصيل ورسومه (بالهللات، وسعر الكيلومتر بعشرات آلاف الريال، ونصف القطر المجاني بالمتر) وهل هو مفعّل وشرائحه الكمية والمسافية؛ والصهريج الذي لم يُحفظ قط يُقرأ بالنسخة 0 بلا نوع. ويحتاج حق عرض الأسعار."
            }
        },
        {
            "name": "market.api.listings.liquid_prices.save",
            "example": {
                "request": {
                    "version": 2,
                    "unit": "cubic_metre_liquid",
                    "unit_price_e4": 450000,
                    "min_quantity_milli": 5000,
                    "max_quantity_milli": 30000,
                    "delivery_model": "tiers",
                    "delivery_fee_halalas": 0,
                    "per_km_e4": 0,
                    "free_radius_m": 5000,
                    "fee_min_halalas": null,
                    "fee_max_halalas": null,
                    "difficulty_fee_halalas": 5000,
                    "quantity_tiers": [
                        {
                            "from_quantity_milli": 0,
                            "to_quantity_milli": 10000,
                            "unit_price_e4": 450000
                        },
                        {
                            "from_quantity_milli": 10000,
                            "to_quantity_milli": null,
                            "unit_price_e4": 400000
                        }
                    ],
                    "distance_tiers": [
                        {
                            "from_m": 0,
                            "to_m": 20000,
                            "fee_halalas": 10000
                        },
                        {
                            "from_m": 20000,
                            "to_m": null,
                            "fee_halalas": 25000
                        }
                    ]
                },
                "response": {
                    "uuid": "0193a1c2-5d90-7a1b-b6f4-2c8e0d5a7f61",
                    "version": 3,
                    "liquid": "drinking_water",
                    "unit": "cubic_metre_liquid",
                    "unit_price_e4": 450000,
                    "min_quantity_milli": 5000,
                    "max_quantity_milli": 30000,
                    "delivery_model": "tiers",
                    "delivery_fee_halalas": 0,
                    "per_km_e4": 0,
                    "free_radius_m": 5000,
                    "fee_min_halalas": null,
                    "fee_max_halalas": null,
                    "difficulty_fee_halalas": 5000,
                    "is_active": true,
                    "quantity_tiers": [
                        {
                            "from_quantity_milli": 0,
                            "to_quantity_milli": 10000,
                            "unit_price_e4": 450000
                        },
                        {
                            "from_quantity_milli": 10000,
                            "to_quantity_milli": null,
                            "unit_price_e4": 400000
                        }
                    ],
                    "distance_tiers": [
                        {
                            "from_m": 0,
                            "to_m": 20000,
                            "fee_halalas": 10000
                        },
                        {
                            "from_m": 20000,
                            "to_m": null,
                            "fee_halalas": 25000
                        }
                    ],
                    "listing_state": "draft"
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 404,
                        "code": "not_found",
                        "reason": "liquid_unknown"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "stale_version"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "listing_archived"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "listing_not_liquid"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "tanker_missing"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "liquid_restrictions_undecided"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "liquid_not_for_kind"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "liquid_not_for_listing"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "liquid_needs_opt_in"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "unit_not_for_liquid"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "price_out_of_range"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "quantity_out_of_range"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "fee_out_of_range"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "per_km_rate_required"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "too_many_tiers"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "tier_out_of_range"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "tier_fee_required"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "tiers_overlap"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "PUT",
            "path": "/market/listings/{uuid}/liquid-prices/{liquid}",
            "auth": "app_token",
            "scope": "market:listings:prices:write",
            "apps": [
                "carrier"
            ],
            "idempotency_key": true,
            "limit": "write",
            "summary": {
                "en": "Saves the price of one liquid, named by its code in the path, under the version the caller read (0 for a first save): the unit, the unit price, the quantity limits, the delivery model with its fees and both tier sets are all sent (a set sent empty is no tiers, and a set replaces the previous one, which is kept in the listing's history); the rules are refused with their reason (a bound, a rate the model needs, bands that overlap, a liquid the tanker, the vehicle or the listing's accepted cargo does not take, a tanker not set yet); saving a switched-off price switches it on; a change sends an approved listing back to review, so the answer is the price row with listing_state. Only for a liquid listing.",
                "ar": "يحفظ سعر سائل واحد معرَّفًا برمزه في المسار، بحسب النسخة التي قرأها المتصل (0 للحفظ الأول): تُرسل الوحدة وسعر الوحدة وحدّا الكمية ونموذج التوصيل برسومه ومجموعتا الشرائح كلها (المجموعة المرسلة فارغة تعني لا شرائح، والمجموعة تحلّ محل السابقة التي تبقى في سجل الإعلان)؛ وتُرفض القواعد بسببها (حد، أو سعر يحتاجه النموذج، أو شرائح متداخلة، أو سائل لا يحمله الصهريج أو المركبة أو بضاعة الإعلان المقبولة، أو صهريج لم يُحدَّد بعد)؛ وحفظ سعر مطفأ يعيده مفعّلًا؛ والتغيير يعيد الإعلان المعتمد إلى المراجعة، فالجواب صف السعر مع listing_state. ولإعلان سوائل فقط."
            }
        },
        {
            "name": "market.api.listings.liquid_prices.switch_off",
            "example": {
                "request": {
                    "version": 3
                },
                "response": {
                    "uuid": "0193a1c2-5d90-7a1b-b6f4-2c8e0d5a7f61",
                    "version": 4,
                    "liquid": "drinking_water",
                    "unit": "cubic_metre_liquid",
                    "unit_price_e4": 450000,
                    "min_quantity_milli": 5000,
                    "max_quantity_milli": 30000,
                    "delivery_model": "tiers",
                    "delivery_fee_halalas": 0,
                    "per_km_e4": 0,
                    "free_radius_m": 5000,
                    "fee_min_halalas": null,
                    "fee_max_halalas": null,
                    "difficulty_fee_halalas": 5000,
                    "is_active": false,
                    "quantity_tiers": [
                        {
                            "from_quantity_milli": 0,
                            "to_quantity_milli": 10000,
                            "unit_price_e4": 450000
                        },
                        {
                            "from_quantity_milli": 10000,
                            "to_quantity_milli": null,
                            "unit_price_e4": 400000
                        }
                    ],
                    "distance_tiers": [
                        {
                            "from_m": 0,
                            "to_m": 20000,
                            "fee_halalas": 10000
                        },
                        {
                            "from_m": 20000,
                            "to_m": null,
                            "fee_halalas": 25000
                        }
                    ],
                    "listing_state": "draft"
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 404,
                        "code": "not_found",
                        "reason": "liquid_unknown"
                    },
                    {
                        "status": 404,
                        "code": "not_found",
                        "reason": "price_missing"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "stale_version"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "listing_archived"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "listing_not_liquid"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "DELETE",
            "path": "/market/listings/{uuid}/liquid-prices/{liquid}",
            "auth": "app_token",
            "scope": "market:listings:prices:write",
            "apps": [
                "carrier"
            ],
            "idempotency_key": true,
            "limit": "write",
            "summary": {
                "en": "Switches the price of one liquid off, under the version the caller names in the body; its row and tiers stay, and saving the price again switches it on. The answer is the price row with listing_state.",
                "ar": "يطفئ سعر سائل واحد بحسب النسخة التي يسمّيها المتصل في الجسم؛ يبقى صفه وشرائحه، وحفظ السعر من جديد يعيده مفعّلًا. والجواب صف السعر مع listing_state."
            }
        },
        {
            "name": "market.api.listings.liquid_tanker.save",
            "example": {
                "request": {
                    "version": 1,
                    "tanker_kind": "water",
                    "origin_city_id": 7,
                    "origin_place_uuid": null
                },
                "response": {
                    "tanker": {
                        "version": 2,
                        "tanker_kind": "water",
                        "origin_city_id": 7,
                        "origin_place_uuid": null
                    },
                    "prices": [
                        {
                            "uuid": "0193a1c2-5d90-7a1b-b6f4-2c8e0d5a7f61",
                            "version": 3,
                            "liquid": "drinking_water",
                            "unit": "cubic_metre_liquid",
                            "unit_price_e4": 450000,
                            "min_quantity_milli": 5000,
                            "max_quantity_milli": 30000,
                            "delivery_model": "tiers",
                            "delivery_fee_halalas": 0,
                            "per_km_e4": 0,
                            "free_radius_m": 5000,
                            "fee_min_halalas": null,
                            "fee_max_halalas": null,
                            "difficulty_fee_halalas": 5000,
                            "is_active": true,
                            "quantity_tiers": [
                                {
                                    "from_quantity_milli": 0,
                                    "to_quantity_milli": 10000,
                                    "unit_price_e4": 450000
                                },
                                {
                                    "from_quantity_milli": 10000,
                                    "to_quantity_milli": null,
                                    "unit_price_e4": 400000
                                }
                            ],
                            "distance_tiers": [
                                {
                                    "from_m": 0,
                                    "to_m": 20000,
                                    "fee_halalas": 10000
                                },
                                {
                                    "from_m": 20000,
                                    "to_m": null,
                                    "fee_halalas": 25000
                                }
                            ]
                        }
                    ],
                    "listing_state": "draft"
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "stale_version"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "listing_archived"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "listing_not_liquid"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "origin_both"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "origin_city_unknown"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "origin_place_unknown"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "PUT",
            "path": "/market/listings/{uuid}/liquid-tanker",
            "auth": "app_token",
            "scope": "market:listings:prices:write",
            "apps": [
                "carrier"
            ],
            "idempotency_key": true,
            "limit": "write",
            "summary": {
                "en": "Saves the tanker of a liquid listing under the version the caller read (0 for a first save): the kind of tanker and the starting point are sent, a city or a saved place of the company or neither, never both; a kind that cannot carry a liquid already priced switches that price off, and a change sends an approved listing back to review, so the answer is the whole liquid document with listing_state. Only for a liquid listing.",
                "ar": "يحفظ صهريج إعلان السوائل بحسب النسخة التي قرأها المتصل (0 للحفظ الأول): يُرسل نوع الصهريج ونقطة البدء، مدينة أو مكانًا محفوظًا للشركة أو لا شيء، ولا الاثنان معًا؛ والنوع الذي لا يحمل سائلًا مسعّرًا يطفئ سعره، والتغيير يعيد الإعلان المعتمد إلى المراجعة، فالجواب وثيقة السوائل كلها مع listing_state. ولإعلان سوائل فقط."
            }
        },
        {
            "name": "market.api.listings.pause",
            "example": {
                "request": null,
                "response": {
                    "uuid": "0193a2f1-b3c4-7e51-8a02-6d9c4f1e7b35",
                    "state": "published",
                    "state_reason": null,
                    "state_changed_at": "2026-11-20T09:15:00Z",
                    "service_type": "freight",
                    "load_mode": "ftl",
                    "vehicle_uuid": "0193a2e8-5f10-7c3d-9b64-2a8e1d7f0c52",
                    "item_uuid": null,
                    "rental_enabled": false,
                    "over_capacity_policy": "accept",
                    "over_capacity_max_trips": 2,
                    "is_visible": false,
                    "hidden_reasons": [
                        "paused"
                    ],
                    "paused_at": null,
                    "archived_at": null,
                    "imported_prices_unconfirmed": false,
                    "version": 12,
                    "created_at": "2026-11-18T11:02:40Z",
                    "updated_at": "2026-11-21T07:00:00Z",
                    "completeness": {
                        "can_submit": true,
                        "required": [],
                        "recommended": [
                            {
                                "code": "pricing.no_estimated_duration",
                                "message": "أضف مدة الرحلة التقديرية ليستفيد منها الشاحنون والتقويم."
                            }
                        ]
                    }
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "already_paused"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "listing_archived"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited",
                        "reason": "pause_too_often"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "POST",
            "path": "/market/listings/{uuid}/pause",
            "auth": "app_token",
            "scope": "market:listings:write",
            "apps": [
                "carrier"
            ],
            "idempotency_key": true,
            "limit": "write",
            "summary": {
                "en": "Pauses the listing: it leaves the market without changing its state or asking for a review; refused when it was paused or resumed too often within the hour; the request sends no body.",
                "ar": "يوقف الإعلان مؤقتًا: يخرج من السوق دون أن تتغير حالته ودون طلب مراجعة؛ ويُرفض إن أُوقف أو استُؤنف أكثر من اللازم خلال الساعة؛ ولا يرسل الطلب جسمًا."
            }
        },
        {
            "name": "market.api.listings.photos",
            "example": {
                "request": null,
                "response": [
                    {
                        "id": "0193a2e9-0b41-7a6c-8d35-1f7e4b9c2a60",
                        "state": "approved",
                        "position": 1
                    },
                    {
                        "id": "0193a2e9-1d83-7f02-9c48-5a2b8e6d0f31",
                        "state": "approved",
                        "position": 2
                    },
                    {
                        "id": "0193a2e9-2e95-7b17-a6d9-4c0f3a7e1b82",
                        "state": "not_approved",
                        "position": null
                    }
                ],
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/listings/{uuid}/photos",
            "auth": "app_token",
            "scope": "market:listings:read",
            "apps": [
                "carrier"
            ],
            "idempotency_key": false,
            "limit": null,
            "summary": {
                "en": "Reads the photos of the listing's vehicle: each one's id, whether the public sees it and its position; never a path or a storage key.",
                "ar": "يقرأ صور مركبة الإعلان: معرّف كل صورة وهل يراها العموم وترتيبها؛ ولا يعطي مسارًا ولا مفتاح تخزين أبدًا."
            }
        },
        {
            "name": "market.api.listings.photos.approve",
            "example": {
                "request": {
                    "confirm_no_plates": true
                },
                "response": {
                    "id": "0193a2e9-2e95-7b17-a6d9-4c0f3a7e1b82",
                    "state": "approved",
                    "position": 3
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "hidden_by_staff"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "not_a_photo"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "archived"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "version_changed"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "limit_reached"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "copy_refused"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited",
                        "reason": "rate_limited"
                    }
                ]
            },
            "method": "POST",
            "path": "/market/listings/{uuid}/photos/{photo}/approve",
            "auth": "app_token",
            "scope": "market:listings:write",
            "apps": [
                "carrier"
            ],
            "idempotency_key": true,
            "limit": "write",
            "summary": {
                "en": "Shows one photo to the public once the caller confirms that no plate, face or paper appears in it (confirm_no_plates: true); the answer is the photo.",
                "ar": "يُظهر صورة للعموم بعد أن يؤكد المتصل أن لا لوحة ولا وجه ولا ورقة تظهر فيها (confirm_no_plates: true)؛ والجواب هو الصورة."
            }
        },
        {
            "name": "market.api.listings.photos.order",
            "example": {
                "request": {
                    "photo_uuids": [
                        "0193a2e9-1d83-7f02-9c48-5a2b8e6d0f31",
                        "0193a2e9-0b41-7a6c-8d35-1f7e4b9c2a60"
                    ]
                },
                "response": [
                    {
                        "id": "0193a2e9-1d83-7f02-9c48-5a2b8e6d0f31",
                        "state": "approved",
                        "position": 1
                    },
                    {
                        "id": "0193a2e9-0b41-7a6c-8d35-1f7e4b9c2a60",
                        "state": "approved",
                        "position": 2
                    },
                    {
                        "id": "0193a2e9-2e95-7b17-a6d9-4c0f3a7e1b82",
                        "state": "not_approved",
                        "position": null
                    }
                ],
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "order_mismatch"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited",
                        "reason": "rate_limited"
                    }
                ]
            },
            "method": "PUT",
            "path": "/market/listings/{uuid}/photos/order",
            "auth": "app_token",
            "scope": "market:listings:write",
            "apps": [
                "carrier"
            ],
            "idempotency_key": true,
            "limit": "write",
            "summary": {
                "en": "Puts the photos the public sees in the order given: photo_uuids names each of them once, no more and no fewer, or the answer is 409 order_mismatch; the answer is every photo of the vehicle with its position.",
                "ar": "يرتّب الصور التي يراها العموم بالترتيب المعطى: يسمّي photo_uuids كلًّا منها مرة واحدة لا أكثر ولا أقل، وإلا فالجواب 409 بالسبب order_mismatch؛ والجواب هو كل صور المركبة مع ترتيبها."
            }
        },
        {
            "name": "market.api.listings.photos.store",
            "example": {
                "request": {
                    "file": "(the photo, sent as multipart/form-data)"
                },
                "response": {
                    "id": "0c6a1b7e-2222-4d2a-9a55-1f6d1f0a0002",
                    "state": "not_approved",
                    "position": null
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 413,
                        "code": "payload_too_large"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited",
                        "reason": "hourly_uploads"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited",
                        "reason": "daily_quota"
                    }
                ]
            },
            "method": "POST",
            "path": "/market/listings/{uuid}/photos",
            "auth": "app_token",
            "scope": "market:listings:write",
            "apps": [
                "carrier"
            ],
            "idempotency_key": true,
            "limit": "write",
            "summary": {
                "en": "Adds one photo to the listing's vehicle, the same set the fleet record holds: a multipart form with one file field (file), a JPEG or a PNG within the photo size cap (413 above it). The fleet's own right to attach documents, its file check, virus scan and plan limit apply, and a file they refuse is 422 on file. The photo is not shown to the public until approved; the answer is the photo, 201. A key has an hourly number of uploads and the company a daily size (429 hourly_uploads or daily_quota); send an Idempotency-Key header.",
                "ar": "يضيف صورة واحدة إلى مركبة الإعلان، وهي مجموعة الصور نفسها في سجل المركبة بالأسطول: نموذج multipart بحقل ملف واحد (file)، صورة JPEG أو PNG ضمن حد حجم الصور (وما فوقه 413). ويسري حق الأسطول في إرفاق الوثائق وفحصه للملف وفحص الفيروسات وحد الباقة، والملف المرفوض 422 على file. ولا تظهر الصورة للعموم حتى تُعتمد، والجواب هو الصورة برمز 201. ولكل مفتاح عدد رفعات في الساعة وللشركة حجم في اليوم (429 بسبب hourly_uploads أو daily_quota)، وأرسل ترويسة Idempotency-Key."
            }
        },
        {
            "name": "market.api.listings.photos.withdraw",
            "example": {
                "request": null,
                "response": {
                    "id": "0193a2e9-2e95-7b17-a6d9-4c0f3a7e1b82",
                    "state": "not_approved",
                    "position": null
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "POST",
            "path": "/market/listings/{uuid}/photos/{photo}/withdraw",
            "auth": "app_token",
            "scope": "market:listings:write",
            "apps": [
                "carrier"
            ],
            "idempotency_key": true,
            "limit": "write",
            "summary": {
                "en": "Takes one photo off public view; the request sends no body and the answer is the photo.",
                "ar": "يسحب صورة من العرض العام؛ ولا يرسل الطلب جسمًا والجواب هو الصورة."
            }
        },
        {
            "name": "market.api.listings.price_sheets",
            "example": {
                "request": null,
                "response": [
                    {
                        "uuid": "0193a2f4-1a6e-7d83-b5c0-8e2f9a4d6b17",
                        "method": "per_km",
                        "base_fee_halalas": 30000,
                        "rate_halalas": 450,
                        "minimum_halalas": 60000,
                        "weekend_bp": 1000,
                        "night_bp": 500,
                        "urgent_bp": 2000,
                        "estimated_duration_hours": 10,
                        "currency": "SAR",
                        "valid_from": "2026-12-01",
                        "valid_to": null,
                        "is_active": true,
                        "version": 1
                    },
                    {
                        "uuid": "0193a2d0-6e35-7b92-a4f8-0c1d7e3b5a29",
                        "method": "per_km",
                        "base_fee_halalas": 28000,
                        "rate_halalas": 420,
                        "minimum_halalas": 60000,
                        "weekend_bp": 1000,
                        "night_bp": 500,
                        "urgent_bp": 2000,
                        "estimated_duration_hours": 10,
                        "currency": "SAR",
                        "valid_from": "2026-06-01",
                        "valid_to": "2026-11-30",
                        "is_active": false,
                        "version": 3
                    }
                ],
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/listings/{uuid}/price-sheets",
            "auth": "app_token",
            "scope": "market:listings:read",
            "apps": [
                "carrier"
            ],
            "idempotency_key": false,
            "limit": null,
            "summary": {
                "en": "Reads the listing's freight price sheets, the live ones in period order and then the ten latest ended ones, each with its version; needs the right to view prices.",
                "ar": "يقرأ قوائم أسعار الشحن للإعلان: السارية بترتيب فتراتها ثم آخر عشر قوائم منتهية، لكل منها نسختها؛ ويحتاج حق عرض الأسعار."
            }
        },
        {
            "name": "market.api.listings.price_sheets.destroy",
            "example": {
                "request": {
                    "version": 2
                },
                "response": {
                    "uuid": "0193a2f4-1a6e-7d83-b5c0-8e2f9a4d6b17",
                    "method": "per_km",
                    "base_fee_halalas": 30000,
                    "rate_halalas": 450,
                    "minimum_halalas": 60000,
                    "weekend_bp": 1000,
                    "night_bp": 500,
                    "urgent_bp": 2000,
                    "estimated_duration_hours": 10,
                    "currency": "SAR",
                    "valid_from": "2026-12-01",
                    "valid_to": null,
                    "is_active": false,
                    "version": 3,
                    "listing_state": "draft"
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 404,
                        "code": "not_found",
                        "reason": "sheet_not_found"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "sheet_changed"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "listing_archived"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "DELETE",
            "path": "/market/listings/{uuid}/price-sheets/{sheet}",
            "auth": "app_token",
            "scope": "market:listings:prices:write",
            "apps": [
                "carrier"
            ],
            "idempotency_key": true,
            "limit": "write",
            "summary": {
                "en": "Ends one price sheet under the version the caller read; the answer is the ended sheet with listing_state.",
                "ar": "ينهي قائمة أسعار واحدة بحسب النسخة التي قرأها المتصل؛ والجواب هو القائمة المنتهية مع listing_state."
            }
        },
        {
            "name": "market.api.listings.price_sheets.replace",
            "example": {
                "request": {
                    "version": 1,
                    "method": "per_km",
                    "base_fee_halalas": 32000,
                    "rate_halalas": 480,
                    "minimum_halalas": 60000,
                    "weekend_bp": 1000,
                    "night_bp": 500,
                    "urgent_bp": 2000,
                    "estimated_duration_hours": 10,
                    "valid_from": "2026-12-01",
                    "valid_to": null
                },
                "response": {
                    "uuid": "0193a2f4-1a6e-7d83-b5c0-8e2f9a4d6b17",
                    "method": "per_km",
                    "base_fee_halalas": 32000,
                    "rate_halalas": 480,
                    "minimum_halalas": 60000,
                    "weekend_bp": 1000,
                    "night_bp": 500,
                    "urgent_bp": 2000,
                    "estimated_duration_hours": 10,
                    "currency": "SAR",
                    "valid_from": "2026-12-01",
                    "valid_to": null,
                    "is_active": true,
                    "version": 2,
                    "listing_state": "draft"
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 404,
                        "code": "not_found",
                        "reason": "sheet_not_found"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "sheet_changed"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "prices_overlap"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "listing_archived"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "listing_not_freight"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "invalid_sheet"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "PUT",
            "path": "/market/listings/{uuid}/price-sheets/{sheet}",
            "auth": "app_token",
            "scope": "market:listings:prices:write",
            "apps": [
                "carrier"
            ],
            "idempotency_key": true,
            "limit": "write",
            "summary": {
                "en": "Replaces one price sheet under the version the caller read; the answer is the sheet with listing_state.",
                "ar": "يستبدل قائمة أسعار واحدة بحسب النسخة التي قرأها المتصل؛ والجواب هو القائمة مع listing_state."
            }
        },
        {
            "name": "market.api.listings.price_sheets.store",
            "example": {
                "request": {
                    "method": "per_km",
                    "base_fee_halalas": 30000,
                    "rate_halalas": 450,
                    "minimum_halalas": 60000,
                    "weekend_bp": 1000,
                    "night_bp": 500,
                    "urgent_bp": 2000,
                    "estimated_duration_hours": 10,
                    "valid_from": "2026-12-01",
                    "valid_to": null
                },
                "response": {
                    "uuid": "0193a2f4-1a6e-7d83-b5c0-8e2f9a4d6b17",
                    "method": "per_km",
                    "base_fee_halalas": 30000,
                    "rate_halalas": 450,
                    "minimum_halalas": 60000,
                    "weekend_bp": 1000,
                    "night_bp": 500,
                    "urgent_bp": 2000,
                    "estimated_duration_hours": 10,
                    "currency": "SAR",
                    "valid_from": "2026-12-01",
                    "valid_to": null,
                    "is_active": true,
                    "version": 1,
                    "listing_state": "draft"
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "prices_overlap"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "listing_archived"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "listing_not_freight"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "invalid_sheet"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "POST",
            "path": "/market/listings/{uuid}/price-sheets",
            "auth": "app_token",
            "scope": "market:listings:prices:write",
            "apps": [
                "carrier"
            ],
            "idempotency_key": true,
            "limit": "write",
            "summary": {
                "en": "Adds one freight price sheet to the listing; it may not overlap another live sheet; the answer is the sheet with listing_state.",
                "ar": "يضيف قائمة أسعار شحن واحدة إلى الإعلان؛ ولا يجوز أن تتداخل مع قائمة سارية أخرى؛ والجواب هو القائمة مع listing_state."
            }
        },
        {
            "name": "market.api.listings.publish",
            "example": {
                "request": {
                    "no_plate_in_photos": true
                },
                "response": {
                    "uuid": "0193a2f1-b3c4-7e51-8a02-6d9c4f1e7b35",
                    "state": "published",
                    "state_reason": null,
                    "state_changed_at": "2026-11-20T09:15:00Z",
                    "service_type": "freight",
                    "load_mode": "ftl",
                    "vehicle_uuid": "0193a2e8-5f10-7c3d-9b64-2a8e1d7f0c52",
                    "item_uuid": null,
                    "rental_enabled": false,
                    "over_capacity_policy": "accept",
                    "over_capacity_max_trips": 2,
                    "is_visible": true,
                    "hidden_reasons": [],
                    "paused_at": null,
                    "archived_at": null,
                    "imported_prices_unconfirmed": false,
                    "version": 11,
                    "created_at": "2026-11-18T11:02:40Z",
                    "updated_at": "2026-11-20T09:15:00Z",
                    "completeness": {
                        "can_submit": true,
                        "required": [],
                        "recommended": [
                            {
                                "code": "pricing.no_estimated_duration",
                                "message": "أضف مدة الرحلة التقديرية ليستفيد منها الشاحنون والتقويم."
                            }
                        ]
                    }
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden",
                        "reason": "not_standing"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "illegal_transition"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "listing_archived"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "vehicle_unavailable"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "make_not_matched"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "confirmation_missing"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "imported_prices_unconfirmed"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "POST",
            "path": "/market/listings/{uuid}/publish",
            "auth": "app_token",
            "scope": "market:listings:write",
            "apps": [
                "carrier"
            ],
            "idempotency_key": true,
            "limit": "write",
            "summary": {
                "en": "Puts an approved listing on sale once the caller confirms that no plate shows in its photos (no_plate_in_photos: true) and, for a listing brought from the previous market, its prices (imported_prices_confirmed: true); needs the carrier to be in good standing.",
                "ar": "يطرح إعلانًا معتمدًا للبيع بعد أن يؤكد المتصل أن لا لوحة تظهر في صوره (no_plate_in_photos: true) وأسعاره كذلك إن كان الإعلان منقولًا من السوق السابق (imported_prices_confirmed: true)؛ ويشترط أن يكون الناقل في وضع سليم."
            }
        },
        {
            "name": "market.api.listings.quote",
            "example": {
                "request": {
                    "pickup": {
                        "city_id": 1024,
                        "city": "الرياض",
                        "district_id": null,
                        "lat": 24.6877,
                        "lng": 46.7219,
                        "address": "المدينة الصناعية الثانية، الرياض",
                        "note": null
                    },
                    "dropoff": {
                        "city_id": 1301,
                        "city": "جدة",
                        "district_id": null,
                        "lat": 21.4858,
                        "lng": 39.1925,
                        "address": "ميناء جدة الإسلامي",
                        "note": null
                    },
                    "window_starts_at": "2026-11-28T04:00:00Z",
                    "window_ends_at": "2026-11-29T20:00:00Z",
                    "cargo_type_id": 7,
                    "cargo_weight_kg": 22000,
                    "urgent": false,
                    "extras": [
                        {
                            "code": "loading_unloading",
                            "quantity": 1
                        }
                    ]
                },
                "response": {
                    "total_excl_vat_halalas": 436500,
                    "vat_bp": 1500,
                    "vat_halalas": 65475,
                    "total_incl_vat_halalas": 501975,
                    "currency": "SAR",
                    "is_contract_price": false,
                    "lines": [
                        {
                            "code": "base_fee",
                            "name": "الرسوم الأساسية",
                            "amount_halalas": 30000
                        },
                        {
                            "code": "usage",
                            "name": "رسوم المسافة",
                            "amount_halalas": 391500
                        },
                        {
                            "code": "extra:loading_unloading",
                            "name": "التحميل والتفريغ",
                            "amount_halalas": 15000
                        }
                    ],
                    "consent": {
                        "version": "direct-booking-2026-11",
                        "statement": "بإرسال الطلب توافق على أن الحجز يصبح ملزمًا إذا قبله الناقل: تُحجز المركبة للفترة التي اخترتها بالسعر المعروض، وقد يترتب على إلغائه لاحقًا رسم إلغاء."
                    }
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 403,
                        "code": "plan_feature_required",
                        "reason": "market.shipper"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "already_waiting"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "own_listing"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "listing_unavailable"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "window_unavailable"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "price_unavailable"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "distance_unavailable"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "direct_not_offered"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "over_capacity"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "one_truck_only"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "unit_not_offered"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "units_unavailable"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "extra_unavailable"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "verification_incomplete"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited",
                        "reason": "quote_limit"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited",
                        "reason": "discount_code_limit"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "POST",
            "path": "/market/listings/{uuid}/quote",
            "auth": "app_token",
            "scope": "market:requests:write",
            "apps": [
                "shipper"
            ],
            "idempotency_key": true,
            "limit": "heavy",
            "summary": {
                "en": "Prices one listed vehicle for a load (pickup, drop-off, loading window and cargo) with the extras, the urgent flag and a discount code the caller names; the answer is the total before and after VAT, its lines and the consent statement a booking must agree to; each shipper may ask only so many quotes an hour.",
                "ar": "يسعّر مركبة واحدة معروضة لحمولة (الاستلام والتسليم ونافذة التحميل والبضاعة) مع الخدمات الإضافية وعلامة الاستعجال ورمز الخصم الذي يسمّيه المتصل؛ والجواب هو الإجمالي قبل الضريبة وبعدها وبنوده ونص الموافقة التي يجب أن يقبلها الحجز؛ ولكل شاحن عدد محدود من التسعيرات في الساعة."
            }
        },
        {
            "name": "market.api.listings.rental_terms",
            "example": {
                "request": null,
                "response": {
                    "version": 2,
                    "rental_type": "both",
                    "pricing_model": "day",
                    "daily_rate_halalas": 90000,
                    "weekly_rate_halalas": 540000,
                    "monthly_rate_halalas": 2000000,
                    "hourly_rate_halalas": null,
                    "per_km_rate_halalas": null,
                    "driver_daily_wage_halalas": 25000,
                    "driver_hourly_wage_halalas": null,
                    "driver_guaranteed_hours_per_day": 8,
                    "min_booking_hours": 24,
                    "currency": "SAR",
                    "is_active": true
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/listings/{uuid}/rental-terms",
            "auth": "app_token",
            "scope": "market:listings:read",
            "apps": [
                "carrier"
            ],
            "idempotency_key": false,
            "limit": null,
            "summary": {
                "en": "Reads the listing's rental terms (rental_type, pricing_model, the daily, weekly, monthly, hourly and per-km rates and the driver's wage and guaranteed hours, all in halalas before VAT, null where not offered, the shortest booking in hours and whether the terms are on) with the version a save must send; terms never saved read version 0 with nothing offered. It needs the right to view prices.",
                "ar": "يقرأ شروط تأجير الإعلان (rental_type وpricing_model وأسعار اليوم والأسبوع والشهر والساعة والكيلومتر وأجر السائق وساعاته المضمونة بالهللات قبل الضريبة، وnull حيث لا يُعرض، وأقصر حجز بالساعات وهل الشروط مفعّلة) مع النسخة التي يجب أن يرسلها الحفظ؛ والشروط التي لم تُحفظ قط تُقرأ بالنسخة 0 بلا شيء معروض. ويحتاج حق عرض الأسعار."
            }
        },
        {
            "name": "market.api.listings.rental_terms.save",
            "example": {
                "request": {
                    "version": 1,
                    "rental_type": "both",
                    "pricing_model": "day",
                    "daily_rate_halalas": 90000,
                    "weekly_rate_halalas": 540000,
                    "monthly_rate_halalas": 2000000,
                    "driver_daily_wage_halalas": 25000,
                    "driver_guaranteed_hours_per_day": 8,
                    "min_booking_hours": 24,
                    "is_active": true
                },
                "response": {
                    "version": 2,
                    "rental_type": "both",
                    "pricing_model": "day",
                    "daily_rate_halalas": 90000,
                    "weekly_rate_halalas": 540000,
                    "monthly_rate_halalas": 2000000,
                    "hourly_rate_halalas": null,
                    "per_km_rate_halalas": null,
                    "driver_daily_wage_halalas": 25000,
                    "driver_hourly_wage_halalas": null,
                    "driver_guaranteed_hours_per_day": 8,
                    "min_booking_hours": 24,
                    "currency": "SAR",
                    "is_active": true,
                    "listing_state": "draft"
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "stale_version"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "listing_archived"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "listing_needs_no_rental_terms"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "daily_rate_required"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "hourly_rate_required"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "per_km_rate_required"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "rate_out_of_range"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "minimum_out_of_range"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "minimum_over_hour_limit"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "guaranteed_hours_required"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "guaranteed_hours_out_of_range"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "driver_terms_without_driver"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "PUT",
            "path": "/market/listings/{uuid}/rental-terms",
            "auth": "app_token",
            "scope": "market:listings:prices:write",
            "apps": [
                "carrier"
            ],
            "idempotency_key": true,
            "limit": "write",
            "summary": {
                "en": "Saves the listing's rental terms under the version the caller read (0 for a first save): every key of the terms is sent, a rate left out or null is not offered; the rules between fields are refused with their reason (a rate the model needs, a bound, a driver's wage on a terms without a driver); a change sends an approved listing back to review, so the answer is the terms with listing_state. Only for a listing that needs rental terms.",
                "ar": "يحفظ شروط تأجير الإعلان بحسب النسخة التي قرأها المتصل (0 للحفظ الأول): تُرسل كل مفاتيح الشروط، والسعر المحذوف أو null غير معروض؛ وتُرفض القواعد بين الحقول بسببها (سعر يحتاجه النموذج، أو حد، أو أجر سائق في شروط بلا سائق)؛ والتغيير يعيد الإعلان المعتمد إلى المراجعة، فالجواب هو الشروط مع listing_state. ولإعلان يحتاج شروط تأجير فقط."
            }
        },
        {
            "name": "market.api.listings.resume",
            "example": {
                "request": null,
                "response": {
                    "uuid": "0193a2f1-b3c4-7e51-8a02-6d9c4f1e7b35",
                    "state": "published",
                    "state_reason": null,
                    "state_changed_at": "2026-11-20T09:15:00Z",
                    "service_type": "freight",
                    "load_mode": "ftl",
                    "vehicle_uuid": "0193a2e8-5f10-7c3d-9b64-2a8e1d7f0c52",
                    "item_uuid": null,
                    "rental_enabled": false,
                    "over_capacity_policy": "accept",
                    "over_capacity_max_trips": 2,
                    "is_visible": true,
                    "hidden_reasons": [],
                    "paused_at": null,
                    "archived_at": null,
                    "imported_prices_unconfirmed": false,
                    "version": 13,
                    "created_at": "2026-11-18T11:02:40Z",
                    "updated_at": "2026-11-21T09:00:00Z",
                    "completeness": {
                        "can_submit": true,
                        "required": [],
                        "recommended": [
                            {
                                "code": "pricing.no_estimated_duration",
                                "message": "أضف مدة الرحلة التقديرية ليستفيد منها الشاحنون والتقويم."
                            }
                        ]
                    }
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "not_paused"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "listing_archived"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited",
                        "reason": "pause_too_often"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "POST",
            "path": "/market/listings/{uuid}/resume",
            "auth": "app_token",
            "scope": "market:listings:write",
            "apps": [
                "carrier"
            ],
            "idempotency_key": true,
            "limit": "write",
            "summary": {
                "en": "Resumes a paused listing, under the same hourly limit on changes as a pause; the request sends no body.",
                "ar": "يستأنف إعلانًا موقوفًا مؤقتًا، تحت الحد الساعي نفسه لتغييرات الإيقاف؛ ولا يرسل الطلب جسمًا."
            }
        },
        {
            "name": "market.api.listings.service_type.replace",
            "example": {
                "request": {
                    "version": 1,
                    "service_type": "rental"
                },
                "response": {
                    "uuid": "0193a2f1-b3c4-7e51-8a02-6d9c4f1e7b35",
                    "state": "draft",
                    "state_reason": null,
                    "state_changed_at": "2026-11-18T11:02:40Z",
                    "service_type": "rental",
                    "load_mode": null,
                    "vehicle_uuid": "0193a2e8-5f10-7c3d-9b64-2a8e1d7f0c52",
                    "item_uuid": null,
                    "rental_enabled": false,
                    "over_capacity_policy": "refuse",
                    "over_capacity_max_trips": null,
                    "is_visible": false,
                    "hidden_reasons": [
                        "not_published"
                    ],
                    "paused_at": null,
                    "archived_at": null,
                    "imported_prices_unconfirmed": false,
                    "version": 2,
                    "created_at": "2026-11-18T11:02:40Z",
                    "updated_at": "2026-11-18T11:02:40Z",
                    "completeness": {
                        "can_submit": false,
                        "required": [
                            {
                                "code": "coverage.no_scope",
                                "message": "حدد أين تخدم: اختر أنواع الرحلات والمنطقة قبل إرسال الإعلان للمراجعة."
                            },
                            {
                                "code": "rental.no_terms",
                                "message": "حدّد أسعار تأجير هذا الإعلان في تبويب «أسعار التأجير» قبل إرساله للمراجعة."
                            }
                        ],
                        "recommended": []
                    }
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "stale_version"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "listing_archived"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "service_type_after_review"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "service_type_priced"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "item_service_not_allowed"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "PUT",
            "path": "/market/listings/{uuid}/service-type",
            "auth": "app_token",
            "scope": "market:listings:write",
            "apps": [
                "carrier"
            ],
            "idempotency_key": true,
            "limit": "write",
            "summary": {
                "en": "Changes the listing's service type (freight, rental, liquid or equipment) under the version the caller read, while it is a draft never sent for review; otherwise 409 service_type_after_review, and 409 service_type_priced when it holds a live price, a shared trip or service terms. The load mode becomes both for freight and null otherwise, and rental stays on only where the type allows it. An item with no plate takes rental or equipment only (422 item_service_not_allowed); the answer is the listing.",
                "ar": "يغيّر نوع خدمة الإعلان (freight أو rental أو liquid أو equipment) بحسب النسخة التي قرأها المتصل، ما دام مسودة لم تُرسل للمراجعة قط؛ وإلا 409 service_type_after_review، و409 service_type_priced إن كان له سعر حيّ أو رحلة مشتركة أو شروط خدمة. يصير نمط الحمولة both للشحن وnull لغيره، ويبقى التأجير حيث يقبله النوع وحده. والمعدّة بلا لوحة تقبل التأجير والمعدّات فقط (422 item_service_not_allowed)؛ والجواب هو الإعلان."
            }
        },
        {
            "name": "market.api.listings.show",
            "example": {
                "request": null,
                "response": {
                    "uuid": "0193a2f1-b3c4-7e51-8a02-6d9c4f1e7b35",
                    "state": "published",
                    "state_reason": null,
                    "state_changed_at": "2026-11-20T09:15:00Z",
                    "service_type": "freight",
                    "load_mode": "ftl",
                    "vehicle_uuid": "0193a2e8-5f10-7c3d-9b64-2a8e1d7f0c52",
                    "item_uuid": null,
                    "rental_enabled": false,
                    "over_capacity_policy": "accept",
                    "over_capacity_max_trips": 2,
                    "is_visible": true,
                    "hidden_reasons": [],
                    "paused_at": null,
                    "archived_at": null,
                    "imported_prices_unconfirmed": false,
                    "version": 11,
                    "created_at": "2026-11-18T11:02:40Z",
                    "updated_at": "2026-11-20T09:15:00Z",
                    "completeness": {
                        "can_submit": true,
                        "required": [],
                        "recommended": [
                            {
                                "code": "pricing.no_estimated_duration",
                                "message": "أضف مدة الرحلة التقديرية ليستفيد منها الشاحنون والتقويم."
                            }
                        ]
                    }
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/listings/{uuid}",
            "auth": "app_token",
            "scope": "market:listings:read",
            "apps": [
                "carrier"
            ],
            "idempotency_key": false,
            "limit": null,
            "summary": {
                "en": "Reads one of the carrier's own listings in full: the list's fields and the completeness report, the required items still missing before it can be submitted and the recommended ones, worded in the caller's language.",
                "ar": "يقرأ أحد إعلانات الناقل نفسه كاملًا: حقول القائمة وتقرير الاكتمال، أي البنود المطلوبة التي لا تزال ناقصة قبل أن يُرسَل الإعلان والبنود الموصى بها، بلغة المتصل."
            }
        },
        {
            "name": "market.api.listings.store",
            "example": {
                "request": {
                    "vehicle_uuid": "0193a2e8-5f10-7c3d-9b64-2a8e1d7f0c52",
                    "service_type": "freight",
                    "terms": {
                        "load_mode": "both",
                        "over_capacity_policy": "refuse",
                        "rental_enabled": false
                    }
                },
                "response": {
                    "uuid": "0193a2f1-b3c4-7e51-8a02-6d9c4f1e7b35",
                    "state": "draft",
                    "state_reason": null,
                    "state_changed_at": "2026-11-18T11:02:40Z",
                    "service_type": "freight",
                    "load_mode": "both",
                    "vehicle_uuid": "0193a2e8-5f10-7c3d-9b64-2a8e1d7f0c52",
                    "item_uuid": null,
                    "rental_enabled": false,
                    "over_capacity_policy": "refuse",
                    "over_capacity_max_trips": null,
                    "is_visible": false,
                    "hidden_reasons": [
                        "not_published"
                    ],
                    "paused_at": null,
                    "archived_at": null,
                    "imported_prices_unconfirmed": false,
                    "version": 1,
                    "created_at": "2026-11-18T11:02:40Z",
                    "updated_at": "2026-11-18T11:02:40Z",
                    "completeness": {
                        "can_submit": false,
                        "required": [
                            {
                                "code": "coverage.no_scope",
                                "message": "حدد أين تخدم: اختر أنواع الرحلات والمنطقة قبل إرسال الإعلان للمراجعة."
                            },
                            {
                                "code": "pricing.no_active_sheet",
                                "message": "أضف قائمة أسعار قبل إرسال الإعلان للمراجعة."
                            }
                        ],
                        "recommended": [
                            {
                                "code": "pricing.no_estimated_duration",
                                "message": "أضف مدة الرحلة التقديرية ليستفيد منها الشاحنون والتقويم."
                            }
                        ]
                    }
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "vehicle_already_listed"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "vehicle_unavailable"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "vehicle_not_market_kind"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "vehicle_type_not_allowed"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "vehicle_type_missing"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "POST",
            "path": "/market/listings",
            "auth": "app_token",
            "scope": "market:listings:write",
            "apps": [
                "carrier"
            ],
            "idempotency_key": true,
            "limit": "write",
            "summary": {
                "en": "Creates a draft listing for one of the company's vehicles and a service type, with optional terms; the answer is the listing in full with what it still lacks before it can be submitted. A vehicle whose type is not in the market's list of types is refused with 409 conflict, reason vehicle_type_not_allowed, and a vehicle with no type is refused with reason vehicle_type_missing while the market requires a type.",
                "ar": "ينشئ إعلانًا مسودة لإحدى مركبات الشركة ولنوع خدمة، مع شروط اختيارية؛ والجواب هو الإعلان كاملًا مع ما ينقصه قبل أن يُرسَل. تُرفض المركبة التي نوعها خارج قائمة أنواع السوق بتعارض 409 وسببه vehicle_type_not_allowed، وتُرفض المركبة بلا نوع بسبب vehicle_type_missing ما دام السوق يشترط النوع."
            }
        },
        {
            "name": "market.api.listings.submit",
            "example": {
                "request": null,
                "response": {
                    "uuid": "0193a2f1-b3c4-7e51-8a02-6d9c4f1e7b35",
                    "state": "submitted",
                    "state_reason": null,
                    "state_changed_at": "2026-11-19T08:30:00Z",
                    "service_type": "freight",
                    "load_mode": "ftl",
                    "vehicle_uuid": "0193a2e8-5f10-7c3d-9b64-2a8e1d7f0c52",
                    "item_uuid": null,
                    "rental_enabled": false,
                    "over_capacity_policy": "accept",
                    "over_capacity_max_trips": 2,
                    "is_visible": false,
                    "hidden_reasons": [
                        "not_published"
                    ],
                    "paused_at": null,
                    "archived_at": null,
                    "imported_prices_unconfirmed": false,
                    "version": 9,
                    "created_at": "2026-11-18T11:02:40Z",
                    "updated_at": "2026-11-19T08:30:00Z",
                    "completeness": {
                        "can_submit": true,
                        "required": [],
                        "recommended": [
                            {
                                "code": "pricing.no_estimated_duration",
                                "message": "أضف مدة الرحلة التقديرية ليستفيد منها الشاحنون والتقويم."
                            }
                        ]
                    }
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "illegal_transition"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "incomplete"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "listing_archived"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "vehicle_unavailable"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "make_not_matched"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "POST",
            "path": "/market/listings/{uuid}/submit",
            "auth": "app_token",
            "scope": "market:listings:write",
            "apps": [
                "carrier"
            ],
            "idempotency_key": true,
            "limit": "write",
            "summary": {
                "en": "Sends a draft for staff review; a listing that lacks a required item answers 409 incomplete with one detail per missing item (completeness.code); the request sends no body.",
                "ar": "يرسل المسودة إلى مراجعة الموظفين؛ والإعلان الناقص بندًا مطلوبًا يجيب 409 بالسبب incomplete مع تفصيل لكل بند ناقص (completeness.code)؛ ولا يرسل الطلب جسمًا."
            }
        },
        {
            "name": "market.api.listings.terms.replace",
            "example": {
                "request": {
                    "version": 1,
                    "load_mode": "ftl",
                    "over_capacity_policy": "accept",
                    "over_capacity_max_trips": 2,
                    "rental_enabled": false
                },
                "response": {
                    "uuid": "0193a2f1-b3c4-7e51-8a02-6d9c4f1e7b35",
                    "state": "draft",
                    "state_reason": null,
                    "state_changed_at": "2026-11-18T11:02:40Z",
                    "service_type": "freight",
                    "load_mode": "ftl",
                    "vehicle_uuid": "0193a2e8-5f10-7c3d-9b64-2a8e1d7f0c52",
                    "item_uuid": null,
                    "rental_enabled": false,
                    "over_capacity_policy": "accept",
                    "over_capacity_max_trips": 2,
                    "is_visible": false,
                    "hidden_reasons": [
                        "not_published"
                    ],
                    "paused_at": null,
                    "archived_at": null,
                    "imported_prices_unconfirmed": false,
                    "version": 2,
                    "created_at": "2026-11-18T11:02:40Z",
                    "updated_at": "2026-11-18T11:31:05Z",
                    "completeness": {
                        "can_submit": false,
                        "required": [
                            {
                                "code": "coverage.no_scope",
                                "message": "حدد أين تخدم: اختر أنواع الرحلات والمنطقة قبل إرسال الإعلان للمراجعة."
                            },
                            {
                                "code": "pricing.no_active_sheet",
                                "message": "أضف قائمة أسعار قبل إرسال الإعلان للمراجعة."
                            }
                        ],
                        "recommended": [
                            {
                                "code": "pricing.no_estimated_duration",
                                "message": "أضف مدة الرحلة التقديرية ليستفيد منها الشاحنون والتقويم."
                            }
                        ]
                    }
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "stale_version"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "listing_archived"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "PUT",
            "path": "/market/listings/{uuid}/terms",
            "auth": "app_token",
            "scope": "market:listings:write",
            "apps": [
                "carrier"
            ],
            "idempotency_key": true,
            "limit": "write",
            "summary": {
                "en": "Replaces the listing's terms (load mode, the over-capacity policy and its trip cap, rental on or off) under the version the caller read; a stale version is 409 stale_version.",
                "ar": "يستبدل شروط الإعلان (نمط الحمولة وسياسة تجاوز السعة وحد رحلاتها وتفعيل التأجير) بحسب النسخة التي قرأها المتصل؛ والنسخة السابقة 409 بسبب stale_version."
            }
        },
        {
            "name": "market.api.listings.withdraw",
            "example": {
                "request": null,
                "response": {
                    "uuid": "0193a2f1-b3c4-7e51-8a02-6d9c4f1e7b35",
                    "state": "draft",
                    "state_reason": null,
                    "state_changed_at": "2026-11-19T09:00:00Z",
                    "service_type": "freight",
                    "load_mode": "ftl",
                    "vehicle_uuid": "0193a2e8-5f10-7c3d-9b64-2a8e1d7f0c52",
                    "item_uuid": null,
                    "rental_enabled": false,
                    "over_capacity_policy": "accept",
                    "over_capacity_max_trips": 2,
                    "is_visible": false,
                    "hidden_reasons": [
                        "not_published"
                    ],
                    "paused_at": null,
                    "archived_at": null,
                    "imported_prices_unconfirmed": false,
                    "version": 10,
                    "created_at": "2026-11-18T11:02:40Z",
                    "updated_at": "2026-11-19T09:00:00Z",
                    "completeness": {
                        "can_submit": true,
                        "required": [],
                        "recommended": [
                            {
                                "code": "pricing.no_estimated_duration",
                                "message": "أضف مدة الرحلة التقديرية ليستفيد منها الشاحنون والتقويم."
                            }
                        ]
                    }
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "illegal_transition"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "withdraw_open_departures"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "listing_archived"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "POST",
            "path": "/market/listings/{uuid}/withdraw",
            "auth": "app_token",
            "scope": "market:listings:write",
            "apps": [
                "carrier"
            ],
            "idempotency_key": true,
            "limit": "write",
            "summary": {
                "en": "Takes the listing back to a draft from review, approval or sale, which starts a new content version; refused while it has open trips; the request sends no body.",
                "ar": "يعيد الإعلان مسودة من المراجعة أو الاعتماد أو البيع، فتبدأ نسخة محتوى جديدة؛ ويُرفض ما دامت له رحلات مفتوحة؛ ولا يرسل الطلب جسمًا."
            }
        },
        {
            "name": "market.api.map.show",
            "example": {
                "request": null,
                "response": {
                    "role": "shipper",
                    "counters": {
                        "all": 2,
                        "awaiting_loading": 1,
                        "on_road": 1,
                        "late": 0,
                        "delivered_today": 0,
                        "no_signal": 0
                    },
                    "cards": [
                        {
                            "booking_uuid": "0193a1f3-4a10-7b8e-9c25-6d1e0f7a3b42",
                            "reference": "MR-0004217",
                            "route": "الرياض ← جدة",
                            "state": "in_transit",
                            "carrier": "شركة الطريق السريع للنقل",
                            "late": false,
                            "no_signal": false,
                            "pickup": {
                                "lat": 24.6877,
                                "lng": 46.7219
                            },
                            "dropoff": {
                                "lat": 21.4858,
                                "lng": 39.1925
                            },
                            "position": {
                                "lat": 23.62,
                                "lng": 42.91,
                                "observed_at": "2026-11-28T11:42:10Z"
                            },
                            "eta": {
                                "earliest": "2026-11-28T17:00:00Z",
                                "latest": "2026-11-28T19:30:00Z",
                                "stopped": false
                            },
                            "remaining_km": 612.4,
                            "delivered_at": null
                        },
                        {
                            "booking_uuid": "0193a1f3-6c05-7d21-8a47-3b9c5e2f1d80",
                            "reference": "MR-0004302",
                            "route": "الدمام ← الرياض",
                            "state": "confirmed",
                            "carrier": "مؤسسة الخليج للشحن",
                            "late": false,
                            "no_signal": false,
                            "pickup": {
                                "lat": 26.4207,
                                "lng": 50.0888
                            },
                            "dropoff": {
                                "lat": 24.7136,
                                "lng": 46.6753
                            },
                            "position": null,
                            "eta": null,
                            "remaining_km": null,
                            "delivered_at": null
                        }
                    ]
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/map",
            "auth": "app_token",
            "scope": "market:map:read",
            "apps": [
                "shipper",
                "carrier"
            ],
            "idempotency_key": false,
            "limit": "heavy",
            "summary": {
                "en": "Reads the market map: counters for all bookings, those awaiting loading, on the road, late, delivered today and with no signal, and a card for each booking with its route, state (a booking in dispute stays while its truck is on the road, with the state disputed), pickup and drop-off points and, only while the goods are aboard and a live fix exists, the truck's rounded position, arrival window and distance left. `role` is `shipper` (default) or `carrier`; `show` keeps the cards of one counter. A shipper's card carries the carrier's public name, never a plate, driver, price or contact. `meta.tracks_unavailable` is true when the trucks' places could not be read just now: the bookings still come, with no truck and no live signal to count.",
                "ar": "يقرأ خريطة السوق: عدّادات كل الحجوزات وما ينتظر التحميل وما في الطريق والمتأخر والمسلَّم اليوم وما بلا إشارة، وبطاقة لكل حجز بمساره وحالته (والحجز قيد النزاع يبقى ما دامت شاحنته على الطريق بالحالة disputed) ونقطتي التحميل والتسليم، ومعها موضع الشاحنة مقرَّبًا ونافذة الوصول والمسافة المتبقية فقط ما دامت البضاعة على متنها وثمة موقع حي. `role` هو `shipper` (الافتراضي) أو `carrier`؛ و`show` يُبقي بطاقات عدّاد واحد. وتحمل بطاقة الشاحن الاسم العام للناقل ولا لوحة ولا سائقًا ولا سعرًا ولا وسيلة اتصال. و`meta.tracks_unavailable` تساوي true حين تعذّرت قراءة مواضع الشاحنات الآن: تأتي الحجوزات بلا شاحنة، ولا يُعتدّ بغياب الإشارة."
            }
        },
        {
            "name": "market.api.offers.index",
            "example": {
                "request": {
                    "query": {
                        "limit": 30
                    }
                },
                "response": [
                    {
                        "uuid": "0193b6a2-4c18-7e53-9d41-2a7f0b8c3e65",
                        "reference": "MR-0004302",
                        "route": "الدمام ← الرياض",
                        "state": "submitted",
                        "total_excl_vat_halalas": 95000,
                        "currency": "SAR",
                        "valid_until": "2026-11-27T12:00:00Z",
                        "earliest_pickup_at": "2026-11-28T05:00:00Z",
                        "decline_reason": null,
                        "includes": [
                            {
                                "code": "unloading_help",
                                "name": "مساعدة في التنزيل",
                                "quantity": 2,
                                "unit": "worker"
                            }
                        ],
                        "thread_uuid": "0193b6a2-4d02-7b9e-8a35-6c0e2f1d9a47",
                        "unread_messages": 1,
                        "offer_mode": "sealed",
                        "auction": null
                    },
                    {
                        "uuid": "0193b5f0-8d27-7a14-b3c6-5e1a9d0f7c82",
                        "reference": "MR-0004188",
                        "route": "جدة ← مكة المكرمة",
                        "state": "declined",
                        "total_excl_vat_halalas": 42000,
                        "currency": "SAR",
                        "valid_until": "2026-11-22T09:00:00Z",
                        "earliest_pickup_at": null,
                        "decline_reason": "not_selected",
                        "includes": [],
                        "thread_uuid": null,
                        "unread_messages": 0,
                        "offer_mode": "sealed",
                        "auction": null
                    }
                ],
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/offers",
            "auth": "app_token",
            "scope": "market:offers:read",
            "apps": [
                "carrier"
            ],
            "idempotency_key": false,
            "limit": null,
            "summary": {
                "en": "Lists the carrier's own offers, newest first whatever their age: without limit or cursor it answers the newest 200 as a plain list, and with limit (1 to 100) or cursor (the uuid of one of its own offers) it answers a page, the cursor of the next page in meta.page.next_cursor. Each row gives its request's reference and route, the state, the price before VAT in halalas, the dates, why it was declined, its conversation and, in an open auction, its standing.",
                "ar": "يسرد عروض الناقل نفسه، الأحدث أولًا مهما قدمت: بلا limit ولا cursor يجيب أحدث 200 عرض قائمة عادية، ومع limit (من 1 إلى 100) أو cursor (معرّف uuid لأحد عروضه) يجيب صفحة ومؤشر الصفحة التالية في meta.page.next_cursor. يعطي كل صف مرجع الطلب ومساره وحالة العرض وسعره قبل الضريبة بالهللات وتواريخه وسبب رفضه إن رُفض ومحادثته، وموقعه في المزاد إن كان الطلب مزادًا مفتوحًا."
            }
        },
        {
            "name": "market.api.offers.lower",
            "example": {
                "request": {
                    "total_excl_vat_halalas": 118000
                },
                "response": {
                    "uuid": "0193a1d4-02b8-7e35-a9c1-4f7b8d2e6a90",
                    "reference": "MR-0004217",
                    "route": "الرياض ← جدة",
                    "state": "submitted",
                    "total_excl_vat_halalas": 118000,
                    "currency": "SAR",
                    "valid_until": "2026-11-27T12:00:00Z",
                    "earliest_pickup_at": "2026-11-28T05:00:00Z",
                    "decline_reason": null,
                    "includes": [],
                    "thread_uuid": "0193a1d4-0391-7d02-8c5e-1a9f3b7c2e64",
                    "unread_messages": 0,
                    "offer_mode": "open_auction",
                    "auction": {
                        "lowest_halalas": 118000,
                        "standing_count": 3,
                        "mine_is_lowest": true,
                        "closes_at": "2026-11-26T16:00:00Z",
                        "extensions": 0,
                        "max_extensions": 3,
                        "lowering": {
                            "highest_halalas": 117000,
                            "lowest_halalas": 59000,
                            "confirm_below_halalas": 94400,
                            "step_percent_bp": 50,
                            "step_floor_halalas": 1000,
                            "interval_seconds": 300,
                            "extends_closing": false,
                            "extend_span_minutes": 10
                        }
                    }
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden",
                        "reason": "standing_suspended"
                    },
                    {
                        "status": 403,
                        "code": "forbidden",
                        "reason": "standing_not_activated"
                    },
                    {
                        "status": 403,
                        "code": "forbidden",
                        "reason": "standing_stopped"
                    },
                    {
                        "status": 403,
                        "code": "forbidden",
                        "reason": "standing_not_verified"
                    },
                    {
                        "status": 403,
                        "code": "plan_feature_required",
                        "reason": "market.carrier"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "not_an_auction"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "leg_not_open"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "auction_closed"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "not_submitted"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "lowering_not_for_discounted_offer"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "limit_reached"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "listing_not_matching"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "price_range"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "lowering_not_lower"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "lowering_below_step"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "lowering_too_deep"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "lowering_needs_confirmation"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "POST",
            "path": "/market/offers/{uuid}/lower",
            "auth": "app_token",
            "scope": "market:offers:write",
            "apps": [
                "carrier"
            ],
            "idempotency_key": true,
            "limit": "write",
            "summary": {
                "en": "Lowers the carrier's own standing offer in an open auction to a new absolute price in halalas before VAT, once the wait between two lowerings has passed; a large lowering needs confirmed: true.",
                "ar": "يخفّض الناقل سعر عرضه القائم في مزاد مفتوح إلى سعر جديد مطلق بالهللات قبل الضريبة، بعد مرور المهلة بين تخفيضين؛ والتخفيض الكبير يحتاج confirmed: true."
            }
        },
        {
            "name": "market.api.offers.show",
            "example": {
                "request": null,
                "response": {
                    "uuid": "0193b6a2-4c18-7e53-9d41-2a7f0b8c3e65",
                    "reference": "MR-0004302",
                    "route": "الدمام ← الرياض",
                    "state": "submitted",
                    "total_excl_vat_halalas": 95000,
                    "currency": "SAR",
                    "valid_until": "2026-11-27T12:00:00Z",
                    "earliest_pickup_at": "2026-11-28T05:00:00Z",
                    "decline_reason": null,
                    "includes": [
                        {
                            "code": "unloading_help",
                            "name": "مساعدة في التنزيل",
                            "quantity": 2,
                            "unit": "worker"
                        }
                    ],
                    "thread_uuid": "0193b6a2-4d02-7b9e-8a35-6c0e2f1d9a47",
                    "unread_messages": 1,
                    "offer_mode": "sealed",
                    "auction": null
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/offers/{uuid}",
            "auth": "app_token",
            "scope": "market:offers:read",
            "apps": [
                "carrier"
            ],
            "idempotency_key": false,
            "limit": null,
            "summary": {
                "en": "Reads one of the carrier's own offers; an offer that is not its own answers the same 404 as one that does not exist. In an open auction the offer's auction block also carries lowering, the bounds of its next lowering: highest_halalas (the highest price it may be lowered to, one step under the current price), lowest_halalas (the lowest, a share of the current price), confirm_below_halalas (a price under it needs confirmed), step_percent_bp and step_floor_halalas (the step is the larger of the two), interval_seconds (the wait between two lowerings), and extends_closing with extend_span_minutes (whether a bid now moves the close, and by how many minutes); lowering is null when the offer can no longer be lowered.",
                "ar": "يقرأ أحد عروض الناقل نفسه؛ والعرض الذي ليس له يجيب 404 نفسها التي يجيبها عرض غير موجود. وفي المزاد المفتوح تحمل كتلة auction في العرض كتلة lowering، حدود تخفيضه التالي: highest_halalas (أعلى سعر يُخفَّض إليه، أدنى من السعر الحالي بخطوة) وlowest_halalas (أدنى سعر، نسبة من السعر الحالي) وconfirm_below_halalas (سعر دونه يحتاج تأكيدًا) وstep_percent_bp وstep_floor_halalas (الخطوة هي الأكبر منهما) وinterval_seconds (الانتظار بين تخفيضين) وextends_closing مع extend_span_minutes (هل تمدّد المزايدة الآن الإغلاق وبكم دقيقة)؛ وتكون lowering بـnull حين لا يمكن تخفيض العرض بعد."
            }
        },
        {
            "name": "market.api.offers.weeks",
            "example": {
                "request": {
                    "query": {
                        "weeks": 8
                    }
                },
                "response": [
                    {
                        "week_starts_on": "2026-09-27",
                        "awarded": 0,
                        "waiting": 0,
                        "not_awarded": 2
                    },
                    {
                        "week_starts_on": "2026-10-04",
                        "awarded": 1,
                        "waiting": 0,
                        "not_awarded": 3
                    },
                    {
                        "week_starts_on": "2026-10-11",
                        "awarded": 2,
                        "waiting": 0,
                        "not_awarded": 1
                    },
                    {
                        "week_starts_on": "2026-10-18",
                        "awarded": 0,
                        "waiting": 0,
                        "not_awarded": 0
                    },
                    {
                        "week_starts_on": "2026-10-25",
                        "awarded": 1,
                        "waiting": 0,
                        "not_awarded": 4
                    },
                    {
                        "week_starts_on": "2026-11-01",
                        "awarded": 3,
                        "waiting": 0,
                        "not_awarded": 2
                    },
                    {
                        "week_starts_on": "2026-11-08",
                        "awarded": 1,
                        "waiting": 1,
                        "not_awarded": 1
                    },
                    {
                        "week_starts_on": "2026-11-15",
                        "awarded": 0,
                        "waiting": 2,
                        "not_awarded": 0
                    }
                ],
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/offers/weeks",
            "auth": "app_token",
            "scope": "market:offers:read",
            "apps": [
                "carrier"
            ],
            "idempotency_key": false,
            "limit": null,
            "summary": {
                "en": "The carrier's own offers by outcome in each of the last 8 or 26 weeks (weeks, 8 by default), Sunday to Saturday in KSA time, earliest first with every week present: awarded, still waiting, or not awarded (withdrawn, expired or declined); counts only.",
                "ar": "عروض الناقل نفسه بحسب النتيجة في كل أسبوع من آخر 8 أو 26 أسبوعًا (weeks، والأصل 8)، من الأحد إلى السبت بتوقيت السعودية، الأقدم أولًا وكل أسبوع حاضر: فاز أو ما زال ينتظر أو لم يفز (سُحب أو انتهى أو رُفض)؛ أعداد فقط."
            }
        },
        {
            "name": "market.api.offers.withdraw",
            "example": {
                "request": null,
                "response": {
                    "uuid": "0193b6a2-4c18-7e53-9d41-2a7f0b8c3e65",
                    "reference": "MR-0004302",
                    "route": "الدمام ← الرياض",
                    "state": "withdrawn",
                    "total_excl_vat_halalas": 95000,
                    "currency": "SAR",
                    "valid_until": "2026-11-27T12:00:00Z",
                    "earliest_pickup_at": "2026-11-28T05:00:00Z",
                    "decline_reason": null,
                    "includes": [
                        {
                            "code": "unloading_help",
                            "name": "مساعدة في التنزيل",
                            "quantity": 2,
                            "unit": "worker"
                        }
                    ],
                    "thread_uuid": "0193b6a2-4d02-7b9e-8a35-6c0e2f1d9a47",
                    "unread_messages": 1,
                    "offer_mode": "sealed",
                    "auction": null
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "not_submitted"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "auction_binding"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "POST",
            "path": "/market/offers/{uuid}/withdraw",
            "auth": "app_token",
            "scope": "market:offers:write",
            "apps": [
                "carrier"
            ],
            "idempotency_key": true,
            "limit": "write",
            "summary": {
                "en": "Withdraws the carrier's own offer while it is still submitted and answers it with its new state; takes no body. A bid in an open auction is binding and answers 409 auction_binding, and an offer no longer submitted answers 409 not_submitted.",
                "ar": "يسحب الناقل عرضه ما دام مقدَّمًا ويجيب العرض بحالته الجديدة؛ بلا جسم. والعرض في مزاد مفتوح ملزِم فيجيب 409 auction_binding، والعرض الذي لم يعد مقدَّمًا يجيب 409 not_submitted."
            }
        },
        {
            "name": "market.api.parcels.index",
            "example": {
                "request": {
                    "query": {
                        "role": "shipper",
                        "state": "registered",
                        "limit": 50
                    }
                },
                "response": [
                    {
                        "uuid": "2d9c4e71-8a05-4b3f-96d2-7e1a0c5b8f34",
                        "code": "K7M2XQ4P",
                        "state": "registered",
                        "booking_uuid": "b7e2a5c9-4f18-4d63-8c0a-3a6d9e1f5b72",
                        "weight_g": 4200,
                        "length_cm": 40,
                        "width_cm": 30,
                        "height_cm": 25,
                        "declared_minor": 120000,
                        "declared_currency": "SAR",
                        "registered_at": "2026-11-21T08:00:00Z",
                        "final_at": null,
                        "steps": [
                            {
                                "state": "registered",
                                "by": "shipper",
                                "note": null,
                                "at": "2026-11-21T08:00:00Z"
                            }
                        ]
                    }
                ],
                "errors": [
                    {
                        "status": 422,
                        "code": "validation_failed"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/parcels",
            "auth": "app_token",
            "scope": "market:parcels:read",
            "apps": [
                "shipper",
                "carrier"
            ],
            "idempotency_key": false,
            "limit": null,
            "summary": {
                "en": "The parcels of the caller's company as shipper or as carrier, of one state when asked, paged by older_than.",
                "ar": "طرود شركة المستدعي شاحنًا أو ناقلًا، بحالة واحدة إن طُلبت، على صفحات بـolder_than."
            }
        },
        {
            "name": "market.api.parcels.link",
            "example": {
                "request": null,
                "response": {
                    "address": "https://market.example.com/track/K7M2XQ4P/1"
                },
                "errors": [
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "link_unavailable"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/parcels/{uuid}/link",
            "auth": "app_token",
            "scope": "market:parcels:register",
            "apps": [
                "shipper"
            ],
            "idempotency_key": false,
            "limit": null,
            "summary": {
                "en": "The tracking address of a parcel's current link.",
                "ar": "عنوان التتبع للرابط الحالي للطرد."
            }
        },
        {
            "name": "market.api.parcels.link_end",
            "example": {
                "request": null,
                "response": {
                    "address": "https://market.example.com/track/K7M2XQ4P/2"
                },
                "errors": [
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "link_epoch_ceiling"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited",
                        "reason": "link_end_limit"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "POST",
            "path": "/market/parcels/{uuid}/link/end",
            "auth": "app_token",
            "scope": "market:parcels:register",
            "apps": [
                "shipper"
            ],
            "idempotency_key": true,
            "limit": "write",
            "summary": {
                "en": "Ends a parcel's current tracking link and answers the new address; a link can be ended only a limited number of times.",
                "ar": "ينهي رابط تتبع الطرد الحالي ويردّ العنوان الجديد؛ ولا يُنهى الرابط إلا عددًا محدودًا من المرات."
            }
        },
        {
            "name": "market.api.parcels.show",
            "example": {
                "request": null,
                "response": {
                    "uuid": "2d9c4e71-8a05-4b3f-96d2-7e1a0c5b8f34",
                    "code": "K7M2XQ4P",
                    "state": "in_transit",
                    "booking_uuid": "b7e2a5c9-4f18-4d63-8c0a-3a6d9e1f5b72",
                    "weight_g": 4200,
                    "length_cm": 40,
                    "width_cm": 30,
                    "height_cm": 25,
                    "declared_minor": 120000,
                    "declared_currency": "SAR",
                    "registered_at": "2026-11-21T08:00:00Z",
                    "final_at": null,
                    "steps": [
                        {
                            "state": "registered",
                            "by": "shipper",
                            "note": null,
                            "at": "2026-11-21T08:00:00Z"
                        },
                        {
                            "state": "received",
                            "by": "carrier",
                            "note": null,
                            "at": "2026-11-21T09:10:00Z"
                        },
                        {
                            "state": "in_transit",
                            "by": "carrier",
                            "note": "غادرت الشاحنة الرياض",
                            "at": "2026-11-21T11:45:00Z"
                        }
                    ]
                },
                "errors": [
                    {
                        "status": 404,
                        "code": "not_found"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/parcels/{uuid}",
            "auth": "app_token",
            "scope": "market:parcels:read",
            "apps": [
                "shipper",
                "carrier"
            ],
            "idempotency_key": false,
            "limit": null,
            "summary": {
                "en": "One parcel with its code, where it stands, its size, its declared value and its steps; no position, name or internal id.",
                "ar": "طرد واحد برمزه وموضعه ومقاسه وقيمته المصرَّح بها وخطواته؛ بلا موقع ولا اسم ولا معرّف داخلي."
            }
        },
        {
            "name": "market.api.parcels.steps",
            "example": {
                "request": {
                    "state": "in_transit",
                    "note": "غادرت الشاحنة الرياض",
                    "lat": 24.7136,
                    "lng": 46.6753
                },
                "response": {
                    "uuid": "2d9c4e71-8a05-4b3f-96d2-7e1a0c5b8f34",
                    "code": "K7M2XQ4P",
                    "state": "in_transit",
                    "booking_uuid": "b7e2a5c9-4f18-4d63-8c0a-3a6d9e1f5b72",
                    "weight_g": 4200,
                    "length_cm": 40,
                    "width_cm": 30,
                    "height_cm": 25,
                    "declared_minor": 120000,
                    "declared_currency": "SAR",
                    "registered_at": "2026-11-21T08:00:00Z",
                    "final_at": null,
                    "steps": [
                        {
                            "state": "registered",
                            "by": "shipper",
                            "note": null,
                            "at": "2026-11-21T08:00:00Z"
                        },
                        {
                            "state": "received",
                            "by": "carrier",
                            "note": null,
                            "at": "2026-11-21T09:10:00Z"
                        },
                        {
                            "state": "in_transit",
                            "by": "carrier",
                            "note": "غادرت الشاحنة الرياض",
                            "at": "2026-11-21T11:45:00Z"
                        }
                    ]
                },
                "errors": [
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "forward_only"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "final"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "note_too_long"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "POST",
            "path": "/market/parcels/{uuid}/steps",
            "auth": "app_token",
            "scope": "market:parcels:move",
            "apps": [
                "carrier"
            ],
            "idempotency_key": true,
            "limit": "write",
            "summary": {
                "en": "The carrier moves a parcel to a later state, with an optional plain note and position; a state never goes back.",
                "ar": "ينقل الناقل الطرد إلى حالة لاحقة، مع ملاحظة مجردة وموضع اختياريين؛ ولا تعود الحالة إلى الوراء."
            }
        },
        {
            "name": "market.api.parcels.store",
            "example": {
                "request": {
                    "booking_uuid": "b7e2a5c9-4f18-4d63-8c0a-3a6d9e1f5b72",
                    "weight_g": 4200,
                    "length_cm": 40,
                    "width_cm": 30,
                    "height_cm": 25,
                    "declared_minor": 120000,
                    "declared_currency": "SAR"
                },
                "response": {
                    "uuid": "2d9c4e71-8a05-4b3f-96d2-7e1a0c5b8f34",
                    "code": "K7M2XQ4P",
                    "state": "registered",
                    "booking_uuid": "b7e2a5c9-4f18-4d63-8c0a-3a6d9e1f5b72",
                    "weight_g": 4200,
                    "length_cm": 40,
                    "width_cm": 30,
                    "height_cm": 25,
                    "declared_minor": 120000,
                    "declared_currency": "SAR",
                    "registered_at": "2026-11-21T08:00:00Z",
                    "final_at": null,
                    "steps": [
                        {
                            "state": "registered",
                            "by": "shipper",
                            "note": null,
                            "at": "2026-11-21T08:00:00Z"
                        }
                    ]
                },
                "errors": [
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "measure_out_of_range"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "declared_needs_both"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "booking_not_open"
                    },
                    {
                        "status": 403,
                        "code": "plan_feature_required",
                        "reason": "market.shipper"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "POST",
            "path": "/market/parcels",
            "auth": "app_token",
            "scope": "market:parcels:register",
            "apps": [
                "shipper"
            ],
            "idempotency_key": true,
            "limit": "write",
            "summary": {
                "en": "Registers a parcel under one of the shipper's open bookings, with an optional size and declared value; the code is the market's.",
                "ar": "يسجّل طردًا تحت حجز مفتوح للشاحن، مع مقاس وقيمة مصرَّح بها اختياريين؛ والرمز من السوق."
            }
        },
        {
            "name": "market.api.payment_methods.default",
            "example": {
                "request": null,
                "response": [
                    {
                        "uuid": "0193b2e0-7a14-7c3d-9e58-2f6a1d4b8c93",
                        "brand": "visa",
                        "last_four": "4242",
                        "exp_month": 12,
                        "exp_year": 2030,
                        "default": false,
                        "expired": false,
                        "created_at": "2026-11-20T09:30:00Z",
                        "saved_by": "نورة السالم",
                        "removal": null
                    },
                    {
                        "uuid": "0193b2e0-9c31-7f20-8b47-3d5e6a1c2f08",
                        "brand": "mastercard",
                        "last_four": "4444",
                        "exp_month": 7,
                        "exp_year": 2031,
                        "default": true,
                        "expired": false,
                        "created_at": "2026-11-21T14:05:00Z",
                        "saved_by": "نورة السالم",
                        "removal": null
                    },
                    {
                        "uuid": "0193b2e0-b552-7a6e-93d1-5c8f2e7a4b16",
                        "brand": "mada",
                        "last_four": "1881",
                        "exp_month": 3,
                        "exp_year": 2026,
                        "default": false,
                        "expired": true,
                        "created_at": "2025-12-02T11:00:00Z",
                        "saved_by": null,
                        "removal": null
                    }
                ],
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "POST",
            "path": "/market/payment-methods/{uuid}/default",
            "auth": "app_token",
            "scope": "market:payment_methods:write",
            "apps": [
                "shipper"
            ],
            "idempotency_key": true,
            "limit": "write",
            "summary": {
                "en": "Makes one of the company's saved cards the default for market payments and answers with the card list; an expired or unknown card is not_found. Send an Idempotency-Key header and an empty body.",
                "ar": "يجعل إحدى البطاقات المحفوظة للشركة الافتراضية لمدفوعات السوق ويجيب بقائمة البطاقات؛ والبطاقة المنتهية أو المجهولة not_found. أرسل ترويسة Idempotency-Key وجسمًا فارغًا."
            }
        },
        {
            "name": "market.api.payment_methods.destroy",
            "example": {
                "request": null,
                "response": [],
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "DELETE",
            "path": "/market/payment-methods/{uuid}",
            "auth": "app_token",
            "scope": "market:payment_methods:write",
            "apps": [
                "shipper"
            ],
            "idempotency_key": true,
            "limit": "write",
            "summary": {
                "en": "Deletes one of the company's saved cards (also at the payment gateway) and answers 204 with no body; an unknown card is not_found, and a card whose removal at the gateway failed stays listed with removal: failed until it is retried.",
                "ar": "يحذف إحدى البطاقات المحفوظة للشركة (ولدى بوابة الدفع أيضًا) ويجيب 204 بلا جسم؛ والبطاقة المجهولة not_found، والتي فشل حذفها لدى البوابة تبقى في القائمة بـremoval: failed حتى يُعاد."
            }
        },
        {
            "name": "market.api.payment_methods.index",
            "example": {
                "request": null,
                "response": [
                    {
                        "uuid": "0193b2e0-7a14-7c3d-9e58-2f6a1d4b8c93",
                        "brand": "visa",
                        "last_four": "4242",
                        "exp_month": 12,
                        "exp_year": 2030,
                        "default": true,
                        "expired": false,
                        "created_at": "2026-11-20T09:30:00Z",
                        "saved_by": "نورة السالم",
                        "removal": null
                    },
                    {
                        "uuid": "0193b2e0-9c31-7f20-8b47-3d5e6a1c2f08",
                        "brand": "mastercard",
                        "last_four": "4444",
                        "exp_month": 7,
                        "exp_year": 2031,
                        "default": false,
                        "expired": false,
                        "created_at": "2026-11-21T14:05:00Z",
                        "saved_by": "نورة السالم",
                        "removal": null
                    },
                    {
                        "uuid": "0193b2e0-b552-7a6e-93d1-5c8f2e7a4b16",
                        "brand": "mada",
                        "last_four": "1881",
                        "exp_month": 3,
                        "exp_year": 2026,
                        "default": false,
                        "expired": true,
                        "created_at": "2025-12-02T11:00:00Z",
                        "saved_by": null,
                        "removal": null
                    }
                ],
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/payment-methods",
            "auth": "app_token",
            "scope": "market:payment_methods:read",
            "apps": [
                "shipper"
            ],
            "idempotency_key": false,
            "limit": null,
            "summary": {
                "en": "Lists the saved payment cards of the shipper's own company (the default first): the token's display facts only, never a card number; meta.saving_enabled says whether saving a card with a payment is switched on. Needs the pay-invoices right; a card is told by its uuid.",
                "ar": "يعرض البطاقات المحفوظة لشركة الشاحن نفسها (الافتراضية أولًا): بيانات العرض فقط ولا رقم بطاقة؛ ويقول meta.saving_enabled هل حفظ البطاقة مع الدفع مفعّل. يحتاج صلاحية دفع الفواتير، وتُعرَّف البطاقة بمعرّفها uuid."
            }
        },
        {
            "name": "market.api.payout_requests.cancel",
            "example": {
                "request": null,
                "response": {
                    "uuid": "6a1f3c8e-2b94-4d07-a5e1-9c7d0b4e2f68",
                    "amount_halalas": 500000,
                    "currency": "SAR",
                    "destination_tail": "4821",
                    "state": "cancelled",
                    "requested_at": "2026-11-21T08:30:00Z",
                    "reference": null,
                    "reason": null,
                    "can_cancel": false
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "not_waiting"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "POST",
            "path": "/market/payout-requests/{uuid}/cancel",
            "auth": "app_token",
            "scope": "market:payouts:write",
            "apps": [
                "carrier"
            ],
            "idempotency_key": true,
            "limit": "write",
            "summary": {
                "en": "Takes back a withdrawal request that still waits for the market.",
                "ar": "يسحب طلب سحب ما زال ينتظر السوق."
            }
        },
        {
            "name": "market.api.payout_requests.index",
            "example": {
                "request": null,
                "response": [
                    {
                        "uuid": "6a1f3c8e-2b94-4d07-a5e1-9c7d0b4e2f68",
                        "amount_halalas": 500000,
                        "currency": "SAR",
                        "destination_tail": "4821",
                        "state": "requested",
                        "requested_at": "2026-11-21T08:30:00Z",
                        "reference": null,
                        "reason": null,
                        "can_cancel": true
                    },
                    {
                        "uuid": "0e8d5b2a-7c31-4f96-b4a8-1d3f6e9c7a52",
                        "amount_halalas": 750000,
                        "currency": "SAR",
                        "destination_tail": "4821",
                        "state": "paid",
                        "requested_at": "2026-11-12T09:00:00Z",
                        "reference": "BANK-77120045",
                        "reason": null,
                        "can_cancel": false
                    },
                    {
                        "uuid": "3c7e9a14-5d28-4b6f-8e01-a2f4c6d8b937",
                        "amount_halalas": 300000,
                        "currency": "SAR",
                        "destination_tail": "4821",
                        "state": "voided",
                        "requested_at": "2026-10-08T07:15:00Z",
                        "reference": null,
                        "reason": "lapsed",
                        "can_cancel": false
                    }
                ],
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/payout-requests",
            "auth": "app_token",
            "scope": "market:wallet:read",
            "apps": [
                "carrier"
            ],
            "idempotency_key": false,
            "limit": null,
            "summary": {
                "en": "The company's withdrawal requests with their state, the last digits of the destination account, the reference of a paid one, the reason of a refused one and the code of why a void one went void (lapsed or destination_changed).",
                "ar": "طلبات سحب الشركة بحالتها وآخر أرقام الحساب المستلِم ومرجع الطلب المدفوع وسبب المرفوض ورمز سبب بطلان الباطل (lapsed أو destination_changed)."
            }
        },
        {
            "name": "market.api.payout_requests.store",
            "example": {
                "request": {
                    "amount_halalas": 500000
                },
                "response": {
                    "uuid": "6a1f3c8e-2b94-4d07-a5e1-9c7d0b4e2f68",
                    "amount_halalas": 500000,
                    "currency": "SAR",
                    "destination_tail": "4821",
                    "state": "requested",
                    "requested_at": "2026-11-21T08:30:00Z",
                    "reference": null,
                    "reason": null,
                    "can_cancel": true
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "below_minimum"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "above_ceiling"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "exceeds_available"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "no_verified_destination"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "carrier_not_payable"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited",
                        "reason": "too_many"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    },
                    {
                        "status": 503,
                        "code": "service_unavailable",
                        "reason": "settings_unreadable"
                    }
                ]
            },
            "method": "POST",
            "path": "/market/payout-requests",
            "auth": "app_token",
            "scope": "market:payouts:write",
            "apps": [
                "carrier"
            ],
            "idempotency_key": true,
            "limit": "write",
            "summary": {
                "en": "Asks to withdraw an amount in halalas to the company's verified account; the company's standing, the market's limits and what is available decide, and a retry with the same key makes one request.",
                "ar": "يطلب سحب مبلغ بالهللات إلى حساب الشركة الموثَّق؛ يقرّر ذلك وضع الشركة وحدود السوق والمتاح، والإعادة بالمفتاح نفسه تصنع طلبًا واحدًا."
            }
        },
        {
            "name": "market.api.places.destroy",
            "example": {
                "request": null,
                "response": [],
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "place_in_use"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "DELETE",
            "path": "/market/places/{uuid}",
            "auth": "app_token",
            "scope": "market:places:write",
            "apps": [
                "shipper"
            ],
            "idempotency_key": true,
            "limit": "write",
            "summary": {
                "en": "Deletes one saved place of the shipper's company unless a carrier listing still uses it as its origin (409 place_in_use); answers 204 with no body.",
                "ar": "يحذف مكانًا محفوظًا واحدًا لشركة الشاحن ما لم يكن إعلان ناقل يستعمله مكان انطلاق (409 place_in_use)؛ ويجيب 204 بلا جسم."
            }
        },
        {
            "name": "market.api.places.index",
            "example": {
                "request": null,
                "response": [
                    {
                        "uuid": "0193a1e8-3b52-7c09-a4d6-8e1f5b2c7a93",
                        "label": "مستودع الرياض",
                        "city_id": 1024,
                        "district_id": null,
                        "lat": 24.6877,
                        "lng": 46.7219,
                        "address": "المدينة الصناعية الثانية، الرياض",
                        "note": "البوابة الشرقية",
                        "created_at": "2026-11-20T08:15:30Z",
                        "updated_at": "2026-11-20T08:15:30Z"
                    },
                    {
                        "uuid": "0193a1e8-5d17-7a3e-b2c8-4f0a9d6e1b75",
                        "label": "ميناء جدة",
                        "city_id": 1301,
                        "district_id": null,
                        "lat": 21.4858,
                        "lng": 39.1925,
                        "address": "ميناء جدة الإسلامي",
                        "note": null,
                        "created_at": "2026-11-20T08:21:02Z",
                        "updated_at": "2026-11-21T06:40:12Z"
                    }
                ],
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/places",
            "auth": "app_token",
            "scope": "market:places:read",
            "apps": [
                "shipper"
            ],
            "idempotency_key": false,
            "limit": null,
            "summary": {
                "en": "Lists the saved places of the shipper's company, a page at a time.",
                "ar": "يسرد الأماكن المحفوظة لشركة الشاحن صفحة صفحة."
            }
        },
        {
            "name": "market.api.places.show",
            "example": {
                "request": null,
                "response": {
                    "uuid": "0193a1e8-3b52-7c09-a4d6-8e1f5b2c7a93",
                    "label": "مستودع الرياض",
                    "city_id": 1024,
                    "district_id": null,
                    "lat": 24.6877,
                    "lng": 46.7219,
                    "address": "المدينة الصناعية الثانية، الرياض",
                    "note": "البوابة الشرقية",
                    "created_at": "2026-11-20T08:15:30Z",
                    "updated_at": "2026-11-20T08:15:30Z"
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/places/{uuid}",
            "auth": "app_token",
            "scope": "market:places:read",
            "apps": [
                "shipper"
            ],
            "idempotency_key": false,
            "limit": null,
            "summary": {
                "en": "Reads one saved place by its uuid; another company's place answers the same 404 as an unknown one.",
                "ar": "يقرأ مكانًا محفوظًا بمعرّفه uuid؛ ومكان شركة أخرى يجيب 404 كالمجهول تمامًا."
            }
        },
        {
            "name": "market.api.places.store",
            "example": {
                "request": {
                    "label": "مستودع الرياض",
                    "city_id": 1024,
                    "lat": 24.6877,
                    "lng": 46.7219,
                    "address": "المدينة الصناعية الثانية، الرياض",
                    "note": "البوابة الشرقية"
                },
                "response": {
                    "uuid": "0193a1e8-3b52-7c09-a4d6-8e1f5b2c7a93",
                    "label": "مستودع الرياض",
                    "city_id": 1024,
                    "district_id": null,
                    "lat": 24.6877,
                    "lng": 46.7219,
                    "address": "المدينة الصناعية الثانية، الرياض",
                    "note": "البوابة الشرقية",
                    "created_at": "2026-11-20T08:15:30Z",
                    "updated_at": "2026-11-20T08:15:30Z"
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "place_label_taken"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "limit_reached"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "place_invalid"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "choice_unknown"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "POST",
            "path": "/market/places",
            "auth": "app_token",
            "scope": "market:places:write",
            "apps": [
                "shipper"
            ],
            "idempotency_key": true,
            "limit": "write",
            "summary": {
                "en": "Saves a place: a label unique within the company, a city, a point (lat, lng) and optionally a district, an address and a note; the number of places a company may keep is limited.",
                "ar": "يحفظ مكانًا: تسمية فريدة في الشركة ومدينة ونقطة (lat وlng) وحيًّا وعنوانًا وملاحظة اختياريًا؛ وعدد الأماكن التي تحتفظ بها الشركة محدود."
            }
        },
        {
            "name": "market.api.places.update",
            "example": {
                "request": {
                    "label": "المستودع الرئيسي",
                    "note": null
                },
                "response": {
                    "uuid": "0193a1e8-3b52-7c09-a4d6-8e1f5b2c7a93",
                    "label": "المستودع الرئيسي",
                    "city_id": 1024,
                    "district_id": null,
                    "lat": 24.6877,
                    "lng": 46.7219,
                    "address": "المدينة الصناعية الثانية، الرياض",
                    "note": null,
                    "created_at": "2026-11-20T08:15:30Z",
                    "updated_at": "2026-11-21T09:05:44Z"
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "place_label_taken"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "place_invalid"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "choice_unknown"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "PATCH",
            "path": "/market/places/{uuid}",
            "auth": "app_token",
            "scope": "market:places:write",
            "apps": [
                "shipper"
            ],
            "idempotency_key": true,
            "limit": "write",
            "summary": {
                "en": "Edits a saved place by the keys sent only; a new city without a district clears the previous city's district, and the label stays unique within the company.",
                "ar": "يعدّل مكانًا محفوظًا بالمفاتيح المرسلة وحدها؛ ومدينة جديدة بلا حيّ تمحو حيّ المدينة السابقة، وتبقى التسمية فريدة في الشركة."
            }
        },
        {
            "name": "market.api.ratings.index",
            "example": {
                "request": null,
                "response": [
                    {
                        "booking_uuid": "0193a1f2-8c53-7f20-ae46-3d7c9f1a5b28",
                        "reference": "MR-0004190",
                        "created_at": "2026-11-15T08:45:00Z",
                        "stars": 2,
                        "aspects": {
                            "communication": 2
                        },
                        "comment": null,
                        "comment_state": "withheld",
                        "comment_reason": "off_topic",
                        "may_appeal": true,
                        "reply": null,
                        "is_hidden": false
                    }
                ],
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/ratings",
            "auth": "app_token",
            "scope": "market:reviews:write",
            "apps": [
                "shipper"
            ],
            "idempotency_key": false,
            "limit": null,
            "summary": {
                "en": "Lists the reviews the shipper's company wrote, newest first, a page at a time (page, and per_page up to 50; the meta gives page, per_page and total): the booking uuid and reference, the stars and aspects, the comment and where it stands, the fixed reason when it was not shown, may_appeal for the person who wrote it, the carrier's passed reply and whether the review is hidden; the carrier is never named.",
                "ar": "يسرد التقييمات التي كتبتها شركة الشاحن، الأحدث أولًا، صفحة صفحة (page وper_page حتى 50؛ وتذكر البيانات الوصفية page وper_page وtotal): uuid الحجز ومرجعه، والنجوم والجوانب، والتعليق وحاله، والسبب الثابت إن لم يُعرض، وmay_appeal لمن كتبه، وردّ الناقل المُجاز وهل التقييم مخفي؛ ولا يُسمّى الناقل أبدًا."
            }
        },
        {
            "name": "market.api.ratings.open",
            "example": {
                "request": null,
                "response": [
                    {
                        "booking_uuid": "0193a1f2-7a40-7e1b-9d35-2c6b8e0f4a17",
                        "reference": "MR-0004217",
                        "ended_at": "2026-11-19T11:20:00Z",
                        "closes_at": "2026-12-19T11:20:00Z"
                    }
                ],
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/ratings/open",
            "auth": "app_token",
            "scope": "market:reviews:write",
            "apps": [
                "shipper"
            ],
            "idempotency_key": false,
            "limit": null,
            "summary": {
                "en": "Lists the finished, settled bookings of the shipper's company that may still be rated, the nearest closing first and at most 25: the booking uuid, its reference, when it finished and the last moment to rate it.",
                "ar": "يسرد الحجوزات المنتهية والمسوّاة لشركة الشاحن التي يمكن تقييمها بعدُ، الأقرب إغلاقًا أولًا وبحد أقصى 25: uuid الحجز ومرجعه ووقت انتهائه وآخر وقت لتقييمه."
            }
        },
        {
            "name": "market.api.ratings.summary",
            "example": {
                "request": null,
                "response": {
                    "written": 6,
                    "open": 2,
                    "appealable": 1
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/ratings/summary",
            "auth": "app_token",
            "scope": "market:reviews:write",
            "apps": [
                "shipper"
            ],
            "idempotency_key": false,
            "limit": null,
            "summary": {
                "en": "Gives the signed-in shipper's company its ratings figures: how many reviews it wrote, how many finished bookings still wait for a rating, and how many withheld comments this person may still appeal.",
                "ar": "يعطي شركة الشاحن المسجَّل أرقام تقييماتها: كم تقييمًا كتبت، وكم حجزًا منتهيًا ما زال ينتظر تقييمًا، وكم تعليقًا محجوبًا يستطيع هذا الشخص أن يعترض عليه بعدُ."
            }
        },
        {
            "name": "market.api.recurrence_rules.end",
            "example": {
                "request": null,
                "response": {
                    "uuid": "0193a2e1-7b4c-7d93-a5f0-3c6e9b1d4a28",
                    "source_booking_uuid": "0193a1f7-2e64-7b18-9d03-6a5c8e1f2b74",
                    "source_reference": "MR-0003981",
                    "cadence": "weekly",
                    "ends_on": "2027-02-28",
                    "max_occurrences": null,
                    "occurrences_made": 0,
                    "source_total_halalas": 118000,
                    "currency": "SAR",
                    "consent_percent": 5,
                    "consent_cap_halalas": 125000,
                    "state": "ended",
                    "pause_reason": null,
                    "ended_reason": "shipper",
                    "created_at": "2026-11-21T09:15:00Z"
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "POST",
            "path": "/market/recurrence-rules/{uuid}/end",
            "auth": "app_token",
            "scope": "market:bookings:write",
            "apps": [
                "shipper",
                "carrier"
            ],
            "idempotency_key": true,
            "limit": "write",
            "summary": {
                "en": "Ends a recurring booking rule for good; a repeat on an ended rule changes nothing.",
                "ar": "ينهي قاعدة الحجز المتكرر نهائيًا؛ وتكرار الطلب على قاعدة منتهية لا يغيّر شيئًا."
            }
        },
        {
            "name": "market.api.recurrence_rules.index",
            "example": {
                "request": null,
                "response": [
                    {
                        "uuid": "0193a2e1-7b4c-7d93-a5f0-3c6e9b1d4a28",
                        "source_booking_uuid": "0193a1f7-2e64-7b18-9d03-6a5c8e1f2b74",
                        "source_reference": "MR-0003981",
                        "cadence": "weekly",
                        "ends_on": "2027-02-28",
                        "max_occurrences": null,
                        "occurrences_made": 0,
                        "source_total_halalas": 118000,
                        "currency": "SAR",
                        "consent_percent": 5,
                        "consent_cap_halalas": 125000,
                        "state": "active",
                        "pause_reason": null,
                        "ended_reason": null,
                        "created_at": "2026-11-21T09:15:00Z"
                    }
                ],
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/recurrence-rules",
            "auth": "app_token",
            "scope": "market:bookings:read",
            "apps": [
                "shipper",
                "carrier"
            ],
            "idempotency_key": false,
            "limit": null,
            "summary": {
                "en": "Lists the recurring booking rules of the caller's company, up to 50, each with its cadence, end, consent and state.",
                "ar": "يعرض قواعد الحجز المتكرر لشركة المستدعي بحدّ أقصى 50 قاعدة، لكل قاعدة تكرارها ونهايتها وموافقتها وحالتها."
            }
        },
        {
            "name": "market.api.recurrence_rules.pause",
            "example": {
                "request": null,
                "response": {
                    "uuid": "0193a2e1-7b4c-7d93-a5f0-3c6e9b1d4a28",
                    "source_booking_uuid": "0193a1f7-2e64-7b18-9d03-6a5c8e1f2b74",
                    "source_reference": "MR-0003981",
                    "cadence": "weekly",
                    "ends_on": "2027-02-28",
                    "max_occurrences": null,
                    "occurrences_made": 0,
                    "source_total_halalas": 118000,
                    "currency": "SAR",
                    "consent_percent": 5,
                    "consent_cap_halalas": 125000,
                    "state": "paused",
                    "pause_reason": "shipper",
                    "ended_reason": null,
                    "created_at": "2026-11-21T09:15:00Z"
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "rule_ended"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "POST",
            "path": "/market/recurrence-rules/{uuid}/pause",
            "auth": "app_token",
            "scope": "market:bookings:write",
            "apps": [
                "shipper",
                "carrier"
            ],
            "idempotency_key": true,
            "limit": "write",
            "summary": {
                "en": "Pauses a running recurring booking rule; a repeat on a paused rule changes nothing, and an ended rule cannot be paused.",
                "ar": "يوقف قاعدة حجز متكرر جارية مؤقتًا؛ وتكرار الطلب على قاعدة موقوفة لا يغيّر شيئًا، ولا تُوقَف قاعدة منتهية."
            }
        },
        {
            "name": "market.api.recurrence_rules.resume",
            "example": {
                "request": null,
                "response": {
                    "uuid": "0193a2e1-7b4c-7d93-a5f0-3c6e9b1d4a28",
                    "source_booking_uuid": "0193a1f7-2e64-7b18-9d03-6a5c8e1f2b74",
                    "source_reference": "MR-0003981",
                    "cadence": "weekly",
                    "ends_on": "2027-02-28",
                    "max_occurrences": null,
                    "occurrences_made": 0,
                    "source_total_halalas": 118000,
                    "currency": "SAR",
                    "consent_percent": 5,
                    "consent_cap_halalas": 125000,
                    "state": "active",
                    "pause_reason": null,
                    "ended_reason": null,
                    "created_at": "2026-11-21T09:15:00Z"
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "rule_ended"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "POST",
            "path": "/market/recurrence-rules/{uuid}/resume",
            "auth": "app_token",
            "scope": "market:bookings:write",
            "apps": [
                "shipper",
                "carrier"
            ],
            "idempotency_key": true,
            "limit": "write",
            "summary": {
                "en": "Resumes a paused recurring booking rule and clears its count of skipped dates; a repeat on a running rule changes nothing, and an ended rule cannot be resumed.",
                "ar": "يستأنف قاعدة حجز متكرر موقوفة ويصفّر عدّ التواريخ المتخطّاة؛ وتكرار الطلب على قاعدة جارية لا يغيّر شيئًا، ولا تُستأنف قاعدة منتهية."
            }
        },
        {
            "name": "market.api.recurrence_rules.show",
            "example": {
                "request": null,
                "response": {
                    "uuid": "0193a2e1-7b4c-7d93-a5f0-3c6e9b1d4a28",
                    "source_booking_uuid": "0193a1f7-2e64-7b18-9d03-6a5c8e1f2b74",
                    "source_reference": "MR-0003981",
                    "cadence": "weekly",
                    "ends_on": "2027-02-28",
                    "max_occurrences": null,
                    "occurrences_made": 0,
                    "source_total_halalas": 118000,
                    "currency": "SAR",
                    "consent_percent": 5,
                    "consent_cap_halalas": 125000,
                    "state": "active",
                    "pause_reason": null,
                    "ended_reason": null,
                    "created_at": "2026-11-21T09:15:00Z"
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/recurrence-rules/{uuid}",
            "auth": "app_token",
            "scope": "market:bookings:read",
            "apps": [
                "shipper",
                "carrier"
            ],
            "idempotency_key": false,
            "limit": null,
            "summary": {
                "en": "Reads one recurring booking rule of the caller's company.",
                "ar": "يقرأ قاعدة حجز متكرر واحدة من قواعد شركة المستدعي."
            }
        },
        {
            "name": "market.api.recurrence_rules.store",
            "example": {
                "request": {
                    "cadence": "weekly",
                    "ends_on": "2027-02-28",
                    "consent_percent": 5,
                    "consent_cap_halalas": 125000
                },
                "response": {
                    "uuid": "0193a2e1-7b4c-7d93-a5f0-3c6e9b1d4a28",
                    "source_booking_uuid": "0193a1f7-2e64-7b18-9d03-6a5c8e1f2b74",
                    "source_reference": "MR-0003981",
                    "cadence": "weekly",
                    "ends_on": "2027-02-28",
                    "max_occurrences": null,
                    "occurrences_made": 0,
                    "source_total_halalas": 118000,
                    "currency": "SAR",
                    "consent_percent": 5,
                    "consent_cap_halalas": 125000,
                    "state": "active",
                    "pause_reason": null,
                    "ended_reason": null,
                    "created_at": "2026-11-21T09:15:00Z"
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "source_not_freight"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "source_not_finished"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "rule_exists"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "limit_reached"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "needs_an_end"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "occurrences_out_of_range"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "end_out_of_range"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "consent_incomplete"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "consent_over_ceiling"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "POST",
            "path": "/market/bookings/{uuid}/recurrence",
            "auth": "app_token",
            "scope": "market:bookings:write",
            "apps": [
                "shipper",
                "carrier"
            ],
            "idempotency_key": true,
            "limit": "write",
            "summary": {
                "en": "Starts a recurring booking from one of the company's own finished freight bookings: the cadence (daily, weekly or monthly), an end date within a year or at most 12 dates, and optionally a price consent (a percent above the first total and a cap in halalas, both or neither); one live rule for a booking, and the number of live rules a company may hold is limited.",
                "ar": "يبدأ حجزًا متكررًا من أحد حجوزات الشحن المنتهية لشركة المستدعي: التكرار (يومي أو أسبوعي أو شهري)، ونهاية بتاريخ خلال سنة أو بعدد لا يزيد على 12 تاريخًا، واختياريًا موافقة على السعر (نسبة فوق السعر الأول وسقف بالهللات، معًا أو لا شيء)؛ قاعدة حيّة واحدة لكل حجز، وعدد القواعد الحيّة للشركة محدود."
            }
        },
        {
            "name": "market.api.rental_extensions.index",
            "example": {
                "request": null,
                "response": [
                    {
                        "booking_uuid": "0193a2b4-7c10-7e53-9d2a-6b4f8a1c3e75",
                        "uuid": "0193a2c9-1e47-7a86-b3d5-8f2c6e0a9d14",
                        "state": "requested",
                        "old_ends_at": "2026-11-29T06:00:00Z",
                        "new_ends_at": "2026-12-02T06:00:00Z",
                        "difference_halalas": 165000,
                        "requested_at": "2026-11-26T09:10:00Z",
                        "decided_at": null,
                        "decision_reason": null
                    },
                    {
                        "booking_uuid": "0193a2d1-5b83-7f20-8e47-3c9a1d6b2f58",
                        "uuid": "0193a2d6-90c2-7b14-a6e8-2d5f7a3c1b09",
                        "state": "requested",
                        "old_ends_at": "2026-12-03T10:00:00Z",
                        "new_ends_at": "2026-12-05T10:00:00Z",
                        "difference_halalas": 98000,
                        "requested_at": "2026-11-27T07:30:00Z",
                        "decided_at": null,
                        "decision_reason": null
                    }
                ],
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/rental-extensions",
            "auth": "app_token",
            "scope": "market:rentals:write",
            "apps": [
                "carrier"
            ],
            "idempotency_key": false,
            "limit": null,
            "summary": {
                "en": "The longer-hire requests waiting for the carrier's answer on its own bookings, earliest first and at most 50 with no paging; each row has the booking, the end it would move to, the difference in halalas before VAT and when it was asked.",
                "ar": "طلبات الإيجار الأطول المنتظرة ردّ الناقل على حجوزاته، الأقدم أولًا وبحد أقصى 50 دون ترقيم؛ وفي كل صف الحجز والنهاية التي سينتقل إليها والفرق بالهللات قبل الضريبة ووقت الطلب."
            }
        },
        {
            "name": "market.api.requests.cancel",
            "example": {
                "request": {
                    "reason": "تأجّل الحمل إلى الشهر القادم"
                },
                "response": {
                    "uuid": "0193a1c2-5d7e-7c4a-8f21-9b3d6e1a4c07",
                    "reference": "MR-0004217",
                    "state": "cancelled",
                    "service_type": "freight",
                    "title": "مواسير حديد من الرياض إلى جدة",
                    "load_mode": "ftl",
                    "cargo": {
                        "type": "مواد بناء",
                        "type_code": "building_materials",
                        "note": null,
                        "weight_kg": 22000,
                        "volume_m3": null,
                        "length_cm": null,
                        "width_cm": null,
                        "height_cm": null,
                        "value_halalas": null
                    },
                    "liquid": {
                        "type": null,
                        "type_code": null,
                        "quantity": null,
                        "unit": null
                    },
                    "answers": [],
                    "rental": {
                        "model": null,
                        "hours": null,
                        "with_driver": null
                    },
                    "pickup": {
                        "city_id": 1024,
                        "city": "الرياض",
                        "district_id": null,
                        "lat": 24.6877,
                        "lng": 46.7219,
                        "address": "المدينة الصناعية الثانية، الرياض",
                        "note": null
                    },
                    "dropoff": {
                        "city_id": 1301,
                        "city": "جدة",
                        "district_id": null,
                        "lat": 21.4858,
                        "lng": 39.1925,
                        "address": "ميناء جدة الإسلامي",
                        "note": null
                    },
                    "window": {
                        "starts_at": "2026-11-28T04:00:00Z",
                        "ends_at": "2026-11-29T20:00:00Z"
                    },
                    "offers_close_at": "2026-11-25T09:30:00Z",
                    "budget": {
                        "amount_halalas": 120000,
                        "currency": "SAR",
                        "excludes_vat": true,
                        "shown": false
                    },
                    "live_offers_count": 2,
                    "direct": false,
                    "legs": [
                        {
                            "uuid": "0193a1c2-5d90-7a1b-b6f4-2c8e0d5a7f13",
                            "position": 1,
                            "state": "cancelled",
                            "vehicle_type": "truck_flatbed",
                            "body_type": null,
                            "category": null,
                            "min_tons": 22,
                            "min_m3": null,
                            "needs": {
                                "refrigerated": false,
                                "tanker": false,
                                "crane": false,
                                "tracking": true
                            },
                            "weight_kg": 22000,
                            "volume_m3": null,
                            "cancel_reason": "تأجّل الحمل إلى الشهر القادم"
                        }
                    ],
                    "cancel_reason": "تأجّل الحمل إلى الشهر القادم",
                    "opened_at": "2026-11-24T08:00:00Z",
                    "created_at": "2026-11-24T07:42:10Z",
                    "updated_at": "2026-11-25T11:20:00Z",
                    "offer_mode": "sealed",
                    "award_ends_at": null,
                    "auction_extensions": null,
                    "bidding_closed_early_at": null
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "not_cancellable"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "cancel_reason_required"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "POST",
            "path": "/market/requests/{uuid}/cancel",
            "auth": "app_token",
            "scope": "market:requests:cancel",
            "apps": [
                "shipper"
            ],
            "idempotency_key": true,
            "limit": "write",
            "summary": {
                "en": "Cancels the shipper's own draft or open request with a written reason of 3 to 500 characters: its open trucks are cancelled and the carriers with standing offers are told; a truck already awarded stays, and when nothing is left to cancel the answer is a conflict.",
                "ar": "يلغي الشاحن مسودة طلبه أو طلبه المفتوح بسبب مكتوب من 3 إلى 500 حرف: تُلغى شاحناته المفتوحة ويُبلَّغ الناقلون أصحاب العروض القائمة؛ وتبقى الشاحنة التي رُسّيت، وإن لم يبقَ ما يُلغى كان الجواب تعارضًا."
            }
        },
        {
            "name": "market.api.requests.close_bidding",
            "example": {
                "request": null,
                "response": {
                    "uuid": "0193a1f6-81c4-7b29-a3d5-6e0f9c2b1d48",
                    "reference": "MR-0004230",
                    "state": "open",
                    "service_type": "freight",
                    "title": "مواسير حديد من الرياض إلى جدة",
                    "load_mode": "ftl",
                    "cargo": {
                        "type": "مواد بناء",
                        "type_code": "building_materials",
                        "note": null,
                        "weight_kg": 22000,
                        "volume_m3": null,
                        "length_cm": null,
                        "width_cm": null,
                        "height_cm": null,
                        "value_halalas": null
                    },
                    "liquid": {
                        "type": null,
                        "type_code": null,
                        "quantity": null,
                        "unit": null
                    },
                    "answers": [],
                    "rental": {
                        "model": null,
                        "hours": null,
                        "with_driver": null
                    },
                    "pickup": {
                        "city_id": 1024,
                        "city": "الرياض",
                        "district_id": null,
                        "lat": 24.6877,
                        "lng": 46.7219,
                        "address": "المدينة الصناعية الثانية، الرياض",
                        "note": null
                    },
                    "dropoff": {
                        "city_id": 1301,
                        "city": "جدة",
                        "district_id": null,
                        "lat": 21.4858,
                        "lng": 39.1925,
                        "address": "ميناء جدة الإسلامي",
                        "note": null
                    },
                    "window": {
                        "starts_at": "2026-11-28T04:00:00Z",
                        "ends_at": "2026-11-29T20:00:00Z"
                    },
                    "offers_close_at": "2026-11-25T09:30:00Z",
                    "budget": null,
                    "live_offers_count": 3,
                    "direct": false,
                    "legs": [
                        {
                            "uuid": "0193a1f6-8203-7e60-9b1a-4d7c3f5e8a29",
                            "position": 1,
                            "state": "open",
                            "vehicle_type": "truck_flatbed",
                            "body_type": null,
                            "category": null,
                            "min_tons": 22,
                            "min_m3": null,
                            "needs": {
                                "refrigerated": false,
                                "tanker": false,
                                "crane": false,
                                "tracking": true
                            },
                            "weight_kg": 22000,
                            "volume_m3": null,
                            "cancel_reason": null
                        }
                    ],
                    "cancel_reason": null,
                    "opened_at": "2026-11-24T08:00:00Z",
                    "created_at": "2026-11-24T07:42:10Z",
                    "updated_at": "2026-11-25T09:30:00Z",
                    "offer_mode": "open_auction",
                    "award_ends_at": "2026-11-26T09:30:00Z",
                    "auction_extensions": 1,
                    "bidding_closed_early_at": "2026-11-25T09:30:00Z"
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "not_open"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "not_an_auction"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "bidding_over"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "POST",
            "path": "/market/requests/{uuid}/close-bidding",
            "auth": "app_token",
            "scope": "market:offers:award",
            "apps": [
                "shipper"
            ],
            "idempotency_key": true,
            "limit": "write",
            "summary": {
                "en": "Closes the bidding of the shipper's own open auction early; the answer is the request with the new close time and the time left to award.",
                "ar": "ينهي الشاحن مزايدة طلبه المفتوح قبل موعدها؛ والجواب هو الطلب بموعد الإغلاق الجديد والمهلة المتبقية للترسية."
            }
        },
        {
            "name": "market.api.requests.copy",
            "example": {
                "request": {
                    "window_starts_at": "2026-12-05T04:00:00Z",
                    "window_ends_at": "2026-12-06T20:00:00Z"
                },
                "response": {
                    "uuid": "0193a3f0-8c21-7d46-b5e9-0a7f2c4d9e18",
                    "reference": "MR-0004390",
                    "state": "draft",
                    "service_type": "freight",
                    "title": "مواسير حديد من الرياض إلى جدة",
                    "load_mode": "ftl",
                    "cargo": {
                        "type": "مواد بناء",
                        "type_code": "building_materials",
                        "note": null,
                        "weight_kg": 22000,
                        "volume_m3": null,
                        "length_cm": null,
                        "width_cm": null,
                        "height_cm": null,
                        "value_halalas": null
                    },
                    "liquid": {
                        "type": null,
                        "type_code": null,
                        "quantity": null,
                        "unit": null
                    },
                    "answers": [],
                    "rental": {
                        "model": null,
                        "hours": null,
                        "with_driver": null
                    },
                    "pickup": {
                        "city_id": 1024,
                        "city": "الرياض",
                        "district_id": null,
                        "lat": 24.6877,
                        "lng": 46.7219,
                        "address": "المدينة الصناعية الثانية، الرياض",
                        "note": null
                    },
                    "dropoff": {
                        "city_id": 1301,
                        "city": "جدة",
                        "district_id": null,
                        "lat": 21.4858,
                        "lng": 39.1925,
                        "address": "ميناء جدة الإسلامي",
                        "note": null
                    },
                    "window": {
                        "starts_at": "2026-12-05T04:00:00Z",
                        "ends_at": "2026-12-06T20:00:00Z"
                    },
                    "offers_close_at": null,
                    "budget": {
                        "amount_halalas": 120000,
                        "currency": "SAR",
                        "excludes_vat": true,
                        "shown": false
                    },
                    "live_offers_count": 2,
                    "direct": false,
                    "legs": [
                        {
                            "uuid": "0193a3f0-8c40-7a33-9c1d-5e8b3f7a2d61",
                            "position": 1,
                            "state": "draft",
                            "vehicle_type": "truck_flatbed",
                            "body_type": null,
                            "category": null,
                            "min_tons": 22,
                            "min_m3": null,
                            "needs": {
                                "refrigerated": false,
                                "tanker": false,
                                "crane": false,
                                "tracking": true
                            },
                            "weight_kg": 22000,
                            "volume_m3": null,
                            "cancel_reason": null
                        }
                    ],
                    "cancel_reason": null,
                    "opened_at": null,
                    "created_at": "2026-11-26T10:05:00Z",
                    "updated_at": "2026-11-26T10:05:00Z",
                    "offer_mode": "sealed",
                    "award_ends_at": null,
                    "auction_extensions": null,
                    "bidding_closed_early_at": null
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "direct_not_copyable"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "source_redacted"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "limit_reached"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "window_order"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "window_lead"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "POST",
            "path": "/market/requests/{uuid}/copy",
            "auth": "app_token",
            "scope": "market:requests:write",
            "apps": [
                "shipper"
            ],
            "idempotency_key": true,
            "limit": "write",
            "summary": {
                "en": "Makes a new draft from one of the company's own earlier requests, with its service, places, trucks, load and answers and the new loading window the caller gives; a direct booking and a request whose places were redacted cannot be copied.",
                "ar": "يصنع مسودة جديدة من أحد طلبات الشركة السابقة بخدمته وأماكنه وشاحناته وحمولته وإجاباته ونافذة التحميل الجديدة التي يحدّدها المستدعي؛ ولا يُنسخ الحجز المباشر ولا الطلب الذي حُجبت أماكنه."
            }
        },
        {
            "name": "market.api.requests.extend",
            "example": {
                "request": {
                    "offers_close_at": "2026-11-26T09:30:00Z"
                },
                "response": {
                    "uuid": "0193a1c2-5d7e-7c4a-8f21-9b3d6e1a4c07",
                    "reference": "MR-0004217",
                    "state": "open",
                    "service_type": "freight",
                    "title": "مواسير حديد من الرياض إلى جدة",
                    "load_mode": "ftl",
                    "cargo": {
                        "type": "مواد بناء",
                        "type_code": "building_materials",
                        "note": null,
                        "weight_kg": 22000,
                        "volume_m3": null,
                        "length_cm": null,
                        "width_cm": null,
                        "height_cm": null,
                        "value_halalas": null
                    },
                    "liquid": {
                        "type": null,
                        "type_code": null,
                        "quantity": null,
                        "unit": null
                    },
                    "answers": [],
                    "rental": {
                        "model": null,
                        "hours": null,
                        "with_driver": null
                    },
                    "pickup": {
                        "city_id": 1024,
                        "city": "الرياض",
                        "district_id": null,
                        "lat": 24.6877,
                        "lng": 46.7219,
                        "address": "المدينة الصناعية الثانية، الرياض",
                        "note": null
                    },
                    "dropoff": {
                        "city_id": 1301,
                        "city": "جدة",
                        "district_id": null,
                        "lat": 21.4858,
                        "lng": 39.1925,
                        "address": "ميناء جدة الإسلامي",
                        "note": null
                    },
                    "window": {
                        "starts_at": "2026-11-28T04:00:00Z",
                        "ends_at": "2026-11-29T20:00:00Z"
                    },
                    "offers_close_at": "2026-11-26T09:30:00Z",
                    "budget": {
                        "amount_halalas": 120000,
                        "currency": "SAR",
                        "excludes_vat": true,
                        "shown": false
                    },
                    "live_offers_count": 2,
                    "direct": false,
                    "legs": [
                        {
                            "uuid": "0193a1c2-5d90-7a1b-b6f4-2c8e0d5a7f13",
                            "position": 1,
                            "state": "open",
                            "vehicle_type": "truck_flatbed",
                            "body_type": null,
                            "category": null,
                            "min_tons": 22,
                            "min_m3": null,
                            "needs": {
                                "refrigerated": false,
                                "tanker": false,
                                "crane": false,
                                "tracking": true
                            },
                            "weight_kg": 22000,
                            "volume_m3": null,
                            "cancel_reason": null
                        }
                    ],
                    "cancel_reason": null,
                    "opened_at": "2026-11-24T08:00:00Z",
                    "created_at": "2026-11-24T07:42:10Z",
                    "updated_at": "2026-11-25T07:10:00Z",
                    "offer_mode": "sealed",
                    "award_ends_at": null,
                    "auction_extensions": null,
                    "bidding_closed_early_at": null
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "not_open"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "auction_not_extendable"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "deadline_invalid"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "POST",
            "path": "/market/requests/{uuid}/extend",
            "auth": "app_token",
            "scope": "market:requests:write",
            "apps": [
                "shipper"
            ],
            "idempotency_key": true,
            "limit": "write",
            "summary": {
                "en": "Moves the offers deadline of an open request to a later time, within the market's longest offer window and before the loading window starts; an auction's deadline moves only by its own counted extension.",
                "ar": "يؤخّر موعد استقبال العروض لطلب مفتوح إلى وقت لاحق ضمن أطول مهلة للعروض في السوق وقبل بدء نافذة التحميل؛ وموعد المزاد لا يتحرك إلا بتمديده المعدود."
            }
        },
        {
            "name": "market.api.requests.index",
            "example": {
                "request": null,
                "response": [
                    {
                        "uuid": "0193a1c2-5d7e-7c4a-8f21-9b3d6e1a4c07",
                        "reference": "MR-0004217",
                        "state": "open",
                        "service_type": "freight",
                        "title": "مواسير حديد من الرياض إلى جدة",
                        "load_mode": "ftl",
                        "cargo": {
                            "type": "مواد بناء",
                            "type_code": "building_materials",
                            "note": null,
                            "weight_kg": 22000,
                            "volume_m3": null,
                            "length_cm": null,
                            "width_cm": null,
                            "height_cm": null,
                            "value_halalas": null
                        },
                        "liquid": {
                            "type": null,
                            "type_code": null,
                            "quantity": null,
                            "unit": null
                        },
                        "answers": [],
                        "rental": {
                            "model": null,
                            "hours": null,
                            "with_driver": null
                        },
                        "pickup": {
                            "city_id": 1024,
                            "city": "الرياض",
                            "district_id": null,
                            "lat": 24.6877,
                            "lng": 46.7219,
                            "address": "المدينة الصناعية الثانية، الرياض",
                            "note": null
                        },
                        "dropoff": {
                            "city_id": 1301,
                            "city": "جدة",
                            "district_id": null,
                            "lat": 21.4858,
                            "lng": 39.1925,
                            "address": "ميناء جدة الإسلامي",
                            "note": null
                        },
                        "window": {
                            "starts_at": "2026-11-28T04:00:00Z",
                            "ends_at": "2026-11-29T20:00:00Z"
                        },
                        "offers_close_at": "2026-11-25T09:30:00Z",
                        "budget": {
                            "amount_halalas": 120000,
                            "currency": "SAR",
                            "excludes_vat": true,
                            "shown": false
                        },
                        "live_offers_count": 2,
                        "direct": false,
                        "legs": [
                            {
                                "uuid": "0193a1c2-5d90-7a1b-b6f4-2c8e0d5a7f13",
                                "position": 1,
                                "state": "open",
                                "vehicle_type": "truck_flatbed",
                                "body_type": null,
                                "category": null,
                                "min_tons": 22,
                                "min_m3": null,
                                "needs": {
                                    "refrigerated": false,
                                    "tanker": false,
                                    "crane": false,
                                    "tracking": true
                                },
                                "weight_kg": 22000,
                                "volume_m3": null,
                                "cancel_reason": null
                            }
                        ],
                        "cancel_reason": null,
                        "opened_at": "2026-11-24T08:00:00Z",
                        "created_at": "2026-11-24T07:42:10Z",
                        "updated_at": "2026-11-24T08:00:00Z",
                        "offer_mode": "sealed",
                        "award_ends_at": null,
                        "auction_extensions": null,
                        "bidding_closed_early_at": null
                    }
                ],
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/requests",
            "auth": "app_token",
            "scope": "market:requests:read",
            "apps": [
                "shipper"
            ],
            "idempotency_key": false,
            "limit": null,
            "summary": {
                "en": "Lists the requests of the caller's company a page at a time, and can be limited to one state with the state filter.",
                "ar": "يعرض طلبات شركة المستدعي صفحة بعد صفحة، ويمكن حصرها في حالة واحدة بمرشّح state."
            }
        },
        {
            "name": "market.api.requests.legs.cancel",
            "example": {
                "request": {
                    "reason": "اكتفينا بشاحنة واحدة"
                },
                "response": {
                    "uuid": "0193a1c2-5d7e-7c4a-8f21-9b3d6e1a4c07",
                    "reference": "MR-0004217",
                    "state": "open",
                    "service_type": "freight",
                    "title": "مواسير حديد من الرياض إلى جدة",
                    "load_mode": "ftl",
                    "cargo": {
                        "type": "مواد بناء",
                        "type_code": "building_materials",
                        "note": null,
                        "weight_kg": 22000,
                        "volume_m3": null,
                        "length_cm": null,
                        "width_cm": null,
                        "height_cm": null,
                        "value_halalas": null
                    },
                    "liquid": {
                        "type": null,
                        "type_code": null,
                        "quantity": null,
                        "unit": null
                    },
                    "answers": [],
                    "rental": {
                        "model": null,
                        "hours": null,
                        "with_driver": null
                    },
                    "pickup": {
                        "city_id": 1024,
                        "city": "الرياض",
                        "district_id": null,
                        "lat": 24.6877,
                        "lng": 46.7219,
                        "address": "المدينة الصناعية الثانية، الرياض",
                        "note": null
                    },
                    "dropoff": {
                        "city_id": 1301,
                        "city": "جدة",
                        "district_id": null,
                        "lat": 21.4858,
                        "lng": 39.1925,
                        "address": "ميناء جدة الإسلامي",
                        "note": null
                    },
                    "window": {
                        "starts_at": "2026-11-28T04:00:00Z",
                        "ends_at": "2026-11-29T20:00:00Z"
                    },
                    "offers_close_at": "2026-11-25T09:30:00Z",
                    "budget": {
                        "amount_halalas": 120000,
                        "currency": "SAR",
                        "excludes_vat": true,
                        "shown": false
                    },
                    "live_offers_count": 2,
                    "direct": false,
                    "legs": [
                        {
                            "uuid": "0193a1c2-5d90-7a1b-b6f4-2c8e0d5a7f13",
                            "position": 1,
                            "state": "open",
                            "vehicle_type": "truck_flatbed",
                            "body_type": null,
                            "category": null,
                            "min_tons": 22,
                            "min_m3": null,
                            "needs": {
                                "refrigerated": false,
                                "tanker": false,
                                "crane": false,
                                "tracking": true
                            },
                            "weight_kg": 22000,
                            "volume_m3": null,
                            "cancel_reason": null
                        },
                        {
                            "uuid": "0193a1c2-5d91-7e52-8a07-d41b9c6e3f20",
                            "position": 2,
                            "state": "cancelled",
                            "vehicle_type": "truck_flatbed",
                            "body_type": null,
                            "category": null,
                            "min_tons": 22,
                            "min_m3": null,
                            "needs": {
                                "refrigerated": false,
                                "tanker": false,
                                "crane": false,
                                "tracking": true
                            },
                            "weight_kg": 22000,
                            "volume_m3": null,
                            "cancel_reason": "اكتفينا بشاحنة واحدة"
                        }
                    ],
                    "cancel_reason": null,
                    "opened_at": "2026-11-24T08:00:00Z",
                    "created_at": "2026-11-24T07:42:10Z",
                    "updated_at": "2026-11-25T11:20:00Z",
                    "offer_mode": "sealed",
                    "award_ends_at": null,
                    "auction_extensions": null,
                    "bidding_closed_early_at": null
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "not_cancellable"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "leg_cannot_move"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "cancel_reason_required"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "POST",
            "path": "/market/requests/{uuid}/legs/{leg}/cancel",
            "auth": "app_token",
            "scope": "market:requests:cancel",
            "apps": [
                "shipper"
            ],
            "idempotency_key": true,
            "limit": "write",
            "summary": {
                "en": "Cancels one truck of the shipper's own request with a written reason; the other trucks go on, and the answer is the whole request.",
                "ar": "يلغي شاحنة واحدة من طلب الشاحن بسبب مكتوب؛ وتمضي الشاحنات الأخرى، والجواب هو الطلب كاملًا."
            }
        },
        {
            "name": "market.api.requests.offers.award",
            "example": {
                "request": null,
                "response": {
                    "uuid": "0193b6d3-5c18-7b92-a4f0-7e1d2c9a8b36",
                    "offer_uuid": "0193b6c4-2e09-7f63-a1d8-4c7b0e9a5f21",
                    "awarded_at": "2026-11-21T14:20:05Z",
                    "total_excl_vat_halalas": 118000,
                    "currency": "SAR",
                    "earliest_pickup_at": "2026-11-28T05:00:00Z"
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 403,
                        "code": "plan_feature_required",
                        "reason": "market.shipper"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "leg_not_open"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "offer_not_available"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "carrier_unavailable"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "auction_still_bidding"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "award_window_over"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "commission_unavailable"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "limit_reached"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "verification_incomplete"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "POST",
            "path": "/market/requests/{uuid}/offers/{offer}/award",
            "auth": "app_token",
            "scope": "market:offers:award",
            "apps": [
                "shipper"
            ],
            "idempotency_key": true,
            "limit": "heavy",
            "summary": {
                "en": "Awards one submitted offer on the shipper's own open request: the vehicle is reserved, the other offers on the same truck are declined as not selected, and the answer is the award with the price before VAT and the earliest pickup; repeating the call for the same offer answers the same award. It answers 403 plan_feature_required without the shipper plan, 422 verification_incomplete when the company has verification steps left, and 409 when the truck or request is no longer open (leg_not_open), the offer has lapsed (offer_not_available), the carrier can no longer serve it (carrier_unavailable, the offer is then declined), an open auction is still bidding (auction_still_bidding) or past its award window (award_window_over), or the hold limit is reached (limit_reached).",
                "ar": "يرسّي الشاحن عرضًا مقدَّمًا على طلبه المفتوح: تُحجز المركبة، وتُرفض العروض الأخرى على الشاحنة نفسها بسبب «لم يُختر»، والجواب هو الترسية بالسعر قبل الضريبة وأبكر استلام؛ وتكرار الطلب لنفس العرض يجيب الترسية نفسها. ويجيب 403 plan_feature_required دون باقة الشاحن، و422 verification_incomplete إن بقيت خطوات توثيق على الشركة، و409 إن لم تعد الشاحنة أو الطلب مفتوحًا (leg_not_open) أو انتهى العرض (offer_not_available) أو لم يعد الناقل يخدمه (carrier_unavailable ويُرفض العرض عندها) أو كان مزاد مفتوح ما زال يستقبل المزايدات (auction_still_bidding) أو فاتت مهلة ترسيته (award_window_over) أو بلغ حدّ الحجز (limit_reached)."
            }
        },
        {
            "name": "market.api.requests.offers.decline",
            "example": {
                "request": null,
                "response": {
                    "uuid": "0193b6c7-91d3-7a48-b5e2-0f6c3d8a1b57",
                    "leg_position": 1,
                    "state": "declined",
                    "total_excl_vat_halalas": 132000,
                    "vat_bp": 1500,
                    "vat_halalas": 19800,
                    "total_incl_vat_halalas": 151800,
                    "currency": "SAR",
                    "valid_until": "2026-11-27T12:00:00Z",
                    "earliest_pickup_at": "2026-11-27T06:00:00Z",
                    "seconds_left": 518400,
                    "price_note": null,
                    "terms": null,
                    "vehicle": {
                        "service": "freight",
                        "vehicle_type": "truck_flatbed",
                        "body_type": "flatbed",
                        "tons": 22,
                        "m3": null,
                        "year": 2021,
                        "refrigerated": false,
                        "tanker": false,
                        "crane": false,
                        "tracked": true,
                        "load_mode": "ftl",
                        "rental_type": null,
                        "supports_driver": null,
                        "verified_on": "2026-10-30"
                    },
                    "carrier": {
                        "public_id": "0193a1b9-3e51-7a62-9c07-4d8b2f6a1e73",
                        "name": "مؤسسة الصقر للشحن",
                        "badges": [
                            "approved"
                        ],
                        "rating": null,
                        "experience_years": null,
                        "service_categories": [],
                        "record": null,
                        "record_shown": true
                    },
                    "difference_from_budget_percent": null,
                    "thread_uuid": "0193b6c7-92b0-7e31-8c74-2a5d9f0e6b18",
                    "unread_messages": 0,
                    "price_changed_at": null,
                    "lowerings": 0,
                    "last_lowered_at": null,
                    "submitted_at": "2026-11-20T08:15:00Z",
                    "state_changed_at": "2026-11-20T08:15:00Z",
                    "decline_reason": null
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "not_submitted"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "POST",
            "path": "/market/requests/{uuid}/offers/{offer}/decline",
            "auth": "app_token",
            "scope": "market:offers:award",
            "apps": [
                "shipper"
            ],
            "idempotency_key": true,
            "limit": "write",
            "summary": {
                "en": "Declines one submitted offer on the shipper's own request and answers it with its new state; takes no body. An offer no longer submitted answers 409 not_submitted.",
                "ar": "يرفض الشاحن عرضًا مقدَّمًا على طلبه ويجيب العرض بحالته الجديدة؛ بلا جسم. والعرض الذي لم يعد مقدَّمًا يجيب 409 not_submitted."
            }
        },
        {
            "name": "market.api.requests.offers.index",
            "example": {
                "request": {
                    "query": {
                        "sort": "amount",
                        "truck": 1,
                        "state": "submitted",
                        "min_price_halalas": 100000,
                        "max_price_halalas": 150000,
                        "approved_only": true,
                        "min_rating": 4,
                        "min_valid_hours": 24,
                        "max_valid_hours": 240,
                        "vehicle_type": "truck_flatbed"
                    }
                },
                "response": [
                    {
                        "uuid": "0193b6c4-2e09-7f63-a1d8-4c7b0e9a5f21",
                        "leg_position": 1,
                        "state": "submitted",
                        "total_excl_vat_halalas": 118000,
                        "vat_bp": 1500,
                        "vat_halalas": 17700,
                        "total_incl_vat_halalas": 135700,
                        "currency": "SAR",
                        "valid_until": "2026-11-27T12:00:00Z",
                        "earliest_pickup_at": "2026-11-28T05:00:00Z",
                        "seconds_left": 518400,
                        "price_note": null,
                        "terms": "الدفع خلال يومين من التسليم",
                        "vehicle": {
                            "service": "freight",
                            "vehicle_type": "truck_flatbed",
                            "body_type": "flatbed",
                            "tons": 22,
                            "m3": null,
                            "year": 2021,
                            "refrigerated": false,
                            "tanker": false,
                            "crane": false,
                            "tracked": true,
                            "load_mode": "ftl",
                            "rental_type": null,
                            "supports_driver": null,
                            "verified_on": "2026-10-30"
                        },
                        "carrier": {
                            "public_id": "0193a1b4-7c2e-7d90-8a35-6f1e9c4d2b08",
                            "name": "شركة الأفق للنقل",
                            "badges": [
                                "approved"
                            ],
                            "rating": {
                                "average": 4.6,
                                "count": 38
                            },
                            "experience_years": 12,
                            "service_categories": [
                                "نقل مبرد",
                                "نقل حاويات"
                            ],
                            "record": {
                                "completed": 120,
                                "on_time_percent": 94,
                                "on_time_without_breakdown_percent": 91
                            },
                            "record_shown": true
                        },
                        "difference_from_budget_percent": null,
                        "thread_uuid": "0193b6c4-2f4a-7c15-9b60-8d3e1a7f0c94",
                        "unread_messages": 0,
                        "price_changed_at": null,
                        "lowerings": 0,
                        "last_lowered_at": null,
                        "submitted_at": "2026-11-20T08:15:00Z",
                        "state_changed_at": "2026-11-20T08:15:00Z",
                        "decline_reason": null
                    },
                    {
                        "uuid": "0193b6c7-91d3-7a48-b5e2-0f6c3d8a1b57",
                        "leg_position": 1,
                        "state": "submitted",
                        "total_excl_vat_halalas": 132000,
                        "vat_bp": 1500,
                        "vat_halalas": 19800,
                        "total_incl_vat_halalas": 151800,
                        "currency": "SAR",
                        "valid_until": "2026-11-27T12:00:00Z",
                        "earliest_pickup_at": "2026-11-27T06:00:00Z",
                        "seconds_left": 518400,
                        "price_note": null,
                        "terms": null,
                        "vehicle": {
                            "service": "freight",
                            "vehicle_type": "truck_flatbed",
                            "body_type": "flatbed",
                            "tons": 22,
                            "m3": null,
                            "year": 2021,
                            "refrigerated": false,
                            "tanker": false,
                            "crane": false,
                            "tracked": true,
                            "load_mode": "ftl",
                            "rental_type": null,
                            "supports_driver": null,
                            "verified_on": "2026-10-30"
                        },
                        "carrier": {
                            "public_id": "0193a1b9-3e51-7a62-9c07-4d8b2f6a1e73",
                            "name": "مؤسسة الصقر للشحن",
                            "badges": [
                                "approved"
                            ],
                            "rating": null,
                            "experience_years": null,
                            "service_categories": [],
                            "record": null,
                            "record_shown": true
                        },
                        "difference_from_budget_percent": null,
                        "thread_uuid": "0193b6c7-92b0-7e31-8c74-2a5d9f0e6b18",
                        "unread_messages": 0,
                        "price_changed_at": null,
                        "lowerings": 0,
                        "last_lowered_at": null,
                        "submitted_at": "2026-11-20T08:15:00Z",
                        "state_changed_at": "2026-11-20T08:15:00Z",
                        "decline_reason": null
                    }
                ],
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/requests/{uuid}/offers",
            "auth": "app_token",
            "scope": "market:offers:compare",
            "apps": [
                "shipper"
            ],
            "idempotency_key": false,
            "limit": null,
            "summary": {
                "en": "Lists the offers on the shipper's own request, the cheapest first unless sort is pickup (earliest pickup first) or capacity (largest first), with every filter optional: truck (the leg's position), state, min_price_halalas and max_price_halalas (before VAT, both ends included), approved_only, min_rating (1 to 5; a carrier without a rating fails it), min_valid_hours and max_valid_hours (the hours the offer still stands, both ends included) and vehicle_type. A value that is not allowed, or a maximum below its minimum, answers 422, never a silent filter. Each offer carries its price with the VAT of the loading day (vat_bp, vat_halalas and total_incl_vat_halalas; the two VAT keys are null and the total is the price when no rate is in force), the day it was submitted and the day its state last changed, decline_reason once it is declined, and the carrier's public_id, the id the carrier's public page and the carriers whatsapp route take, given only while the offer stands or won (submitted or accepted) and null for every other state and for a carrier with no public page. The carrier block also carries experience_years and service_categories, what the carrier published for its public page (its own statements, not checked by the market; null and an empty list when none), and its record with record_shown while the market setting shows it. A carrier's contacts stay hidden until an award.",
                "ar": "يسرد العروض على طلب الشاحن نفسه، الأرخص أولًا ما لم يكن sort هو pickup (الأبكر استلامًا أولًا) أو capacity (الأكبر حمولة أولًا)، وكل مرشّح اختياري: truck (ترتيب الشاحنة)، state، min_price_halalas وmax_price_halalas (قبل الضريبة وكلا الطرفين داخل)، approved_only، min_rating (من 1 إلى 5؛ والناقل بلا تقييم لا يجتازه)، min_valid_hours وmax_valid_hours (الساعات التي يبقى فيها العرض قائمًا وكلا الطرفين داخل)، vehicle_type. وقيمة غير مسموحة أو حدّ أعلى دون حدّه الأدنى يجيب 422 ولا يُهمَل المرشّح بصمت. ويحمل كل عرض سعره مع ضريبة يوم التحميل (vat_bp وvat_halalas وtotal_incl_vat_halalas؛ يكون المفتاحان الأولان null ويكون الإجمالي هو السعر حين لا نسبة سارية)، ويوم تقديمه ويوم آخر تغيّر لحالته، وdecline_reason متى رُفض، وpublic_id الناقل، المعرّف الذي تأخذه صفحة الناقل العامة ومسار carriers whatsapp، ويُعطى ما دام العرض قائمًا أو فائزًا (submitted أو accepted) ويكون null في كل حالة أخرى ولناقل لا صفحة عامة له. وتحمل كتلة الناقل أيضًا experience_years وservice_categories: ما نشره لصفحته العامة (أقواله هو لا يتحقق منها السوق، وnull وقائمة فارغة حين لا شيء)، وسجلّه record مع record_shown ما دام إعداد السوق يعرضه. وتبقى بيانات تواصل الناقل مخفية حتى الترسية."
            }
        },
        {
            "name": "market.api.requests.offers.show",
            "example": {
                "request": null,
                "response": {
                    "uuid": "0193b6c4-2e09-7f63-a1d8-4c7b0e9a5f21",
                    "leg_position": 1,
                    "state": "submitted",
                    "total_excl_vat_halalas": 118000,
                    "vat_bp": 1500,
                    "vat_halalas": 17700,
                    "total_incl_vat_halalas": 135700,
                    "currency": "SAR",
                    "valid_until": "2026-11-27T12:00:00Z",
                    "earliest_pickup_at": "2026-11-28T05:00:00Z",
                    "seconds_left": 518400,
                    "price_note": null,
                    "terms": "الدفع خلال يومين من التسليم",
                    "vehicle": {
                        "service": "freight",
                        "vehicle_type": "truck_flatbed",
                        "body_type": "flatbed",
                        "tons": 22,
                        "m3": null,
                        "year": 2021,
                        "refrigerated": false,
                        "tanker": false,
                        "crane": false,
                        "tracked": true,
                        "load_mode": "ftl",
                        "rental_type": null,
                        "supports_driver": null,
                        "verified_on": "2026-10-30"
                    },
                    "carrier": {
                        "public_id": "0193a1b4-7c2e-7d90-8a35-6f1e9c4d2b08",
                        "name": "شركة الأفق للنقل",
                        "badges": [
                            "approved"
                        ],
                        "rating": {
                            "average": 4.6,
                            "count": 38
                        },
                        "experience_years": 12,
                        "service_categories": [
                            "نقل مبرد",
                            "نقل حاويات"
                        ],
                        "record": {
                            "completed": 120,
                            "on_time_percent": 94,
                            "on_time_without_breakdown_percent": 91
                        },
                        "record_shown": true
                    },
                    "difference_from_budget_percent": null,
                    "thread_uuid": "0193b6c4-2f4a-7c15-9b60-8d3e1a7f0c94",
                    "unread_messages": 0,
                    "price_changed_at": null,
                    "lowerings": 0,
                    "last_lowered_at": null,
                    "submitted_at": "2026-11-20T08:15:00Z",
                    "state_changed_at": "2026-11-20T08:15:00Z",
                    "decline_reason": null
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/requests/{uuid}/offers/{offer}",
            "auth": "app_token",
            "scope": "market:offers:compare",
            "apps": [
                "shipper"
            ],
            "idempotency_key": false,
            "limit": null,
            "summary": {
                "en": "Reads one offer on the shipper's own request as the list gives it; an offer that is not on this request answers the same 404 as one that does not exist.",
                "ar": "يقرأ عرضًا واحدًا على طلب الشاحن نفسه كما تعطيه القائمة؛ والعرض الذي ليس على هذا الطلب يجيب 404 نفسها التي يجيبها عرض غير موجود."
            }
        },
        {
            "name": "market.api.requests.open",
            "example": {
                "request": {
                    "offers_close_at": "2026-11-25T09:30:00Z",
                    "invite_favourites": true
                },
                "response": {
                    "uuid": "0193a1c2-5d7e-7c4a-8f21-9b3d6e1a4c07",
                    "reference": "MR-0004217",
                    "state": "open",
                    "service_type": "freight",
                    "title": "مواسير حديد من الرياض إلى جدة",
                    "load_mode": "ftl",
                    "cargo": {
                        "type": "مواد بناء",
                        "type_code": "building_materials",
                        "note": null,
                        "weight_kg": 22000,
                        "volume_m3": null,
                        "length_cm": null,
                        "width_cm": null,
                        "height_cm": null,
                        "value_halalas": null
                    },
                    "liquid": {
                        "type": null,
                        "type_code": null,
                        "quantity": null,
                        "unit": null
                    },
                    "answers": [],
                    "rental": {
                        "model": null,
                        "hours": null,
                        "with_driver": null
                    },
                    "pickup": {
                        "city_id": 1024,
                        "city": "الرياض",
                        "district_id": null,
                        "lat": 24.6877,
                        "lng": 46.7219,
                        "address": "المدينة الصناعية الثانية، الرياض",
                        "note": null
                    },
                    "dropoff": {
                        "city_id": 1301,
                        "city": "جدة",
                        "district_id": null,
                        "lat": 21.4858,
                        "lng": 39.1925,
                        "address": "ميناء جدة الإسلامي",
                        "note": null
                    },
                    "window": {
                        "starts_at": "2026-11-28T04:00:00Z",
                        "ends_at": "2026-11-29T20:00:00Z"
                    },
                    "offers_close_at": "2026-11-25T09:30:00Z",
                    "budget": {
                        "amount_halalas": 120000,
                        "currency": "SAR",
                        "excludes_vat": true,
                        "shown": false
                    },
                    "live_offers_count": 2,
                    "direct": false,
                    "legs": [
                        {
                            "uuid": "0193a1c2-5d90-7a1b-b6f4-2c8e0d5a7f13",
                            "position": 1,
                            "state": "open",
                            "vehicle_type": "truck_flatbed",
                            "body_type": null,
                            "category": null,
                            "min_tons": 22,
                            "min_m3": null,
                            "needs": {
                                "refrigerated": false,
                                "tanker": false,
                                "crane": false,
                                "tracking": true
                            },
                            "weight_kg": 22000,
                            "volume_m3": null,
                            "cancel_reason": null
                        }
                    ],
                    "cancel_reason": null,
                    "opened_at": "2026-11-24T08:00:00Z",
                    "created_at": "2026-11-24T07:42:10Z",
                    "updated_at": "2026-11-24T08:00:00Z",
                    "offer_mode": "sealed",
                    "award_ends_at": null,
                    "auction_extensions": null,
                    "bidding_closed_early_at": null
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 403,
                        "code": "plan_feature_required",
                        "reason": "market.shipper"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "not_a_draft"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "limit_reached"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "verification_incomplete"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "no_legs"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "answers_missing"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "window_lead"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "deadline_invalid"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "auction_deadline_too_soon"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "auction_unavailable"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "POST",
            "path": "/market/requests/{uuid}/open",
            "auth": "app_token",
            "scope": "market:requests:write",
            "apps": [
                "shipper"
            ],
            "idempotency_key": true,
            "limit": "heavy",
            "summary": {
                "en": "Opens a draft request to carriers: the company must hold the shipper plan and have finished its verification, the questions its cargo requires must be answered, and the number of open requests a company may hold is limited; offers_close_at sets the offers deadline (the usual time when it is empty) and invite_favourites: true lets the company's favourite carriers see the request first.",
                "ar": "يفتح مسودة طلب للناقلين: يجب أن تملك الشركة باقة الشاحن وأن تنهي التحقق منها، وأن تُجاب الأسئلة التي تطلبها حمولتها، وعدد الطلبات المفتوحة للشركة محدود؛ ويحدّد offers_close_at موعد استقبال العروض (المدة المعتادة إن تُرك فارغًا)، ويتيح invite_favourites: true لناقلي الشركة المفضّلين أن يروا الطلب أولًا."
            }
        },
        {
            "name": "market.api.requests.show",
            "example": {
                "request": null,
                "response": {
                    "uuid": "0193a1c2-5d7e-7c4a-8f21-9b3d6e1a4c07",
                    "reference": "MR-0004217",
                    "state": "open",
                    "service_type": "freight",
                    "title": "مواسير حديد من الرياض إلى جدة",
                    "load_mode": "ftl",
                    "cargo": {
                        "type": "مواد بناء",
                        "type_code": "building_materials",
                        "note": null,
                        "weight_kg": 22000,
                        "volume_m3": null,
                        "length_cm": null,
                        "width_cm": null,
                        "height_cm": null,
                        "value_halalas": null
                    },
                    "liquid": {
                        "type": null,
                        "type_code": null,
                        "quantity": null,
                        "unit": null
                    },
                    "answers": [],
                    "rental": {
                        "model": null,
                        "hours": null,
                        "with_driver": null
                    },
                    "pickup": {
                        "city_id": 1024,
                        "city": "الرياض",
                        "district_id": null,
                        "lat": 24.6877,
                        "lng": 46.7219,
                        "address": "المدينة الصناعية الثانية، الرياض",
                        "note": null
                    },
                    "dropoff": {
                        "city_id": 1301,
                        "city": "جدة",
                        "district_id": null,
                        "lat": 21.4858,
                        "lng": 39.1925,
                        "address": "ميناء جدة الإسلامي",
                        "note": null
                    },
                    "window": {
                        "starts_at": "2026-11-28T04:00:00Z",
                        "ends_at": "2026-11-29T20:00:00Z"
                    },
                    "offers_close_at": "2026-11-25T09:30:00Z",
                    "budget": {
                        "amount_halalas": 120000,
                        "currency": "SAR",
                        "excludes_vat": true,
                        "shown": false
                    },
                    "live_offers_count": 2,
                    "direct": false,
                    "legs": [
                        {
                            "uuid": "0193a1c2-5d90-7a1b-b6f4-2c8e0d5a7f13",
                            "position": 1,
                            "state": "open",
                            "vehicle_type": "truck_flatbed",
                            "body_type": null,
                            "category": null,
                            "min_tons": 22,
                            "min_m3": null,
                            "needs": {
                                "refrigerated": false,
                                "tanker": false,
                                "crane": false,
                                "tracking": true
                            },
                            "weight_kg": 22000,
                            "volume_m3": null,
                            "cancel_reason": null
                        }
                    ],
                    "cancel_reason": null,
                    "opened_at": "2026-11-24T08:00:00Z",
                    "created_at": "2026-11-24T07:42:10Z",
                    "updated_at": "2026-11-24T08:00:00Z",
                    "offer_mode": "sealed",
                    "award_ends_at": null,
                    "auction_extensions": null,
                    "bidding_closed_early_at": null
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/requests/{uuid}",
            "auth": "app_token",
            "scope": "market:requests:read",
            "apps": [
                "shipper"
            ],
            "idempotency_key": false,
            "limit": null,
            "summary": {
                "en": "Reads one request of the caller's company with its trucks, its cargo answers, its offers deadline and, for an auction, its award time and extensions. Each request carries the codes of its cargo and liquid types beside their names (type_code, the value the write accepts), the city names and district ids of its places, every answer with the value as it was stored beside its question and what a carrier reads of it (value; display is empty where the text carried a contact), the shipper's own budget, given to its owner whether or not the carriers see it, with which it is (shown; before, a hidden budget read null, and a carrier's board still reads it as null), how many offers stand on it (live_offers_count) and whether it is a direct booking addressed to one carrier's listing (direct), so a draft is read back whole to be written again.",
                "ar": "يقرأ طلبًا واحدًا من طلبات شركة المستدعي بشاحناته وإجابات حمولته وموعد استقبال عروضه، ومعها وقت الترسية وتمديداته إن كان مزادًا. ويحمل كل طلب رمزَي نوعَي حمولته وسائله بجانب اسميهما (type_code، القيمة التي تقبلها الكتابة) وأسماء مدن أماكنه ومعرّفات أحيائها وكل إجابة بقيمتها كما خُزّنت بجانب سؤالها وما يقرؤه الناقل منها (value؛ وdisplay فارغ حيث حمل النص وسيلة اتصال) وميزانية الشاحن نفسه، تُعطى لمالكها سواء رآها الناقلون أم لا، مع ما هي عليه (shown؛ كانت الميزانية المخفية تُقرأ null، ولوحة الناقل ما زالت تقرؤها null) وكم عرضًا قائمًا عليه (live_offers_count) وهل هو حجز مباشر موجّه إلى إعلان ناقل واحد (direct)، فتُقرأ المسودة كاملة لتُكتب من جديد."
            }
        },
        {
            "name": "market.api.requests.store",
            "example": {
                "request": {
                    "service": "freight",
                    "title": "مواسير حديد من الرياض إلى جدة",
                    "pickup": {
                        "city_id": 1024,
                        "lat": 24.6877,
                        "lng": 46.7219,
                        "address": "المدينة الصناعية الثانية، الرياض"
                    },
                    "dropoff": {
                        "city_id": 1301,
                        "lat": 21.4858,
                        "lng": 39.1925,
                        "address": "ميناء جدة الإسلامي"
                    },
                    "window_starts_at": "2026-11-28T04:00:00Z",
                    "window_ends_at": "2026-11-29T20:00:00Z",
                    "legs": [
                        {
                            "vehicle_type_code": "truck_flatbed",
                            "min_tons": 22,
                            "needs_tracking": true,
                            "leg_weight_kg": 22000
                        }
                    ],
                    "load_mode": "ftl",
                    "cargo_type_id": 7,
                    "cargo_weight_kg": 22000
                },
                "response": {
                    "uuid": "0193a1c2-5d7e-7c4a-8f21-9b3d6e1a4c07",
                    "reference": "MR-0004217",
                    "state": "draft",
                    "service_type": "freight",
                    "title": "مواسير حديد من الرياض إلى جدة",
                    "load_mode": "ftl",
                    "cargo": {
                        "type": "مواد بناء",
                        "type_code": "building_materials",
                        "note": null,
                        "weight_kg": 22000,
                        "volume_m3": null,
                        "length_cm": null,
                        "width_cm": null,
                        "height_cm": null,
                        "value_halalas": null
                    },
                    "liquid": {
                        "type": null,
                        "type_code": null,
                        "quantity": null,
                        "unit": null
                    },
                    "answers": [],
                    "rental": {
                        "model": null,
                        "hours": null,
                        "with_driver": null
                    },
                    "pickup": {
                        "city_id": 1024,
                        "city": "الرياض",
                        "district_id": null,
                        "lat": 24.6877,
                        "lng": 46.7219,
                        "address": "المدينة الصناعية الثانية، الرياض",
                        "note": null
                    },
                    "dropoff": {
                        "city_id": 1301,
                        "city": "جدة",
                        "district_id": null,
                        "lat": 21.4858,
                        "lng": 39.1925,
                        "address": "ميناء جدة الإسلامي",
                        "note": null
                    },
                    "window": {
                        "starts_at": "2026-11-28T04:00:00Z",
                        "ends_at": "2026-11-29T20:00:00Z"
                    },
                    "offers_close_at": null,
                    "budget": {
                        "amount_halalas": 120000,
                        "currency": "SAR",
                        "excludes_vat": true,
                        "shown": false
                    },
                    "live_offers_count": 2,
                    "direct": false,
                    "legs": [
                        {
                            "uuid": "0193a1c2-5d90-7a1b-b6f4-2c8e0d5a7f13",
                            "position": 1,
                            "state": "draft",
                            "vehicle_type": "truck_flatbed",
                            "body_type": null,
                            "category": null,
                            "min_tons": 22,
                            "min_m3": null,
                            "needs": {
                                "refrigerated": false,
                                "tanker": false,
                                "crane": false,
                                "tracking": true
                            },
                            "weight_kg": 22000,
                            "volume_m3": null,
                            "cancel_reason": null
                        }
                    ],
                    "cancel_reason": null,
                    "opened_at": null,
                    "created_at": "2026-11-24T07:42:10Z",
                    "updated_at": "2026-11-24T08:00:00Z",
                    "offer_mode": "sealed",
                    "award_ends_at": null,
                    "auction_extensions": null,
                    "bidding_closed_early_at": null
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "limit_reached"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "legs_count"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "window_order"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "window_lead"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "dropoff_required"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "dropoff_not_allowed"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "coordinates_invalid"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "text_too_long"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "budget_invalid"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "load_mode_required"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "cargo_type_required"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "rental_model_required"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "equipment_type_required"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "leg_weight_exceeds"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "answers_invalid"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "choice_unknown"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "auction_unavailable"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "POST",
            "path": "/market/requests",
            "auth": "app_token",
            "scope": "market:requests:write",
            "apps": [
                "shipper"
            ],
            "idempotency_key": true,
            "limit": "write",
            "summary": {
                "en": "Creates a draft request with its trucks for one service (freight, rental, liquid or equipment); the market's rules for that service, the lead time before loading and the limits on the drafts a company may hold and create in a day are checked here, and a key outside the listed ones is refused; the cargo type and the liquid type are named by their code (cargo_type and liquid_type, the codes the cargo-types read gives) or by their number (cargo_type_id and liquid_type_id), not both.",
                "ar": "ينشئ مسودة طلب بشاحناتها لخدمة واحدة (شحن أو تأجير أو سوائل أو معدات)؛ وتُفحص هنا قواعد السوق لتلك الخدمة والمهلة قبل التحميل وحدود المسودات التي تملكها الشركة وتنشئها في اليوم، ويُرفض أي مفتاح خارج المفاتيح المسموحة؛ ويُسمّى نوع الحمولة ونوع السائل برمزه (cargo_type وliquid_type، من الرموز التي تعطيها قراءة أنواع الحمولة) أو برقمه (cargo_type_id وliquid_type_id) لا بهما معًا."
            }
        },
        {
            "name": "market.api.requests.update",
            "example": {
                "request": {
                    "service": "freight",
                    "title": "مواسير حديد من الرياض إلى ميناء جدة",
                    "pickup": {
                        "city_id": 1024,
                        "lat": 24.6877,
                        "lng": 46.7219,
                        "address": "المدينة الصناعية الثانية، الرياض"
                    },
                    "dropoff": {
                        "city_id": 1301,
                        "lat": 21.4858,
                        "lng": 39.1925,
                        "address": "ميناء جدة الإسلامي"
                    },
                    "window_starts_at": "2026-11-28T04:00:00Z",
                    "window_ends_at": "2026-11-29T20:00:00Z",
                    "legs": [
                        {
                            "vehicle_type_code": "truck_flatbed",
                            "min_tons": 22,
                            "needs_tracking": true,
                            "leg_weight_kg": 22000
                        }
                    ],
                    "load_mode": "ftl",
                    "cargo_type_id": 7,
                    "cargo_weight_kg": 21500
                },
                "response": {
                    "uuid": "0193a1c2-5d7e-7c4a-8f21-9b3d6e1a4c07",
                    "reference": "MR-0004217",
                    "state": "draft",
                    "service_type": "freight",
                    "title": "مواسير حديد من الرياض إلى ميناء جدة",
                    "load_mode": "ftl",
                    "cargo": {
                        "type": "مواد بناء",
                        "type_code": "building_materials",
                        "note": null,
                        "weight_kg": 21500,
                        "volume_m3": null,
                        "length_cm": null,
                        "width_cm": null,
                        "height_cm": null,
                        "value_halalas": null
                    },
                    "liquid": {
                        "type": null,
                        "type_code": null,
                        "quantity": null,
                        "unit": null
                    },
                    "answers": [],
                    "rental": {
                        "model": null,
                        "hours": null,
                        "with_driver": null
                    },
                    "pickup": {
                        "city_id": 1024,
                        "city": "الرياض",
                        "district_id": null,
                        "lat": 24.6877,
                        "lng": 46.7219,
                        "address": "المدينة الصناعية الثانية، الرياض",
                        "note": null
                    },
                    "dropoff": {
                        "city_id": 1301,
                        "city": "جدة",
                        "district_id": null,
                        "lat": 21.4858,
                        "lng": 39.1925,
                        "address": "ميناء جدة الإسلامي",
                        "note": null
                    },
                    "window": {
                        "starts_at": "2026-11-28T04:00:00Z",
                        "ends_at": "2026-11-29T20:00:00Z"
                    },
                    "offers_close_at": null,
                    "budget": {
                        "amount_halalas": 120000,
                        "currency": "SAR",
                        "excludes_vat": true,
                        "shown": false
                    },
                    "live_offers_count": 2,
                    "direct": false,
                    "legs": [
                        {
                            "uuid": "0193a1c2-5d90-7a1b-b6f4-2c8e0d5a7f13",
                            "position": 1,
                            "state": "draft",
                            "vehicle_type": "truck_flatbed",
                            "body_type": null,
                            "category": null,
                            "min_tons": 22,
                            "min_m3": null,
                            "needs": {
                                "refrigerated": false,
                                "tanker": false,
                                "crane": false,
                                "tracking": true
                            },
                            "weight_kg": 22000,
                            "volume_m3": null,
                            "cancel_reason": null
                        }
                    ],
                    "cancel_reason": null,
                    "opened_at": null,
                    "created_at": "2026-11-24T07:42:10Z",
                    "updated_at": "2026-11-24T07:55:00Z",
                    "offer_mode": "sealed",
                    "award_ends_at": null,
                    "auction_extensions": null,
                    "bidding_closed_early_at": null
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "not_a_draft"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "service_locked"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "legs_count"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "window_order"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "window_lead"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "dropoff_required"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "dropoff_not_allowed"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "coordinates_invalid"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "text_too_long"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "budget_invalid"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "load_mode_required"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "cargo_type_required"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "rental_model_required"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "equipment_type_required"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "leg_weight_exceeds"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "answers_invalid"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "choice_unknown"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "auction_unavailable"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "PATCH",
            "path": "/market/requests/{uuid}",
            "auth": "app_token",
            "scope": "market:requests:write",
            "apps": [
                "shipper"
            ],
            "idempotency_key": true,
            "limit": "write",
            "summary": {
                "en": "Replaces a draft request whole, with its trucks; its service cannot change, and a request that is open or later is not edited here.",
                "ar": "يستبدل مسودة طلب كاملةً بشاحناتها؛ ولا تتغير خدمتها، ولا يُعدَّل هنا طلب مفتوح أو بعده."
            }
        },
        {
            "name": "market.api.requests.weather",
            "example": {
                "request": null,
                "response": {
                    "available": true,
                    "day": "2026-11-28",
                    "pickup": {
                        "temperature_c": 31,
                        "min_c": 19,
                        "max_c": 31,
                        "condition": "مشمس",
                        "condition_code": "CLEAR",
                        "wind_kph": 14,
                        "wind_direction": "NE",
                        "icon": "clear"
                    },
                    "dropoff": {
                        "temperature_c": 34.5,
                        "min_c": 25,
                        "max_c": 34.5,
                        "condition": "غائم جزئيًا",
                        "condition_code": "PARTLY_CLOUDY",
                        "wind_kph": 18.5,
                        "wind_direction": "W",
                        "icon": "partly_cloudy"
                    }
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/requests/{uuid}/weather",
            "auth": "app_token",
            "scope": "market:requests:read",
            "apps": [
                "shipper"
            ],
            "idempotency_key": false,
            "limit": null,
            "summary": {
                "en": "Returns the weather at the two places of one request of the caller's company (loading and delivery) on its loading day: available says whether the weather service is on (false until the owner sets its key), day is the loading day in Saudi time, and pickup and dropoff each hold a forecast in degrees Celsius with the condition in the caller's language and the wind in kilometres per hour, each null when the place has no point or the service has no answer for that day (more than ten days away or past); only the request's own stored points are ever asked about, so the API takes no coordinates from the caller, and another company's request is a 404.",
                "ar": "يعيد طقس مكاني الطلب (التحميل والتفريغ) في يوم التحميل لطلب واحد من طلبات شركة المستدعي: available هل خدمة الطقس مفعّلة (false حتى يضع المالك مفتاحها)، وday يوم التحميل بتوقيت السعودية، وpickup وdropoff لكل منهما توقّع بدرجات مئوية وحالة الجو بلغة المستدعي وسرعة الرياح بالكيلومتر في الساعة، وكل منهما فارغ (null) إن لم تكن للمكان نقطة أو لم يكن للخدمة جواب لذلك اليوم (يتجاوز عشرة أيام أو مضى)؛ ولا يخرج من الطلب إلا نقطتاه المحفوظتان، فلا تقبل الواجهة إحداثيات من المستدعي، وطلب شركة أخرى هو 404."
            }
        },
        {
            "name": "market.api.reviews.appeal",
            "example": {
                "request": null,
                "response": {
                    "uuid": "0193a1f2-7a40-7e1b-9d35-2c6b8e0f4a17",
                    "reply_state": "appealed"
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "not_writer"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "not_withheld"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "already_appealed"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "POST",
            "path": "/market/reviews/{uuid}/reply/appeal",
            "auth": "app_token",
            "scope": "market:reviews:reply",
            "apps": [
                "carrier"
            ],
            "idempotency_key": true,
            "limit": "write",
            "summary": {
                "en": "The carrier user who wrote a reply that staff did not show appeals it, once; no body is sent, another staff member decides and that decision is final, and the answer is the review's uuid with its reply state, now appealed. Another user of the carrier, a reply that was not withheld and a second appeal are refused with a 409.",
                "ar": "يعترض مستخدم الناقل الذي كتب ردًّا لم يعرضه الموظفون مرة واحدة؛ بلا جسم، ويقرر موظف آخر وقراره نهائي، والجواب هو uuid التقييم مع حال ردّه وقد صار معترَضًا عليه. ويُرفض بـ409 مستخدم آخر للناقل، وردّ لم يُحجب، واعتراض ثانٍ."
            }
        },
        {
            "name": "market.api.reviews.index",
            "example": {
                "request": null,
                "response": [
                    {
                        "uuid": "0193a1f2-7a40-7e1b-9d35-2c6b8e0f4a17",
                        "reference": "MR-0004217",
                        "created_at": "2026-11-19T11:20:00Z",
                        "stars": 5,
                        "aspects": {
                            "timeliness": 5,
                            "communication": 4,
                            "cargo_care": 5
                        },
                        "comment": "التزم بالموعد وتواصل معنا طوال الطريق.",
                        "comment_state": "passed",
                        "reply": null,
                        "reply_state": "none",
                        "reply_reason": null,
                        "is_hidden": false,
                        "may_reply": true,
                        "may_appeal": false
                    },
                    {
                        "uuid": "0193a1f2-8c53-7f20-ae46-3d7c9f1a5b28",
                        "reference": "MR-0004190",
                        "created_at": "2026-11-15T08:45:00Z",
                        "stars": 4,
                        "aspects": [],
                        "comment": null,
                        "comment_state": "waiting",
                        "reply": "شكرًا لثقتكم، يسعدنا خدمتكم دائمًا.",
                        "reply_state": "waiting",
                        "reply_reason": null,
                        "is_hidden": false,
                        "may_reply": false,
                        "may_appeal": false
                    }
                ],
                "errors": [
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/reviews",
            "auth": "app_token",
            "scope": "market:reviews:read",
            "apps": [
                "carrier"
            ],
            "idempotency_key": false,
            "limit": null,
            "summary": {
                "en": "Lists the reviews shippers wrote about the signed-in carrier's own bookings, newest first, a page at a time (page, and per_page up to 50; the meta gives page, per_page and total): the stars, the rated aspects, the comment only once staff passed it, the carrier's own reply and where it stands, and whether the carrier may still reply; the aspects of a review that rated none are an empty object ({}), shown as [] in the example.",
                "ar": "يسرد التقييمات التي كتبها الشاحنون عن حجوزات الناقل المسجَّل نفسه، الأحدث أولًا، صفحة صفحة (page وper_page حتى 50؛ وتذكر البيانات الوصفية page وper_page وtotal): النجوم والجوانب المقيَّمة والتعليق متى أجازه الموظفون فقط وردّ الناقل ومرحلته وهل يجوز له الرد بعد؛ وجوانب تقييم لم يقيِّم جانبًا تأتي كائنًا فارغًا ({}) ويظهر في المثال []."
            }
        },
        {
            "name": "market.api.reviews.reply",
            "example": {
                "request": {
                    "text": "شكرًا لثقتكم، يسعدنا خدمتكم دائمًا."
                },
                "response": {
                    "uuid": "0193a1f2-7a40-7e1b-9d35-2c6b8e0f4a17",
                    "reply_state": "waiting"
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "already_replied"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "review_hidden"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "reply_empty"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "reply_long"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "reply_unsafe"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "reply_contact"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "POST",
            "path": "/market/reviews/{uuid}/reply",
            "auth": "app_token",
            "scope": "market:reviews:reply",
            "apps": [
                "carrier"
            ],
            "idempotency_key": true,
            "limit": "write",
            "summary": {
                "en": "The carrier answers one review of its own, once, in at most 2000 characters; staff pass the reply before it is shown, and the answer is the review with where its reply stands.",
                "ar": "يردّ الناقل على تقييم من تقييماته مرة واحدة في ألفي حرف على الأكثر؛ ويجيز الموظفون الرد قبل أن يُعرض، والجواب هو التقييم بمرحلة ردّه."
            }
        },
        {
            "name": "market.api.reviews.summary",
            "example": {
                "request": null,
                "response": {
                    "count": 38,
                    "average": 4.6,
                    "awaiting_reply": 3
                },
                "errors": [
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/reviews/summary",
            "auth": "app_token",
            "scope": "market:reviews:read",
            "apps": [
                "carrier"
            ],
            "idempotency_key": false,
            "limit": null,
            "summary": {
                "en": "Gives the signed-in carrier its review figures: how many reviews it has, their average stars (null until they reach the minimum) and how many still wait for its reply.",
                "ar": "يعطي الناقل المسجَّل أرقام تقييماته: عددها ومتوسط نجومها (فارغ حتى تبلغ الحدّ الأدنى) وكم منها ينتظر ردّه."
            }
        },
        {
            "name": "market.api.shipper_standing.show",
            "example": {
                "request": null,
                "response": {
                    "may_open": false,
                    "reason": "verification_incomplete",
                    "missing_steps": [
                        "identity",
                        "phone"
                    ]
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/shipper/standing",
            "auth": "app_token",
            "scope": "market:requests:read",
            "apps": [
                "shipper"
            ],
            "idempotency_key": false,
            "limit": null,
            "summary": {
                "en": "The caller's own company standing as a shipper, for the shipper app to read before a write is refused: may_open (whether its people may open a request and award an offer), reason (plan_required, then verification_incomplete, in the order the writes check them, or null) and missing_steps (the verification steps still left, as the keys the verification_incomplete refusal already names). The company is the token user's own, never taken from the call; never an id, a date or the staff's reason; never cached.",
                "ar": "وضع شركة المتصل نفسه بصفتها شاحنًا، يقرؤه تطبيق الشاحن قبل أن تُرفض الكتابة: may_open (هل يحق لأفرادها فتح طلب وترسية عرض) وreason (plan_required ثم verification_incomplete بترتيب فحص الكتابة لهما، أو null) وmissing_steps (خطوات التحقق الباقية مفاتيحَ هي نفسها التي يسمّيها رفض verification_incomplete). الشركة هي شركة مستخدم الرمز لا من الاستدعاء؛ ولا معرّف ولا تاريخ ولا سبب الموظف؛ ولا يُخزَّن مؤقتًا."
            }
        },
        {
            "name": "market.api.standing.show",
            "example": {
                "request": null,
                "response": {
                    "may_sell": false,
                    "reason": "not_verified",
                    "carrier_id": "0193a2c0-7a14-7e63-b2d8-5c9e1f4a6b30"
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/standing",
            "auth": "app_token",
            "scope": "market:standing:read",
            "apps": [
                "carrier"
            ],
            "idempotency_key": false,
            "limit": null,
            "summary": {
                "en": "The caller's own company standing in the market for the carrier app: may_sell, and the one leg that stops it as a key (suspended, not_activated, stopped or not_verified, in the order the legs are asked) or null when it may sell. The company is the token user's own, never taken from the call; never a list of legs, a date, an id or the staff's reason; never cached.",
                "ar": "وضع شركة المتصل نفسه في السوق لتطبيق الناقل: may_sell، والحلقة الوحيدة التي توقفه مفتاحًا (suspended أو not_activated أو stopped أو not_verified بترتيب السؤال عنها) أو null حين يحق له البيع. الشركة هي شركة مستخدم الرمز لا من الاستدعاء؛ ولا قائمة حلقات ولا تاريخ ولا معرّف ولا سبب الموظف؛ ولا يُخزَّن مؤقتًا."
            }
        },
        {
            "name": "market.api.threads.index",
            "example": {
                "request": {
                    "query": {
                        "limit": 20
                    }
                },
                "response": [
                    {
                        "uuid": "0193a1d4-0391-7d02-8c5e-1a9f3b7c2e64",
                        "offer_uuid": "0193a1d4-02b8-7e35-a9c1-4f7b8d2e6a90",
                        "booking_uuid": null,
                        "request_reference": "MR-0004217",
                        "other_party_name": "نقليات المثال",
                        "state": "open",
                        "contacts_open": false,
                        "unread": 2,
                        "last_message_at": "2026-11-24T10:42:00Z"
                    },
                    {
                        "uuid": "0193a1e7-1c44-7f90-b2d1-5e8a0c3f9b21",
                        "offer_uuid": null,
                        "booking_uuid": "0193a1e7-0a12-7b3c-9d4e-6f1a2b3c4d5e",
                        "request_reference": "MR-0004188",
                        "other_party_name": "شركة الشحن التجريبية",
                        "state": "open",
                        "contacts_open": true,
                        "unread": 0,
                        "last_message_at": "2026-11-23T16:05:00Z"
                    }
                ],
                "errors": [
                    {
                        "status": 422,
                        "code": "validation_failed"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/threads",
            "auth": "app_token",
            "scope": "market:threads:read",
            "apps": [
                "shipper",
                "carrier"
            ],
            "idempotency_key": false,
            "limit": null,
            "summary": {
                "en": "The caller's conversations about offers and bookings, newest first, a page at a time: up to limit (100 by default and at most), then cursor with the value of meta.page.next_cursor for the next page, and meta.total for how many there are; each with the other party by its public name, whether contacts are open, and how many messages are unread; never a user, a company or a contact.",
                "ar": "محادثات الشركة على العروض والحجوزات، الأحدث أولًا، صفحة بعد صفحة: حتى limit (افتراضه 100 وأقصاه 100)، ثم cursor بقيمة meta.page.next_cursor للصفحة التالية، وmeta.total بعددها كلها؛ ولكل محادثة الطرف الآخر باسمه العام، وهل فُتحت وسائل التواصل، وعدد الرسائل غير المقروءة؛ ولا يظهر مستخدم ولا شركة ولا وسيلة تواصل."
            }
        },
        {
            "name": "market.api.threads.messages",
            "example": {
                "request": {
                    "query": {
                        "limit": 50
                    }
                },
                "response": {
                    "thread": {
                        "uuid": "0193a1d4-0391-7d02-8c5e-1a9f3b7c2e64",
                        "offer_uuid": "0193a1d4-02b8-7e35-a9c1-4f7b8d2e6a90",
                        "booking_uuid": null,
                        "request_reference": "MR-0004217",
                        "other_party_name": "نقليات المثال",
                        "state": "open",
                        "contacts_open": false,
                        "unread": 2,
                        "last_message_at": "2026-11-24T10:42:00Z"
                    },
                    "has_older": false,
                    "older_cursor": null,
                    "messages": [
                        {
                            "from_me": false,
                            "body": "هل يشمل السعر التحميل في الموقع؟",
                            "at": "2026-11-24T10:30:00Z"
                        },
                        {
                            "from_me": true,
                            "body": "نعم، التحميل والتنزيل ضمن السعر.",
                            "at": "2026-11-24T10:42:00Z"
                        }
                    ]
                },
                "errors": [
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/threads/{uuid}/messages",
            "auth": "app_token",
            "scope": "market:threads:read",
            "apps": [
                "shipper",
                "carrier"
            ],
            "idempotency_key": false,
            "limit": null,
            "summary": {
                "en": "The latest messages of one of the caller's threads, earliest first, up to limit (50 by default, 200 at most), and whether earlier ones exist; when they do, older_cursor passed back as before gives the window before the messages shown; a thread that is not the caller's is not found, and a cursor this API did not give is 422.",
                "ar": "آخر رسائل محادثة من محادثات الشركة، الأقدم أولًا، حتى limit (افتراضه 50 وأقصاه 200)، ومع ذلك هل توجد رسائل أقدم؛ فإن وُجدت فإعادة older_cursor في before تعطي النافذة التي قبل الرسائل المعروضة؛ والمحادثة التي ليست للشركة لا توجد، والمؤشر الذي لم تُعطه هذه الواجهة 422."
            }
        },
        {
            "name": "market.api.threads.of_booking",
            "example": {
                "request": null,
                "response": {
                    "thread_uuid": "0193a1e7-1c44-7f90-b2d1-5e8a0c3f9b21"
                },
                "errors": [
                    {
                        "status": 404,
                        "code": "not_found"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/bookings/{uuid}/thread",
            "auth": "app_token",
            "scope": "market:threads:read",
            "apps": [
                "shipper",
                "carrier"
            ],
            "idempotency_key": false,
            "limit": null,
            "summary": {
                "en": "The thread of one of the caller's bookings, as its uuid, so the app can open the booking's conversation.",
                "ar": "معرّف محادثة حجز من حجوزات الشركة، ليفتح التطبيق محادثة الحجز."
            }
        },
        {
            "name": "market.api.threads.post",
            "example": {
                "request": {
                    "body": "هل يمكن التحميل صباح الاثنين؟"
                },
                "response": {
                    "posted": true
                },
                "errors": [
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "thread_closed"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "limit_reached"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "thread_full"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "body_required"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "body_too_long"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "contact_digit_run"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "contact_email"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "contact_link"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "contact_messenger"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "contact_spelled_number"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "contact_mixed_number"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "POST",
            "path": "/market/offers/{offer}/messages",
            "auth": "app_token",
            "scope": "market:threads:write",
            "apps": [
                "shipper",
                "carrier"
            ],
            "idempotency_key": true,
            "limit": "write",
            "summary": {
                "en": "Posts a message on the conversation of an offer the caller is a party to; a phone number, an email, a link or a messenger handle in the text is refused until contacts open, and a conversation that holds its maximum number of messages answers 409 conflict with reason thread_full (it answered 422 validation_failed with that reason before 2026-11-23).",
                "ar": "يرسل رسالة في محادثة عرض الشركة طرف فيه؛ ويُرفض في النص رقم الهاتف والبريد والرابط وحساب المراسلة حتى تُفتح وسائل التواصل، والمحادثة التي بلغت أقصى عدد من الرسائل تجيب 409 conflict بالسبب thread_full (كانت تجيب 422 validation_failed بهذا السبب قبل 2026-11-23)."
            }
        },
        {
            "name": "market.api.threads.post_booking",
            "example": {
                "request": {
                    "body": "وصل السائق إلى موقع التحميل."
                },
                "response": {
                    "posted": true
                },
                "errors": [
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "thread_closed"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "booking_ended"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "limit_reached"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "thread_full"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "body_required"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "body_too_long"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "contact_digit_run"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "contact_email"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "contact_link"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "contact_messenger"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "contact_spelled_number"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "contact_mixed_number"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "POST",
            "path": "/market/bookings/{uuid}/messages",
            "auth": "app_token",
            "scope": "market:threads:write",
            "apps": [
                "shipper",
                "carrier"
            ],
            "idempotency_key": true,
            "limit": "write",
            "summary": {
                "en": "Posts a message on the conversation of one of the caller's bookings; an ended booking takes no new message, and a conversation that holds its maximum number of messages answers 409 conflict with reason thread_full (it answered 422 validation_failed with that reason before 2026-11-23).",
                "ar": "يرسل رسالة في محادثة حجز من حجوزات الشركة؛ والحجز المنتهي لا يقبل رسالة جديدة، والمحادثة التي بلغت أقصى عدد من الرسائل تجيب 409 conflict بالسبب thread_full (كانت تجيب 422 validation_failed بهذا السبب قبل 2026-11-23)."
            }
        },
        {
            "name": "market.api.threads.read",
            "example": {
                "request": null,
                "response": {
                    "thread": {
                        "uuid": "0193a1d4-0391-7d02-8c5e-1a9f3b7c2e64",
                        "offer_uuid": "0193a1d4-02b8-7e35-a9c1-4f7b8d2e6a90",
                        "booking_uuid": null,
                        "request_reference": "MR-0004217",
                        "other_party_name": "نقليات المثال",
                        "state": "open",
                        "contacts_open": false,
                        "unread": 0,
                        "last_message_at": "2026-11-24T10:42:00Z"
                    },
                    "has_older": true,
                    "older_cursor": "eyJtIjo0MjE3fQ",
                    "messages": [
                        {
                            "from_me": true,
                            "body": "نعم، التحميل والتنزيل ضمن السعر.",
                            "at": "2026-11-24T10:42:00Z"
                        }
                    ]
                },
                "errors": [
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "POST",
            "path": "/market/threads/{uuid}/read",
            "auth": "app_token",
            "scope": "market:threads:write",
            "apps": [
                "shipper",
                "carrier"
            ],
            "idempotency_key": true,
            "limit": "write",
            "summary": {
                "en": "Marks the caller's thread as read up to now and answers the thread with its latest message.",
                "ar": "يعلّم محادثة الشركة مقروءة حتى الآن، ويُرجع المحادثة مع آخر رسالة فيها."
            }
        },
        {
            "name": "market.api.transfers.approve",
            "example": {
                "request": null,
                "response": {
                    "uuid": "0193c2a8-4e71-7b36-9c05-1d8f6a3e7b24",
                    "status": "completed",
                    "shipper_approved_at": "2026-11-22T13:05:00+00:00",
                    "new_booking_uuid": "0193c2b9-6a14-7c52-8e37-3b9d1f0a5c68"
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "no_longer_open"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "claim_closed"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "approval_expired"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "POST",
            "path": "/market/transfers/{uuid}/approve",
            "auth": "app_token",
            "scope": "market:transfers:approve",
            "apps": [
                "shipper"
            ],
            "idempotency_key": true,
            "limit": "write",
            "summary": {
                "en": "The shipper approves a claimed urgent offer on one of its bookings; no body. Approving moves the booking at once: the current booking ends with no fee and the answer carries the offer as completed, shipper_approved_at and new_booking_uuid. A claim that closed, was declined or lapsed answers 409 claim_closed, and one past its time 409 approval_expired.",
                "ar": "يوافق الشاحن على عرض عاجل أخذه ناقل لأحد حجوزاته؛ بلا جسم. وتنتقل الموافقة بالحجز في الحال: يُلغى الحجز الحالي بلا رسوم ويحمل الجواب العرض بحالة completed وshipper_approved_at وnew_booking_uuid. والطلب المغلق أو المرفوض أو المنتهي جوابه 409 claim_closed، وما تجاوز مهلته 409 approval_expired."
            }
        },
        {
            "name": "market.api.transfers.cancel",
            "example": {
                "request": {
                    "version": 1
                },
                "response": {
                    "uuid": "0193c2a8-4e71-7b36-9c05-1d8f6a3e7b24",
                    "status": "cancelled",
                    "reason": "carrier_request",
                    "service_type": "freight",
                    "window_starts_at": "2026-11-24T05:00:00Z",
                    "window_ends_at": "2026-11-24T09:00:00Z",
                    "vehicle_type": "truck_flatbed",
                    "cargo_weight_kg": 22000,
                    "expires_at": "2026-11-23T18:00:00Z",
                    "version": 2,
                    "created_at": "2026-11-22T10:15:00Z",
                    "updated_at": "2026-11-22T11:02:00Z"
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "not_open"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "offer_changed"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "POST",
            "path": "/market/transfers/{uuid}/cancel",
            "auth": "app_token",
            "scope": "market:transfers:write",
            "apps": [
                "carrier"
            ],
            "idempotency_key": true,
            "limit": "write",
            "summary": {
                "en": "Takes back the caller's own open urgent offer; version, the row version it read, is optional and a changed offer answers 409 offer_changed.",
                "ar": "يسحب المتصل عرضه العاجل المفتوح؛ وversion، نسخة الصف التي قرأها، اختيارية، والعرض المتغيّر يُجاب 409 offer_changed."
            }
        },
        {
            "name": "market.api.transfers.claim",
            "example": {
                "request": {
                    "listing": "0193c1d0-8b42-7a19-b3e6-5f2c9d4a0e87",
                    "expected_payout_halalas": 91000
                },
                "response": {
                    "uuid": "0193c2a8-4e71-7b36-9c05-1d8f6a3e7b24",
                    "status": "claimed",
                    "reason": "carrier_request",
                    "service_type": "freight",
                    "window_starts_at": "2026-11-24T05:00:00Z",
                    "window_ends_at": "2026-11-24T09:00:00Z",
                    "vehicle_type": "truck_flatbed",
                    "cargo_weight_kg": 22000,
                    "expires_at": "2026-11-23T18:00:00Z",
                    "version": 2,
                    "created_at": "2026-11-22T10:15:00Z",
                    "updated_at": "2026-11-22T12:20:00Z"
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "no_longer_open"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "does_not_fit"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "not_allowed"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "payout_changed"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "window_too_near"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "inclusion_not_offered"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited",
                        "reason": "wait"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "POST",
            "path": "/market/transfers/{uuid}/claim",
            "auth": "app_token",
            "scope": "market:transfers:claim",
            "apps": [
                "carrier"
            ],
            "idempotency_key": true,
            "limit": "write",
            "summary": {
                "en": "Takes an open urgent offer on a listing of the caller's own, at the payout it saw (expected_payout_halalas); a changed payout answers 409 payout_changed and an hourly limit 429 with the reason wait.",
                "ar": "يأخذ عرضًا عاجلًا مفتوحًا على إعلان من إعلانات المتصل بالصافي الذي رآه (expected_payout_halalas)؛ والصافي المتغيّر يُجاب 409 payout_changed، والحد الساعي 429 بالسبب wait."
            }
        },
        {
            "name": "market.api.transfers.decline",
            "example": {
                "request": null,
                "response": {
                    "uuid": "0193c2a8-4e71-7b36-9c05-1d8f6a3e7b24",
                    "status": "cancelled"
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "claim_closed"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "POST",
            "path": "/market/transfers/{uuid}/decline",
            "auth": "app_token",
            "scope": "market:transfers:approve",
            "apps": [
                "shipper"
            ],
            "idempotency_key": true,
            "limit": "write",
            "summary": {
                "en": "The shipper declines a claimed urgent offer on one of its bookings; no body. The booking stays with its carrier and the answer is the offer as cancelled; a claim that no longer waits answers 409 claim_closed.",
                "ar": "يرفض الشاحن عرضًا عاجلًا أخذه ناقل لأحد حجوزاته؛ بلا جسم. يبقى الحجز عند ناقله والجواب هو العرض بحالة cancelled؛ وطلب لم يعد ينتظر جوابه 409 claim_closed."
            }
        },
        {
            "name": "market.api.transfers.index",
            "example": {
                "request": null,
                "response": [
                    {
                        "uuid": "0193c2a8-4e71-7b36-9c05-1d8f6a3e7b24",
                        "service_type": "freight",
                        "route": "الرياض ← جدة",
                        "window_starts_at": "2026-11-24T05:00:00+00:00",
                        "window_ends_at": "2026-11-24T09:00:00+00:00",
                        "vehicle_type": "شاحنة مسطحة",
                        "cargo_type": "مواد بناء",
                        "cargo_weight_kg": 22000,
                        "expires_at": "2026-11-23T18:00:00+00:00",
                        "payout_halalas": 91000,
                        "includes": [
                            {
                                "code": "unloading_help",
                                "name": "مساعدة في التفريغ",
                                "quantity": 2,
                                "unit": "hours"
                            }
                        ],
                        "listing_uuids": [
                            "0193c1d0-8b42-7a19-b3e6-5f2c9d4a0e87"
                        ]
                    }
                ],
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/transfers",
            "auth": "app_token",
            "scope": "market:transfers:read",
            "apps": [
                "carrier"
            ],
            "idempotency_key": false,
            "limit": "heavy",
            "summary": {
                "en": "The board of other carriers' open urgent offers that the caller may take on a listing of its own: where, when, what, the payout in halalas on its own terms and what the booking's price includes (which the taker takes over), with the caller's listings that fit.",
                "ar": "لوحة العروض العاجلة المفتوحة لدى ناقلين آخرين مما يحق للمتصل أخذه على إعلان من إعلاناته: أين ومتى وماذا، وصافي ما يُدفع له بالهللات بشروطه، وما يشمله سعر الحجز مما يتسلّمه الآخذ، مع إعلاناته التي تناسب العرض."
            }
        },
        {
            "name": "market.api.transfers.store",
            "example": {
                "request": null,
                "response": {
                    "uuid": "0193c2a8-4e71-7b36-9c05-1d8f6a3e7b24",
                    "status": "open",
                    "reason": "carrier_request",
                    "service_type": "freight",
                    "window_starts_at": "2026-11-24T05:00:00Z",
                    "window_ends_at": "2026-11-24T09:00:00Z",
                    "vehicle_type": "truck_flatbed",
                    "cargo_weight_kg": 22000,
                    "expires_at": "2026-11-23T18:00:00Z",
                    "version": 1,
                    "created_at": "2026-11-22T10:15:00Z",
                    "updated_at": "2026-11-22T10:15:00Z"
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "already_offered"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "booking_started"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "transfer_limit"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited",
                        "reason": "wait"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "POST",
            "path": "/market/bookings/{booking}/transfer",
            "auth": "app_token",
            "scope": "market:transfers:write",
            "apps": [
                "carrier"
            ],
            "idempotency_key": true,
            "limit": "write",
            "summary": {
                "en": "Opens an urgent offer for one of the caller's own bookings that has not started; no body. An hourly limit answers 429 with the reason wait.",
                "ar": "يفتح عرضًا عاجلًا لأحد حجوزات المتصل التي لم تبدأ؛ بلا جسم. وللحد الساعي جواب 429 بالسبب wait."
            }
        },
        {
            "name": "market.api.trips.cancel",
            "example": {
                "request": {
                    "version": 3,
                    "reason": "تعطّل المركبة قبل الانطلاق"
                },
                "response": {
                    "uuid": "0193d0a1-2c58-7e41-b6a9-4f1d8c3e7a02",
                    "reference": "K7Q2M9XD",
                    "listing_uuid": "0193c1d0-8b42-7a19-b3e6-5f2c9d4a0e87",
                    "route": {
                        "from": "مستودع الرياض",
                        "to": "ميناء الدمام"
                    },
                    "vehicle": "شاحنة مسطحة 4821 ABC",
                    "state": "cancelled",
                    "awaiting_review": false,
                    "refused": false,
                    "review_refusal_reason": null,
                    "imported": false,
                    "sale_mode": "shares",
                    "departs_at": "2026-11-26T04:00:00Z",
                    "arrives_at": "2026-11-26T09:30:00Z",
                    "booking_cutoff_at": "2026-11-25T16:00:00Z",
                    "max_shares": 8,
                    "shares_count": 0,
                    "is_suspended": false,
                    "suspension_reason": null,
                    "is_return": false,
                    "version": 4,
                    "created_at": "2026-11-22T08:30:00Z",
                    "updated_at": "2026-11-22T10:40:00Z",
                    "missing": [],
                    "stops": [
                        {
                            "position": 0,
                            "kind": "origin",
                            "name": "مستودع الرياض",
                            "city_id": 1024,
                            "lat": 24.6877,
                            "lng": 46.7219,
                            "loading_allowed": true,
                            "distance_from_start_m": 0,
                            "leg_minutes": 0,
                            "stop_minutes": 0,
                            "planned_arrival_at": "2026-11-26T04:00:00Z",
                            "planned_departure_at": "2026-11-26T04:00:00Z"
                        },
                        {
                            "position": 1,
                            "kind": "stop",
                            "name": "الهفوف",
                            "city_id": 1117,
                            "lat": 25.3647,
                            "lng": 49.5878,
                            "loading_allowed": true,
                            "distance_from_start_m": 330000,
                            "leg_minutes": 190,
                            "stop_minutes": 30,
                            "planned_arrival_at": "2026-11-26T07:10:00Z",
                            "planned_departure_at": "2026-11-26T07:40:00Z"
                        },
                        {
                            "position": 2,
                            "kind": "destination",
                            "name": "ميناء الدمام",
                            "city_id": 1118,
                            "lat": 26.4207,
                            "lng": 50.0888,
                            "loading_allowed": false,
                            "distance_from_start_m": 400000,
                            "leg_minutes": 110,
                            "stop_minutes": 0,
                            "planned_arrival_at": "2026-11-26T09:30:00Z",
                            "planned_departure_at": "2026-11-26T09:30:00Z"
                        }
                    ],
                    "capacity": {
                        "weight": 20000
                    },
                    "prices": [
                        {
                            "basis": "route_fraction",
                            "unit": "ton",
                            "cargo_type": null,
                            "price_halalas": 12000,
                            "ton_rate_halalas": null,
                            "m3_rate_halalas": null,
                            "minimum_halalas": 6000,
                            "excludes_vat": true
                        },
                        {
                            "basis": "by_load",
                            "unit": null,
                            "cargo_type": "building_materials",
                            "price_halalas": null,
                            "ton_rate_halalas": 9000,
                            "m3_rate_halalas": 4000,
                            "minimum_halalas": 6000,
                            "excludes_vat": true
                        }
                    ]
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "stale_version"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "cancel_with_shares"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "cancel_suspended"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "cancel_reason"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "cancel_reason_length"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "POST",
            "path": "/market/trips/{uuid}/cancel",
            "auth": "app_token",
            "scope": "market:trips:write",
            "apps": [
                "carrier"
            ],
            "idempotency_key": true,
            "limit": "write",
            "summary": {
                "en": "Cancels a trip, given the row version it read and optionally a reason; a trip with shares sold cannot be cancelled.",
                "ar": "يلغي رحلة بنسخة الصف التي قرأها وبسبب اختياري؛ والرحلة التي بيعت حصص منها لا تُلغى."
            }
        },
        {
            "name": "market.api.trips.capacity",
            "example": {
                "request": {
                    "version": 5,
                    "dimension": "weight",
                    "capacity": 24000
                },
                "response": {
                    "uuid": "0193d0a1-2c58-7e41-b6a9-4f1d8c3e7a02",
                    "reference": "K7Q2M9XD",
                    "listing_uuid": "0193c1d0-8b42-7a19-b3e6-5f2c9d4a0e87",
                    "route": {
                        "from": "مستودع الرياض",
                        "to": "ميناء الدمام"
                    },
                    "vehicle": "شاحنة مسطحة 4821 ABC",
                    "state": "published",
                    "awaiting_review": false,
                    "refused": false,
                    "review_refusal_reason": null,
                    "imported": false,
                    "sale_mode": "shares",
                    "departs_at": "2026-11-26T04:00:00Z",
                    "arrives_at": "2026-11-26T09:30:00Z",
                    "booking_cutoff_at": "2026-11-25T16:00:00Z",
                    "max_shares": 8,
                    "shares_count": 2,
                    "is_suspended": false,
                    "suspension_reason": null,
                    "is_return": false,
                    "version": 6,
                    "created_at": "2026-11-22T08:30:00Z",
                    "updated_at": "2026-11-25T10:20:00Z",
                    "missing": [],
                    "stops": [
                        {
                            "position": 0,
                            "kind": "origin",
                            "name": "مستودع الرياض",
                            "city_id": 1024,
                            "lat": 24.6877,
                            "lng": 46.7219,
                            "loading_allowed": true,
                            "distance_from_start_m": 0,
                            "leg_minutes": 0,
                            "stop_minutes": 0,
                            "planned_arrival_at": "2026-11-26T04:00:00Z",
                            "planned_departure_at": "2026-11-26T04:00:00Z"
                        },
                        {
                            "position": 1,
                            "kind": "stop",
                            "name": "الهفوف",
                            "city_id": 1117,
                            "lat": 25.3647,
                            "lng": 49.5878,
                            "loading_allowed": true,
                            "distance_from_start_m": 330000,
                            "leg_minutes": 190,
                            "stop_minutes": 30,
                            "planned_arrival_at": "2026-11-26T07:10:00Z",
                            "planned_departure_at": "2026-11-26T07:40:00Z"
                        },
                        {
                            "position": 2,
                            "kind": "destination",
                            "name": "ميناء الدمام",
                            "city_id": 1118,
                            "lat": 26.4207,
                            "lng": 50.0888,
                            "loading_allowed": false,
                            "distance_from_start_m": 400000,
                            "leg_minutes": 110,
                            "stop_minutes": 0,
                            "planned_arrival_at": "2026-11-26T09:30:00Z",
                            "planned_departure_at": "2026-11-26T09:30:00Z"
                        }
                    ],
                    "capacity": {
                        "weight": 24000
                    },
                    "prices": [
                        {
                            "basis": "route_fraction",
                            "unit": "ton",
                            "cargo_type": null,
                            "price_halalas": 12000,
                            "ton_rate_halalas": null,
                            "m3_rate_halalas": null,
                            "minimum_halalas": 6000,
                            "excludes_vat": true
                        },
                        {
                            "basis": "by_load",
                            "unit": null,
                            "cargo_type": "building_materials",
                            "price_halalas": null,
                            "ton_rate_halalas": 9000,
                            "m3_rate_halalas": 4000,
                            "minimum_halalas": 6000,
                            "excludes_vat": true
                        }
                    ]
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "stale_version"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "after_booking_closed"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "capacity_raise_only"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "capacity_dimension_missing"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "POST",
            "path": "/market/trips/{uuid}/capacity",
            "auth": "app_token",
            "scope": "market:trips:write",
            "apps": [
                "carrier"
            ],
            "idempotency_key": true,
            "limit": "write",
            "summary": {
                "en": "Raises the total of one capacity (weight, volume or a count) of a published trip that already has bookings, given the row version it read; never lowers it.",
                "ar": "يرفع إجمالي سعة واحدة (الوزن أو الحجم أو عدّ) لرحلة منشورة لها حجوزات بنسخة الصف التي قرأها؛ ولا يخفضها أبدًا."
            }
        },
        {
            "name": "market.api.trips.close",
            "example": {
                "request": {
                    "version": 3
                },
                "response": {
                    "uuid": "0193d0a1-2c58-7e41-b6a9-4f1d8c3e7a02",
                    "reference": "K7Q2M9XD",
                    "listing_uuid": "0193c1d0-8b42-7a19-b3e6-5f2c9d4a0e87",
                    "route": {
                        "from": "مستودع الرياض",
                        "to": "ميناء الدمام"
                    },
                    "vehicle": "شاحنة مسطحة 4821 ABC",
                    "state": "closed",
                    "awaiting_review": false,
                    "refused": false,
                    "review_refusal_reason": null,
                    "imported": false,
                    "sale_mode": "shares",
                    "departs_at": "2026-11-26T04:00:00Z",
                    "arrives_at": "2026-11-26T09:30:00Z",
                    "booking_cutoff_at": "2026-11-25T16:00:00Z",
                    "max_shares": 8,
                    "shares_count": 2,
                    "is_suspended": false,
                    "suspension_reason": null,
                    "is_return": false,
                    "version": 4,
                    "created_at": "2026-11-22T08:30:00Z",
                    "updated_at": "2026-11-25T16:00:00Z",
                    "missing": [],
                    "stops": [
                        {
                            "position": 0,
                            "kind": "origin",
                            "name": "مستودع الرياض",
                            "city_id": 1024,
                            "lat": 24.6877,
                            "lng": 46.7219,
                            "loading_allowed": true,
                            "distance_from_start_m": 0,
                            "leg_minutes": 0,
                            "stop_minutes": 0,
                            "planned_arrival_at": "2026-11-26T04:00:00Z",
                            "planned_departure_at": "2026-11-26T04:00:00Z"
                        },
                        {
                            "position": 1,
                            "kind": "stop",
                            "name": "الهفوف",
                            "city_id": 1117,
                            "lat": 25.3647,
                            "lng": 49.5878,
                            "loading_allowed": true,
                            "distance_from_start_m": 330000,
                            "leg_minutes": 190,
                            "stop_minutes": 30,
                            "planned_arrival_at": "2026-11-26T07:10:00Z",
                            "planned_departure_at": "2026-11-26T07:40:00Z"
                        },
                        {
                            "position": 2,
                            "kind": "destination",
                            "name": "ميناء الدمام",
                            "city_id": 1118,
                            "lat": 26.4207,
                            "lng": 50.0888,
                            "loading_allowed": false,
                            "distance_from_start_m": 400000,
                            "leg_minutes": 110,
                            "stop_minutes": 0,
                            "planned_arrival_at": "2026-11-26T09:30:00Z",
                            "planned_departure_at": "2026-11-26T09:30:00Z"
                        }
                    ],
                    "capacity": {
                        "weight": 20000
                    },
                    "prices": [
                        {
                            "basis": "route_fraction",
                            "unit": "ton",
                            "cargo_type": null,
                            "price_halalas": 12000,
                            "ton_rate_halalas": null,
                            "m3_rate_halalas": null,
                            "minimum_halalas": 6000,
                            "excludes_vat": true
                        },
                        {
                            "basis": "by_load",
                            "unit": null,
                            "cargo_type": "building_materials",
                            "price_halalas": null,
                            "ton_rate_halalas": 9000,
                            "m3_rate_halalas": 4000,
                            "minimum_halalas": 6000,
                            "excludes_vat": true
                        }
                    ]
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "stale_version"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "close_suspended"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "POST",
            "path": "/market/trips/{uuid}/close",
            "auth": "app_token",
            "scope": "market:trips:write",
            "apps": [
                "carrier"
            ],
            "idempotency_key": true,
            "limit": "write",
            "summary": {
                "en": "Closes a published trip to further bookings, given the row version it read.",
                "ar": "يغلق رحلة منشورة أمام حجوزات أخرى بنسخة الصف التي قرأها."
            }
        },
        {
            "name": "market.api.trips.index",
            "example": {
                "request": {
                    "query": {
                        "status": "published",
                        "limit": 20
                    }
                },
                "response": [
                    {
                        "uuid": "0193d0a1-2c58-7e41-b6a9-4f1d8c3e7a02",
                        "reference": "K7Q2M9XD",
                        "listing_uuid": "0193c1d0-8b42-7a19-b3e6-5f2c9d4a0e87",
                        "route": {
                            "from": "مستودع الرياض",
                            "to": "ميناء الدمام"
                        },
                        "vehicle": "شاحنة مسطحة 4821 ABC",
                        "state": "published",
                        "awaiting_review": false,
                        "refused": false,
                        "review_refusal_reason": null,
                        "imported": false,
                        "sale_mode": "shares",
                        "departs_at": "2026-11-26T04:00:00Z",
                        "arrives_at": "2026-11-26T09:30:00Z",
                        "booking_cutoff_at": "2026-11-25T16:00:00Z",
                        "max_shares": 6,
                        "shares_count": 2,
                        "is_suspended": false,
                        "suspension_reason": null,
                        "is_return": false,
                        "version": 3,
                        "created_at": "2026-11-22T08:30:00Z",
                        "updated_at": "2026-11-22T09:05:00Z"
                    }
                ],
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/trips",
            "auth": "app_token",
            "scope": "market:trips:read",
            "apps": [
                "carrier"
            ],
            "idempotency_key": false,
            "limit": null,
            "summary": {
                "en": "Lists the carrier's own shared trips, a page at a time (limit, and the cursor of meta.page.next_cursor), by status (the trip's state): where each goes, with which truck, whether a draft waits for the team's approval or was refused (with the team's reason) and, for a suspended trip, why the team stopped it (suspension_reason, the sentence the carrier reads on its trip page, null otherwise); never another company's.",
                "ar": "يعرض الرحلات المشتركة الخاصة بالناقل، صفحةً صفحة (limit ومؤشر meta.page.next_cursor)، ويُرشَّح بـ status (حالة الرحلة): وجهة كل رحلة والشاحنة، وهل المسودة تنتظر موافقة الفريق أو رفضها (مع سبب الفريق)، ولرحلة موقوفة سبب إيقاف الفريق لها (suspension_reason، الجملة التي يقرؤها الناقل في صفحة رحلته، وإلا null)؛ ولا يعرض رحلات شركة أخرى."
            }
        },
        {
            "name": "market.api.trips.prices",
            "example": {
                "request": {
                    "version": 5,
                    "prices": [
                        {
                            "basis": "route_fraction",
                            "unit": "ton",
                            "price_halalas": 13000,
                            "minimum_halalas": 6000
                        }
                    ]
                },
                "response": {
                    "uuid": "0193d0a1-2c58-7e41-b6a9-4f1d8c3e7a02",
                    "reference": "K7Q2M9XD",
                    "listing_uuid": "0193c1d0-8b42-7a19-b3e6-5f2c9d4a0e87",
                    "route": {
                        "from": "مستودع الرياض",
                        "to": "ميناء الدمام"
                    },
                    "vehicle": "شاحنة مسطحة 4821 ABC",
                    "state": "published",
                    "awaiting_review": false,
                    "refused": false,
                    "review_refusal_reason": null,
                    "imported": false,
                    "sale_mode": "shares",
                    "departs_at": "2026-11-26T04:00:00Z",
                    "arrives_at": "2026-11-26T09:30:00Z",
                    "booking_cutoff_at": "2026-11-25T16:00:00Z",
                    "max_shares": 8,
                    "shares_count": 2,
                    "is_suspended": false,
                    "suspension_reason": null,
                    "is_return": false,
                    "version": 6,
                    "created_at": "2026-11-22T08:30:00Z",
                    "updated_at": "2026-11-25T10:25:00Z",
                    "missing": [],
                    "stops": [
                        {
                            "position": 0,
                            "kind": "origin",
                            "name": "مستودع الرياض",
                            "city_id": 1024,
                            "lat": 24.6877,
                            "lng": 46.7219,
                            "loading_allowed": true,
                            "distance_from_start_m": 0,
                            "leg_minutes": 0,
                            "stop_minutes": 0,
                            "planned_arrival_at": "2026-11-26T04:00:00Z",
                            "planned_departure_at": "2026-11-26T04:00:00Z"
                        },
                        {
                            "position": 1,
                            "kind": "stop",
                            "name": "الهفوف",
                            "city_id": 1117,
                            "lat": 25.3647,
                            "lng": 49.5878,
                            "loading_allowed": true,
                            "distance_from_start_m": 330000,
                            "leg_minutes": 190,
                            "stop_minutes": 30,
                            "planned_arrival_at": "2026-11-26T07:10:00Z",
                            "planned_departure_at": "2026-11-26T07:40:00Z"
                        },
                        {
                            "position": 2,
                            "kind": "destination",
                            "name": "ميناء الدمام",
                            "city_id": 1118,
                            "lat": 26.4207,
                            "lng": 50.0888,
                            "loading_allowed": false,
                            "distance_from_start_m": 400000,
                            "leg_minutes": 110,
                            "stop_minutes": 0,
                            "planned_arrival_at": "2026-11-26T09:30:00Z",
                            "planned_departure_at": "2026-11-26T09:30:00Z"
                        }
                    ],
                    "capacity": {
                        "weight": 20000
                    },
                    "prices": [
                        {
                            "basis": "route_fraction",
                            "unit": "ton",
                            "price_halalas": 13000,
                            "minimum_halalas": 6000,
                            "excludes_vat": true
                        }
                    ]
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "stale_version"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "after_booking_closed"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "prices_empty"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "POST",
            "path": "/market/trips/{uuid}/prices",
            "auth": "app_token",
            "scope": "market:trips:publish",
            "apps": [
                "carrier"
            ],
            "idempotency_key": true,
            "limit": "write",
            "summary": {
                "en": "Replaces the prices of a published trip that already has bookings, given the row version it read; the shares already booked keep their own amounts and only the bookings still to come use the new prices. It needs the publishing scope, not the trips write scope, because it changes the offer shippers book and pay against.",
                "ar": "يستبدل أسعار رحلة منشورة لها حجوزات بنسخة الصف التي قرأها؛ والحصص المحجوزة تبقى بمبالغها وتأخذ الحجوزات القادمة وحدها الأسعار الجديدة. ويلزمه نطاق النشر لا نطاق كتابة الرحلات، لأنه يغيّر العرض الذي يحجز الشاحنون ويدفعون عليه."
            }
        },
        {
            "name": "market.api.trips.publish",
            "example": {
                "request": {
                    "version": 2
                },
                "response": {
                    "uuid": "0193d0a1-2c58-7e41-b6a9-4f1d8c3e7a02",
                    "reference": "K7Q2M9XD",
                    "listing_uuid": "0193c1d0-8b42-7a19-b3e6-5f2c9d4a0e87",
                    "route": {
                        "from": "مستودع الرياض",
                        "to": "ميناء الدمام"
                    },
                    "vehicle": "شاحنة مسطحة 4821 ABC",
                    "state": "published",
                    "awaiting_review": false,
                    "refused": false,
                    "review_refusal_reason": null,
                    "imported": false,
                    "sale_mode": "shares",
                    "departs_at": "2026-11-26T04:00:00Z",
                    "arrives_at": "2026-11-26T09:30:00Z",
                    "booking_cutoff_at": "2026-11-25T16:00:00Z",
                    "max_shares": 8,
                    "shares_count": 0,
                    "is_suspended": false,
                    "suspension_reason": null,
                    "is_return": false,
                    "version": 3,
                    "created_at": "2026-11-22T08:30:00Z",
                    "updated_at": "2026-11-22T09:05:00Z",
                    "missing": [],
                    "stops": [
                        {
                            "position": 0,
                            "kind": "origin",
                            "name": "مستودع الرياض",
                            "city_id": 1024,
                            "lat": 24.6877,
                            "lng": 46.7219,
                            "loading_allowed": true,
                            "distance_from_start_m": 0,
                            "leg_minutes": 0,
                            "stop_minutes": 0,
                            "planned_arrival_at": "2026-11-26T04:00:00Z",
                            "planned_departure_at": "2026-11-26T04:00:00Z"
                        },
                        {
                            "position": 1,
                            "kind": "stop",
                            "name": "الهفوف",
                            "city_id": 1117,
                            "lat": 25.3647,
                            "lng": 49.5878,
                            "loading_allowed": true,
                            "distance_from_start_m": 330000,
                            "leg_minutes": 190,
                            "stop_minutes": 30,
                            "planned_arrival_at": "2026-11-26T07:10:00Z",
                            "planned_departure_at": "2026-11-26T07:40:00Z"
                        },
                        {
                            "position": 2,
                            "kind": "destination",
                            "name": "ميناء الدمام",
                            "city_id": 1118,
                            "lat": 26.4207,
                            "lng": 50.0888,
                            "loading_allowed": false,
                            "distance_from_start_m": 400000,
                            "leg_minutes": 110,
                            "stop_minutes": 0,
                            "planned_arrival_at": "2026-11-26T09:30:00Z",
                            "planned_departure_at": "2026-11-26T09:30:00Z"
                        }
                    ],
                    "capacity": {
                        "weight": 20000
                    },
                    "prices": [
                        {
                            "basis": "route_fraction",
                            "unit": "ton",
                            "cargo_type": null,
                            "price_halalas": 12000,
                            "ton_rate_halalas": null,
                            "m3_rate_halalas": null,
                            "minimum_halalas": 6000,
                            "excludes_vat": true
                        },
                        {
                            "basis": "by_load",
                            "unit": null,
                            "cargo_type": "building_materials",
                            "price_halalas": null,
                            "ton_rate_halalas": 9000,
                            "m3_rate_halalas": 4000,
                            "minimum_halalas": 6000,
                            "excludes_vat": true
                        }
                    ]
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "stale_version"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "not_a_draft"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "awaiting_review"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "publish_time_passed"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "carrier_not_approved"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "listing_not_published"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "listing_not_freight"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "imported_trip_unconfirmed"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "publish_refused"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "publish_needs_price"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "sale_mode_not_allowed"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "whole_needs_capacity"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "POST",
            "path": "/market/trips/{uuid}/publish",
            "auth": "app_token",
            "scope": "market:trips:publish",
            "apps": [
                "carrier"
            ],
            "idempotency_key": true,
            "limit": "write",
            "summary": {
                "en": "Publishes a draft trip for sale, given the row version it read; the carrier must be approved, the listing published and the trip priced. A trip that came from the previous market also needs imported_trip_confirmed: true, and where the team approves new trips first the answer is the draft with awaiting_review true.",
                "ar": "ينشر مسودة رحلة للبيع بنسخة الصف التي قرأها؛ ويلزم أن يكون الناقل معتمدًا والإعلان منشورًا والرحلة مسعّرة. والرحلة التي جاءت من السوق السابق تحتاج أيضًا imported_trip_confirmed: true، وحيث يوافق الفريق على الرحلات الجديدة أولًا فالجواب المسودة مع awaiting_review true."
            }
        },
        {
            "name": "market.api.trips.show",
            "example": {
                "request": null,
                "response": {
                    "uuid": "0193d0a1-2c58-7e41-b6a9-4f1d8c3e7a02",
                    "reference": "K7Q2M9XD",
                    "listing_uuid": "0193c1d0-8b42-7a19-b3e6-5f2c9d4a0e87",
                    "route": {
                        "from": "مستودع الرياض",
                        "to": "ميناء الدمام"
                    },
                    "vehicle": "شاحنة مسطحة 4821 ABC",
                    "state": "draft",
                    "awaiting_review": false,
                    "refused": false,
                    "review_refusal_reason": null,
                    "imported": false,
                    "sale_mode": "shares",
                    "departs_at": "2026-11-26T04:00:00Z",
                    "arrives_at": "2026-11-26T09:30:00Z",
                    "booking_cutoff_at": "2026-11-25T16:00:00Z",
                    "max_shares": 6,
                    "shares_count": 0,
                    "is_suspended": false,
                    "suspension_reason": null,
                    "is_return": false,
                    "version": 1,
                    "created_at": "2026-11-22T08:30:00Z",
                    "updated_at": "2026-11-22T08:30:00Z",
                    "missing": [],
                    "stops": [
                        {
                            "position": 0,
                            "kind": "origin",
                            "name": "مستودع الرياض",
                            "city_id": 1024,
                            "lat": 24.6877,
                            "lng": 46.7219,
                            "loading_allowed": true,
                            "distance_from_start_m": 0,
                            "leg_minutes": 0,
                            "stop_minutes": 0,
                            "planned_arrival_at": "2026-11-26T04:00:00Z",
                            "planned_departure_at": "2026-11-26T04:00:00Z"
                        },
                        {
                            "position": 1,
                            "kind": "stop",
                            "name": "الهفوف",
                            "city_id": 1117,
                            "lat": 25.3647,
                            "lng": 49.5878,
                            "loading_allowed": true,
                            "distance_from_start_m": 330000,
                            "leg_minutes": 190,
                            "stop_minutes": 30,
                            "planned_arrival_at": "2026-11-26T07:10:00Z",
                            "planned_departure_at": "2026-11-26T07:40:00Z"
                        },
                        {
                            "position": 2,
                            "kind": "destination",
                            "name": "ميناء الدمام",
                            "city_id": 1118,
                            "lat": 26.4207,
                            "lng": 50.0888,
                            "loading_allowed": false,
                            "distance_from_start_m": 400000,
                            "leg_minutes": 110,
                            "stop_minutes": 0,
                            "planned_arrival_at": "2026-11-26T09:30:00Z",
                            "planned_departure_at": "2026-11-26T09:30:00Z"
                        }
                    ],
                    "capacity": {
                        "weight": 20000
                    },
                    "prices": [
                        {
                            "basis": "route_fraction",
                            "unit": "ton",
                            "cargo_type": null,
                            "price_halalas": 12000,
                            "ton_rate_halalas": null,
                            "m3_rate_halalas": null,
                            "minimum_halalas": 6000,
                            "excludes_vat": true
                        },
                        {
                            "basis": "by_load",
                            "unit": null,
                            "cargo_type": "building_materials",
                            "price_halalas": null,
                            "ton_rate_halalas": 9000,
                            "m3_rate_halalas": 4000,
                            "minimum_halalas": 6000,
                            "excludes_vat": true
                        }
                    ]
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/trips/{uuid}",
            "auth": "app_token",
            "scope": "market:trips:read",
            "apps": [
                "carrier"
            ],
            "idempotency_key": false,
            "limit": null,
            "summary": {
                "en": "Reads one of the carrier's own shared trips in full: the list's keys, what a draft still lacks before it can be published (missing), its stops by position, what it can carry and what it charges before VAT.",
                "ar": "يقرأ رحلة مشتركة واحدة للناقل كاملة: مفاتيح القائمة وما ينقص المسودة قبل نشرها (missing) ومحطاتها بترتيبها وما تحمله وما تتقاضاه قبل الضريبة."
            }
        },
        {
            "name": "market.api.trips.store",
            "example": {
                "request": {
                    "departs_at": "2026-11-26T04:00:00Z",
                    "cutoff_hours": 12,
                    "sale_mode": "shares",
                    "max_shares": 6,
                    "weight_kg": 20000,
                    "origin": {
                        "name": "مستودع الرياض",
                        "city_id": 1024,
                        "lat": 24.6877,
                        "lng": 46.7219
                    },
                    "via": [
                        {
                            "kind": "stop",
                            "name": "الهفوف",
                            "city_id": 1117,
                            "lat": 25.3647,
                            "lng": 49.5878,
                            "loading": true,
                            "distance_km": 330,
                            "leg_minutes": 190,
                            "stop_minutes": 30
                        }
                    ],
                    "destination": {
                        "name": "ميناء الدمام",
                        "city_id": 1118,
                        "lat": 26.4207,
                        "lng": 50.0888,
                        "distance_km": 400,
                        "leg_minutes": 110
                    },
                    "prices": [
                        {
                            "basis": "route_fraction",
                            "unit": "ton",
                            "price_halalas": 12000,
                            "minimum_halalas": 6000
                        },
                        {
                            "basis": "by_load",
                            "cargo_type": "building_materials",
                            "ton_rate_halalas": 9000,
                            "m3_rate_halalas": 4000,
                            "minimum_halalas": 6000
                        }
                    ]
                },
                "response": {
                    "uuid": "0193d0a1-2c58-7e41-b6a9-4f1d8c3e7a02",
                    "reference": "K7Q2M9XD",
                    "listing_uuid": "0193c1d0-8b42-7a19-b3e6-5f2c9d4a0e87",
                    "route": {
                        "from": "مستودع الرياض",
                        "to": "ميناء الدمام"
                    },
                    "vehicle": "شاحنة مسطحة 4821 ABC",
                    "state": "draft",
                    "awaiting_review": false,
                    "refused": false,
                    "review_refusal_reason": null,
                    "imported": false,
                    "sale_mode": "shares",
                    "departs_at": "2026-11-26T04:00:00Z",
                    "arrives_at": "2026-11-26T09:30:00Z",
                    "booking_cutoff_at": "2026-11-25T16:00:00Z",
                    "max_shares": 6,
                    "shares_count": 0,
                    "is_suspended": false,
                    "suspension_reason": null,
                    "is_return": false,
                    "version": 1,
                    "created_at": "2026-11-22T08:30:00Z",
                    "updated_at": "2026-11-22T08:30:00Z",
                    "missing": [],
                    "stops": [
                        {
                            "position": 0,
                            "kind": "origin",
                            "name": "مستودع الرياض",
                            "city_id": 1024,
                            "lat": 24.6877,
                            "lng": 46.7219,
                            "loading_allowed": true,
                            "distance_from_start_m": 0,
                            "leg_minutes": 0,
                            "stop_minutes": 0,
                            "planned_arrival_at": "2026-11-26T04:00:00Z",
                            "planned_departure_at": "2026-11-26T04:00:00Z"
                        },
                        {
                            "position": 1,
                            "kind": "stop",
                            "name": "الهفوف",
                            "city_id": 1117,
                            "lat": 25.3647,
                            "lng": 49.5878,
                            "loading_allowed": true,
                            "distance_from_start_m": 330000,
                            "leg_minutes": 190,
                            "stop_minutes": 30,
                            "planned_arrival_at": "2026-11-26T07:10:00Z",
                            "planned_departure_at": "2026-11-26T07:40:00Z"
                        },
                        {
                            "position": 2,
                            "kind": "destination",
                            "name": "ميناء الدمام",
                            "city_id": 1118,
                            "lat": 26.4207,
                            "lng": 50.0888,
                            "loading_allowed": false,
                            "distance_from_start_m": 400000,
                            "leg_minutes": 110,
                            "stop_minutes": 0,
                            "planned_arrival_at": "2026-11-26T09:30:00Z",
                            "planned_departure_at": "2026-11-26T09:30:00Z"
                        }
                    ],
                    "capacity": {
                        "weight": 20000
                    },
                    "prices": [
                        {
                            "basis": "route_fraction",
                            "unit": "ton",
                            "cargo_type": null,
                            "price_halalas": 12000,
                            "ton_rate_halalas": null,
                            "m3_rate_halalas": null,
                            "minimum_halalas": 6000,
                            "excludes_vat": true
                        },
                        {
                            "basis": "by_load",
                            "unit": null,
                            "cargo_type": "building_materials",
                            "price_halalas": null,
                            "ton_rate_halalas": 9000,
                            "m3_rate_halalas": 4000,
                            "minimum_halalas": 6000,
                            "excludes_vat": true
                        }
                    ]
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "listing_archived"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "listing_not_freight"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "departs_in_past"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "cutoff_choice"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "too_few_stops"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "distance_order"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "sale_mode_not_allowed"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "price_rows"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "POST",
            "path": "/market/listings/{listing}/trips",
            "auth": "app_token",
            "scope": "market:trips:write",
            "apps": [
                "carrier"
            ],
            "idempotency_key": true,
            "limit": "write",
            "summary": {
                "en": "Makes a draft shared trip for one of the carrier's own listings: when it leaves, the booking cut-off in hours, the sale mode, the shares, the capacity, the stops with their distances and minutes, and the prices in halalas: a price per unit (basis route_fraction, per_km or whole, with its unit unless whole) or a price by load (basis by_load: no unit and no price_halalas, a ton_rate_halalas and/or an m3_rate_halalas, and optionally the cargo_type code it is for); the answer is the draft, 201.",
                "ar": "ينشئ مسودة رحلة مشتركة لأحد إعلانات الناقل: موعد الانطلاق وساعات إغلاق الحجز ونمط البيع والحصص والسعة والمحطات بمسافاتها ودقائقها والأسعار بالهللات: سعر لكل وحدة (basis بقيمة route_fraction أو per_km أو whole ومعه unit إلا للشاحنة كاملة) أو سعر بالحمولة (basis بقيمة by_load بلا unit ولا price_halalas، مع ton_rate_halalas أو m3_rate_halalas أو كليهما، واختياريًا رمز cargo_type الذي يخصّه)؛ والجواب المسودة، 201."
            }
        },
        {
            "name": "market.api.trips.times",
            "example": {
                "request": {
                    "version": 5,
                    "departs_at": "2026-11-26T06:00:00Z"
                },
                "response": {
                    "uuid": "0193d0a1-2c58-7e41-b6a9-4f1d8c3e7a02",
                    "reference": "K7Q2M9XD",
                    "listing_uuid": "0193c1d0-8b42-7a19-b3e6-5f2c9d4a0e87",
                    "route": {
                        "from": "مستودع الرياض",
                        "to": "ميناء الدمام"
                    },
                    "vehicle": "شاحنة مسطحة 4821 ABC",
                    "state": "published",
                    "awaiting_review": false,
                    "refused": false,
                    "review_refusal_reason": null,
                    "imported": false,
                    "sale_mode": "shares",
                    "departs_at": "2026-11-26T06:00:00Z",
                    "arrives_at": "2026-11-26T11:30:00Z",
                    "booking_cutoff_at": "2026-11-25T18:00:00Z",
                    "max_shares": 8,
                    "shares_count": 2,
                    "is_suspended": false,
                    "suspension_reason": null,
                    "is_return": false,
                    "version": 6,
                    "created_at": "2026-11-22T08:30:00Z",
                    "updated_at": "2026-11-25T10:30:00Z",
                    "missing": [],
                    "stops": [
                        {
                            "position": 0,
                            "kind": "origin",
                            "name": "مستودع الرياض",
                            "city_id": 1024,
                            "lat": 24.6877,
                            "lng": 46.7219,
                            "loading_allowed": true,
                            "distance_from_start_m": 0,
                            "leg_minutes": 0,
                            "stop_minutes": 0,
                            "planned_arrival_at": "2026-11-26T04:00:00Z",
                            "planned_departure_at": "2026-11-26T04:00:00Z"
                        },
                        {
                            "position": 1,
                            "kind": "stop",
                            "name": "الهفوف",
                            "city_id": 1117,
                            "lat": 25.3647,
                            "lng": 49.5878,
                            "loading_allowed": true,
                            "distance_from_start_m": 330000,
                            "leg_minutes": 190,
                            "stop_minutes": 30,
                            "planned_arrival_at": "2026-11-26T07:10:00Z",
                            "planned_departure_at": "2026-11-26T07:40:00Z"
                        },
                        {
                            "position": 2,
                            "kind": "destination",
                            "name": "ميناء الدمام",
                            "city_id": 1118,
                            "lat": 26.4207,
                            "lng": 50.0888,
                            "loading_allowed": false,
                            "distance_from_start_m": 400000,
                            "leg_minutes": 110,
                            "stop_minutes": 0,
                            "planned_arrival_at": "2026-11-26T09:30:00Z",
                            "planned_departure_at": "2026-11-26T09:30:00Z"
                        }
                    ],
                    "capacity": {
                        "weight": 20000
                    },
                    "prices": [
                        {
                            "basis": "route_fraction",
                            "unit": "ton",
                            "cargo_type": null,
                            "price_halalas": 12000,
                            "ton_rate_halalas": null,
                            "m3_rate_halalas": null,
                            "minimum_halalas": 6000,
                            "excludes_vat": true
                        },
                        {
                            "basis": "by_load",
                            "unit": null,
                            "cargo_type": "building_materials",
                            "price_halalas": null,
                            "ton_rate_halalas": 9000,
                            "m3_rate_halalas": 4000,
                            "minimum_halalas": 6000,
                            "excludes_vat": true
                        }
                    ]
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "stale_version"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "after_booking_closed"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "times_moves_used"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "times_move_without_bookings"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "times_unchanged"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "times_move_beyond_limit"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "times_move_past"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "POST",
            "path": "/market/trips/{uuid}/times",
            "auth": "app_token",
            "scope": "market:trips:write",
            "apps": [
                "carrier"
            ],
            "idempotency_key": true,
            "limit": "write",
            "summary": {
                "en": "Moves a published trip with bookings, its cut-off and every stop, to a new departure time within the limits the market sets (at most three moves); each booked shipper is told.",
                "ar": "يحرّك رحلة منشورة لها حجوزات وموعد إغلاقها وكل محطة فيها إلى موعد انطلاق جديد ضمن حدود يضعها السوق (ثلاث مرات على الأكثر)؛ ويُخطَر كل شاحن حاجز."
            }
        },
        {
            "name": "market.api.trips.update",
            "example": {
                "request": {
                    "departs_at": "2026-11-26T04:00:00Z",
                    "cutoff_hours": 12,
                    "sale_mode": "shares",
                    "max_shares": 8,
                    "weight_kg": 20000,
                    "origin": {
                        "name": "مستودع الرياض",
                        "city_id": 1024,
                        "lat": 24.6877,
                        "lng": 46.7219
                    },
                    "via": [
                        {
                            "kind": "stop",
                            "name": "الهفوف",
                            "city_id": 1117,
                            "lat": 25.3647,
                            "lng": 49.5878,
                            "loading": true,
                            "distance_km": 330,
                            "leg_minutes": 190,
                            "stop_minutes": 30
                        }
                    ],
                    "destination": {
                        "name": "ميناء الدمام",
                        "city_id": 1118,
                        "lat": 26.4207,
                        "lng": 50.0888,
                        "distance_km": 400,
                        "leg_minutes": 110
                    },
                    "prices": [
                        {
                            "basis": "route_fraction",
                            "unit": "ton",
                            "price_halalas": 12000,
                            "minimum_halalas": 6000
                        },
                        {
                            "basis": "by_load",
                            "cargo_type": "building_materials",
                            "ton_rate_halalas": 9000,
                            "m3_rate_halalas": 4000,
                            "minimum_halalas": 6000
                        }
                    ],
                    "version": 1
                },
                "response": {
                    "uuid": "0193d0a1-2c58-7e41-b6a9-4f1d8c3e7a02",
                    "reference": "K7Q2M9XD",
                    "listing_uuid": "0193c1d0-8b42-7a19-b3e6-5f2c9d4a0e87",
                    "route": {
                        "from": "مستودع الرياض",
                        "to": "ميناء الدمام"
                    },
                    "vehicle": "شاحنة مسطحة 4821 ABC",
                    "state": "draft",
                    "awaiting_review": false,
                    "refused": false,
                    "review_refusal_reason": null,
                    "imported": false,
                    "sale_mode": "shares",
                    "departs_at": "2026-11-26T04:00:00Z",
                    "arrives_at": "2026-11-26T09:30:00Z",
                    "booking_cutoff_at": "2026-11-25T16:00:00Z",
                    "max_shares": 8,
                    "shares_count": 0,
                    "is_suspended": false,
                    "suspension_reason": null,
                    "is_return": false,
                    "version": 2,
                    "created_at": "2026-11-22T08:30:00Z",
                    "updated_at": "2026-11-22T08:50:00Z",
                    "missing": [],
                    "stops": [
                        {
                            "position": 0,
                            "kind": "origin",
                            "name": "مستودع الرياض",
                            "city_id": 1024,
                            "lat": 24.6877,
                            "lng": 46.7219,
                            "loading_allowed": true,
                            "distance_from_start_m": 0,
                            "leg_minutes": 0,
                            "stop_minutes": 0,
                            "planned_arrival_at": "2026-11-26T04:00:00Z",
                            "planned_departure_at": "2026-11-26T04:00:00Z"
                        },
                        {
                            "position": 1,
                            "kind": "stop",
                            "name": "الهفوف",
                            "city_id": 1117,
                            "lat": 25.3647,
                            "lng": 49.5878,
                            "loading_allowed": true,
                            "distance_from_start_m": 330000,
                            "leg_minutes": 190,
                            "stop_minutes": 30,
                            "planned_arrival_at": "2026-11-26T07:10:00Z",
                            "planned_departure_at": "2026-11-26T07:40:00Z"
                        },
                        {
                            "position": 2,
                            "kind": "destination",
                            "name": "ميناء الدمام",
                            "city_id": 1118,
                            "lat": 26.4207,
                            "lng": 50.0888,
                            "loading_allowed": false,
                            "distance_from_start_m": 400000,
                            "leg_minutes": 110,
                            "stop_minutes": 0,
                            "planned_arrival_at": "2026-11-26T09:30:00Z",
                            "planned_departure_at": "2026-11-26T09:30:00Z"
                        }
                    ],
                    "capacity": {
                        "weight": 20000
                    },
                    "prices": [
                        {
                            "basis": "route_fraction",
                            "unit": "ton",
                            "cargo_type": null,
                            "price_halalas": 12000,
                            "ton_rate_halalas": null,
                            "m3_rate_halalas": null,
                            "minimum_halalas": 6000,
                            "excludes_vat": true
                        },
                        {
                            "basis": "by_load",
                            "unit": null,
                            "cargo_type": "building_materials",
                            "price_halalas": null,
                            "ton_rate_halalas": 9000,
                            "m3_rate_halalas": 4000,
                            "minimum_halalas": 6000,
                            "excludes_vat": true
                        }
                    ]
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "stale_version"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "departure_frozen"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "departure_has_shares"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "plan_locked"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "prices_locked"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "departs_in_past"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "cutoff_choice"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "too_few_stops"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "distance_order"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "sale_mode_not_allowed"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "price_rows"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "PUT",
            "path": "/market/trips/{uuid}",
            "auth": "app_token",
            "scope": "market:trips:write",
            "apps": [
                "carrier"
            ],
            "idempotency_key": true,
            "limit": "write",
            "summary": {
                "en": "Changes a draft or an unsold trip with the same body as the draft and the row version the app read (version); a trip changed since answers 409 stale_version.",
                "ar": "يغيّر مسودة أو رحلة لم تُبَع بالجسم نفسه الذي أُنشئت به ونسخة الصف التي قرأها التطبيق (version)؛ والرحلة المتغيّرة منذ ذلك تُجاب 409 stale_version."
            }
        },
        {
            "name": "market.api.trips.vehicle",
            "example": {
                "request": {
                    "version": 5,
                    "listing": "0193c1d0-8b42-7a19-b3e6-5f2c9d4a0e99"
                },
                "response": {
                    "uuid": "0193d0a1-2c58-7e41-b6a9-4f1d8c3e7a02",
                    "reference": "K7Q2M9XD",
                    "listing_uuid": "0193c1d0-8b42-7a19-b3e6-5f2c9d4a0e99",
                    "route": {
                        "from": "مستودع الرياض",
                        "to": "ميناء الدمام"
                    },
                    "vehicle": "شاحنة مسطحة 7310 XYZ",
                    "state": "published",
                    "awaiting_review": false,
                    "refused": false,
                    "review_refusal_reason": null,
                    "imported": false,
                    "sale_mode": "shares",
                    "departs_at": "2026-11-26T04:00:00Z",
                    "arrives_at": "2026-11-26T09:30:00Z",
                    "booking_cutoff_at": "2026-11-25T16:00:00Z",
                    "max_shares": 8,
                    "shares_count": 2,
                    "is_suspended": false,
                    "suspension_reason": null,
                    "is_return": false,
                    "version": 6,
                    "created_at": "2026-11-22T08:30:00Z",
                    "updated_at": "2026-11-25T10:35:00Z",
                    "missing": [],
                    "stops": [
                        {
                            "position": 0,
                            "kind": "origin",
                            "name": "مستودع الرياض",
                            "city_id": 1024,
                            "lat": 24.6877,
                            "lng": 46.7219,
                            "loading_allowed": true,
                            "distance_from_start_m": 0,
                            "leg_minutes": 0,
                            "stop_minutes": 0,
                            "planned_arrival_at": "2026-11-26T04:00:00Z",
                            "planned_departure_at": "2026-11-26T04:00:00Z"
                        },
                        {
                            "position": 1,
                            "kind": "stop",
                            "name": "الهفوف",
                            "city_id": 1117,
                            "lat": 25.3647,
                            "lng": 49.5878,
                            "loading_allowed": true,
                            "distance_from_start_m": 330000,
                            "leg_minutes": 190,
                            "stop_minutes": 30,
                            "planned_arrival_at": "2026-11-26T07:10:00Z",
                            "planned_departure_at": "2026-11-26T07:40:00Z"
                        },
                        {
                            "position": 2,
                            "kind": "destination",
                            "name": "ميناء الدمام",
                            "city_id": 1118,
                            "lat": 26.4207,
                            "lng": 50.0888,
                            "loading_allowed": false,
                            "distance_from_start_m": 400000,
                            "leg_minutes": 110,
                            "stop_minutes": 0,
                            "planned_arrival_at": "2026-11-26T09:30:00Z",
                            "planned_departure_at": "2026-11-26T09:30:00Z"
                        }
                    ],
                    "capacity": {
                        "weight": 20000
                    },
                    "prices": [
                        {
                            "basis": "route_fraction",
                            "unit": "ton",
                            "cargo_type": null,
                            "price_halalas": 12000,
                            "ton_rate_halalas": null,
                            "m3_rate_halalas": null,
                            "minimum_halalas": 6000,
                            "excludes_vat": true
                        },
                        {
                            "basis": "by_load",
                            "unit": null,
                            "cargo_type": "building_materials",
                            "price_halalas": null,
                            "ton_rate_halalas": 9000,
                            "m3_rate_halalas": 4000,
                            "minimum_halalas": 6000,
                            "excludes_vat": true
                        }
                    ]
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "stale_version"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "vehicle_replace_closed"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "vehicle_replace_trip"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "hold_busy"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "vehicle_replace_smaller"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "vehicle_replace_not_ready"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "POST",
            "path": "/market/trips/{uuid}/vehicle",
            "auth": "app_token",
            "scope": "market:trips:write",
            "apps": [
                "carrier"
            ],
            "idempotency_key": true,
            "limit": "write",
            "summary": {
                "en": "Replaces the truck of a published or booking-closed trip by another of the company's ready trucks (not smaller than what is booked); each booked shipper is told.",
                "ar": "يستبدل شاحنة رحلة منشورة أو أُغلق حجزها بأخرى جاهزة من شاحنات الشركة (لا أصغر مما حُجز)؛ ويُخطَر كل شاحن حاجز."
            }
        },
        {
            "name": "market.api.trips.withdraw_review",
            "example": {
                "request": {
                    "version": 3
                },
                "response": {
                    "uuid": "0193d0a1-2c58-7e41-b6a9-4f1d8c3e7a02",
                    "reference": "K7Q2M9XD",
                    "listing_uuid": "0193c1d0-8b42-7a19-b3e6-5f2c9d4a0e87",
                    "route": {
                        "from": "مستودع الرياض",
                        "to": "ميناء الدمام"
                    },
                    "vehicle": "شاحنة مسطحة 4821 ABC",
                    "state": "draft",
                    "awaiting_review": false,
                    "refused": false,
                    "review_refusal_reason": null,
                    "imported": false,
                    "sale_mode": "shares",
                    "departs_at": "2026-11-26T04:00:00Z",
                    "arrives_at": "2026-11-26T09:30:00Z",
                    "booking_cutoff_at": "2026-11-25T16:00:00Z",
                    "max_shares": 8,
                    "shares_count": 0,
                    "is_suspended": false,
                    "suspension_reason": null,
                    "is_return": false,
                    "version": 4,
                    "created_at": "2026-11-22T08:30:00Z",
                    "updated_at": "2026-11-22T09:40:00Z",
                    "missing": [],
                    "stops": [
                        {
                            "position": 0,
                            "kind": "origin",
                            "name": "مستودع الرياض",
                            "city_id": 1024,
                            "lat": 24.6877,
                            "lng": 46.7219,
                            "loading_allowed": true,
                            "distance_from_start_m": 0,
                            "leg_minutes": 0,
                            "stop_minutes": 0,
                            "planned_arrival_at": "2026-11-26T04:00:00Z",
                            "planned_departure_at": "2026-11-26T04:00:00Z"
                        },
                        {
                            "position": 1,
                            "kind": "stop",
                            "name": "الهفوف",
                            "city_id": 1117,
                            "lat": 25.3647,
                            "lng": 49.5878,
                            "loading_allowed": true,
                            "distance_from_start_m": 330000,
                            "leg_minutes": 190,
                            "stop_minutes": 30,
                            "planned_arrival_at": "2026-11-26T07:10:00Z",
                            "planned_departure_at": "2026-11-26T07:40:00Z"
                        },
                        {
                            "position": 2,
                            "kind": "destination",
                            "name": "ميناء الدمام",
                            "city_id": 1118,
                            "lat": 26.4207,
                            "lng": 50.0888,
                            "loading_allowed": false,
                            "distance_from_start_m": 400000,
                            "leg_minutes": 110,
                            "stop_minutes": 0,
                            "planned_arrival_at": "2026-11-26T09:30:00Z",
                            "planned_departure_at": "2026-11-26T09:30:00Z"
                        }
                    ],
                    "capacity": {
                        "weight": 20000
                    },
                    "prices": [
                        {
                            "basis": "route_fraction",
                            "unit": "ton",
                            "cargo_type": null,
                            "price_halalas": 12000,
                            "ton_rate_halalas": null,
                            "m3_rate_halalas": null,
                            "minimum_halalas": 6000,
                            "excludes_vat": true
                        },
                        {
                            "basis": "by_load",
                            "unit": null,
                            "cargo_type": "building_materials",
                            "price_halalas": null,
                            "ton_rate_halalas": 9000,
                            "m3_rate_halalas": 4000,
                            "minimum_halalas": 6000,
                            "excludes_vat": true
                        }
                    ]
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "stale_version"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "not_awaiting_review"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "POST",
            "path": "/market/trips/{uuid}/withdraw-review",
            "auth": "app_token",
            "scope": "market:trips:write",
            "apps": [
                "carrier"
            ],
            "idempotency_key": true,
            "limit": "write",
            "summary": {
                "en": "Takes back a draft trip that waits for the team's approval, given the row version it read, so it is a plain draft the carrier can change again; a trip that does not wait answers 409 not_awaiting_review.",
                "ar": "يسحب الناقل مسودة رحلة تنتظر موافقة الفريق بنسخة الصف التي قرأها فتعود مسودة عادية يعدّلها من جديد؛ والرحلة التي لا تنتظر جوابها 409 not_awaiting_review."
            }
        },
        {
            "name": "market.api.verification.cases.index",
            "example": {
                "request": null,
                "response": [
                    {
                        "uuid": "0193a1e7-4c20-7b3a-9d18-6e2f5a8c1b34",
                        "set": {
                            "code": "freight_carrier",
                            "label": "ناقل بضائع"
                        },
                        "state": "returned",
                        "state_label": "مُعاد للتعديل",
                        "editable": true,
                        "items": [
                            {
                                "key": "commercial_registration",
                                "title": "السجل التجاري",
                                "kind": "document",
                                "required": true,
                                "status": "verified",
                                "status_label": "متحقق منه",
                                "rejection_reason": null,
                                "expires_on": "2027-03-14",
                                "expired": false,
                                "accepts_file": false
                            },
                            {
                                "key": "transport_licence",
                                "title": "رخصة النقل",
                                "kind": "document",
                                "required": true,
                                "status": "rejected",
                                "status_label": "مرفوض",
                                "rejection_reason": "الصورة غير واضحة؛ ارفع نسخة أوضح من الرخصة",
                                "expires_on": null,
                                "expired": false,
                                "accepts_file": true
                            },
                            {
                                "key": "insurance_policy",
                                "title": "وثيقة التأمين",
                                "kind": "document",
                                "required": false,
                                "status": "missing",
                                "status_label": "ناقص",
                                "rejection_reason": null,
                                "expires_on": null,
                                "expired": false,
                                "accepts_file": true
                            }
                        ]
                    }
                ],
                "errors": []
            },
            "method": "GET",
            "path": "/market/verification/cases",
            "auth": "app_token",
            "scope": "market:verification:read",
            "apps": [
                "carrier"
            ],
            "idempotency_key": false,
            "limit": null,
            "summary": {
                "en": "Lists the carrier's own verification cases: for each, the set it fills, its state, whether it may still be changed and its items with where each one stands, the reason a rejected item gives, its expiry date and whether a file may be sent for it now.",
                "ar": "يسرد حالات التحقق الخاصة بالناقل نفسه: لكل حالة المجموعة التي تملؤها وحالتها وهل ما زال تعديلها ممكنًا، وبنودها مع موقف كل بند وسبب الرفض إن رُفض وتاريخ انتهائه وهل يُقبل له ملف الآن."
            }
        },
        {
            "name": "market.api.verification.cases.show",
            "example": {
                "request": null,
                "response": {
                    "uuid": "0193a1e7-4c20-7b3a-9d18-6e2f5a8c1b34",
                    "set": {
                        "code": "freight_carrier",
                        "label": "ناقل بضائع"
                    },
                    "state": "returned",
                    "state_label": "مُعاد للتعديل",
                    "editable": true,
                    "items": [
                        {
                            "key": "commercial_registration",
                            "title": "السجل التجاري",
                            "kind": "document",
                            "required": true,
                            "status": "verified",
                            "status_label": "متحقق منه",
                            "rejection_reason": null,
                            "expires_on": "2027-03-14",
                            "expired": false,
                            "accepts_file": false
                        },
                        {
                            "key": "transport_licence",
                            "title": "رخصة النقل",
                            "kind": "document",
                            "required": true,
                            "status": "rejected",
                            "status_label": "مرفوض",
                            "rejection_reason": "الصورة غير واضحة؛ ارفع نسخة أوضح من الرخصة",
                            "expires_on": null,
                            "expired": false,
                            "accepts_file": true
                        },
                        {
                            "key": "insurance_policy",
                            "title": "وثيقة التأمين",
                            "kind": "document",
                            "required": false,
                            "status": "missing",
                            "status_label": "ناقص",
                            "rejection_reason": null,
                            "expires_on": null,
                            "expired": false,
                            "accepts_file": true
                        }
                    ]
                },
                "errors": [
                    {
                        "status": 404,
                        "code": "not_found"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/verification/cases/{uuid}",
            "auth": "app_token",
            "scope": "market:verification:read",
            "apps": [
                "carrier"
            ],
            "idempotency_key": false,
            "limit": null,
            "summary": {
                "en": "Reads one of the carrier's own verification cases by its id, in the same shape as the list; a case of another company answers not found.",
                "ar": "يقرأ إحدى حالات التحقق الخاصة بالناقل بمعرّفها، بالشكل نفسه الذي في القائمة؛ وحالة شركة أخرى تُجاب بأنها غير موجودة."
            }
        },
        {
            "name": "market.api.verification.documents.store",
            "example": {
                "request": {
                    "file": "(the file, sent as multipart/form-data)",
                    "issuer": "الهيئة العامة للنقل",
                    "issued_on": "2026-01-10",
                    "expires_on": "2027-01-09"
                },
                "response": {
                    "uuid": "0193a1e7-4c20-7b3a-9d18-6e2f5a8c1b34",
                    "set": {
                        "code": "freight_carrier",
                        "label": "ناقل بضائع"
                    },
                    "state": "returned",
                    "state_label": "مُعاد للتعديل",
                    "editable": true,
                    "items": [
                        {
                            "key": "commercial_registration",
                            "title": "السجل التجاري",
                            "kind": "document",
                            "required": true,
                            "status": "verified",
                            "status_label": "متحقق منه",
                            "rejection_reason": null,
                            "expires_on": "2027-03-14",
                            "expired": false,
                            "accepts_file": false
                        },
                        {
                            "key": "transport_licence",
                            "title": "رخصة النقل",
                            "kind": "document",
                            "required": true,
                            "status": "uploaded_unverified",
                            "status_label": "مرفوع، غير متحقق منه",
                            "rejection_reason": null,
                            "expires_on": null,
                            "expired": false,
                            "accepts_file": true
                        },
                        {
                            "key": "insurance_policy",
                            "title": "وثيقة التأمين",
                            "kind": "document",
                            "required": false,
                            "status": "missing",
                            "status_label": "ناقص",
                            "rejection_reason": null,
                            "expires_on": null,
                            "expired": false,
                            "accepts_file": true
                        }
                    ]
                },
                "errors": [
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "case_not_editable"
                    },
                    {
                        "status": 409,
                        "code": "conflict",
                        "reason": "item_state"
                    },
                    {
                        "status": 413,
                        "code": "payload_too_large"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "item_not_a_document"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "file_refused"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "dates_invalid"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    }
                ]
            },
            "method": "POST",
            "path": "/market/verification/cases/{uuid}/items/{key}/document",
            "auth": "app_token",
            "scope": "market:verification:write",
            "apps": [
                "carrier"
            ],
            "idempotency_key": true,
            "limit": "write",
            "summary": {
                "en": "Sends a file for one document item of the carrier's own case, with the issuer and the two dates the document states if known; the file only reaches the waiting state and nothing here verifies it, and the answer is the case as it now stands.",
                "ar": "يرسل ملفًا لبند مستند في حالة الناقل نفسه، مع الجهة المصدِرة وتاريخَي المستند إن عُرفا؛ والملف لا يصل إلا إلى حالة الانتظار ولا يتحقق منه شيء هنا، والجواب هو الحالة كما صارت."
            }
        },
        {
            "name": "market.api.wallet.movements",
            "example": {
                "request": {
                    "query": {
                        "month": "2026-11",
                        "page": 1,
                        "per_page": 20
                    }
                },
                "response": [
                    {
                        "kind": "release",
                        "at": "2026-11-18T07:42:10Z",
                        "reference": "MR-0004102",
                        "held_halalas": -480000,
                        "payable_halalas": 480000,
                        "receivable_halalas": 0
                    },
                    {
                        "kind": "payout",
                        "at": "2026-11-12T09:15:44Z",
                        "reference": "",
                        "held_halalas": 0,
                        "payable_halalas": -750000,
                        "receivable_halalas": 0
                    },
                    {
                        "kind": "split",
                        "at": "2026-11-03T11:03:02Z",
                        "reference": "MR-0003988",
                        "held_halalas": 480000,
                        "payable_halalas": 0,
                        "receivable_halalas": 0
                    }
                ],
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/wallet/movements",
            "auth": "app_token",
            "scope": "market:wallet:read",
            "apps": [
                "carrier"
            ],
            "idempotency_key": false,
            "limit": null,
            "summary": {
                "en": "The latest wallet movements (up to fifty, newest first), or those of one Saudi month, paged; each with its kind, time, request reference and what it changed in the held, owed and owed-to-the-market figures.",
                "ar": "آخر حركات المحفظة (حتى خمسين، الأحدث أولًا) أو حركات شهر سعودي واحد، على صفحات؛ لكل حركة نوعها ووقتها ومرجع الطلب وما غيّرته في أرقام المحجوز والمستحق وما على الشركة للسوق."
            }
        },
        {
            "name": "market.api.wallet.show",
            "example": {
                "request": null,
                "response": {
                    "currency": "SAR",
                    "payable_halalas": 1250000,
                    "available_halalas": 1000000,
                    "held_halalas": 480000,
                    "withdrawn_halalas": 2300000,
                    "receivable_halalas": 0,
                    "payouts_paused": false,
                    "standing_reason": null,
                    "can_request_payout": true
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/wallet",
            "auth": "app_token",
            "scope": "market:wallet:read",
            "apps": [
                "carrier"
            ],
            "idempotency_key": false,
            "limit": null,
            "summary": {
                "en": "Where the carrier company's money stands, in halalas: owed to it, available to withdraw, held, paid out, and what it owes the market; and whether a withdrawal may be asked now.",
                "ar": "أين يقف مال شركة الناقل بالهللات: المستحق لها والمتاح للسحب والمحجوز والمدفوع لها وما تدين به للسوق، وهل يجوز طلب سحب الآن."
            }
        },
        {
            "name": "market.api.wallet.statement",
            "example": {
                "request": {
                    "query": {
                        "month": "2026-10"
                    }
                },
                "response": {
                    "month": "2026-10",
                    "currency": "SAR",
                    "opening_payable_halalas": 310000,
                    "released_halalas": 1940000,
                    "paid_out_halalas": 1500000,
                    "closing_payable_halalas": 750000,
                    "closing_held_halalas": 480000,
                    "closing_receivable_halalas": 0
                },
                "errors": [
                    {
                        "status": 403,
                        "code": "forbidden"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/wallet/statement",
            "auth": "app_token",
            "scope": "market:wallet:read",
            "apps": [
                "carrier"
            ],
            "idempotency_key": false,
            "limit": null,
            "summary": {
                "en": "One month's statement: what was owed to the company at its start, what the market released, what was paid out, and where the figures stand at its end.",
                "ar": "كشف شهر واحد: المستحق للشركة في أوله وما حرّره السوق وما دُفع وأين تقف الأرقام في آخره."
            }
        },
        {
            "name": "market.catalogue.api.addon_services.index",
            "example": {
                "request": null,
                "response": [
                    {
                        "code": "loading_unloading",
                        "label": "التحميل والتفريغ",
                        "description": "عمال لتحميل البضاعة وتفريغها",
                        "service_types": [
                            "freight",
                            "liquid"
                        ],
                        "charge_basis": "fixed",
                        "requires_quantity": false,
                        "requires_duration": false,
                        "requires_notes": false,
                        "required_fact": null,
                        "category_codes": []
                    }
                ],
                "errors": [
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "unknown_filter"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "unknown_value"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "invalid_value"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    },
                    {
                        "status": 503,
                        "code": "service_unavailable"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/catalogue/addon-services",
            "auth": "none",
            "scope": null,
            "apps": [
                "shipper",
                "carrier"
            ],
            "idempotency_key": false,
            "limit": null,
            "summary": {
                "en": "The extra services a listing may offer, each with its code, label, description, the services it fits, how it is charged, what a request must say for it, the fact the vehicle must hold and the categories it is limited to, optionally for one service (service); cached for five minutes.",
                "ar": "الخدمات الإضافية التي قد يقدمها الإعلان، لكل منها رمزها واسمها ووصفها والخدمات التي تناسبها وطريقة احتسابها وما يجب أن يذكره الطلب لها والواقعة التي يجب أن تتحقق في المركبة والفئات التي تُحصر فيها، ويمكن حصرها في خدمة واحدة (service)؛ وتُخزَّن خمس دقائق."
            }
        },
        {
            "name": "market.catalogue.api.cargo_types.index",
            "example": {
                "request": null,
                "response": [
                    {
                        "code": "building_materials",
                        "kind": "goods",
                        "label": "مواد بناء",
                        "description": "حديد وإسمنت وبلاط ومواسير",
                        "packing_notes": "تُربط وتُغطى بشادر",
                        "requires_refrigeration": false,
                        "requires_hazmat": false,
                        "requires_permit": false,
                        "needs_dedicated_vehicle": false,
                        "insurance_recommended": true,
                        "temperature_min_c": null,
                        "temperature_max_c": null,
                        "weight_limit_per_unit_kg": 24000,
                        "min_lead_hours": 12,
                        "unit_codes": [
                            "ton",
                            "pallet"
                        ],
                        "default_unit": "ton",
                        "picture_url": "https://market.example.com/storage/market/cargo-types/building-materials.webp",
                        "picture_credit": "Pexels، ترخيص الاستخدام المجاني مع ذكر المصوّر",
                        "questions": [
                            {
                                "code": "stackable",
                                "kind": "choice",
                                "label": "هل يمكن رصّها؟",
                                "required": true,
                                "options": [
                                    {
                                        "code": "yes",
                                        "label": "نعم"
                                    },
                                    {
                                        "code": "no",
                                        "label": "لا"
                                    }
                                ],
                                "min": null,
                                "max": null,
                                "max_length": null
                            }
                        ]
                    }
                ],
                "errors": [
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "unknown_filter"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "unknown_value"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "invalid_value"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    },
                    {
                        "status": 503,
                        "code": "service_unavailable"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/catalogue/cargo-types",
            "auth": "none",
            "scope": null,
            "apps": [
                "shipper",
                "carrier"
            ],
            "idempotency_key": false,
            "limit": null,
            "summary": {
                "en": "The active cargo types with their handling flags, units, picture with the written source and licence that stands beside it, and the questions a request asks for each (a question that asks for a person is never given), optionally for one kind (kind: goods, equipment_use or liquid); cached for five minutes.",
                "ar": "أنواع البضائع الفعالة بعلاماتها ووحداتها وصورة كل نوع مع مصدرها وترخيصها المكتوبين وأسئلة الطلب لكل نوع (والسؤال الذي يطلب شخصًا لا يُعطى أبدًا)، ويمكن حصرها في نوع واحد (kind: goods أو equipment_use أو liquid)؛ وتُخزَّن خمس دقائق."
            }
        },
        {
            "name": "market.catalogue.api.cargo_types.show",
            "example": {
                "request": null,
                "response": {
                    "code": "building_materials",
                    "kind": "goods",
                    "label": "مواد بناء",
                    "description": "رمل وحصى وإسمنت وطوب وما يشبهها",
                    "packing_notes": null,
                    "requires_refrigeration": false,
                    "requires_hazmat": false,
                    "requires_permit": false,
                    "units": [
                        {
                            "code": "ton",
                            "name": "طن",
                            "is_default": true,
                            "default_quantity_milli": 1000,
                            "min_quantity_milli": 500,
                            "max_quantity_milli": 40000
                        },
                        {
                            "code": "kg",
                            "name": "كيلوغرام",
                            "is_default": false,
                            "default_quantity_milli": 1000,
                            "min_quantity_milli": 1,
                            "max_quantity_milli": 100000000
                        }
                    ],
                    "default_unit": "ton",
                    "picture_url": "https://market.example.com/storage/market/cargo-types/building-materials.webp",
                    "picture_credit": "Pexels، ترخيص الاستخدام المجاني مع ذكر المصوّر",
                    "categories": [
                        {
                            "code": "tipper_trucks",
                            "label": "قلابات",
                            "picture_url": "https://market.example.com/storage/market/categories/tipper-trucks.jpg",
                            "picture_credit": "صورة المنصة، جميع الحقوق محفوظة",
                            "vehicle_types": [
                                {
                                    "code": "truck",
                                    "name": "شاحنة"
                                },
                                {
                                    "code": "semi_trailer",
                                    "name": "مقطورة نصفية"
                                }
                            ]
                        }
                    ]
                },
                "errors": [
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "unknown_filter"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    },
                    {
                        "status": 503,
                        "code": "service_unavailable"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/catalogue/cargo-types/{code}",
            "auth": "none",
            "scope": null,
            "apps": [
                "shipper",
                "carrier"
            ],
            "idempotency_key": false,
            "limit": null,
            "summary": {
                "en": "What choosing one cargo type opens, in the language of Accept-Language, the reverse of a category's read: the type's card (its flags, its picture with the written source and licence that stands beside it and its units as rows, the default first, each with the quantity a request starts at and the least and the most it may hold, in thousandths of the unit, the same rows as a category's read) and categories, the leaf categories a shipper can book it in, each with its code, label, picture and credit and the vehicle types a request may name there; a code no offered category carries answers not_found and no query key is accepted. Public: no sign-in and no scope.",
                "ar": "ماذا يفتح اختيار نوع حمولة واحد، بلغة Accept-Language، وهو عكس قراءة الفئة: بطاقة النوع (علاماته وصورته مع المصدر والترخيص المكتوبين بجانبها ووحداته صفوفًا، الافتراضية أولًا، لكل منها الكمية التي يبدأ منها الطلب وأقل ما يحمله وأكثره بآلاف الوحدة، وهي صفوف قراءة الفئة نفسها) وcategories، الفئات الورقية التي يمكن للشاحن أن يحجزه فيها، لكلٍّ رمزها واسمها وصورتها ومصدرها وأنواع المركبات التي يجوز للطلب أن يسمّيها فيها؛ ورمز لا تحمله فئة يعرضها السوق جوابه not_found ولا يُقبل أي مفتاح استعلام. عامة بلا دخول ولا نطاق."
            }
        },
        {
            "name": "market.catalogue.api.carriers.departures",
            "example": {
                "request": null,
                "response": [
                    {
                        "uuid": "0193a3d4-6b21-7f08-9c35-2e7a4d1b8f60",
                        "from_city": "الرياض",
                        "to_city": "جدة",
                        "departs_at": "2026-11-28T04:00:00Z",
                        "arrives_at": "2026-11-28T14:00:00Z",
                        "booking_cutoff_at": "2026-11-27T16:00:00Z",
                        "remaining": [
                            {
                                "dimension": "weight",
                                "remaining": 8000
                            },
                            {
                                "dimension": "volume",
                                "remaining": 40000
                            }
                        ],
                        "price_from": {
                            "amount_halalas": 12000,
                            "basis": "ton",
                            "basis_words": "للطن",
                            "currency": "SAR",
                            "excludes_vat": true
                        },
                        "filling_soon": false
                    }
                ],
                "errors": [
                    {
                        "status": 429,
                        "code": "rate_limited"
                    },
                    {
                        "status": 503,
                        "code": "service_unavailable"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/catalogue/carriers/{publicId}/departures",
            "auth": "none",
            "scope": null,
            "apps": [
                "shipper",
                "carrier"
            ],
            "idempotency_key": false,
            "limit": null,
            "summary": {
                "en": "The soonest shared trips of one carrier that still have room, six at most, each with its two cities, its times, the space left in each dimension, the price from and whether it is filling soon; an unknown carrier gives an empty list.",
                "ar": "أقرب الرحلات المشتركة لناقل واحد وفيها مكان، ست رحلات كحد أقصى، لكل منها مدينتاها وأوقاتها والمساحة الباقية في كل بُعد والسعر ابتداءً من وهل تمتلئ قريبًا؛ والناقل المجهول يعطي قائمة فارغة."
            }
        },
        {
            "name": "market.catalogue.api.carriers.reviews",
            "example": {
                "request": null,
                "response": {
                    "count": 38,
                    "average": 4.6,
                    "aspects": {
                        "timeliness": 4.7,
                        "communication": 4.5,
                        "vehicle_condition": 4.6,
                        "cargo_care": 4.8
                    },
                    "comments": [
                        {
                            "stars": 5,
                            "text": "وصلت الشحنة في موعدها وبحالة ممتازة",
                            "reply": "شكرًا لثقتكم، يسعدنا خدمتكم دائمًا.",
                            "month": "2026-10",
                            "service": "freight"
                        }
                    ]
                },
                "errors": [
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    },
                    {
                        "status": 503,
                        "code": "service_unavailable"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/catalogue/carriers/{publicId}/reviews",
            "auth": "none",
            "scope": null,
            "apps": [
                "shipper",
                "carrier"
            ],
            "idempotency_key": false,
            "limit": null,
            "summary": {
                "en": "A carrier's public reviews as one block: the number of reviews, the average, the average of each aspect rated often enough and the newest comments staff passed (stars, text, month and the service it was for, freight or rental, an equipment hire counting as rental, never who rated); a carrier with no public block is not_found.",
                "ar": "تقييمات الناقل العامة كتلة واحدة: عدد التقييمات والمتوسط ومتوسط كل جانب قُيِّم بما يكفي وأحدث التعليقات التي أجازها الموظفون (النجوم والنص والشهر والخدمة التي كان التقييم لها: freight أو rental وتأجير المعدات يُعدّ rental، ولا شيء عن المقيِّم)؛ والناقل الذي لا كتلة عامة له not_found."
            }
        },
        {
            "name": "market.catalogue.api.carriers.show",
            "example": {
                "request": null,
                "response": [
                    {
                        "uuid": "0193a3c1-2d4e-7b58-9a16-4f7c1e8d3a02",
                        "service": "freight",
                        "title": "شاحنة مسطحة 24 طن",
                        "vehicle": {
                            "type": "شاحنة مسطحة",
                            "tons": "24",
                            "m3": null,
                            "year": 2022
                        },
                        "flags": {
                            "refrigerated": false,
                            "live_sensor": true,
                            "tanker": false,
                            "crane": false,
                            "tracked": true
                        },
                        "load_mode": "ftl",
                        "rental_type": null,
                        "with_driver_available": false,
                        "price_from": {
                            "amount_halalas": 45000,
                            "basis": "trip",
                            "basis_words": "للرحلة",
                            "currency": "SAR",
                            "excludes_vat": true
                        },
                        "verified_on": "2026-11-10",
                        "photos": [
                            {
                                "uuid": "0193a3b8-1c72-7d49-a5e6-3b8f0d4c9a17"
                            }
                        ],
                        "carrier": {
                            "id": "0193a2c0-7a14-7e63-b2d8-5c9e1f4a6b30",
                            "name": "شركة الأفق للنقل",
                            "badges": [
                                "approved"
                            ],
                            "experience_years": 12,
                            "service_categories": [
                                "نقل مبرد",
                                "نقل حاويات"
                            ]
                        },
                        "distance_band": null,
                        "available_now": true,
                        "available_from": "2026-11-23",
                        "route_match": true,
                        "base_city": null
                    }
                ],
                "errors": [
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "invalid_value"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "cursor_invalid"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "cursor_expired"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    },
                    {
                        "status": 503,
                        "code": "service_unavailable"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/catalogue/carriers/{publicId}",
            "auth": "none",
            "scope": null,
            "apps": [
                "shipper",
                "carrier"
            ],
            "idempotency_key": false,
            "limit": null,
            "summary": {
                "en": "A carrier's public page by its public id: its listings a page at a time (meta.page.next_cursor, sent back as cursor) and, in meta.carrier, its name, badges (approved always; licence_valid when it holds a transport-activity licence in force; wasl when its registration with the regulator is valid), rating, bio, whether it has a WhatsApp number, years of experience and service categories (its own statements, not checked by the market), platform (what the platform itself holds: completed_bookings, the bookings it finished here, null until at least five from three different shipper companies; listed_vehicles, its public listings now; member_since, the month YYYY-MM of its first published listing) and the paths of its logo and cover; an unknown id is not_found.",
                "ar": "صفحة الناقل العامة بمعرّفه العام: إعلاناته صفحةً صفحة (meta.page.next_cursor يُرسَل ثانية باسم cursor) وفي meta.carrier اسمه وشاراته (approved دائمًا، وlicence_valid حين يحمل ترخيص نشاط نقل ساريًا، وwasl حين يكون تسجيله لدى الجهة المنظِّمة صالحًا) وتقييمه ونبذته وهل لديه رقم واتساب وسنوات خبرته وفئات خدمته (أقواله هو لا يتحقق منها السوق) وplatform (ما تحمله المنصة نفسها: completed_bookings الحجوزات التي أنهاها هنا، وnull ما لم تبلغ خمسة على الأقل من ثلاث شركات شاحنة مختلفة؛ وlisted_vehicles إعلاناته العامة الآن؛ وmember_since شهر YYYY-MM لأول إعلان نُشر له) ومسارا شعاره وغلافه؛ والمعرّف المجهول not_found."
            }
        },
        {
            "name": "market.catalogue.api.categories.index",
            "example": {
                "request": null,
                "response": [
                    {
                        "code": "trucks",
                        "label": "الشاحنات",
                        "picture_url": null,
                        "picture_credit": null,
                        "service_types": [
                            "freight",
                            "liquid",
                            "rental"
                        ],
                        "leaf": false,
                        "vehicle_types": [],
                        "body_type_codes": [],
                        "children": [
                            {
                                "code": "flatbed_trucks",
                                "label": "شاحنات مسطحة",
                                "picture_url": "https://market.example.com/storage/market/categories/flatbed-trucks.jpg",
                                "picture_credit": "صورة المنصة، جميع الحقوق محفوظة",
                                "service_types": [],
                                "leaf": true,
                                "vehicle_types": [
                                    {
                                        "code": "truck",
                                        "name": "شاحنة"
                                    },
                                    {
                                        "code": "semi_trailer",
                                        "name": "مقطورة نصفية"
                                    }
                                ],
                                "body_type_codes": [
                                    "flatbed"
                                ],
                                "children": []
                            }
                        ]
                    }
                ],
                "errors": [
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "unknown_filter"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "unknown_value"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "invalid_value"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    },
                    {
                        "status": 503,
                        "code": "service_unavailable"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/catalogue/categories",
            "auth": "none",
            "scope": null,
            "apps": [
                "shipper",
                "carrier"
            ],
            "idempotency_key": false,
            "limit": null,
            "summary": {
                "en": "The categories a request picks a truck from, as the request form offers them: each root with its children down to the leaves, each with its picture and the written source and licence that stands beside it, and for a leaf its vehicle types and body type codes, optionally for one service (service); cached for five minutes.",
                "ar": "الفئات التي يختار منها الطلب شاحنته كما يعرضها نموذج الطلب: كل جذر بأبنائه نزولًا إلى الأوراق ولكل منها صورته مع مصدرها وترخيصها المكتوبين، وللورقة أنواع مركباتها ورموز هياكلها، ويمكن حصرها في خدمة واحدة (service)؛ وتُخزَّن خمس دقائق."
            }
        },
        {
            "name": "market.catalogue.api.categories.show",
            "example": {
                "request": null,
                "response": {
                    "code": "tipper_trucks",
                    "label": "قلابات",
                    "picture_url": "https://market.example.com/storage/market/categories/tipper-trucks.jpg",
                    "picture_credit": "صورة المنصة، جميع الحقوق محفوظة",
                    "parent": "trucks",
                    "leaf": true,
                    "service_types": [
                        "freight",
                        "liquid",
                        "rental"
                    ],
                    "children": [],
                    "cargo_types": [
                        {
                            "code": "building_materials",
                            "kind": "goods",
                            "label": "مواد بناء",
                            "description": "رمل وحصى وإسمنت وطوب وما يشبهها",
                            "packing_notes": null,
                            "requires_refrigeration": false,
                            "requires_hazmat": false,
                            "requires_permit": false,
                            "units": [
                                {
                                    "code": "ton",
                                    "name": "طن",
                                    "is_default": true,
                                    "default_quantity_milli": 1000,
                                    "min_quantity_milli": 500,
                                    "max_quantity_milli": 40000
                                },
                                {
                                    "code": "kg",
                                    "name": "كيلوغرام",
                                    "is_default": false,
                                    "default_quantity_milli": 1000,
                                    "min_quantity_milli": 1,
                                    "max_quantity_milli": 100000000
                                }
                            ],
                            "default_unit": "ton",
                            "picture_url": "https://market.example.com/storage/market/cargo-types/building-materials.webp",
                            "picture_credit": "Pexels، ترخيص الاستخدام المجاني مع ذكر المصوّر"
                        }
                    ],
                    "vehicle_types": [
                        {
                            "code": "truck",
                            "name": "شاحنة"
                        },
                        {
                            "code": "semi_trailer",
                            "name": "مقطورة نصفية"
                        }
                    ],
                    "body_type_codes": [
                        "tipper"
                    ]
                },
                "errors": [
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "unknown_filter"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    },
                    {
                        "status": 503,
                        "code": "service_unavailable"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/catalogue/categories/{code}",
            "auth": "none",
            "scope": null,
            "apps": [
                "shipper",
                "carrier"
            ],
            "idempotency_key": false,
            "limit": null,
            "summary": {
                "en": "What choosing one category opens, in the language of Accept-Language: its picture with the written source and licence that stands beside it, its subcategories (code, label, whether each is a leaf, its picture) and, for a leaf, the cargo types it offers (the linked ones, or every active type of its services when it links none, each with its picture and its units: the default first, each with the quantity a request starts at and the least and the most it may hold, in thousandths of the unit: where the master data sets none the least is 1, a thousandth of the unit, which is the smallest quantity a booking accepts, the most is the market's ceiling and the start is 1000, one whole unit, kept inside the other two) and the vehicle types and body types a request may name with it, as the request wizard offers them; a category the market does not offer answers not_found and no query key is accepted. Public: no sign-in and no scope.",
                "ar": "ما يفتحه اختيار فئة واحدة بلغة Accept-Language: صورتها مع المصدر والترخيص المكتوبين بجانبها، وفئاتها الفرعية (الرمز والاسم وهل هي ورقة وصورتها)، وللورقة أنواع البضائع التي تعرضها (المربوطة بها، أو كل الأنواع الفعّالة لخدماتها إن لم تربط شيئًا، ولكل نوع صورته ووحداته: الافتراضية أولًا، ولكل وحدة الكمية التي يبدأ منها الطلب وأقل ما يحمله وأكثره بآلاف الوحدة: حيث لا تضع البيانات الرئيسية حدًّا يكون الأقل 1، أي جزءًا من ألف من الوحدة وهو أصغر كمية يقبلها الحجز، والأكثر سقف السوق، وتكون البداية 1000، أي وحدة كاملة، داخل الحدّين الآخرين) وأنواع المركبات وأنواع الهياكل التي يجوز للطلب أن يسمّيها معها كما يعرضها معالج الطلب؛ وفئة لا يعرضها السوق جوابها not_found ولا يُقبل أي مفتاح استعلام. عامة بلا دخول ولا نطاق."
            }
        },
        {
            "name": "market.catalogue.api.cities.index",
            "example": {
                "request": null,
                "response": [
                    {
                        "id": 7,
                        "label": "الرياض"
                    },
                    {
                        "id": 12,
                        "label": "الرياض الخبراء"
                    }
                ],
                "errors": [
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "unknown_filter"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "query_length"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    },
                    {
                        "status": 503,
                        "code": "service_unavailable"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/catalogue/cities",
            "auth": "none",
            "scope": null,
            "apps": [
                "shipper",
                "carrier"
            ],
            "idempotency_key": false,
            "limit": null,
            "summary": {
                "en": "The cities whose names match the letters typed (q, 2 to 40 characters), ten at most, named in the language of Accept-Language; a shorter or longer text is refused with query_length; cached for five minutes.",
                "ar": "المدن التي تطابق أسماؤها الحروف المكتوبة (q، من 2 إلى 40 حرفًا) وعشر مدن كحد أقصى بلغة Accept-Language؛ والنص الأقصر أو الأطول يُرفض بالسبب query_length؛ ويُخزَّن خمس دقائق."
            }
        },
        {
            "name": "market.catalogue.api.city_at_point",
            "example": {
                "request": {
                    "lat": 24.7136,
                    "lng": 46.6753
                },
                "response": {
                    "inside_kingdom": true,
                    "city": {
                        "id": 7,
                        "label": "الرياض"
                    }
                },
                "errors": [
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "unknown_filter"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "invalid_value"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "out_of_range"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    },
                    {
                        "status": 503,
                        "code": "service_unavailable"
                    }
                ]
            },
            "method": "POST",
            "path": "/market/catalogue/city-at-point",
            "auth": "none",
            "scope": null,
            "apps": [
                "shipper",
                "carrier"
            ],
            "idempotency_key": false,
            "limit": null,
            "summary": {
                "en": "The city a person's own position lies in, sent only in the body of this call (lat and lng as numbers) and kept by nobody: whether the point is inside the Kingdom and, if so, the city; never cached.",
                "ar": "المدينة التي يقع فيها موضع الشخص نفسه، يُرسَل في جسم هذا الطلب وحده (lat وlng رقمين) ولا يحفظه أحد: هل النقطة داخل المملكة وإن كانت فالمدينة؛ ولا يُخزَّن أبدًا."
            }
        },
        {
            "name": "market.catalogue.api.departures.nearby",
            "example": {
                "request": {
                    "lat": 24.7136,
                    "lng": 46.6753
                },
                "response": [
                    {
                        "id": "0193d0a1-2c58-7e41-b6a9-4f1d8c3e7a02",
                        "from_city": "الرياض",
                        "to_city": "الدمام",
                        "departs_at": "2026-11-26T04:00:00+00:00",
                        "arrives_at": "2026-11-26T09:30:00+00:00",
                        "booking_cutoff_at": "2026-11-25T16:00:00+00:00",
                        "remaining": [
                            {
                                "dimension": "weight",
                                "remaining": 18500
                            }
                        ],
                        "price_from": null,
                        "carrier": {
                            "name": "شركة الطريق للنقل",
                            "public_id": "0193b0e7-5a14-7d92-8c3f-9e6b2a4d1f50"
                        },
                        "vehicle_category": {
                            "code": "flatbed_trucks",
                            "label": "سطحة"
                        },
                        "distance_km": 12
                    }
                ],
                "errors": [
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "unknown_filter"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "invalid_value"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "out_of_range"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    },
                    {
                        "status": 503,
                        "code": "service_unavailable"
                    }
                ]
            },
            "method": "POST",
            "path": "/market/catalogue/departures/nearby",
            "auth": "none",
            "scope": null,
            "apps": [
                "shipper",
                "carrier"
            ],
            "idempotency_key": false,
            "limit": null,
            "summary": {
                "en": "The offered shared trips near a person's own position, sent only in the body of this call (lat and lng as numbers) and kept by nobody: the position is rounded to two decimals, used for this call only and never put in a cursor, a cache or a log, and it is never returned; a trip is near when a named city on its route is within the owner's radius of it, and distance_km is the distance to the centre of the nearest such city (never a point of the carrier's), in whole kilometres and at least one; the nearest trips first, at most one page, no cursor and no count; the read looks at the 200 soonest offered trips only, so a nearer trip that leaves later may not be listed; never cached.",
                "ar": "الرحلات المشتركة المعروضة القريبة من موقع الشخص نفسه، يُرسَل في جسم هذا النداء وحده (lat وlng عددين) ولا يحتفظ به أحد: يُقرَّب الموقع إلى منزلتين عشريتين ويُستعمل لهذا النداء فحسب ولا يدخل مؤشرًا ولا كاشًا ولا سجلًّا ولا يُردّ أبدًا؛ والرحلة قريبة حين تقع مدينة مسمّاة على مسارها ضمن نصف قطر المالك منه، وdistance_km هي المسافة إلى مركز أقرب مدينة كهذه (لا إلى نقطة للناقل) بكيلومترات صحيحة لا تقل عن واحد؛ الأقرب أولًا وصفحة واحدة على الأكثر بلا مؤشر ولا عدّ؛ وتنظر القراءة في أقرب 200 رحلة معروضة موعدًا فقط، فرحلة أقرب موقعًا موعدها لاحق قد لا تُسرد؛ ولا يُخزَّن جوابها."
            }
        },
        {
            "name": "market.catalogue.api.listings.counts",
            "example": {
                "request": null,
                "response": {
                    "results": 24,
                    "options": {
                        "category": {
                            "heavy_trucks": 14,
                            "light_trucks": null
                        },
                        "vehicle_type": {
                            "truck_flatbed": 9
                        },
                        "body_type": {
                            "flatbed": 9
                        },
                        "cargo_type": {
                            "building_materials": 12
                        },
                        "extra": {
                            "loading_unloading": 7
                        }
                    }
                },
                "errors": [
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "unknown_filter"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "unknown_value"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "invalid_value"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "out_of_range"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "too_many_extras"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "pickup_required"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "near_required"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "day_required"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "cursor_invalid"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "cursor_expired"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "cursor_limit"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    },
                    {
                        "status": 503,
                        "code": "service_unavailable"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/catalogue/listings/counts",
            "auth": "none",
            "scope": null,
            "apps": [
                "shipper",
                "carrier"
            ],
            "idempotency_key": false,
            "limit": null,
            "summary": {
                "en": "How many listings a search keeps (results) and how many each choice of the category, vehicle_type, body_type, cargo_type and extra facets would keep (options: facet, then the choice's code, then its number), each choice counted with that facet's own choice of the search taken out; it takes the same keys as the listings search. A number is a number of listings and is given only when at least the minimum number of distinct carriers stand behind it, otherwise it is null, and zero is zero; a choice a facet does not list has no listing. A search that names a pickup_city or dropoff_city has no exact count: results is null and every facet is empty. The answer is kept a minute and marked noindex.",
                "ar": "كم إعلانًا يُبقي البحث (results) وكم يُبقي كل خيار من أوجه category وvehicle_type وbody_type وcargo_type وextra (options: الوجه ثم رمز الخيار ثم عدده)، ويُحسب كل خيار بعد إخراج اختيار البحث نفسه في ذلك الوجه؛ ويأخذ مفاتيح بحث الإعلانات نفسها. والرقم عدد إعلانات ولا يُعطى إلا حين يقف خلفه أقل عدد من الناقلين المتمايزين على الأقل وإلا فهو null، والصفر صفر؛ والخيار الذي لا يذكره الوجه لا إعلان فيه. والبحث الذي يسمّي pickup_city أو dropoff_city لا عدّ دقيقًا له: results فيه null وكل وجه فارغ. وتُحفظ الإجابة دقيقة وتُوسَم noindex."
            }
        },
        {
            "name": "market.catalogue.api.listings.estimate",
            "example": {
                "request": null,
                "response": {
                    "available": true,
                    "reason": null,
                    "amount_halalas": 382430,
                    "currency": "SAR",
                    "excludes_vat": true,
                    "distance_km": 949.8
                },
                "errors": [
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "unknown_filter"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "unknown_value"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "invalid_value"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "out_of_range"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    },
                    {
                        "status": 503,
                        "code": "service_unavailable"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/catalogue/listings/{uuid}/estimate",
            "auth": "none",
            "scope": null,
            "apps": [
                "shipper",
                "carrier"
            ],
            "idempotency_key": false,
            "limit": null,
            "summary": {
                "en": "A visitor's price estimate for a listing's truck page. Send pickup_city and dropoff_city (city ids from the cities read) and day (Y-m-d, a Saudi calendar day from today up to 90 days ahead), and no other key. When available is true: amount_halalas, the estimate before VAT, with currency and excludes_vat true, and distance_km, the road distance between the two cities when it is known (else null). It is priced from the listing's own public price (the lane's price when it has one) with a daytime pickup and with no cargo, extra services, discount, contract price or urgency; it books nothing, binds nobody and does not say whether this visitor may book. When available is false, reason says why: service_not_estimated (the listing is not freight), route_not_covered (its public coverage does not serve the two cities), load_needed (it is priced by the weight or volume of the load), distance_unavailable (it is priced by distance and the road is not known now), price_on_request or price_unavailable. A hidden or unknown listing is 404. This read has its own, tighter limit for each address.",
                "ar": "تقدير سعر لزائر صفحة الشاحنة. أرسل pickup_city وdropoff_city (معرّفا مدينتين من قراءة المدن) وday (بصيغة Y-m-d، يوم بالتقويم السعودي من اليوم إلى 90 يومًا) ولا مفتاح غيرها. حين تكون available بقيمة true ترجع amount_halalas وهو التقدير قبل الضريبة ومعه currency وexcludes_vat بقيمة true، وdistance_km وهي مسافة الطريق بين المدينتين حين تُعرف (وإلا null). يُحسب من سعر الإعلان العام نفسه (سعر المسار حين يوجد) بتحميل في النهار، وبلا حمولة ولا خدمات إضافية ولا خصم ولا سعر عقد ولا استعجال؛ ولا يحجز شيئًا ولا يُلزم أحدًا ولا يقول هل يحق لهذا الزائر أن يحجز. وحين تكون available بقيمة false يقول reason السبب: service_not_estimated (الإعلان ليس شحنًا)، أو route_not_covered (تغطيته العامة لا تشمل المدينتين)، أو load_needed (سعره بوزن الحمولة أو حجمها)، أو distance_unavailable (سعره بالمسافة والطريق غير معروف الآن)، أو price_on_request أو price_unavailable. والإعلان المخفي أو المجهول 404. ولهذه القراءة حدّ خاص أضيق لكل عنوان."
            }
        },
        {
            "name": "market.catalogue.api.listings.index",
            "example": {
                "request": null,
                "response": [
                    {
                        "uuid": "0193a3c1-2d4e-7b58-9a16-4f7c1e8d3a02",
                        "service": "freight",
                        "title": "شاحنة مسطحة 24 طن",
                        "vehicle": {
                            "type": "شاحنة مسطحة",
                            "tons": "24",
                            "m3": null,
                            "year": 2022
                        },
                        "flags": {
                            "refrigerated": false,
                            "live_sensor": true,
                            "tanker": false,
                            "crane": false,
                            "tracked": true
                        },
                        "load_mode": "ftl",
                        "rental_type": null,
                        "with_driver_available": false,
                        "price_from": {
                            "amount_halalas": 45000,
                            "basis": "trip",
                            "basis_words": "للرحلة",
                            "currency": "SAR",
                            "excludes_vat": true
                        },
                        "verified_on": "2026-11-10",
                        "photos": [
                            {
                                "uuid": "0193a3b8-1c72-7d49-a5e6-3b8f0d4c9a17"
                            }
                        ],
                        "carrier": {
                            "id": "0193a2c0-7a14-7e63-b2d8-5c9e1f4a6b30",
                            "name": "شركة الأفق للنقل",
                            "badges": [
                                "approved"
                            ],
                            "experience_years": 12,
                            "service_categories": [
                                "نقل مبرد",
                                "نقل حاويات"
                            ]
                        },
                        "distance_band": null,
                        "available_now": true,
                        "available_from": "2026-11-23",
                        "route_match": true,
                        "base_city": null
                    },
                    {
                        "uuid": "0193a3c1-5e90-7c24-8b3d-6a1f9d2e7c45",
                        "service": "rental",
                        "title": "رافعة شوكية للإيجار",
                        "vehicle": {
                            "type": "رافعة شوكية",
                            "tons": "5",
                            "m3": null,
                            "year": 2021
                        },
                        "flags": {
                            "refrigerated": false,
                            "live_sensor": true,
                            "tanker": false,
                            "crane": false,
                            "tracked": true
                        },
                        "load_mode": null,
                        "rental_type": "both",
                        "with_driver_available": true,
                        "price_from": {
                            "amount_halalas": 90000,
                            "basis": "day",
                            "basis_words": "لليوم",
                            "currency": "SAR",
                            "excludes_vat": true
                        },
                        "verified_on": "2026-11-10",
                        "photos": [],
                        "carrier": {
                            "id": "0193a2c0-7a14-7e63-b2d8-5c9e1f4a6b30",
                            "name": "شركة الأفق للنقل",
                            "badges": [
                                "approved"
                            ],
                            "experience_years": 12,
                            "service_categories": [
                                "نقل مبرد",
                                "نقل حاويات"
                            ]
                        },
                        "distance_band": null,
                        "available_now": false,
                        "available_from": null,
                        "route_match": false,
                        "base_city": "جدة"
                    }
                ],
                "errors": [
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "unknown_filter"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "unknown_value"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "invalid_value"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "out_of_range"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "too_many_extras"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "pickup_required"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "near_required"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "day_required"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "cursor_invalid"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "cursor_expired"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "cursor_limit"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    },
                    {
                        "status": 503,
                        "code": "service_unavailable"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/catalogue/listings",
            "auth": "none",
            "scope": null,
            "apps": [
                "shipper",
                "carrier"
            ],
            "idempotency_key": false,
            "limit": null,
            "summary": {
                "en": "Searches the public catalogue of listed vehicles, the same answer for everyone: one page of cards (limit 1 to 24, 12 by default) with the cursor of the next page in meta.page.next_cursor, sent back as cursor, the number of the page in meta.page.number (from 1) and the cursor of the page before it in meta.page.previous_cursor (null on the first page; on the second it is the cursor of the first, which opens the same page as sending no cursor, so a link to page 1 may leave the cursor out; there is still no total); filtered by service, category, vehicle_type, body_type, cargo_type (the code the cargo-types read gives, such as building_materials; a number is still read as the number it is), min_tons, min_m3, refrigerated, tanker, crane, tracked, available_now, with_driver, scope, load_mode, extra, pickup_city, dropoff_city, near_city with within_km, day with slot, and price_min and price_max with price_basis, and ordered by sort. Each card of the results also carries available_from, the first Saudi day within two weeks on which the listing is open (null when there is none; never why a day is closed), and route_match, true when the search names a pickup city and the listing itself names that trip (its lane or delivery city, or its own zones) rather than a wider area; on every other answer that carries a card they are null and false. The carrier block of every card, on every answer, also carries experience_years and service_categories, what the carrier published for its public page (its own statements, not checked by the market; null and an empty list when none). Every card, on every answer, also carries base_city, the name of the city the listing is based in where the carrier stored one for the public (the base city of the listing, else the city of a market-only item) and null otherwise; it is never taken from a served area, a branch or a delivery origin. A key it does not know is refused with unknown_filter, and a value out of range names its field.",
                "ar": "يبحث في كتالوج المركبات المعروضة العام، والجواب نفسه للجميع: صفحة من البطاقات (limit من 1 إلى 24، والافتراضي 12) ومؤشر الصفحة التالية في meta.page.next_cursor يُرسَل ثانية باسم cursor، ورقم الصفحة في meta.page.number (من 1) ومؤشر الصفحة التي قبلها في meta.page.previous_cursor (null في الصفحة الأولى؛ وفي الثانية هو مؤشر الأولى، ويفتح الصفحة نفسها التي يفتحها إرسال لا مؤشر، فرابط الصفحة 1 قد يترك المؤشر؛ ولا مجموع أيضًا)؛ ويُرشَّح بـ service وcategory وvehicle_type وbody_type وcargo_type (رمز نوع البضاعة كما تعطيه قراءة cargo-types مثل building_materials، والرقم ما زال يُقرأ رقمًا) وmin_tons وmin_m3 وrefrigerated وtanker وcrane وtracked وavailable_now وwith_driver وscope وload_mode وextra وpickup_city وdropoff_city وnear_city مع within_km وday مع slot وprice_min وprice_max مع price_basis، ويُرتَّب بـ sort. وتحمل كل بطاقة في النتائج أيضًا available_from: أول يوم سعودي خلال أسبوعين يكون فيه الإعلان متاحًا (null إن لم يوجد، ولا يُذكر سبب إغلاق أي يوم)، وroute_match: صحيح حين يسمّي البحث مدينة تحميل ويسمّي الإعلان نفسه هذه الرحلة (مساره أو مدينة تسليمه أو مناطقه الخاصة) لا منطقة أوسع؛ وفي كل جواب آخر يحمل بطاقة تكونان null وfalse. وكتلة الناقل في كل بطاقة في كل جواب تحمل أيضًا experience_years وservice_categories: ما نشره لصفحته العامة (أقواله هو لا يتحقق منها السوق، وnull وقائمة فارغة حين لا شيء). وكل بطاقة في كل جواب تحمل أيضًا base_city: اسم مدينة أساس الإعلان حيث خزّنها الناقل للعموم (مدينة أساس الإعلان، وإلا مدينة صنف السوق)، وnull فيما عدا ذلك، ولا تؤخذ من منطقة تغطية ولا من فرع ولا من مدينة منطلق التوصيل. والمفتاح الذي لا يعرفه يُرفض بالسبب unknown_filter، والقيمة الخارجة عن المدى تُسمّي حقلها."
            }
        },
        {
            "name": "market.catalogue.api.listings.show",
            "example": {
                "request": null,
                "response": {
                    "uuid": "0193a3c1-2d4e-7b58-9a16-4f7c1e8d3a02",
                    "service": "freight",
                    "title": "شاحنة مسطحة 24 طن",
                    "vehicle": {
                        "type": "شاحنة مسطحة",
                        "tons": "24",
                        "m3": null,
                        "year": 2022
                    },
                    "flags": {
                        "refrigerated": false,
                        "live_sensor": true,
                        "tanker": false,
                        "crane": false,
                        "tracked": true
                    },
                    "load_mode": "ftl",
                    "rental_type": null,
                    "with_driver_available": false,
                    "price_from": {
                        "amount_halalas": 45000,
                        "basis": "trip",
                        "basis_words": "للرحلة",
                        "currency": "SAR",
                        "excludes_vat": true
                    },
                    "verified_on": "2026-11-10",
                    "photos": [
                        {
                            "uuid": "0193a3b8-1c72-7d49-a5e6-3b8f0d4c9a17"
                        }
                    ],
                    "carrier": {
                        "id": "0193a2c0-7a14-7e63-b2d8-5c9e1f4a6b30",
                        "name": "شركة الأفق للنقل",
                        "badges": [
                            "approved"
                        ],
                        "experience_years": 12,
                        "service_categories": [
                            "نقل مبرد",
                            "نقل حاويات"
                        ]
                    },
                    "distance_band": null,
                    "available_now": true,
                    "available_from": "2026-11-23",
                    "route_match": true,
                    "base_city": null,
                    "cargo_limits": {
                        "weight_kg": 24000,
                        "volume_l": 90000,
                        "length_mm": 13600,
                        "width_mm": 2550,
                        "height_mm": 3000
                    },
                    "over_capacity": {
                        "policy": "refuse",
                        "max_trips": null
                    },
                    "rental_enabled": false,
                    "price_sheet": {
                        "method": "per_km",
                        "basis": "km",
                        "base_fee_halalas": 30000,
                        "rate_halalas": 450,
                        "minimum_halalas": 60000,
                        "weekend_bp": 1000,
                        "night_bp": 500,
                        "urgent_bp": 2000,
                        "estimated_duration_hours": 10,
                        "currency": "SAR",
                        "excludes_vat": true,
                        "valid_from": "2026-12-01",
                        "valid_to": null
                    },
                    "coverage": {
                        "scopes": {
                            "local": true,
                            "national": true,
                            "international": false
                        },
                        "zones": [
                            {
                                "name": "الرياض الكبرى",
                                "shape": "circle",
                                "centre": {
                                    "lat": 24.7136,
                                    "lng": 46.6753
                                },
                                "radius_km": 50,
                                "ring": []
                            }
                        ],
                        "regions": [
                            "منطقة الرياض"
                        ],
                        "cities": [
                            "الرياض",
                            "جدة"
                        ],
                        "countries": [
                            "SA"
                        ],
                        "routes": [
                            {
                                "from": "الرياض",
                                "to": "جدة",
                                "hours": 10
                            }
                        ]
                    },
                    "extras": [
                        {
                            "code": "loading_unloading",
                            "name": "التحميل والتفريغ",
                            "description": "عمال لتحميل البضاعة وتفريغها",
                            "basis": "fixed",
                            "price_halalas": 15000,
                            "hourly_halalas": null,
                            "half_day_halalas": null,
                            "full_day_halalas": null,
                            "requires": {
                                "quantity": false,
                                "duration": false,
                                "notes": false
                            }
                        }
                    ],
                    "accepted_cargo": [
                        {
                            "code": "building_materials",
                            "name": "مواد بناء",
                            "units": [
                                {
                                    "code": "ton",
                                    "label": "طن",
                                    "max_quantity": "24"
                                },
                                {
                                    "code": "pallet",
                                    "label": "طبلية",
                                    "max_quantity": "26"
                                }
                            ]
                        }
                    ],
                    "description": null,
                    "scheduled_trips": [
                        {
                            "uuid": "0193a3d4-6b21-7f08-9c35-2e7a4d1b8f60",
                            "from_city": "الرياض",
                            "to_city": "جدة",
                            "departs_at": "2026-11-28T04:00:00Z",
                            "arrives_at": "2026-11-28T14:00:00Z",
                            "booking_cutoff_at": "2026-11-27T16:00:00Z",
                            "remaining": [
                                {
                                    "dimension": "weight",
                                    "remaining": 8000
                                },
                                {
                                    "dimension": "volume",
                                    "remaining": 40000
                                }
                            ],
                            "price_from": {
                                "amount_halalas": 12000,
                                "basis": "ton",
                                "basis_words": "للطن",
                                "currency": "SAR",
                                "excludes_vat": true
                            },
                            "filling_soon": false
                        }
                    ],
                    "direct_bookable": true
                },
                "errors": [
                    {
                        "status": 404,
                        "code": "not_found"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    },
                    {
                        "status": 503,
                        "code": "service_unavailable"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/catalogue/listings/{uuid}",
            "auth": "none",
            "scope": null,
            "apps": [
                "shipper",
                "carrier"
            ],
            "idempotency_key": false,
            "limit": null,
            "summary": {
                "en": "Reads one listed vehicle in full: the card's fields and its cargo limits, its over-capacity policy, whether it is offered for hire, its current price sheet before VAT, its coverage (scopes, areas, regions, cities, countries and lanes) and the extras it offers with their prices, and direct_bookable, whether it can be booked straight from its page, as freight at a price sheet or as a hire or a machine at active terms with the hire road open (the carrier block of every card carries the carrier's public id, the one the carrier page and the carrier reads take, with its experience_years and service_categories as it published them: its own statements, not checked by the market, null and an empty list when none), accepted_cargo, the cargo types it takes (a restricted type only if its carrier agreed to it) each with the units the listing prices it in and the most taken in each unit (max_quantity, null when the carrier set none), description, what the carrier wrote about the listing in both languages (ar and en; the words of a market-only item, else the listing's own; plain text whose line breaks separate paragraphs; the carrier's own words, not checked by the market; a text with a contact detail in it is left out; null when neither language has words), and scheduled_trips, the next three open shared trips of its vehicle as the carrier page lists them (a truck on a fixed route has some, otherwise an empty list); a listing that is unknown or not on sale is not_found.",
                "ar": "يقرأ مركبة معروضة واحدة كاملة: حقول البطاقة وحدود حمولتها وسياسة تجاوز السعة وهل تُعرض للتأجير وقائمة سعرها الحالية قبل الضريبة وتغطيتها (النطاقات والمناطق والأقاليم والمدن والدول والمسارات) والخدمات الإضافية التي تقدمها بأسعارها، وdirect_bookable: هل يُحجز مباشرة من صفحته، شحنًا بقائمة سعر أو تأجيرًا أو معدة بشروط نشطة وطريق التأجير مفتوح (وكتلة الناقل في كل بطاقة تحمل المعرّف العام للناقل، وهو الذي تأخذه صفحة الناقل وقراءاته، ومعه experience_years وservice_categories كما نشرهما: أقواله هو لا يتحقق منها السوق، وnull وقائمة فارغة حين لا شيء)، وaccepted_cargo: أنواع الحمولة التي يقبلها (ولا يظهر النوع المقيَّد إلا إن وافق عليه ناقله) لكل نوع الوحدات التي يسعّره الإعلان بها وأقصى ما يُقبل في كل وحدة (max_quantity، وnull إن لم يضع الناقل حدًّا)، وdescription: ما كتبه الناقل عن الإعلان بلغتيه (ar وen: وصف صنف السوق، وإلا وصف الإعلان نفسه؛ نص عادي تفصل أسطرُه الفقرات، وهو قول الناقل ولا تتحقق منه السوق، وتُترك اللغة التي فيها وسيلة اتصال، وnull حين لا كلام في أي لغة)، وscheduled_trips: أقرب ثلاث رحلات مشتركة مفتوحة لمركبته كما تعرضها صفحة الناقل (للشاحنة على مسار ثابت رحلات، وإلا قائمة فارغة)؛ والإعلان المجهول أو غير المعروض للبيع not_found."
            }
        },
        {
            "name": "market.catalogue.api.map.index",
            "example": {
                "request": null,
                "response": [
                    {
                        "city": 7,
                        "label": "الرياض",
                        "lat": 24.7136,
                        "lng": 46.6753,
                        "carriers": 14,
                        "price_from": {
                            "amount_halalas": 120000,
                            "basis": "trip",
                            "basis_words": "للرحلة",
                            "currency": "SAR",
                            "excludes_vat": true
                        }
                    },
                    {
                        "city": 9,
                        "label": "جدة",
                        "lat": 21.4858,
                        "lng": 39.1925,
                        "carriers": 9,
                        "price_from": null
                    }
                ],
                "errors": [
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "unknown_filter"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "unknown_value"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "invalid_value"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "out_of_range"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "too_many_extras"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "pickup_required"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "near_required"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "day_required"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "cursor_invalid"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "cursor_expired"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "cursor_limit"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    },
                    {
                        "status": 503,
                        "code": "service_unavailable"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/catalogue/map",
            "auth": "none",
            "scope": null,
            "apps": [
                "shipper",
                "carrier"
            ],
            "idempotency_key": false,
            "limit": null,
            "summary": {
                "en": "The cities the results of a search name, each with its public centre, the number of distinct carriers there (a city under the minimum number of carriers is left out) and price_from, the lowest starting price before VAT among them in the basis the search counts by (price_basis, the trip by default; null when none is priced in it), never a truck's position; it takes the same keys as the listings search.",
                "ar": "المدن التي تسمّيها نتائج البحث، لكل منها مركزها العام وعدد الناقلين المختلفين فيها (والمدينة تحت الحد الأدنى من الناقلين تُحذف) وprice_from: أقل سعر ابتداءً قبل الضريبة بينهم بالأساس الذي يعدّ به البحث (price_basis، الرحلة افتراضيًا، وnull إن لم يُسعَّر أحد به) ولا موضع شاحنة أبدًا؛ وتأخذ مفاتيح بحث الإعلانات نفسها."
            }
        },
        {
            "name": "market.catalogue.api.open_requests.index",
            "example": {
                "request": null,
                "response": [
                    {
                        "from_city": "الرياض",
                        "to_city": "جدة",
                        "cargo_type": {
                            "code": "building_materials",
                            "name": "مواد بناء"
                        },
                        "window_from": "2026-12-03",
                        "window_until": "2026-12-05",
                        "published_at": "2026-12-01T09:00:00Z"
                    }
                ],
                "errors": [
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "unknown_filter"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    },
                    {
                        "status": 503,
                        "code": "service_unavailable"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/catalogue/open-requests",
            "auth": "none",
            "scope": null,
            "apps": [
                "shipper",
                "carrier"
            ],
            "idempotency_key": false,
            "limit": null,
            "summary": {
                "en": "The board of the requests open for offers, for the market home, newest first and twelve at most: each card has the two cities, the cargo type (code and name), the first and last day the load may be picked up (Saudi calendar days) and the hour the request was published, and never who asked, a price, a place, a size or an id. A request shows an hour after it opened and only while its offers are open; a restricted cargo and a request aimed at one carrier never show; one company has two cards at most; the list is empty unless at least three different shipper companies have a request on it, and empty while the owner's switch for the board is off, which it is by default. The answer is kept five minutes, so a request cancelled or awarded in that time may still be listed; no query key is accepted.",
                "ar": "لوحة الطلبات المفتوحة لتلقّي العروض للصفحة الرئيسية للسوق، الأحدث أولًا واثنا عشر طلبًا كحدّ أقصى: لكل بطاقة المدينتان ونوع الحمولة (الرمز والاسم) وأول يوم وآخر يوم يجوز فيهما التحميل (بالتقويم السعودي) والساعة التي نُشر فيها الطلب، ولا يظهر من طلبه ولا سعر ولا موضع ولا حجم ولا معرّف. لا يظهر الطلب إلا بعد ساعة من فتحه وما دامت عروضه مفتوحة؛ ولا تظهر حمولة مقيَّدة ولا طلب موجَّه إلى ناقل بعينه؛ ولشركة واحدة بطاقتان كحدّ أقصى؛ والقائمة فارغة ما لم يكن على اللوحة طلب من ثلاث شركات شاحنين مختلفة على الأقل، وفارغة ما دام مفتاح المالك الخاص باللوحة مطفأً وهو مطفأ افتراضيًا. تُحفظ الإجابة خمس دقائق فقد يبقى طلب أُلغي أو مُنح خلالها في القائمة؛ ولا يُقبل أي مفتاح استعلام."
            }
        },
        {
            "name": "market.catalogue.api.units.index",
            "example": {
                "request": null,
                "response": [
                    {
                        "code": "ton",
                        "type": "weight",
                        "label": "طن",
                        "symbol": "t",
                        "base_factor": "1000",
                        "is_base": false
                    },
                    {
                        "code": "kg",
                        "type": "weight",
                        "label": "كيلوجرام",
                        "symbol": "kg",
                        "base_factor": "1",
                        "is_base": true
                    }
                ],
                "errors": [
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "unknown_filter"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "unknown_value"
                    },
                    {
                        "status": 422,
                        "code": "validation_failed",
                        "reason": "invalid_value"
                    },
                    {
                        "status": 429,
                        "code": "rate_limited"
                    },
                    {
                        "status": 503,
                        "code": "service_unavailable"
                    }
                ]
            },
            "method": "GET",
            "path": "/market/catalogue/units",
            "auth": "none",
            "scope": null,
            "apps": [
                "shipper",
                "carrier"
            ],
            "idempotency_key": false,
            "limit": null,
            "summary": {
                "en": "The units of measure the catalogue knows, each with its code, type, label, symbol and factor to the base unit of its type, optionally for one type (type: count, weight, volume, length or liquid); cached for five minutes.",
                "ar": "وحدات القياس التي يعرفها الكتالوج، لكل وحدة رمزها ونوعها واسمها ورمزها المكتوب ومعاملها إلى الوحدة الأساسية لنوعها، ويمكن حصرها في نوع واحد (type: count أو weight أو volume أو length أو liquid)؛ وتُخزَّن خمس دقائق."
            }
        }
    ]
}