{
    "openapi": "3.1.0",
    "info": {
        "title": "RevOrder API",
        "version": "2026-09-09",
        "summary": "Order ingest, delivery data and automation triggers.",
        "description": "The curated public surface. Connector transports and provider callbacks are deliberately excluded — see the developer portal for what is published and why."
    },
    "servers": [
        {
            "url": "https://revorder.com"
        }
    ],
    "security": [],
    "components": {
        "securitySchemes": {
            "ShopKeyHeader": {
                "type": "apiKey",
                "in": "header",
                "name": "X-Shop-Key",
                "description": "Server-side shop key. Never publishable."
            },
            "HmacSignature": {
                "type": "apiKey",
                "in": "header",
                "name": "X-RevOrder-Signature",
                "description": "hex(HMAC-SHA256(secret, \"{timestamp}.{raw body}\")). Sent with X-RevOrder-Timestamp."
            }
        }
    },
    "tags": [
        {
            "name": "Inbound orders",
            "description": "Push orders into RevOrder from a platform we have no native connector for. One URL per shop, HMAC-signed, replay-protected. This is the integration path for a custom storefront or an in-house backend."
        },
        {
            "name": "Contacts",
            "description": "Push sign-ups from your own forms — a newsletter box, a lead page, a marketing site without a shop — into RevOrder campaigns and automations. Same URL, secret and signing as inbound orders; only the event differs."
        },
        {
            "name": "Checkout API",
            "description": "Read-mostly endpoints the storefront calls from the browser to build a delivery selector: couriers, cities, offices, streets, price. CORS is open and the shop key travels in the path, so treat it as publishable — it identifies a shop and grants no write access."
        },
        {
            "name": "Delivery API",
            "description": "The same delivery questions as the Checkout API, asked server-to-server. Authenticate with the X-Shop-Key header and keep the key on your backend. Use these when you render checkout yourself and do not want a shop key in page source."
        },
        {
            "name": "Automation triggers",
            "description": "Start a RevOrder automation from your own system. Each automation with a webhook trigger mints its own token, so the URL is the credential and revoking one flow never affects another."
        }
    ],
    "paths": {
        "/api/checkout/v1/calculate-price": {
            "post": {
                "tags": [
                    "Checkout API"
                ],
                "operationId": "checkout_calculate_price",
                "summary": "Price one method for a destination",
                "description": "Takes a `method_id` from the flat list above and prices it for a specific destination. Use this when the shopper picks a method and you need the final figure, including any cash-on-delivery fee.",
                "responses": {
                    "200": {
                        "description": "Calculated price. `cod_amount` feeds the calculation; the response carries the resolved price, not a fee breakdown.",
                        "content": {
                            "application/json": {
                                "example": {
                                    "success": true,
                                    "data": {
                                        "price": 4.5,
                                        "price_formatted": "€4.50",
                                        "price_bgn_formatted": "8.80 лв.",
                                        "currency": "EUR"
                                    }
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Shop key does not resolve.",
                        "content": {
                            "application/json": {
                                "example": {
                                    "success": false,
                                    "message": "Shop not found"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "shop_key": {
                                        "type": "string",
                                        "description": "Publishable shop key."
                                    },
                                    "method_id": {
                                        "type": "string",
                                        "description": "An `id` from the shipping-methods list."
                                    },
                                    "city": {
                                        "type": "string",
                                        "description": "Destination city."
                                    },
                                    "zip": {
                                        "type": "string",
                                        "description": "Destination postal code."
                                    },
                                    "weight": {
                                        "type": "number",
                                        "description": "Kilograms. Minimum 0, defaults to 1.0."
                                    },
                                    "subtotal": {
                                        "type": "number",
                                        "description": "Cart subtotal, for free-shipping thresholds. Minimum 0."
                                    },
                                    "office_id": {
                                        "type": "string",
                                        "description": "Required for office and locker methods."
                                    },
                                    "address": {
                                        "type": "string",
                                        "description": "Required for door delivery."
                                    },
                                    "cod_amount": {
                                        "type": "number",
                                        "description": "Cash-on-delivery amount, when the fee depends on it. Minimum 0."
                                    }
                                },
                                "required": [
                                    "shop_key",
                                    "method_id"
                                ]
                            },
                            "example": {
                                "shop_key": "your_shop_key",
                                "method_id": "econt_office",
                                "city": "София",
                                "office_id": "1234",
                                "weight": 1.5,
                                "subtotal": 49.3,
                                "cod_amount": 54.29
                            }
                        }
                    }
                }
            }
        },
        "/api/checkout/v1/cities/{shopKey}": {
            "get": {
                "tags": [
                    "Checkout API"
                ],
                "operationId": "checkout_cities",
                "summary": "Search cities",
                "description": "Autocomplete source for the city field. Returns postal codes alongside names, so the same result can fill both inputs.",
                "parameters": [
                    {
                        "name": "shopKey",
                        "in": "path",
                        "required": true,
                        "description": "Publishable shop key.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "term",
                        "in": "query",
                        "required": true,
                        "description": "What the shopper has typed. Shorter than 2 characters returns an empty list without querying the carrier.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "country",
                        "in": "query",
                        "required": false,
                        "description": "ISO 3166-1 alpha-2. Defaults to BG.",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Matching cities, at most 50 rows. A term below the minimum length answers with an empty list and a min_term_length hint.",
                        "content": {
                            "application/json": {
                                "example": {
                                    "success": true,
                                    "data": [
                                        {
                                            "name": "София",
                                            "post_code": "1000",
                                            "country": "BG"
                                        }
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/checkout/v1/couriers/{shopKey}": {
            "get": {
                "tags": [
                    "Checkout API"
                ],
                "operationId": "checkout_couriers",
                "summary": "List the couriers a shop offers",
                "description": "Returns the shop's enabled couriers and the delivery types each supports. `mode` tells you where the list came from: `nextlevel` when the shop delivers through the NextLevel aggregator (office and locker counts are then populated), `integration` when it uses its own courier contracts.",
                "parameters": [
                    {
                        "name": "shopKey",
                        "in": "path",
                        "required": true,
                        "description": "Publishable shop key.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "country",
                        "in": "query",
                        "required": false,
                        "description": "Restrict to couriers serving this country. Aggregator mode only.",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Courier list.",
                        "content": {
                            "application/json": {
                                "example": {
                                    "success": true,
                                    "mode": "nextlevel",
                                    "default": "econt",
                                    "data": [
                                        {
                                            "id": "econt",
                                            "name": "Econt",
                                            "slug": "econt",
                                            "has_offices": true,
                                            "has_lockers": true,
                                            "offices_count": 1204,
                                            "lockers_count": 312,
                                            "supports_door_delivery": true,
                                            "countries": [
                                                "BG",
                                                "RO"
                                            ],
                                            "enabled": true
                                        }
                                    ],
                                    "countries": [
                                        {
                                            "code": "BG",
                                            "name": "Bulgaria"
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Shop key does not resolve.",
                        "content": {
                            "application/json": {
                                "example": {
                                    "success": false,
                                    "error": "Shop not found"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/checkout/v1/offices/{shopKey}/search": {
            "get": {
                "tags": [
                    "Checkout API"
                ],
                "operationId": "checkout_offices_search",
                "summary": "Search offices and lockers",
                "description": "Free-text search across every courier the shop offers. Prefer this over the per-courier listing when the shopper has already typed something.",
                "parameters": [
                    {
                        "name": "shopKey",
                        "in": "path",
                        "required": true,
                        "description": "Publishable shop key.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "city",
                        "in": "query",
                        "required": false,
                        "description": "Restrict to a city.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "term",
                        "in": "query",
                        "required": false,
                        "description": "Free-text match on office name or address.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "courier",
                        "in": "query",
                        "required": false,
                        "description": "Restrict to one courier.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "type",
                        "in": "query",
                        "required": false,
                        "description": "office or locker.",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Matching locations.",
                        "content": {
                            "application/json": {
                                "example": {
                                    "success": true,
                                    "data": [
                                        {
                                            "id": "1234",
                                            "name": "Office Vitosha",
                                            "address": "ul. Vitosha 12",
                                            "city": "София",
                                            "courier": "econt",
                                            "type": "office"
                                        }
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/checkout/v1/offices/{shopKey}/{courierId}": {
            "get": {
                "tags": [
                    "Checkout API"
                ],
                "operationId": "checkout_offices",
                "summary": "List a courier's offices in a city",
                "description": "Use when the shopper has picked a courier and a city and you want the whole list.",
                "parameters": [
                    {
                        "name": "shopKey",
                        "in": "path",
                        "required": true,
                        "description": "Publishable shop key.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "courierId",
                        "in": "path",
                        "required": true,
                        "description": "Courier slug, as returned by the couriers endpoint.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "city",
                        "in": "query",
                        "required": false,
                        "description": "City name.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "zip",
                        "in": "query",
                        "required": false,
                        "description": "Postal code, when the city name is ambiguous.",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Office list.",
                        "content": {
                            "application/json": {
                                "example": {
                                    "success": true,
                                    "data": []
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/checkout/v1/sdk/{shopKey}.js": {
            "get": {
                "tags": [
                    "Checkout API"
                ],
                "operationId": "checkout_sdk",
                "summary": "Load the JavaScript SDK",
                "description": "A per-shop browser bundle that renders the delivery selector and calls the endpoints above for you. Use it unless you need to own the UI.",
                "parameters": [
                    {
                        "name": "shopKey",
                        "in": "path",
                        "required": true,
                        "description": "Publishable shop key.",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The SDK bundle.",
                        "content": {
                            "application/javascript": {
                                "example": "// RevOrder Checkout SDK"
                            }
                        }
                    }
                }
            }
        },
        "/api/checkout/v1/settings/{shopKey}": {
            "get": {
                "tags": [
                    "Checkout API"
                ],
                "operationId": "checkout_settings",
                "summary": "Read the shop's checkout configuration",
                "description": "The configuration the delivery selector renders from. Contains no secrets and is safe to fetch from the browser.",
                "parameters": [
                    {
                        "name": "shopKey",
                        "in": "path",
                        "required": true,
                        "description": "Publishable shop key.",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Checkout settings.",
                        "content": {
                            "application/json": {
                                "example": {
                                    "success": true,
                                    "settings": {
                                        "enabled": true,
                                        "default_country": "BG"
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/checkout/v1/shipping-methods": {
            "get": {
                "tags": [
                    "Checkout API"
                ],
                "operationId": "checkout_shipping_methods",
                "summary": "List every shipping method, flat",
                "description": "One flat list of the shop's shipping methods with the courier, delivery type and base price already resolved — the couriers endpoint plus its per-courier follow-ups in a single call. Cached for 5 minutes. Unlike the rest of this group the shop key is a query parameter, not a path segment. KEY ON `courier.underlying_courier.id`, NOT ON `courier.id`: for options stored before delivery methods required a name, `courier.id` is the literal \"nextlevel\" and the carrier moves into `underlying_courier`; for everything a shop can publish today it is the carrier itself. `underlying_courier.id` is the carrier in both cases. We are not freezing `courier.id` until that is normalised.",
                "parameters": [
                    {
                        "name": "shop_key",
                        "in": "query",
                        "required": true,
                        "description": "Publishable shop key.",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Flat method list.",
                        "content": {
                            "application/json": {
                                "example": {
                                    "success": true,
                                    "data": [
                                        {
                                            "id": "BG_ekont_office",
                                            "name": "Econt to office",
                                            "courier": {
                                                "id": "ekont",
                                                "name": "Ekont",
                                                "logo": "https://revorder.com/images/couriers/econt.png",
                                                "underlying_courier": {
                                                    "id": "ekont",
                                                    "name": "Ekont"
                                                }
                                            },
                                            "type": "office",
                                            "pricing_mode": "fixed",
                                            "price": 4.5,
                                            "price_formatted": "€4.50",
                                            "currency": "EUR",
                                            "free_from": null,
                                            "delivery_time": null,
                                            "requires_office_selection": true,
                                            "requires_locker_selection": false,
                                            "requires_address": false,
                                            "requires_postcode": false,
                                            "country": "BG",
                                            "sort_order": 999,
                                            "filter_by_type": false
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Shop key does not resolve.",
                        "content": {
                            "application/json": {
                                "example": {
                                    "success": false,
                                    "message": "Shop not found"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "shop_key missing.",
                        "content": {
                            "application/json": {
                                "example": {
                                    "message": "The shop key field is required.",
                                    "errors": {
                                        "shop_key": [
                                            "The shop key field is required."
                                        ]
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/checkout/v1/shipping/{shopKey}": {
            "post": {
                "tags": [
                    "Checkout API"
                ],
                "operationId": "checkout_shipping",
                "summary": "Price a delivery",
                "description": "Returns the shipping cost for a chosen destination. For `office` and `locker` pass `office_id`; for `address` pass `street` and `post_code`.",
                "parameters": [
                    {
                        "name": "shopKey",
                        "in": "path",
                        "required": true,
                        "description": "Publishable shop key.",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Calculated price.",
                        "content": {
                            "application/json": {
                                "example": {
                                    "success": true,
                                    "price": 4.99,
                                    "currency": "BGN"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation failed.",
                        "content": {
                            "application/json": {
                                "example": {
                                    "message": "The city field is required.",
                                    "errors": {
                                        "city": [
                                            "The city field is required."
                                        ]
                                    }
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "city": {
                                        "type": "string",
                                        "description": "Max 100 characters."
                                    },
                                    "country": {
                                        "type": "string",
                                        "description": "ISO 3166-1 alpha-2. Defaults to BG."
                                    },
                                    "zip": {
                                        "type": "string",
                                        "description": "Max 20 characters."
                                    },
                                    "weight": {
                                        "type": "number",
                                        "description": "Kilograms. Defaults to 1.0 in aggregator mode."
                                    },
                                    "subtotal": {
                                        "type": "number",
                                        "description": "Cart subtotal, for free-shipping thresholds."
                                    },
                                    "courier_id": {
                                        "type": "string",
                                        "description": "Restrict to one courier."
                                    },
                                    "delivery_type": {
                                        "type": "string",
                                        "description": "office · locker · address."
                                    },
                                    "office_id": {
                                        "type": "string",
                                        "description": "Required for office and locker delivery."
                                    },
                                    "street": {
                                        "type": "string",
                                        "description": "Required for address delivery. Max 200 characters."
                                    },
                                    "post_code": {
                                        "type": "string",
                                        "description": "Used for address delivery."
                                    }
                                },
                                "required": [
                                    "city"
                                ]
                            },
                            "example": {
                                "country": "BG",
                                "city": "София",
                                "delivery_type": "office",
                                "office_id": "1234",
                                "weight": 1.5,
                                "subtotal": 49.3
                            }
                        }
                    }
                }
            }
        },
        "/api/checkout/v1/streets/{shopKey}": {
            "get": {
                "tags": [
                    "Checkout API"
                ],
                "operationId": "checkout_streets",
                "summary": "Search streets",
                "description": "Autocomplete for door delivery. Pass the `place_id` from a city result to scope the search to that settlement.",
                "parameters": [
                    {
                        "name": "shopKey",
                        "in": "path",
                        "required": true,
                        "description": "Publishable shop key.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "term",
                        "in": "query",
                        "required": true,
                        "description": "What the shopper has typed.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "place_id",
                        "in": "query",
                        "required": false,
                        "description": "Settlement identifier from the city search.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "post_code",
                        "in": "query",
                        "required": false,
                        "description": "Postal code.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "country",
                        "in": "query",
                        "required": false,
                        "description": "Defaults to BG.",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Matching streets.",
                        "content": {
                            "application/json": {
                                "example": {
                                    "success": true,
                                    "data": []
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/checkout/v1/validate-address/{shopKey}": {
            "post": {
                "tags": [
                    "Checkout API"
                ],
                "operationId": "checkout_validate_address",
                "summary": "Validate a delivery address",
                "description": "Checks an address against the courier catalogue before the order is placed.",
                "parameters": [
                    {
                        "name": "shopKey",
                        "in": "path",
                        "required": true,
                        "description": "Publishable shop key.",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Validation verdict.",
                        "content": {
                            "application/json": {
                                "example": {
                                    "success": true,
                                    "validation": {
                                        "valid": true,
                                        "normalized": {
                                            "city": "София",
                                            "post_code": "1000"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation failed.",
                        "content": {
                            "application/json": {
                                "example": {
                                    "success": false,
                                    "error": "Validation failed"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "country": {
                                        "type": "string",
                                        "description": "ISO 3166-1 alpha-2. Max 2 characters."
                                    },
                                    "city": {
                                        "type": "string",
                                        "description": "Max 100 characters."
                                    },
                                    "address": {
                                        "type": "string",
                                        "description": "Max 255 characters."
                                    },
                                    "zip": {
                                        "type": "string",
                                        "description": "Max 20 characters."
                                    }
                                },
                                "required": [
                                    "country",
                                    "city",
                                    "address"
                                ]
                            },
                            "example": {
                                "country": "BG",
                                "city": "София",
                                "address": "ul. Vitosha 12",
                                "zip": "1000"
                            }
                        }
                    }
                }
            }
        },
        "/api/checkout/v1/validate-phone/{shopKey}": {
            "post": {
                "tags": [
                    "Checkout API"
                ],
                "operationId": "checkout_validate_phone",
                "summary": "Check a phone number's format",
                "description": "Advisory only. A negative verdict is a hint for the shopper, never a gate — fulfilment eligibility does not depend on it, so do not block submission on this response.",
                "parameters": [
                    {
                        "name": "shopKey",
                        "in": "path",
                        "required": true,
                        "description": "Publishable shop key.",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Advisory verdict.",
                        "content": {
                            "application/json": {
                                "example": {
                                    "success": true,
                                    "valid": true,
                                    "normalized": "+359888123456"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "phone": {
                                        "type": "string",
                                        "description": "The number as typed."
                                    },
                                    "country": {
                                        "type": "string",
                                        "description": "ISO 3166-1 alpha-2, to pick the expected format."
                                    }
                                },
                                "required": [
                                    "phone"
                                ]
                            },
                            "example": {
                                "phone": "0888123456",
                                "country": "BG"
                            }
                        }
                    }
                }
            }
        },
        "/api/nextcheckout/offices": {
            "post": {
                "tags": [
                    "Delivery API"
                ],
                "operationId": "delivery_offices",
                "summary": "List offices for a courier",
                "description": "Server-side equivalent of the Checkout API office listing.",
                "responses": {
                    "200": {
                        "description": "Office list.",
                        "content": {
                            "application/json": {
                                "example": {
                                    "success": true,
                                    "data": []
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Checkout Plus is not enabled for the shop.",
                        "content": {
                            "application/json": {
                                "example": {
                                    "success": false,
                                    "error": "NextCheckout plugin not enabled for this shop"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "ShopKeyHeader": []
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "courierId": {
                                        "type": "string",
                                        "description": "One of: speedy, econt, dhl."
                                    },
                                    "city": {
                                        "type": "string",
                                        "description": "Max 100 characters."
                                    },
                                    "zip": {
                                        "type": "string",
                                        "description": "Max 20 characters."
                                    }
                                },
                                "required": [
                                    "courierId",
                                    "city"
                                ]
                            },
                            "example": {
                                "courierId": "econt",
                                "city": "София",
                                "zip": "1000"
                            }
                        }
                    }
                }
            }
        },
        "/api/nextcheckout/shipping-methods": {
            "post": {
                "tags": [
                    "Delivery API"
                ],
                "operationId": "delivery_shipping_methods",
                "summary": "List available shipping methods",
                "description": "Returns the methods that apply to a destination and cart, already priced. Requires the Checkout Plus plugin to be enabled on the shop.",
                "responses": {
                    "200": {
                        "description": "Available methods.",
                        "content": {
                            "application/json": {
                                "example": {
                                    "success": true,
                                    "data": [
                                        {
                                            "id": "flat_rate_1",
                                            "name": "Standard Shipping",
                                            "cost": 5.99,
                                            "type": "flat_rate",
                                            "delivery_time": "3-5 business days"
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Missing or unknown shop key.",
                        "content": {
                            "application/json": {
                                "example": {
                                    "success": false,
                                    "error": "Shop key is required"
                                }
                            }
                        }
                    },
                    "403": {
                        "description": "Checkout Plus is not enabled for the shop.",
                        "content": {
                            "application/json": {
                                "example": {
                                    "success": false,
                                    "error": "NextCheckout plugin not enabled for this shop"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation failed.",
                        "content": {
                            "application/json": {
                                "example": {
                                    "message": "Country code is required",
                                    "errors": {
                                        "country": [
                                            "Country code is required"
                                        ]
                                    }
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "ShopKeyHeader": []
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "country": {
                                        "type": "string",
                                        "description": "ISO 3166-1 alpha-2. Exactly 2 characters; normalised to upper case."
                                    },
                                    "subtotal": {
                                        "type": "number",
                                        "description": "Cart subtotal. Minimum 0."
                                    },
                                    "city": {
                                        "type": "string",
                                        "description": "Max 100 characters."
                                    },
                                    "zip": {
                                        "type": "string",
                                        "description": "Max 20 characters."
                                    },
                                    "weight": {
                                        "type": "number",
                                        "description": "Kilograms. Minimum 0, defaults to 0."
                                    },
                                    "items": {
                                        "type": "integer",
                                        "description": "Item count. Minimum 0, defaults to 0."
                                    }
                                },
                                "required": [
                                    "country",
                                    "subtotal"
                                ]
                            },
                            "example": {
                                "country": "BG",
                                "city": "София",
                                "zip": "1000",
                                "subtotal": 99.99,
                                "weight": 2.5,
                                "items": 3
                            }
                        }
                    }
                }
            }
        },
        "/api/nextcheckout/validate-address": {
            "post": {
                "tags": [
                    "Delivery API"
                ],
                "operationId": "delivery_validate_address",
                "summary": "Validate an address",
                "description": "Server-side address check. Takes `address1`/`address2` rather than the Checkout API's single `address` field.",
                "responses": {
                    "200": {
                        "description": "Validation verdict.",
                        "content": {
                            "application/json": {
                                "example": {
                                    "success": true,
                                    "data": {
                                        "valid": true
                                    }
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "ShopKeyHeader": []
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "country": {
                                        "type": "string",
                                        "description": "ISO 3166-1 alpha-2. Exactly 2 characters."
                                    },
                                    "city": {
                                        "type": "string",
                                        "description": "Max 100 characters."
                                    },
                                    "zip": {
                                        "type": "string",
                                        "description": "Max 20 characters."
                                    },
                                    "address1": {
                                        "type": "string",
                                        "description": "Max 255 characters."
                                    },
                                    "address2": {
                                        "type": "string",
                                        "description": "Max 255 characters."
                                    }
                                },
                                "required": [
                                    "country",
                                    "city"
                                ]
                            },
                            "example": {
                                "country": "BG",
                                "city": "София",
                                "zip": "1000",
                                "address1": "ul. Vitosha 12",
                                "address2": "ap. 4"
                            }
                        }
                    }
                }
            }
        },
        "/api/v1/automations/webhook/{token}": {
            "post": {
                "tags": [
                    "Automation triggers"
                ],
                "operationId": "automations_trigger",
                "summary": "Trigger an automation",
                "description": "Runs the automation the token belongs to. The JSON body is handed to the flow as trigger data, so its fields are whatever that automation reads. Copy the URL from the automation's webhook trigger step — the token is not derivable from anything else, and a flow only runs while it is live.",
                "parameters": [
                    {
                        "name": "token",
                        "in": "path",
                        "required": true,
                        "description": "The automation's own webhook secret. Treat it as a credential.",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Accepted and queued.",
                        "content": {
                            "application/json": {
                                "example": {
                                    "ok": true,
                                    "queued": true
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Token does not resolve to a live automation.",
                        "content": {
                            "application/json": {
                                "example": {
                                    "error": "Not found"
                                }
                            }
                        }
                    },
                    "429": {
                        "description": "Too many triggers. See Rate limits.",
                        "content": {
                            "application/json": {
                                "example": {
                                    "message": "Too Many Attempts."
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": false,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "additionalProperties": true
                            },
                            "example": {
                                "order_id": "10023",
                                "customer": {
                                    "email": "ivan@example.com"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/api/webhooks/{shopKey}": {
            "post": {
                "tags": [
                    "Contacts"
                ],
                "operationId": "contacts_unsubscribe",
                "summary": "Unsubscribe contacts",
                "description": "Send `contact.unsubscribe` with up to 200 `{ \"email\": … }` objects when people unsubscribe on your side. Marketing email to them stops for your account; transactional email is unaffected.",
                "parameters": [
                    {
                        "name": "shopKey",
                        "in": "path",
                        "required": true,
                        "description": "Identifies the shop.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "X-RevOrder-Event",
                        "in": "header",
                        "required": true,
                        "description": "contact.unsubscribe",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Processed.",
                        "content": {
                            "application/json": {
                                "example": {
                                    "ok": true,
                                    "event": "contact.unsubscribe",
                                    "summary": {
                                        "received": 1,
                                        "unsubscribed": 1
                                    },
                                    "contacts": [
                                        {
                                            "index": 0,
                                            "result": "unsubscribed"
                                        }
                                    ]
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "HmacSignature": []
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "contacts": {
                                        "type": "string",
                                        "description": "The address to suppress."
                                    }
                                },
                                "required": [
                                    "contacts"
                                ]
                            },
                            "example": {
                                "event": "contact.unsubscribe",
                                "data": {
                                    "contacts": [
                                        {
                                            "email": "ivan@example.com"
                                        }
                                    ]
                                }
                            }
                        }
                    }
                }
            },
            "get": {
                "tags": [
                    "Inbound orders"
                ],
                "operationId": "orders_webhook_health",
                "summary": "Check the endpoint is reachable",
                "description": "Unsigned reachability probe. Confirms the URL and the shop key resolve; it proves nothing about your signing and discloses nothing about the shop. Use a signed `ping` event for that.",
                "parameters": [
                    {
                        "name": "shopKey",
                        "in": "path",
                        "required": true,
                        "description": "Identifies the shop.",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Endpoint is live.",
                        "content": {
                            "application/json": {
                                "example": {
                                    "ok": true
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}