{
  "openapi": "3.1.0",
  "info": {
    "title": "Sendsational API",
    "version": "1.0.0",
    "summary": "Contacts, consent, events and webhooks for Sendsational, the email marketing platform.",
    "description": "REST and JSON. Every request carries an API key: `Authorization: Bearer ss_live_…`. Keys belong to one workspace and carry scopes.\n\nField names are snake_case, times are ISO 8601 in UTC, and money is a decimal number in the currency's main unit.\n\nUnknown fields in a request body are refused, so a typo is an error and not silently ignored.\n\nEach key may make a set number of requests a minute (600 unless changed); the RateLimit-Limit, RateLimit-Remaining and RateLimit-Reset headers say where you stand, and a 429 carries Retry-After.\n\nSend an Idempotency-Key header (up to 255 characters) on a POST or PATCH to make a retry safe: the first answer is stored for 24 hours and returned again, with Idempotent-Replayed: true.\n\nEvery error has one shape: `{ error: { type, code, message, details?, request_id } }`.\n\nWebhooks are signed the Standard Webhooks way (HMAC-SHA256 over \"{webhook-id}.{webhook-timestamp}.{body}\") and retried after 1 min, 5 min, 30 min, 2 h, 6 h, 12 h, 24 h.",
    "contact": {
      "name": "Sendsational",
      "url": "https://app.sendsational.app/docs/api"
    }
  },
  "servers": [
    {
      "url": "https://api.sendsational.app/v1"
    }
  ],
  "security": [
    {
      "apiKey": []
    }
  ],
  "tags": [
    {
      "name": "Account",
      "description": "Check that a key works."
    },
    {
      "name": "Contacts",
      "description": "People, their custom fields, tags and consent."
    },
    {
      "name": "Events",
      "description": "What contacts did: the standard store events and your own."
    },
    {
      "name": "Products and orders",
      "description": "Optional objects, stored under your own ids."
    },
    {
      "name": "Webhook endpoints",
      "description": "Where we tell your systems about changes."
    }
  ],
  "paths": {
    "/me": {
      "get": {
        "operationId": "getMe",
        "tags": [
          "Account"
        ],
        "summary": "Check a key",
        "description": "Returns the workspace the key belongs to and what the key may do. A cheap way to check a key works.",
        "responses": {
          "200": {
            "description": "The workspace and the key.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Me"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/contacts": {
      "post": {
        "operationId": "upsertContact",
        "tags": [
          "Contacts"
        ],
        "summary": "Create or update a contact",
        "description": "Finds the contact by email address and updates it, or creates it. Fields you leave out keep their stored value. Answers 201 when the contact was created and 200 when it was updated.",
        "x-required-scope": "contacts:write",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ContactUpsert"
              },
              "example": {
                "email": "maya@juniperco.example",
                "first_name": "Maya",
                "properties": {
                  "favourite_collection": "Linen"
                },
                "add_tags": [
                  "vip"
                ],
                "consent": {
                  "email": {
                    "status": "subscribed",
                    "source": "signup_form"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The contact was updated.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Contact"
                }
              }
            }
          },
          "201": {
            "description": "The contact was created.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Contact"
                }
              }
            }
          },
          "400": {
            "description": "The body is not valid JSON.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "description": "The first request with this Idempotency-Key is still running.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "A field was refused.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "get": {
        "operationId": "listContacts",
        "tags": [
          "Contacts"
        ],
        "summary": "List contacts",
        "description": "Newest first, a page at a time. To look one contact up by address, pass email.",
        "x-required-scope": "contacts:read",
        "parameters": [
          {
            "name": "email",
            "in": "query",
            "required": false,
            "description": "Only the contact with this address.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "external_id",
            "in": "query",
            "required": false,
            "description": "Only the contact with this external id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "tag",
            "in": "query",
            "required": false,
            "description": "Only contacts with this tag.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "How many to return, 1 to 200.",
            "schema": {
              "default": 50,
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "The next_cursor from the previous page.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page of contacts.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContactList"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/contacts/bulk": {
      "post": {
        "operationId": "bulkUpsertContacts",
        "tags": [
          "Contacts"
        ],
        "summary": "Create or update many contacts",
        "description": "Up to 500 contacts in one request, each handled like a single create or update. A contact that is refused does not stop the others: check results for each one. The whole request counts once against the rate limit.",
        "x-required-scope": "contacts:write",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ContactBulkUpsert"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "One result per contact, in the order sent.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContactBulkResult"
                }
              }
            }
          },
          "400": {
            "description": "The body is not valid JSON.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "description": "The first request with this Idempotency-Key is still running.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The request itself was refused, for example more than 500 contacts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/contacts/{id}": {
      "get": {
        "operationId": "getContact",
        "tags": [
          "Contacts"
        ],
        "summary": "Get a contact",
        "x-required-scope": "contacts:read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The contact's id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The contact.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Contact"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "No contact has this id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "patch": {
        "operationId": "updateContact",
        "tags": [
          "Contacts"
        ],
        "summary": "Update a contact by id",
        "description": "Changes the fields you send. This is the way to change a contact's email address.",
        "x-required-scope": "contacts:write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The contact's id.",
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ContactUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The contact after the change.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Contact"
                }
              }
            }
          },
          "400": {
            "description": "The body is not valid JSON.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "No contact has this id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Another contact already has the new email address.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "A field was refused.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "delete": {
        "operationId": "deleteContact",
        "tags": [
          "Contacts"
        ],
        "summary": "Delete a contact",
        "description": "Removes the contact with its consent history and events. Orders are kept without the contact. If the address had bounced or complained it stays on the suppression list, so it is not emailed if it is added again.",
        "x-required-scope": "contacts:write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The contact's id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "No contact has this id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/events": {
      "post": {
        "operationId": "trackEvent",
        "tags": [
          "Events"
        ],
        "summary": "Track an event",
        "description": "Records something a contact did. The five standard store events are checked for their required properties; any other name is a custom event and is stored as sent. Answers 201 for a new event and 200 when the same event was already stored.",
        "x-required-scope": "events:write",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EventTrack"
              },
              "example": {
                "name": "order_placed",
                "contact": {
                  "email": "maya@juniperco.example"
                },
                "id": "order-1001-placed",
                "occurred_at": "2026-11-24T15:04:05Z",
                "properties": {
                  "order_id": "1001",
                  "total": 84.5,
                  "currency": "USD",
                  "items": [
                    {
                      "product_id": "mug-oat",
                      "title": "Oat glaze mug",
                      "quantity": 2,
                      "price": 28
                    }
                  ]
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "This event was already stored.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Event"
                }
              }
            }
          },
          "201": {
            "description": "The event was stored.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Event"
                }
              }
            }
          },
          "400": {
            "description": "The body is not valid JSON.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "description": "The first request with this Idempotency-Key is still running.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "A field was refused, or no contact matches.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/events/bulk": {
      "post": {
        "operationId": "bulkTrackEvents",
        "tags": [
          "Events"
        ],
        "summary": "Track many events",
        "description": "Up to 500 events in one request. An event that is refused does not stop the others. The whole request counts once against the rate limit.",
        "x-required-scope": "events:write",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EventBulkTrack"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "One result per event, in the order sent.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EventBulkResult"
                }
              }
            }
          },
          "400": {
            "description": "The body is not valid JSON.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "description": "The first request with this Idempotency-Key is still running.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The request itself was refused, for example more than 500 events.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/products/{id}": {
      "put": {
        "operationId": "putProduct",
        "tags": [
          "Products and orders"
        ],
        "summary": "Create or replace a product",
        "description": "Stores a product under your own id, for product blocks and recommendations in emails. Optional: events work without it.",
        "x-required-scope": "products:write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Your id for the product. URL-encode it.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProductPut"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The product was replaced.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Product"
                }
              }
            }
          },
          "201": {
            "description": "The product was created.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Product"
                }
              }
            }
          },
          "400": {
            "description": "The body is not valid JSON.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "description": "A field was refused.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "get": {
        "operationId": "getProduct",
        "tags": [
          "Products and orders"
        ],
        "summary": "Get a product",
        "x-required-scope": "products:read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Your id for the product. URL-encode it.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The product.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Product"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "No product has this id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/orders/{id}": {
      "put": {
        "operationId": "putOrder",
        "tags": [
          "Products and orders"
        ],
        "summary": "Create or replace an order",
        "description": "Stores an order under your own id without recording an event. Use it to load past orders or to correct one. For a new order, send an order_placed event instead: it stores the order and can start flows.",
        "x-required-scope": "orders:write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Your id for the order. URL-encode it.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OrderPut"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The order was replaced.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Order"
                }
              }
            }
          },
          "201": {
            "description": "The order was created.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Order"
                }
              }
            }
          },
          "400": {
            "description": "The body is not valid JSON.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "description": "A field was refused, or no contact matches.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "get": {
        "operationId": "getOrder",
        "tags": [
          "Products and orders"
        ],
        "summary": "Get an order",
        "x-required-scope": "orders:read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Your id for the order. URL-encode it.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The order.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Order"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "No order has this id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/webhook_endpoints": {
      "post": {
        "operationId": "createWebhookEndpoint",
        "tags": [
          "Webhook endpoints"
        ],
        "summary": "Add a webhook endpoint",
        "description": "We will POST the chosen events to this address, signed. The signing secret is in this response and is never shown again: it is not stored in readable form, so a replay of this request with the same Idempotency-Key returns the endpoint with secret set to null. If you lost the secret, remove the endpoint and add it again.",
        "x-required-scope": "webhooks:write",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEndpointCreate"
              },
              "example": {
                "url": "https://juniperco.example/hooks/sendsational",
                "events": [
                  "contact.unsubscribed",
                  "email.bounced",
                  "email.complained"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The endpoint, with its signing secret.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookEndpointCreated"
                }
              }
            }
          },
          "400": {
            "description": "The body is not valid JSON.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "description": "The first request with this Idempotency-Key is still running.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The address or an event type was refused.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "get": {
        "operationId": "listWebhookEndpoints",
        "tags": [
          "Webhook endpoints"
        ],
        "summary": "List webhook endpoints",
        "x-required-scope": "webhooks:read",
        "responses": {
          "200": {
            "description": "Every endpoint of the workspace.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookEndpointList"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/webhook_endpoints/{id}": {
      "get": {
        "operationId": "getWebhookEndpoint",
        "tags": [
          "Webhook endpoints"
        ],
        "summary": "Get a webhook endpoint",
        "x-required-scope": "webhooks:read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The endpoint's id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The endpoint.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookEndpoint"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "No endpoint has this id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "patch": {
        "operationId": "updateWebhookEndpoint",
        "tags": [
          "Webhook endpoints"
        ],
        "summary": "Change a webhook endpoint",
        "description": "Change the address or the events, or switch the endpoint off and on. An endpoint we switched off after two days of failures is switched back on here.",
        "x-required-scope": "webhooks:write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The endpoint's id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEndpointUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The endpoint after the change.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookEndpoint"
                }
              }
            }
          },
          "400": {
            "description": "The body is not valid JSON.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "No endpoint has this id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The address or an event type was refused.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "delete": {
        "operationId": "deleteWebhookEndpoint",
        "tags": [
          "Webhook endpoints"
        ],
        "summary": "Remove a webhook endpoint",
        "x-required-scope": "webhooks:write",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The endpoint's id.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Removed. Deliveries still waiting for it are dropped.",
            "headers": {
              "X-Request-Id": {
                "$ref": "#/components/headers/X-Request-Id"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "No endpoint has this id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    }
  },
  "webhooks": {
    "contact.subscribed": {
      "post": {
        "operationId": "onContactSubscribed",
        "summary": "Subscribed",
        "description": "Sent to your endpoint as a POST with type \"contact.subscribed\". Answer with any 2xx status within 10 seconds.",
        "parameters": [
          {
            "$ref": "#/components/parameters/webhook-id"
          },
          {
            "$ref": "#/components/parameters/webhook-timestamp"
          },
          {
            "$ref": "#/components/parameters/webhook-signature"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookPayload"
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Received. Anything else is retried."
          }
        }
      }
    },
    "contact.unsubscribed": {
      "post": {
        "operationId": "onContactUnsubscribed",
        "summary": "Unsubscribed",
        "description": "Sent to your endpoint as a POST with type \"contact.unsubscribed\". Answer with any 2xx status within 10 seconds.",
        "parameters": [
          {
            "$ref": "#/components/parameters/webhook-id"
          },
          {
            "$ref": "#/components/parameters/webhook-timestamp"
          },
          {
            "$ref": "#/components/parameters/webhook-signature"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookPayload"
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Received. Anything else is retried."
          }
        }
      }
    },
    "contact.consent_changed": {
      "post": {
        "operationId": "onContactConsentChanged",
        "summary": "Consent changed",
        "description": "Sent to your endpoint as a POST with type \"contact.consent_changed\". Answer with any 2xx status within 10 seconds.",
        "parameters": [
          {
            "$ref": "#/components/parameters/webhook-id"
          },
          {
            "$ref": "#/components/parameters/webhook-timestamp"
          },
          {
            "$ref": "#/components/parameters/webhook-signature"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookPayload"
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Received. Anything else is retried."
          }
        }
      }
    },
    "email.bounced": {
      "post": {
        "operationId": "onEmailBounced",
        "summary": "Bounced",
        "description": "Sent to your endpoint as a POST with type \"email.bounced\". Answer with any 2xx status within 10 seconds.",
        "parameters": [
          {
            "$ref": "#/components/parameters/webhook-id"
          },
          {
            "$ref": "#/components/parameters/webhook-timestamp"
          },
          {
            "$ref": "#/components/parameters/webhook-signature"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookPayload"
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Received. Anything else is retried."
          }
        }
      }
    },
    "email.complained": {
      "post": {
        "operationId": "onEmailComplained",
        "summary": "Complained",
        "description": "Sent to your endpoint as a POST with type \"email.complained\". Answer with any 2xx status within 10 seconds.",
        "parameters": [
          {
            "$ref": "#/components/parameters/webhook-id"
          },
          {
            "$ref": "#/components/parameters/webhook-timestamp"
          },
          {
            "$ref": "#/components/parameters/webhook-signature"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookPayload"
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Received. Anything else is retried."
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "apiKey": {
        "type": "http",
        "scheme": "bearer",
        "description": "An API key from Settings, API keys. It starts with ss_live_ and is shown once, when it is created."
      }
    },
    "parameters": {
      "IdempotencyKey": {
        "name": "Idempotency-Key",
        "in": "header",
        "required": false,
        "description": "Any unique text, such as a UUID. A repeat of the same request with the same key returns the first answer instead of doing the work twice.",
        "schema": {
          "type": "string",
          "minLength": 1,
          "maxLength": 255
        }
      },
      "webhook-id": {
        "name": "webhook-id",
        "in": "header",
        "required": true,
        "description": "The event's id. The same on every retry.",
        "schema": {
          "type": "string"
        }
      },
      "webhook-timestamp": {
        "name": "webhook-timestamp",
        "in": "header",
        "required": true,
        "description": "When this attempt was sent, in Unix seconds. Refuse anything older than five minutes.",
        "schema": {
          "type": "string"
        }
      },
      "webhook-signature": {
        "name": "webhook-signature",
        "in": "header",
        "required": true,
        "description": "One or more space-separated signatures, each \"v1,\" followed by the base64 HMAC-SHA256 of \"{webhook-id}.{webhook-timestamp}.{body}\" with your endpoint's secret.",
        "schema": {
          "type": "string"
        }
      }
    },
    "headers": {
      "X-Request-Id": {
        "description": "Identifies this request. Quote it when asking for help.",
        "schema": {
          "type": "string"
        }
      },
      "Retry-After": {
        "description": "Seconds to wait before trying again.",
        "schema": {
          "type": "integer"
        }
      }
    },
    "responses": {
      "Unauthorized": {
        "description": "The API key is missing, not valid, or revoked.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "Forbidden": {
        "description": "The API key does not have the scope this request needs.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "RateLimited": {
        "description": "Too many requests for this key in the current minute.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        },
        "headers": {
          "Retry-After": {
            "$ref": "#/components/headers/Retry-After"
          }
        }
      }
    },
    "schemas": {
      "Contact": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "email": {
            "type": "string",
            "format": "email",
            "description": "Always lower-case."
          },
          "external_id": {
            "description": "Your own id for this person, if you gave one.",
            "type": [
              "string",
              "null"
            ]
          },
          "first_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "last_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "phone": {
            "type": [
              "string",
              "null"
            ]
          },
          "properties": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {
              "type": [
                "string",
                "number",
                "boolean"
              ]
            },
            "description": "Custom fields."
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Sorted alphabetically, without regard to case."
          },
          "consent": {
            "type": "object",
            "properties": {
              "email": {
                "type": "object",
                "properties": {
                  "status": {
                    "type": "string",
                    "enum": [
                      "subscribed",
                      "unsubscribed",
                      "never_subscribed"
                    ]
                  },
                  "source": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "changed_at": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "date-time",
                        "description": "ISO 8601, for example 2026-11-24T15:04:05Z."
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "description": "When the person made the choice."
                  }
                },
                "required": [
                  "status",
                  "source",
                  "changed_at"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "email"
            ],
            "additionalProperties": false
          },
          "suppression": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "reason": {
                    "type": "string",
                    "enum": [
                      "bounced",
                      "complained",
                      "manual"
                    ]
                  },
                  "created_at": {
                    "type": "string",
                    "format": "date-time",
                    "description": "ISO 8601, for example 2026-11-24T15:04:05Z."
                  }
                },
                "required": [
                  "reason",
                  "created_at"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ],
            "description": "Set when the address must not be emailed whatever the consent says: it bounced, complained, or was blocked by hand."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "ISO 8601, for example 2026-11-24T15:04:05Z."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "ISO 8601, for example 2026-11-24T15:04:05Z."
          }
        },
        "required": [
          "id",
          "email",
          "external_id",
          "first_name",
          "last_name",
          "phone",
          "properties",
          "tags",
          "consent",
          "suppression",
          "created_at",
          "updated_at"
        ],
        "additionalProperties": false
      },
      "ContactBulkResult": {
        "type": "object",
        "properties": {
          "results": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "status": {
                  "type": "string",
                  "enum": [
                    "created",
                    "updated",
                    "error"
                  ]
                },
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "email": {
                  "type": "string"
                },
                "error": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "details": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "field": {
                            "type": "string",
                            "description": "Dotted path to the field, for example consent.email.status."
                          },
                          "code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "field",
                          "code",
                          "message"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "code",
                    "message"
                  ],
                  "additionalProperties": false
                }
              },
              "required": [
                "status"
              ],
              "additionalProperties": false
            },
            "description": "One entry per contact sent, in the same order."
          },
          "summary": {
            "type": "object",
            "properties": {
              "created": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              "updated": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              "errors": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              }
            },
            "required": [
              "created",
              "updated",
              "errors"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "results",
          "summary"
        ],
        "additionalProperties": false
      },
      "ContactBulkUpsert": {
        "type": "object",
        "properties": {
          "contacts": {
            "minItems": 1,
            "maxItems": 500,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ContactUpsert"
            },
            "description": "1 to 500 contacts. Two entries with the same address are merged."
          }
        },
        "required": [
          "contacts"
        ],
        "additionalProperties": false
      },
      "ContactList": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Contact"
            }
          },
          "next_cursor": {
            "description": "Pass as cursor to get the next page. Null on the last page.",
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "data",
          "next_cursor"
        ],
        "additionalProperties": false
      },
      "ContactUpdate": {
        "type": "object",
        "properties": {
          "email": {
            "description": "A new address for this contact. Consent, tags and fields stay with the contact.",
            "type": "string",
            "maxLength": 254,
            "format": "email",
            "example": "maya@juniperco.example"
          },
          "external_id": {
            "description": "Your own id for this person, such as a customer id. Unique in the workspace. Send null to clear it.",
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ]
          },
          "first_name": {
            "description": "First name. Send null to clear it.",
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              {
                "type": "null"
              }
            ]
          },
          "last_name": {
            "description": "Last name. Send null to clear it.",
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              {
                "type": "null"
              }
            ]
          },
          "phone": {
            "description": "Phone number, stored as sent. It carries no consent. Send null to clear it.",
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 40
              },
              {
                "type": "null"
              }
            ]
          },
          "properties": {
            "type": "object",
            "propertyNames": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9_]{0,63}$"
            },
            "additionalProperties": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 1000
                },
                {
                  "type": "number"
                },
                {
                  "type": "boolean"
                },
                {
                  "type": "null"
                }
              ]
            },
            "description": "Custom fields, merged into the ones already stored. Values are text, numbers or true/false. A field keeps the type of the first value it was given. Send null to remove a field.",
            "example": {
              "favourite_collection": "Linen",
              "lifetime_value": 812.5
            }
          },
          "add_tags": {
            "description": "Tags to add. Tags are case-sensitive.",
            "maxItems": 100,
            "type": "array",
            "items": {
              "example": "vip",
              "type": "string"
            }
          },
          "remove_tags": {
            "description": "Tags to remove. Removing a tag the contact does not have is fine.",
            "maxItems": 100,
            "type": "array",
            "items": {
              "example": "vip",
              "type": "string"
            }
          },
          "consent": {
            "description": "Consent changes, per channel.",
            "type": "object",
            "properties": {
              "email": {
                "type": "object",
                "properties": {
                  "status": {
                    "type": "string",
                    "enum": [
                      "subscribed",
                      "unsubscribed"
                    ]
                  },
                  "source": {
                    "description": "Where the choice was made, in your own words: \"signup_form\", \"checkout\", \"preference_page\". Defaults to \"api\".",
                    "type": "string",
                    "pattern": "^[a-z0-9][a-z0-9_.:-]{0,63}$"
                  },
                  "occurred_at": {
                    "description": "When the person made the choice. Defaults to now. An older change never overrides a newer one.",
                    "type": "string",
                    "format": "date-time"
                  }
                },
                "required": [
                  "status"
                ],
                "additionalProperties": false,
                "description": "A consent change. It is applied by the consent rules, so the contact in the response shows what the consent is now."
              }
            },
            "additionalProperties": false
          }
        },
        "additionalProperties": false
      },
      "ContactUpsert": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "maxLength": 254,
            "format": "email",
            "example": "maya@juniperco.example",
            "description": "Identifies the contact. Compared without regard to case."
          },
          "external_id": {
            "description": "Your own id for this person, such as a customer id. Unique in the workspace. Send null to clear it.",
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ]
          },
          "first_name": {
            "description": "First name. Send null to clear it.",
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              {
                "type": "null"
              }
            ]
          },
          "last_name": {
            "description": "Last name. Send null to clear it.",
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              {
                "type": "null"
              }
            ]
          },
          "phone": {
            "description": "Phone number, stored as sent. It carries no consent. Send null to clear it.",
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 40
              },
              {
                "type": "null"
              }
            ]
          },
          "properties": {
            "type": "object",
            "propertyNames": {
              "type": "string",
              "pattern": "^[a-z][a-z0-9_]{0,63}$"
            },
            "additionalProperties": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 1000
                },
                {
                  "type": "number"
                },
                {
                  "type": "boolean"
                },
                {
                  "type": "null"
                }
              ]
            },
            "description": "Custom fields, merged into the ones already stored. Values are text, numbers or true/false. A field keeps the type of the first value it was given. Send null to remove a field.",
            "example": {
              "favourite_collection": "Linen",
              "lifetime_value": 812.5
            }
          },
          "add_tags": {
            "description": "Tags to add. Tags are case-sensitive.",
            "maxItems": 100,
            "type": "array",
            "items": {
              "example": "vip",
              "type": "string"
            }
          },
          "remove_tags": {
            "description": "Tags to remove. Removing a tag the contact does not have is fine.",
            "maxItems": 100,
            "type": "array",
            "items": {
              "example": "vip",
              "type": "string"
            }
          },
          "consent": {
            "description": "Consent changes, per channel.",
            "type": "object",
            "properties": {
              "email": {
                "type": "object",
                "properties": {
                  "status": {
                    "type": "string",
                    "enum": [
                      "subscribed",
                      "unsubscribed"
                    ]
                  },
                  "source": {
                    "description": "Where the choice was made, in your own words: \"signup_form\", \"checkout\", \"preference_page\". Defaults to \"api\".",
                    "type": "string",
                    "pattern": "^[a-z0-9][a-z0-9_.:-]{0,63}$"
                  },
                  "occurred_at": {
                    "description": "When the person made the choice. Defaults to now. An older change never overrides a newer one.",
                    "type": "string",
                    "format": "date-time"
                  }
                },
                "required": [
                  "status"
                ],
                "additionalProperties": false,
                "description": "A consent change. It is applied by the consent rules, so the contact in the response shows what the consent is now."
              }
            },
            "additionalProperties": false
          }
        },
        "required": [
          "email"
        ],
        "additionalProperties": false,
        "description": "Fields left out keep their stored value."
      },
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": [
                  "invalid_request",
                  "authentication_error",
                  "permission_error",
                  "not_found",
                  "conflict",
                  "rate_limited",
                  "internal_error"
                ],
                "description": "The family of error. Decide what to do from this."
              },
              "code": {
                "type": "string",
                "description": "The exact error, stable and safe to match on."
              },
              "message": {
                "type": "string",
                "description": "For a person to read. The wording may change."
              },
              "details": {
                "description": "One entry per problem, when the request was refused for its content.",
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "field": {
                      "type": "string",
                      "description": "Dotted path to the field, for example consent.email.status."
                    },
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "field",
                    "code",
                    "message"
                  ],
                  "additionalProperties": false
                }
              },
              "request_id": {
                "type": "string",
                "description": "Quote this when asking for help. Also in the X-Request-Id header."
              }
            },
            "required": [
              "type",
              "code",
              "message",
              "request_id"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "error"
        ],
        "additionalProperties": false,
        "description": "Every error has this shape."
      },
      "Event": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "contact_id": {
            "type": "string",
            "format": "uuid"
          },
          "occurred_at": {
            "type": "string",
            "format": "date-time",
            "description": "ISO 8601, for example 2026-11-24T15:04:05Z."
          },
          "duplicate": {
            "type": "boolean",
            "description": "True when this event was already stored and nothing new was recorded."
          }
        },
        "required": [
          "id",
          "name",
          "contact_id",
          "occurred_at",
          "duplicate"
        ],
        "additionalProperties": false
      },
      "EventBulkResult": {
        "type": "object",
        "properties": {
          "results": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "status": {
                  "type": "string",
                  "enum": [
                    "created",
                    "duplicate",
                    "error"
                  ]
                },
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "contact_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "error": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "details": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "field": {
                            "type": "string",
                            "description": "Dotted path to the field, for example consent.email.status."
                          },
                          "code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "field",
                          "code",
                          "message"
                        ],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": [
                    "code",
                    "message"
                  ],
                  "additionalProperties": false
                }
              },
              "required": [
                "status"
              ],
              "additionalProperties": false
            },
            "description": "One entry per event sent, in the same order."
          },
          "summary": {
            "type": "object",
            "properties": {
              "created": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              "duplicates": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              "errors": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              }
            },
            "required": [
              "created",
              "duplicates",
              "errors"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "results",
          "summary"
        ],
        "additionalProperties": false
      },
      "EventBulkTrack": {
        "type": "object",
        "properties": {
          "events": {
            "minItems": 1,
            "maxItems": 500,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EventTrack"
            },
            "description": "1 to 500 events."
          }
        },
        "required": [
          "events"
        ],
        "additionalProperties": false
      },
      "EventTrack": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9_]{0,63}$",
            "description": "One of the standard store events (product_viewed, added_to_cart, checkout_started, order_placed, order_fulfilled) or any name of your own.",
            "example": "order_placed"
          },
          "contact": {
            "type": "object",
            "properties": {
              "id": {
                "description": "The contact's id.",
                "type": "string",
                "format": "uuid"
              },
              "email": {
                "description": "If no contact has this address, one is created with no consent.",
                "type": "string",
                "maxLength": 254,
                "format": "email",
                "example": "maya@juniperco.example"
              },
              "external_id": {
                "description": "Your own id for the contact.",
                "type": "string",
                "minLength": 1,
                "maxLength": 255
              }
            },
            "additionalProperties": false,
            "description": "Which contact. Give exactly one of id, email or external_id."
          },
          "properties": {
            "description": "Anything about the event. The standard store events have required properties; see the docs.",
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {}
          },
          "occurred_at": {
            "description": "When it happened. Defaults to now.",
            "type": "string",
            "format": "date-time"
          },
          "id": {
            "description": "Your own id for the event. An event with the same id and occurred_at is stored once, so send both to make a retry safe.",
            "type": "string",
            "minLength": 1,
            "maxLength": 255
          }
        },
        "required": [
          "name",
          "contact"
        ],
        "additionalProperties": false
      },
      "Me": {
        "type": "object",
        "properties": {
          "workspace": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "name"
            ],
            "additionalProperties": false
          },
          "api_key": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "format": "uuid"
              },
              "name": {
                "type": "string"
              },
              "scopes": {
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "contacts:read",
                    "contacts:write",
                    "events:write",
                    "orders:read",
                    "orders:write",
                    "products:read",
                    "products:write",
                    "webhooks:read",
                    "webhooks:write"
                  ]
                }
              },
              "rate_limit_per_minute": {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              }
            },
            "required": [
              "id",
              "name",
              "scopes",
              "rate_limit_per_minute"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "workspace",
          "api_key"
        ],
        "additionalProperties": false
      },
      "Order": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Your id for the order."
          },
          "contact_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "email": {
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "placed",
              "fulfilled",
              "canceled",
              "refunded"
            ]
          },
          "total": {
            "type": "number"
          },
          "currency": {
            "type": "string"
          },
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "propertyNames": {
                "type": "string"
              },
              "additionalProperties": {}
            }
          },
          "properties": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {}
          },
          "placed_at": {
            "type": "string",
            "format": "date-time",
            "description": "ISO 8601, for example 2026-11-24T15:04:05Z."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "ISO 8601, for example 2026-11-24T15:04:05Z."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "ISO 8601, for example 2026-11-24T15:04:05Z."
          }
        },
        "required": [
          "id",
          "contact_id",
          "email",
          "status",
          "total",
          "currency",
          "items",
          "properties",
          "placed_at",
          "created_at",
          "updated_at"
        ],
        "additionalProperties": false
      },
      "OrderPut": {
        "type": "object",
        "properties": {
          "contact": {
            "type": "object",
            "properties": {
              "id": {
                "description": "The contact's id.",
                "type": "string",
                "format": "uuid"
              },
              "email": {
                "description": "If no contact has this address, one is created with no consent.",
                "type": "string",
                "maxLength": 254,
                "format": "email",
                "example": "maya@juniperco.example"
              },
              "external_id": {
                "description": "Your own id for the contact.",
                "type": "string",
                "minLength": 1,
                "maxLength": 255
              }
            },
            "additionalProperties": false,
            "description": "Which contact. Give exactly one of id, email or external_id."
          },
          "total": {
            "type": "number",
            "minimum": 0,
            "description": "A decimal number in the currency's main unit: 12.5, not 1250."
          },
          "currency": {
            "example": "USD",
            "type": "string",
            "pattern": "^[A-Za-z]{3}$"
          },
          "status": {
            "description": "Defaults to \"placed\".",
            "type": "string",
            "enum": [
              "placed",
              "fulfilled",
              "canceled",
              "refunded"
            ]
          },
          "items": {
            "maxItems": 500,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "product_id": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 255,
                  "description": "Your id for the product."
                },
                "title": {
                  "type": "string",
                  "maxLength": 500
                },
                "quantity": {
                  "description": "Defaults to 1.",
                  "type": "integer",
                  "exclusiveMinimum": 0,
                  "maximum": 9007199254740991
                },
                "price": {
                  "description": "Price of one unit.",
                  "type": "number",
                  "minimum": 0
                }
              },
              "required": [
                "product_id"
              ],
              "additionalProperties": {},
              "description": "One line of a cart, checkout or order. Extra properties are kept."
            }
          },
          "placed_at": {
            "description": "When the order was placed. Defaults to now for a new order.",
            "type": "string",
            "format": "date-time"
          },
          "properties": {
            "description": "Anything else about the order.",
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {}
          }
        },
        "required": [
          "contact",
          "total",
          "currency"
        ],
        "additionalProperties": false,
        "description": "The whole order. This stores the order without recording an event; send order_placed to do both."
      },
      "Product": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Your id for the product."
          },
          "title": {
            "type": "string"
          },
          "url": {
            "type": [
              "string",
              "null"
            ]
          },
          "image_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "price": {
            "type": [
              "number",
              "null"
            ]
          },
          "currency": {
            "type": [
              "string",
              "null"
            ]
          },
          "categories": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "available": {
            "type": "boolean"
          },
          "properties": {
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {}
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "ISO 8601, for example 2026-11-24T15:04:05Z."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "ISO 8601, for example 2026-11-24T15:04:05Z."
          }
        },
        "required": [
          "id",
          "title",
          "url",
          "image_url",
          "price",
          "currency",
          "categories",
          "available",
          "properties",
          "created_at",
          "updated_at"
        ],
        "additionalProperties": false
      },
      "ProductPut": {
        "type": "object",
        "properties": {
          "title": {
            "type": "string",
            "minLength": 1,
            "maxLength": 500
          },
          "url": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 2000,
                "format": "uri"
              },
              {
                "type": "null"
              }
            ]
          },
          "image_url": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 2000,
                "format": "uri"
              },
              {
                "type": "null"
              }
            ]
          },
          "price": {
            "anyOf": [
              {
                "type": "number",
                "minimum": 0,
                "description": "A decimal number in the currency's main unit: 12.5, not 1250."
              },
              {
                "type": "null"
              }
            ]
          },
          "currency": {
            "anyOf": [
              {
                "example": "USD",
                "type": "string",
                "pattern": "^[A-Za-z]{3}$"
              },
              {
                "type": "null"
              }
            ]
          },
          "categories": {
            "maxItems": 50,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          },
          "available": {
            "description": "False when it cannot be bought now. Defaults to true.",
            "type": "boolean"
          },
          "properties": {
            "description": "Anything else about the product.",
            "type": "object",
            "propertyNames": {
              "type": "string"
            },
            "additionalProperties": {}
          }
        },
        "required": [
          "title"
        ],
        "additionalProperties": false,
        "description": "The whole product. Fields left out go back to their defaults."
      },
      "WebhookEndpoint": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "url": {
            "type": "string"
          },
          "events": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "contact.subscribed",
                "contact.unsubscribed",
                "contact.consent_changed",
                "email.bounced",
                "email.complained"
              ]
            }
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "enabled",
              "disabled"
            ]
          },
          "disabled_reason": {
            "type": [
              "string",
              "null"
            ]
          },
          "last_success_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "description": "ISO 8601, for example 2026-11-24T15:04:05Z."
              },
              {
                "type": "null"
              }
            ]
          },
          "last_failure_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "description": "ISO 8601, for example 2026-11-24T15:04:05Z."
              },
              {
                "type": "null"
              }
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "ISO 8601, for example 2026-11-24T15:04:05Z."
          }
        },
        "required": [
          "id",
          "url",
          "events",
          "description",
          "status",
          "disabled_reason",
          "last_success_at",
          "last_failure_at",
          "created_at"
        ],
        "additionalProperties": false
      },
      "WebhookEndpointCreate": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "maxLength": 2000,
            "description": "Where to send events. Must be https.",
            "example": "https://juniperco.example/hooks/sendsational"
          },
          "events": {
            "minItems": 1,
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "contact.subscribed",
                "contact.unsubscribed",
                "contact.consent_changed",
                "email.bounced",
                "email.complained"
              ]
            },
            "description": "The event types to send."
          },
          "description": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 200
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "url",
          "events"
        ],
        "additionalProperties": false
      },
      "WebhookEndpointCreated": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "url": {
            "type": "string"
          },
          "events": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "contact.subscribed",
                "contact.unsubscribed",
                "contact.consent_changed",
                "email.bounced",
                "email.complained"
              ]
            }
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "enabled",
              "disabled"
            ]
          },
          "disabled_reason": {
            "type": [
              "string",
              "null"
            ]
          },
          "last_success_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "description": "ISO 8601, for example 2026-11-24T15:04:05Z."
              },
              {
                "type": "null"
              }
            ]
          },
          "last_failure_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "description": "ISO 8601, for example 2026-11-24T15:04:05Z."
              },
              {
                "type": "null"
              }
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "ISO 8601, for example 2026-11-24T15:04:05Z."
          },
          "secret": {
            "description": "The signing secret. Shown only in the first answer: store it now. Null when this answer is a replay for a repeated Idempotency-Key, because the secret can no longer be shown.",
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "url",
          "events",
          "description",
          "status",
          "disabled_reason",
          "last_success_at",
          "last_failure_at",
          "created_at",
          "secret"
        ],
        "additionalProperties": false
      },
      "WebhookEndpointList": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WebhookEndpoint"
            }
          }
        },
        "required": [
          "data"
        ],
        "additionalProperties": false
      },
      "WebhookEndpointUpdate": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "maxLength": 2000
          },
          "events": {
            "minItems": 1,
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "contact.subscribed",
                "contact.unsubscribed",
                "contact.consent_changed",
                "email.bounced",
                "email.complained"
              ]
            }
          },
          "description": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 200
              },
              {
                "type": "null"
              }
            ]
          },
          "status": {
            "description": "Switch the endpoint off or back on.",
            "type": "string",
            "enum": [
              "enabled",
              "disabled"
            ]
          }
        },
        "additionalProperties": false
      },
      "WebhookPayload": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The event's id, also in the webhook-id header. The same on every retry: use it to ignore repeats."
          },
          "type": {
            "type": "string",
            "enum": [
              "contact.subscribed",
              "contact.unsubscribed",
              "contact.consent_changed",
              "email.bounced",
              "email.complained"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "ISO 8601, for example 2026-11-24T15:04:05Z."
          },
          "workspace_id": {
            "type": "string"
          },
          "test": {
            "description": "True for a sample event sent from the app.",
            "type": "boolean"
          },
          "data": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "contact": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "email": {
                        "type": "string"
                      },
                      "external_id": {
                        "type": [
                          "string",
                          "null"
                        ]
                      }
                    },
                    "required": [
                      "id",
                      "email",
                      "external_id"
                    ],
                    "additionalProperties": false
                  },
                  "consent": {
                    "type": "object",
                    "properties": {
                      "channel": {
                        "type": "string",
                        "const": "email"
                      },
                      "status": {
                        "type": "string",
                        "enum": [
                          "subscribed",
                          "unsubscribed"
                        ]
                      },
                      "previous_status": {
                        "type": "string",
                        "enum": [
                          "subscribed",
                          "unsubscribed",
                          "never_subscribed"
                        ]
                      },
                      "source": {
                        "type": "string",
                        "description": "Where the change came from. Use it to ignore changes your own system sent."
                      },
                      "occurred_at": {
                        "type": "string",
                        "format": "date-time",
                        "description": "ISO 8601, for example 2026-11-24T15:04:05Z."
                      }
                    },
                    "required": [
                      "channel",
                      "status",
                      "previous_status",
                      "source",
                      "occurred_at"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "contact",
                  "consent"
                ],
                "additionalProperties": false,
                "description": "For contact.subscribed, contact.unsubscribed and contact.consent_changed."
              },
              {
                "type": "object",
                "properties": {
                  "contact": {
                    "anyOf": [
                      {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "email": {
                            "type": "string"
                          },
                          "external_id": {
                            "type": [
                              "string",
                              "null"
                            ]
                          }
                        },
                        "required": [
                          "id",
                          "email",
                          "external_id"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "email": {
                    "type": "string"
                  },
                  "message_id": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "uuid"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "occurred_at": {
                    "type": "string",
                    "format": "date-time",
                    "description": "ISO 8601, for example 2026-11-24T15:04:05Z."
                  },
                  "suppressed": {
                    "type": "boolean",
                    "description": "True when the address was added to the suppression list."
                  },
                  "bounce": {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "enum": [
                          "hard",
                          "blocked"
                        ]
                      },
                      "category": {
                        "type": [
                          "string",
                          "null"
                        ]
                      }
                    },
                    "required": [
                      "kind",
                      "category"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "contact",
                  "email",
                  "message_id",
                  "occurred_at",
                  "suppressed"
                ],
                "additionalProperties": false,
                "description": "For email.bounced and email.complained."
              }
            ]
          }
        },
        "required": [
          "id",
          "type",
          "created_at",
          "workspace_id",
          "data"
        ],
        "additionalProperties": false,
        "description": "The body of every webhook request we send."
      }
    }
  },
  "x-scopes": {
    "contacts:read": "Read contacts",
    "contacts:write": "Add and change contacts",
    "events:write": "Send events",
    "orders:read": "Read orders",
    "orders:write": "Add and change orders",
    "products:read": "Read products",
    "products:write": "Add and change products",
    "webhooks:read": "Read webhook endpoints",
    "webhooks:write": "Manage webhook endpoints"
  },
  "x-standard-events": {
    "product_viewed": {
      "type": "object",
      "properties": {
        "product_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 255,
          "description": "Your id for the product."
        },
        "title": {
          "type": "string",
          "maxLength": 500
        },
        "url": {
          "type": "string",
          "maxLength": 2000,
          "format": "uri"
        },
        "image_url": {
          "type": "string",
          "maxLength": 2000,
          "format": "uri"
        },
        "price": {
          "type": "number",
          "minimum": 0
        },
        "currency": {
          "type": "string",
          "pattern": "^[A-Za-z]{3}$"
        },
        "categories": {
          "maxItems": 50,
          "type": "array",
          "items": {
            "type": "string",
            "maxLength": 200
          }
        }
      },
      "required": [
        "product_id"
      ],
      "additionalProperties": {}
    },
    "added_to_cart": {
      "type": "object",
      "properties": {
        "product_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 255,
          "description": "Your id for the product."
        },
        "quantity": {
          "description": "Defaults to 1.",
          "type": "integer",
          "exclusiveMinimum": 0,
          "maximum": 9007199254740991
        },
        "title": {
          "type": "string",
          "maxLength": 500
        },
        "price": {
          "type": "number",
          "minimum": 0
        },
        "currency": {
          "type": "string",
          "pattern": "^[A-Za-z]{3}$"
        },
        "cart_url": {
          "description": "Where the person can pick the cart up again.",
          "type": "string",
          "maxLength": 2000,
          "format": "uri"
        }
      },
      "required": [
        "product_id"
      ],
      "additionalProperties": {}
    },
    "checkout_started": {
      "type": "object",
      "properties": {
        "checkout_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 255,
          "description": "Your id for the checkout."
        },
        "total": {
          "type": "number",
          "minimum": 0
        },
        "currency": {
          "type": "string",
          "pattern": "^[A-Za-z]{3}$"
        },
        "items": {
          "maxItems": 500,
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "product_id": {
                "type": "string",
                "minLength": 1,
                "maxLength": 255,
                "description": "Your id for the product."
              },
              "title": {
                "type": "string",
                "maxLength": 500
              },
              "quantity": {
                "description": "Defaults to 1.",
                "type": "integer",
                "exclusiveMinimum": 0,
                "maximum": 9007199254740991
              },
              "price": {
                "description": "Price of one unit.",
                "type": "number",
                "minimum": 0
              }
            },
            "required": [
              "product_id"
            ],
            "additionalProperties": {},
            "description": "One line of a cart, checkout or order. Extra properties are kept."
          }
        },
        "checkout_url": {
          "description": "Where the person can finish the checkout.",
          "type": "string",
          "maxLength": 2000,
          "format": "uri"
        }
      },
      "required": [
        "checkout_id",
        "total",
        "currency"
      ],
      "additionalProperties": {}
    },
    "order_placed": {
      "type": "object",
      "properties": {
        "order_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 255,
          "description": "Your id for the order. The order is stored under it."
        },
        "total": {
          "type": "number",
          "minimum": 0
        },
        "currency": {
          "type": "string",
          "pattern": "^[A-Za-z]{3}$"
        },
        "items": {
          "maxItems": 500,
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "product_id": {
                "type": "string",
                "minLength": 1,
                "maxLength": 255,
                "description": "Your id for the product."
              },
              "title": {
                "type": "string",
                "maxLength": 500
              },
              "quantity": {
                "description": "Defaults to 1.",
                "type": "integer",
                "exclusiveMinimum": 0,
                "maximum": 9007199254740991
              },
              "price": {
                "description": "Price of one unit.",
                "type": "number",
                "minimum": 0
              }
            },
            "required": [
              "product_id"
            ],
            "additionalProperties": {},
            "description": "One line of a cart, checkout or order. Extra properties are kept."
          }
        }
      },
      "required": [
        "order_id",
        "total",
        "currency"
      ],
      "additionalProperties": {}
    },
    "order_fulfilled": {
      "type": "object",
      "properties": {
        "order_id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 255,
          "description": "Your id for the order."
        },
        "tracking_url": {
          "type": "string",
          "maxLength": 2000,
          "format": "uri"
        },
        "carrier": {
          "type": "string",
          "maxLength": 200
        }
      },
      "required": [
        "order_id"
      ],
      "additionalProperties": {}
    }
  }
}
