{
  "openapi": "3.1.0",
  "info": {
    "title": "Mixpayer Merchant API",
    "version": "2026-11-16",
    "description": "All request fields use camelCase. Webhooks use the documented flat JSON contract. Base URL is shared; API keys and stored resources isolate live and sandbox. Prices use integer minor currency units."
  },
  "servers": [
    {
      "url": "https://api.mixpayer.com"
    }
  ],
  "paths": {
    "/api/v1/merchant/checkout/sessions": {
      "post": {
        "operationId": "post_api_v1_merchant_checkout_sessions",
        "summary": "Create a server-priced checkout session using a numeric priceId from the matching environment",
        "tags": [
          "Merchant API"
        ],
        "security": [
          {
            "MerchantKey": []
          }
        ],
        "responses": {
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/RateLimit"
          },
          "201": {
            "description": "Checkout session created; data.token and data.checkoutUrl are returned",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CheckoutSession"
                    }
                  }
                }
              }
            }
          }
        },
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CheckoutInput"
              },
              "example": {
                "customerId": "user_123",
                "priceId": 22,
                "requestId": "app-order-1001",
                "metadata": {
                  "appOrderId": "1001"
                },
                "successUrl": "https://example.com/payment/success",
                "cancelUrl": "https://example.com/payment/canceled"
              }
            }
          }
        }
      }
    },
    "/api/v1/merchant/checkout/sessions/{token}": {
      "get": {
        "operationId": "get_api_v1_merchant_checkout_sessions__token_",
        "summary": "GET /api/v1/merchant/checkout/sessions/{token}",
        "tags": [
          "Merchant API"
        ],
        "security": [
          {
            "MerchantKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful resource read or operation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CheckoutSession"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/RateLimit"
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/api/v1/merchant/checkout/sessions/{token}/simulate-pay": {
      "post": {
        "operationId": "post_api_v1_merchant_checkout_sessions__token__simulate_pay",
        "summary": "POST /api/v1/merchant/checkout/sessions/{token}/simulate-pay",
        "tags": [
          "Merchant API"
        ],
        "security": [
          {
            "MerchantKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful resource read or operation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {}
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/RateLimit"
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "description": "Sandbox key and a matching sandbox resource required. Never contacts an upstream payment provider."
      }
    },
    "/api/v1/merchant/customers/{customerId}/entitlements/{kind}": {
      "get": {
        "operationId": "get_api_v1_merchant_customers__customerId__entitlements__kind_",
        "summary": "GET /api/v1/merchant/customers/{customerId}/entitlements/{kind}",
        "tags": [
          "Merchant API"
        ],
        "security": [
          {
            "MerchantKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful resource read or operation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {}
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/RateLimit"
          }
        },
        "parameters": [
          {
            "name": "customerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "kind",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/api/v1/merchant/customers/{customerId}/entitlements/{kind}/reservations": {
      "post": {
        "operationId": "post_api_v1_merchant_customers__customerId__entitlements__kind__reservations",
        "summary": "POST /api/v1/merchant/customers/{customerId}/entitlements/{kind}/reservations",
        "tags": [
          "Merchant API"
        ],
        "security": [
          {
            "MerchantKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful resource read or operation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {}
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/RateLimit"
          }
        },
        "parameters": [
          {
            "name": "customerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "kind",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/api/v1/merchant/entitlements/reservations/{key}/release": {
      "post": {
        "operationId": "post_api_v1_merchant_entitlements_reservations__key__release",
        "summary": "POST /api/v1/merchant/entitlements/reservations/{key}/release",
        "tags": [
          "Merchant API"
        ],
        "security": [
          {
            "MerchantKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful resource read or operation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {}
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/RateLimit"
          }
        },
        "parameters": [
          {
            "name": "key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/api/v1/merchant/entitlements/reservations/{key}/consume": {
      "post": {
        "operationId": "post_api_v1_merchant_entitlements_reservations__key__consume",
        "summary": "POST /api/v1/merchant/entitlements/reservations/{key}/consume",
        "tags": [
          "Merchant API"
        ],
        "security": [
          {
            "MerchantKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful resource read or operation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {}
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/RateLimit"
          }
        },
        "parameters": [
          {
            "name": "key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/api/v1/merchant/customers/{customerId}/entitlements/{kind}/consume": {
      "post": {
        "operationId": "post_api_v1_merchant_customers__customerId__entitlements__kind__consume",
        "summary": "POST /api/v1/merchant/customers/{customerId}/entitlements/{kind}/consume",
        "tags": [
          "Merchant API"
        ],
        "security": [
          {
            "MerchantKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful resource read or operation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {}
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/RateLimit"
          }
        },
        "parameters": [
          {
            "name": "customerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "kind",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/api/v1/merchant/refunds": {
      "post": {
        "operationId": "post_api_v1_merchant_refunds",
        "summary": "POST /api/v1/merchant/refunds",
        "tags": [
          "Merchant API"
        ],
        "security": [
          {
            "MerchantKey": []
          }
        ],
        "responses": {
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/RateLimit"
          },
          "201": {
            "description": "Successful resource read or operation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {}
                  }
                }
              }
            }
          }
        },
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "reason"
                ],
                "properties": {
                  "orderId": {
                    "type": "integer",
                    "minimum": 1
                  },
                  "orderNo": {
                    "type": "string"
                  },
                  "amountMinor": {
                    "type": "integer",
                    "minimum": 1,
                    "description": "Omit for remaining full amount; integer minor units"
                  },
                  "reason": {
                    "type": "string",
                    "minLength": 5,
                    "maxLength": 255
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/merchant/orders/{orderId}/cancel-subscription": {
      "post": {
        "operationId": "post_api_v1_merchant_orders__orderId__cancel_subscription",
        "summary": "POST /api/v1/merchant/orders/{orderId}/cancel-subscription",
        "tags": [
          "Merchant API"
        ],
        "security": [
          {
            "MerchantKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Subscription with cancelAtPeriodEnd=true. Immediate cancellation is not supported.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {}
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/RateLimit"
          }
        },
        "parameters": [
          {
            "name": "orderId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "mode": {
                    "type": "string",
                    "enum": [
                      "at_period_end"
                    ],
                    "default": "at_period_end"
                  }
                }
              }
            }
          }
        },
        "description": "Schedules cancellation at period end; status remains active during the paid period. Repeating cancellation is idempotent. The order route is a backward-compatible alias; prefer the subscription route."
      }
    },
    "/api/v1/merchant/subscriptions": {
      "get": {
        "operationId": "get_api_v1_merchant_subscriptions",
        "summary": "GET /api/v1/merchant/subscriptions",
        "tags": [
          "Merchant API"
        ],
        "security": [
          {
            "MerchantKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful resource read or operation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {}
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/RateLimit"
          }
        },
        "parameters": []
      }
    },
    "/api/v1/merchant/subscriptions/{id}": {
      "get": {
        "operationId": "get_api_v1_merchant_subscriptions__id_",
        "summary": "GET /api/v1/merchant/subscriptions/{id}",
        "tags": [
          "Merchant API"
        ],
        "security": [
          {
            "MerchantKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful resource read or operation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Subscription"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/RateLimit"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/api/v1/merchant/subscriptions/{id}/cancel": {
      "post": {
        "operationId": "post_api_v1_merchant_subscriptions__id__cancel",
        "summary": "POST /api/v1/merchant/subscriptions/{id}/cancel",
        "tags": [
          "Merchant API"
        ],
        "security": [
          {
            "MerchantKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Subscription with cancelAtPeriodEnd=true. Immediate cancellation is not supported.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Subscription"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/RateLimit"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "mode": {
                    "type": "string",
                    "enum": [
                      "at_period_end"
                    ],
                    "default": "at_period_end"
                  }
                }
              }
            }
          }
        },
        "description": "Schedules cancellation at period end; status remains active during the paid period. Repeating cancellation is idempotent. The order route is a backward-compatible alias; prefer the subscription route."
      }
    },
    "/api/v1/merchant/subscriptions/{id}/resume": {
      "post": {
        "operationId": "post_api_v1_merchant_subscriptions__id__resume",
        "summary": "POST /api/v1/merchant/subscriptions/{id}/resume",
        "tags": [
          "Merchant API"
        ],
        "security": [
          {
            "MerchantKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful resource read or operation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Subscription"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/RateLimit"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/api/v1/merchant/subscriptions/{id}/change-plan": {
      "post": {
        "operationId": "post_api_v1_merchant_subscriptions__id__change_plan",
        "summary": "POST /api/v1/merchant/subscriptions/{id}/change-plan",
        "tags": [
          "Merchant API"
        ],
        "security": [
          {
            "MerchantKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful resource read or operation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Subscription"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/RateLimit"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/api/v1/merchant/subscriptions/{id}/switch-collection-price": {
      "post": {
        "operationId": "post_api_v1_merchant_subscriptions__id__switch_collection_price",
        "summary": "POST /api/v1/merchant/subscriptions/{id}/switch-collection-price",
        "tags": [
          "Merchant API"
        ],
        "security": [
          {
            "MerchantKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful resource read or operation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Subscription"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/RateLimit"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/api/v1/merchant/customers/{customerId}/licenses": {
      "get": {
        "operationId": "get_api_v1_merchant_customers__customerId__licenses",
        "summary": "GET /api/v1/merchant/customers/{customerId}/licenses",
        "tags": [
          "Merchant API"
        ],
        "security": [
          {
            "MerchantKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful resource read or operation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {}
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/RateLimit"
          }
        },
        "parameters": [
          {
            "name": "customerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/api/v1/merchant/customers/{customerId}/features": {
      "get": {
        "operationId": "get_api_v1_merchant_customers__customerId__features",
        "summary": "GET /api/v1/merchant/customers/{customerId}/features",
        "tags": [
          "Merchant API"
        ],
        "security": [
          {
            "MerchantKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful resource read or operation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {}
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/RateLimit"
          }
        },
        "parameters": [
          {
            "name": "customerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/api/v1/merchant/licenses/verify": {
      "post": {
        "operationId": "post_api_v1_merchant_licenses_verify",
        "summary": "POST /api/v1/merchant/licenses/verify",
        "tags": [
          "Merchant API"
        ],
        "security": [
          {
            "MerchantKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful resource read or operation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {}
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/RateLimit"
          }
        },
        "parameters": [],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/api/v1/merchant/meters": {
      "get": {
        "operationId": "get_api_v1_merchant_meters",
        "summary": "GET /api/v1/merchant/meters",
        "tags": [
          "Merchant API"
        ],
        "security": [
          {
            "MerchantKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful resource read or operation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {}
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/RateLimit"
          }
        },
        "parameters": []
      },
      "post": {
        "operationId": "post_api_v1_merchant_meters",
        "summary": "POST /api/v1/merchant/meters",
        "tags": [
          "Merchant API"
        ],
        "security": [
          {
            "MerchantKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful resource read or operation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {}
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/RateLimit"
          }
        },
        "parameters": [],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/api/v1/merchant/meters/events": {
      "post": {
        "operationId": "post_api_v1_merchant_meters_events",
        "summary": "POST /api/v1/merchant/meters/events",
        "tags": [
          "Merchant API"
        ],
        "security": [
          {
            "MerchantKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful resource read or operation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {}
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/RateLimit"
          }
        },
        "parameters": [],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/api/v1/merchant/meters/{code}/usage": {
      "get": {
        "operationId": "get_api_v1_merchant_meters__code__usage",
        "summary": "GET /api/v1/merchant/meters/{code}/usage",
        "tags": [
          "Merchant API"
        ],
        "security": [
          {
            "MerchantKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful resource read or operation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {}
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/RateLimit"
          }
        },
        "parameters": [
          {
            "name": "code",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/api/v1/merchant/usage-bills": {
      "get": {
        "operationId": "get_api_v1_merchant_usage_bills",
        "summary": "GET /api/v1/merchant/usage-bills",
        "tags": [
          "Merchant API"
        ],
        "security": [
          {
            "MerchantKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful resource read or operation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {}
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/RateLimit"
          }
        },
        "parameters": []
      }
    },
    "/api/v1/merchant/subscriptions/{id}/close-meter-period": {
      "post": {
        "operationId": "post_api_v1_merchant_subscriptions__id__close_meter_period",
        "summary": "POST /api/v1/merchant/subscriptions/{id}/close-meter-period",
        "tags": [
          "Merchant API"
        ],
        "security": [
          {
            "MerchantKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful resource read or operation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Subscription"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/RateLimit"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/api/v1/merchant/collections": {
      "get": {
        "operationId": "get_api_v1_merchant_collections",
        "summary": "GET /api/v1/merchant/collections",
        "tags": [
          "Merchant API"
        ],
        "security": [
          {
            "MerchantKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful resource read or operation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {}
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/RateLimit"
          }
        },
        "parameters": []
      }
    },
    "/api/v1/merchant/collections/{code}": {
      "get": {
        "operationId": "get_api_v1_merchant_collections__code_",
        "summary": "GET /api/v1/merchant/collections/{code}",
        "tags": [
          "Merchant API"
        ],
        "security": [
          {
            "MerchantKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful resource read or operation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {}
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/RateLimit"
          }
        },
        "parameters": [
          {
            "name": "code",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/api/v1/merchant/portal/sessions": {
      "post": {
        "operationId": "post_api_v1_merchant_portal_sessions",
        "summary": "POST /api/v1/merchant/portal/sessions",
        "tags": [
          "Merchant API"
        ],
        "security": [
          {
            "MerchantKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful resource read or operation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {}
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/RateLimit"
          }
        },
        "parameters": [],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/api/v1/merchant/payment-links": {
      "post": {
        "operationId": "post_api_v1_merchant_payment_links",
        "summary": "POST /api/v1/merchant/payment-links",
        "tags": [
          "Merchant API"
        ],
        "security": [
          {
            "MerchantKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful resource read or operation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {}
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/RateLimit"
          }
        },
        "parameters": [],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/api/v1/merchant/pricing/quote": {
      "post": {
        "operationId": "post_api_v1_merchant_pricing_quote",
        "summary": "POST /api/v1/merchant/pricing/quote",
        "tags": [
          "Merchant API"
        ],
        "security": [
          {
            "MerchantKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful resource read or operation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {}
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/RateLimit"
          }
        },
        "parameters": [],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/api/v1/merchant/analytics/summary": {
      "get": {
        "operationId": "get_api_v1_merchant_analytics_summary",
        "summary": "GET /api/v1/merchant/analytics/summary",
        "tags": [
          "Merchant API"
        ],
        "security": [
          {
            "MerchantKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful resource read or operation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {}
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/RateLimit"
          }
        },
        "parameters": []
      }
    },
    "/api/v1/merchant/invoices": {
      "get": {
        "operationId": "get_api_v1_merchant_invoices",
        "summary": "GET /api/v1/merchant/invoices",
        "tags": [
          "Merchant API"
        ],
        "security": [
          {
            "MerchantKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful resource read or operation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {}
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/RateLimit"
          }
        },
        "parameters": []
      }
    },
    "/api/v1/merchant/disputes": {
      "post": {
        "operationId": "post_api_v1_merchant_disputes",
        "summary": "POST /api/v1/merchant/disputes",
        "tags": [
          "Merchant API"
        ],
        "security": [
          {
            "MerchantKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful resource read or operation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {}
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/RateLimit"
          }
        },
        "parameters": [],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        }
      }
    },
    "/api/v1/merchant/products": {
      "get": {
        "operationId": "get_api_v1_merchant_products",
        "summary": "GET /api/v1/merchant/products",
        "tags": [
          "Merchant API"
        ],
        "security": [
          {
            "MerchantKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful resource read or operation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {}
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/RateLimit"
          }
        },
        "parameters": []
      }
    },
    "/api/v1/merchant/products/{id}/prices": {
      "get": {
        "operationId": "get_api_v1_merchant_products__id__prices",
        "summary": "GET /api/v1/merchant/products/{id}/prices",
        "tags": [
          "Merchant API"
        ],
        "security": [
          {
            "MerchantKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful resource read or operation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {}
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/RateLimit"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/api/v1/merchant/subscriptions/{id}/simulate-renewal": {
      "post": {
        "operationId": "post_api_v1_merchant_subscriptions__id__simulate_renewal",
        "summary": "POST /api/v1/merchant/subscriptions/{id}/simulate-renewal",
        "tags": [
          "Merchant API"
        ],
        "security": [
          {
            "MerchantKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Successful resource read or operation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Subscription"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/RateLimit"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "description": "Sandbox key and a matching sandbox resource required. Never contacts an upstream payment provider."
      }
    },
    "/api/v1/public/checkout/sessions/{token}": {
      "get": {
        "summary": "Read a token-bound checkout resource in any status (including complete)",
        "security": [],
        "parameters": [
          {
            "name": "token",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Resource exists; data.status is open, complete, expired, canceled or failed. GET returns 200 for complete resources.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CheckoutSession"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/public/checkout/sessions/{token}/simulate": {
      "post": {
        "summary": "Complete or cancel a hosted sandbox session without a secret in the browser",
        "security": [],
        "parameters": [
          {
            "name": "token",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "outcome": {
                    "type": "string",
                    "enum": [
                      "success",
                      "declined",
                      "canceled"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated sandbox session"
          },
          "409": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/v1/public/checkout/sessions/{token}/return": {
      "get": {
        "summary": "Get the stored success/cancel URL with server-generated signed query parameters",
        "security": [],
        "parameters": [
          {
            "name": "token",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "data.url contains signed return URL"
          },
          "409": {
            "description": "Session has no final result or configured return URL"
          }
        }
      }
    },
    "/api/v1/public/checkout/sessions/{token}/amount": {
      "post": {
        "summary": "Change the amount of an open, editable custom-amount checkout",
        "security": [],
        "parameters": [
          {
            "name": "token",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "customAmountMinor"
                ],
                "properties": {
                  "customAmountMinor": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 999999999999
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated public checkout snapshot"
          },
          "400": {
            "description": "Integer minor units required"
          },
          "409": {
            "description": "Amount out of range, locked, expired, closed or payment already started"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "MerchantKey": {
        "type": "http",
        "scheme": "bearer",
        "description": "sk_live_\u2026 or sk_test_\u2026; X-Api-Key is also accepted. Never expose secrets in browser code."
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        }
      },
      "CheckoutInput": {
        "type": "object",
        "required": [
          "customerId",
          "priceId"
        ],
        "properties": {
          "customerId": {
            "type": "string"
          },
          "priceId": {
            "type": "integer",
            "minimum": 1
          },
          "requestId": {
            "type": "string",
            "maxLength": 190
          },
          "metadata": {
            "type": "object",
            "maxProperties": 50,
            "additionalProperties": {
              "type": "string",
              "maxLength": 500
            }
          },
          "email": {
            "type": "string"
          },
          "successUrl": {
            "type": "string",
            "format": "uri"
          },
          "cancelUrl": {
            "type": "string",
            "format": "uri"
          },
          "discountCodes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "featureFlags": {
            "type": "object"
          },
          "customization": {
            "type": "object"
          },
          "customFields": {
            "type": "array",
            "maxItems": 5,
            "items": {
              "type": "object"
            }
          },
          "minimalAddress": {
            "type": "boolean"
          },
          "purchaseQuantity": {
            "type": "integer",
            "minimum": 1,
            "maximum": 10000,
            "default": 1,
            "description": "Number of packs or fixed-price subscriptions; product maxQuantity may be smaller. Separate from uses included per pack."
          },
          "customAmountMinor": {
            "type": "integer",
            "minimum": 1,
            "maximum": 999999999999,
            "description": "Authenticated merchant-set one-time amount in integer minor units. The price switch controls editing: off = fixed display; on = editable initial value. Saved bounds apply when configured. Omit to use the configured default price."
          }
        }
      },
      "CheckoutSession": {
        "type": "object",
        "required": [
          "token",
          "orderId",
          "orderNo",
          "customerId",
          "productId",
          "priceId",
          "amountMinor",
          "currency",
          "status",
          "environment",
          "expiresAt",
          "options"
        ],
        "properties": {
          "token": {
            "type": "string"
          },
          "orderId": {
            "type": "integer"
          },
          "orderNo": {
            "type": "string"
          },
          "customerId": {
            "type": "string"
          },
          "productId": {
            "type": "integer"
          },
          "priceId": {
            "type": "integer"
          },
          "amountMinor": {
            "type": "integer"
          },
          "currency": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "open",
              "complete",
              "expired",
              "canceled",
              "failed"
            ]
          },
          "environment": {
            "type": "string",
            "enum": [
              "live",
              "sandbox"
            ]
          },
          "orderStatus": {
            "type": "string",
            "enum": [
              "pending",
              "paid",
              "refunded",
              "failed",
              "canceled"
            ]
          },
          "checkoutUrl": {
            "type": "string",
            "format": "uri"
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time"
          },
          "options": {
            "type": "object",
            "properties": {
              "metadata": {
                "type": "object",
                "additionalProperties": {
                  "type": "string"
                }
              },
              "requestId": {
                "type": "string"
              },
              "customAmountLocked": {
                "type": "boolean",
                "description": "True when the session amount is fixed by the merchant"
              },
              "customAmountEditable": {
                "type": "boolean",
                "description": "Snapshot of the price editing switch for amount-based sessions"
              },
              "customAmountPolicy": {
                "type": "object",
                "description": "Saved amount bounds and receipt policy"
              }
            }
          },
          "originalAmountMinor": {
            "type": "integer",
            "description": "Original list total for all purchased units"
          },
          "purchaseQuantity": {
            "type": "integer",
            "description": "Number of units purchased"
          },
          "unitAmountMinor": {
            "type": "integer",
            "description": "Localized unit selling price before volume discount"
          },
          "volumeDiscountMinor": {
            "type": "integer",
            "description": "Volume savings for all purchased units"
          },
          "volumeDiscountPercent": {
            "type": "integer",
            "description": "Highest matching percent off"
          },
          "entitlementUnits": {
            "type": "integer",
            "description": "Total credits or uses granted"
          },
          "recurringAmountMinor": {
            "type": "integer",
            "description": "Recurring total after volume discount and tax, excluding the initial coupon"
          },
          "customAmountMinor": {
            "type": "integer",
            "description": "Final customer-entered gross amount; zero for a fixed price"
          },
          "customGrantMode": {
            "type": "string",
            "description": "none (payment only), fixed or proportional"
          },
          "paymentStarted": {
            "type": "boolean"
          }
        }
      },
      "Subscription": {
        "type": "object",
        "required": [
          "id",
          "orderId",
          "customerId",
          "productId",
          "priceId",
          "environment",
          "status",
          "cancelAtPeriodEnd",
          "currentPeriodEnd"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "orderId": {
            "type": "integer"
          },
          "customerId": {
            "type": "string"
          },
          "productId": {
            "type": "integer"
          },
          "priceId": {
            "type": "integer"
          },
          "environment": {
            "type": "string",
            "enum": [
              "live",
              "sandbox"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "trialing",
              "active",
              "past_due",
              "canceled",
              "expired"
            ]
          },
          "cancelAtPeriodEnd": {
            "type": "boolean"
          },
          "currentPeriodEnd": {
            "type": "string",
            "format": "date-time"
          }
        }
      }
    },
    "responses": {
      "Error": {
        "description": "Error code with optional human-readable message",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "RateLimit": {
        "description": "120 requests/minute per site and environment, burst 30; obey Retry-After",
        "headers": {
          "Retry-After": {
            "schema": {
              "type": "integer"
            }
          },
          "X-RateLimit-Limit": {
            "schema": {
              "type": "integer"
            }
          },
          "X-RateLimit-Remaining": {
            "schema": {
              "type": "integer"
            }
          }
        }
      }
    }
  },
  "webhooks": {
    "payment.succeeded": {
      "post": {
        "summary": "payment.succeeded",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "type",
                  "eventId",
                  "environment",
                  "livemode"
                ],
                "properties": {
                  "type": {
                    "type": "string"
                  },
                  "eventId": {
                    "type": "string"
                  },
                  "schemaVersion": {
                    "type": "string"
                  },
                  "createdAt": {
                    "type": "string"
                  },
                  "environment": {
                    "type": "string"
                  },
                  "livemode": {
                    "type": "boolean"
                  },
                  "orderId": {
                    "type": "integer"
                  },
                  "orderNo": {
                    "type": "string"
                  },
                  "productId": {
                    "type": "integer"
                  },
                  "priceId": {
                    "type": "integer"
                  },
                  "customerId": {
                    "type": "string"
                  },
                  "orderAmountMinor": {
                    "type": "integer"
                  },
                  "currency": {
                    "type": "string"
                  },
                  "checkoutSessionId": {
                    "type": "string"
                  },
                  "requestId": {
                    "type": "string"
                  },
                  "metadata": {
                    "type": "object"
                  },
                  "purchaseQuantity": {
                    "type": "integer"
                  },
                  "unitAmountMinor": {
                    "type": "integer"
                  },
                  "volumeDiscountMinor": {
                    "type": "integer"
                  },
                  "volumeDiscountPercent": {
                    "type": "integer"
                  },
                  "entitlementUnits": {
                    "type": "integer"
                  },
                  "recurringAmountMinor": {
                    "type": "integer"
                  },
                  "customAmountMinor": {
                    "type": "integer"
                  },
                  "customGrantMode": {
                    "type": "string"
                  },
                  "amountMinor": {
                    "type": "integer"
                  },
                  "providerPaymentId": {
                    "type": "string"
                  },
                  "subscriptionId": {
                    "type": "integer"
                  }
                }
              },
              "example": {
                "type": "payment.succeeded",
                "eventId": "payment.succeeded:example",
                "schemaVersion": "2026-11-16",
                "createdAt": "2026-11-16T08:00:00Z",
                "environment": "sandbox",
                "livemode": false,
                "orderId": 8001,
                "orderNo": "20261116080000123456789012",
                "productId": 26,
                "priceId": 22,
                "customerId": "user_123",
                "orderAmountMinor": 2900,
                "currency": "USD",
                "checkoutSessionId": "cs_example",
                "requestId": "app-order-1001",
                "metadata": {
                  "appOrderId": "1001",
                  "plan": "pro"
                },
                "purchaseQuantity": 1,
                "unitAmountMinor": 2900,
                "volumeDiscountMinor": 0,
                "volumeDiscountPercent": 0,
                "entitlementUnits": 0,
                "recurringAmountMinor": 2900,
                "customAmountMinor": 0,
                "customGrantMode": "",
                "amountMinor": 2900,
                "providerPaymentId": "sandbox_cs_example",
                "subscriptionId": 301
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Persist event idempotently and acknowledge promptly; any 2xx accepted"
          }
        }
      }
    },
    "subscription.updated": {
      "post": {
        "summary": "subscription.updated",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "type",
                  "eventId",
                  "environment",
                  "livemode"
                ],
                "properties": {
                  "type": {
                    "type": "string"
                  },
                  "eventId": {
                    "type": "string"
                  },
                  "schemaVersion": {
                    "type": "string"
                  },
                  "createdAt": {
                    "type": "string"
                  },
                  "environment": {
                    "type": "string"
                  },
                  "livemode": {
                    "type": "boolean"
                  },
                  "orderId": {
                    "type": "integer"
                  },
                  "orderNo": {
                    "type": "string"
                  },
                  "productId": {
                    "type": "integer"
                  },
                  "priceId": {
                    "type": "integer"
                  },
                  "customerId": {
                    "type": "string"
                  },
                  "orderAmountMinor": {
                    "type": "integer"
                  },
                  "currency": {
                    "type": "string"
                  },
                  "checkoutSessionId": {
                    "type": "string"
                  },
                  "requestId": {
                    "type": "string"
                  },
                  "metadata": {
                    "type": "object"
                  },
                  "purchaseQuantity": {
                    "type": "integer"
                  },
                  "unitAmountMinor": {
                    "type": "integer"
                  },
                  "volumeDiscountMinor": {
                    "type": "integer"
                  },
                  "volumeDiscountPercent": {
                    "type": "integer"
                  },
                  "entitlementUnits": {
                    "type": "integer"
                  },
                  "recurringAmountMinor": {
                    "type": "integer"
                  },
                  "customAmountMinor": {
                    "type": "integer"
                  },
                  "customGrantMode": {
                    "type": "string"
                  },
                  "subscriptionId": {
                    "type": "integer"
                  },
                  "status": {
                    "type": "string"
                  },
                  "pendingPriceId": {
                    "type": "integer"
                  },
                  "currentPeriodStart": {
                    "type": "string"
                  },
                  "currentPeriodEnd": {
                    "type": "string"
                  },
                  "trialEnd": {
                    "type": "string"
                  },
                  "gracePeriodEnd": {
                    "type": "string"
                  },
                  "cancelAtPeriodEnd": {
                    "type": "boolean"
                  }
                }
              },
              "example": {
                "type": "subscription.updated",
                "eventId": "subscription.updated:example",
                "schemaVersion": "2026-11-16",
                "createdAt": "2026-11-16T08:00:00Z",
                "environment": "sandbox",
                "livemode": false,
                "orderId": 8001,
                "orderNo": "20261116080000123456789012",
                "productId": 26,
                "priceId": 22,
                "customerId": "user_123",
                "orderAmountMinor": 2900,
                "currency": "USD",
                "checkoutSessionId": "cs_example",
                "requestId": "app-order-1001",
                "metadata": {
                  "appOrderId": "1001",
                  "plan": "pro"
                },
                "purchaseQuantity": 1,
                "unitAmountMinor": 2900,
                "volumeDiscountMinor": 0,
                "volumeDiscountPercent": 0,
                "entitlementUnits": 0,
                "recurringAmountMinor": 2900,
                "customAmountMinor": 0,
                "customGrantMode": "",
                "subscriptionId": 301,
                "status": "active",
                "pendingPriceId": 23,
                "currentPeriodStart": "2026-11-16T08:00:00Z",
                "currentPeriodEnd": "2026-12-16T08:00:00Z",
                "trialEnd": "",
                "gracePeriodEnd": "",
                "cancelAtPeriodEnd": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Persist event idempotently and acknowledge promptly; any 2xx accepted"
          }
        }
      }
    },
    "subscription.canceled": {
      "post": {
        "summary": "subscription.canceled",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "type",
                  "eventId",
                  "environment",
                  "livemode"
                ],
                "properties": {
                  "type": {
                    "type": "string"
                  },
                  "eventId": {
                    "type": "string"
                  },
                  "schemaVersion": {
                    "type": "string"
                  },
                  "createdAt": {
                    "type": "string"
                  },
                  "environment": {
                    "type": "string"
                  },
                  "livemode": {
                    "type": "boolean"
                  },
                  "orderId": {
                    "type": "integer"
                  },
                  "orderNo": {
                    "type": "string"
                  },
                  "productId": {
                    "type": "integer"
                  },
                  "priceId": {
                    "type": "integer"
                  },
                  "customerId": {
                    "type": "string"
                  },
                  "orderAmountMinor": {
                    "type": "integer"
                  },
                  "currency": {
                    "type": "string"
                  },
                  "checkoutSessionId": {
                    "type": "string"
                  },
                  "requestId": {
                    "type": "string"
                  },
                  "metadata": {
                    "type": "object"
                  },
                  "purchaseQuantity": {
                    "type": "integer"
                  },
                  "unitAmountMinor": {
                    "type": "integer"
                  },
                  "volumeDiscountMinor": {
                    "type": "integer"
                  },
                  "volumeDiscountPercent": {
                    "type": "integer"
                  },
                  "entitlementUnits": {
                    "type": "integer"
                  },
                  "recurringAmountMinor": {
                    "type": "integer"
                  },
                  "customAmountMinor": {
                    "type": "integer"
                  },
                  "customGrantMode": {
                    "type": "string"
                  },
                  "subscriptionId": {
                    "type": "integer"
                  },
                  "status": {
                    "type": "string"
                  },
                  "pendingPriceId": {
                    "type": "integer"
                  },
                  "currentPeriodStart": {
                    "type": "string"
                  },
                  "currentPeriodEnd": {
                    "type": "string"
                  },
                  "trialEnd": {
                    "type": "string"
                  },
                  "gracePeriodEnd": {
                    "type": "string"
                  },
                  "cancelAtPeriodEnd": {
                    "type": "boolean"
                  }
                }
              },
              "example": {
                "type": "subscription.canceled",
                "eventId": "subscription.canceled:example",
                "schemaVersion": "2026-11-16",
                "createdAt": "2026-11-16T08:00:00Z",
                "environment": "sandbox",
                "livemode": false,
                "orderId": 8001,
                "orderNo": "20261116080000123456789012",
                "productId": 26,
                "priceId": 22,
                "customerId": "user_123",
                "orderAmountMinor": 2900,
                "currency": "USD",
                "checkoutSessionId": "cs_example",
                "requestId": "app-order-1001",
                "metadata": {
                  "appOrderId": "1001",
                  "plan": "pro"
                },
                "purchaseQuantity": 1,
                "unitAmountMinor": 2900,
                "volumeDiscountMinor": 0,
                "volumeDiscountPercent": 0,
                "entitlementUnits": 0,
                "recurringAmountMinor": 2900,
                "customAmountMinor": 0,
                "customGrantMode": "",
                "subscriptionId": 301,
                "status": "active",
                "pendingPriceId": 0,
                "currentPeriodStart": "2026-11-16T08:00:00Z",
                "currentPeriodEnd": "2026-12-16T08:00:00Z",
                "trialEnd": "",
                "gracePeriodEnd": "",
                "cancelAtPeriodEnd": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Persist event idempotently and acknowledge promptly; any 2xx accepted"
          }
        }
      }
    },
    "subscription.renewed": {
      "post": {
        "summary": "subscription.renewed",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "type",
                  "eventId",
                  "environment",
                  "livemode"
                ],
                "properties": {
                  "type": {
                    "type": "string"
                  },
                  "eventId": {
                    "type": "string"
                  },
                  "schemaVersion": {
                    "type": "string"
                  },
                  "createdAt": {
                    "type": "string"
                  },
                  "environment": {
                    "type": "string"
                  },
                  "livemode": {
                    "type": "boolean"
                  },
                  "orderId": {
                    "type": "integer"
                  },
                  "orderNo": {
                    "type": "string"
                  },
                  "productId": {
                    "type": "integer"
                  },
                  "priceId": {
                    "type": "integer"
                  },
                  "customerId": {
                    "type": "string"
                  },
                  "orderAmountMinor": {
                    "type": "integer"
                  },
                  "currency": {
                    "type": "string"
                  },
                  "checkoutSessionId": {
                    "type": "string"
                  },
                  "requestId": {
                    "type": "string"
                  },
                  "metadata": {
                    "type": "object"
                  },
                  "purchaseQuantity": {
                    "type": "integer"
                  },
                  "unitAmountMinor": {
                    "type": "integer"
                  },
                  "volumeDiscountMinor": {
                    "type": "integer"
                  },
                  "volumeDiscountPercent": {
                    "type": "integer"
                  },
                  "entitlementUnits": {
                    "type": "integer"
                  },
                  "recurringAmountMinor": {
                    "type": "integer"
                  },
                  "customAmountMinor": {
                    "type": "integer"
                  },
                  "customGrantMode": {
                    "type": "string"
                  },
                  "subscriptionId": {
                    "type": "integer"
                  },
                  "status": {
                    "type": "string"
                  },
                  "pendingPriceId": {
                    "type": "integer"
                  },
                  "currentPeriodStart": {
                    "type": "string"
                  },
                  "currentPeriodEnd": {
                    "type": "string"
                  },
                  "trialEnd": {
                    "type": "string"
                  },
                  "gracePeriodEnd": {
                    "type": "string"
                  },
                  "cancelAtPeriodEnd": {
                    "type": "boolean"
                  }
                }
              },
              "example": {
                "type": "subscription.renewed",
                "eventId": "subscription.renewed:example",
                "schemaVersion": "2026-11-16",
                "createdAt": "2026-11-16T08:00:00Z",
                "environment": "sandbox",
                "livemode": false,
                "orderId": 8001,
                "orderNo": "20261116080000123456789012",
                "productId": 26,
                "priceId": 22,
                "customerId": "user_123",
                "orderAmountMinor": 2900,
                "currency": "USD",
                "checkoutSessionId": "cs_example",
                "requestId": "app-order-1001",
                "metadata": {
                  "appOrderId": "1001",
                  "plan": "pro"
                },
                "purchaseQuantity": 1,
                "unitAmountMinor": 2900,
                "volumeDiscountMinor": 0,
                "volumeDiscountPercent": 0,
                "entitlementUnits": 0,
                "recurringAmountMinor": 2900,
                "customAmountMinor": 0,
                "customGrantMode": "",
                "subscriptionId": 301,
                "status": "active",
                "pendingPriceId": 0,
                "currentPeriodStart": "2026-12-16T08:00:00Z",
                "currentPeriodEnd": "2027-01-15T08:00:00Z",
                "trialEnd": "",
                "gracePeriodEnd": "",
                "cancelAtPeriodEnd": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Persist event idempotently and acknowledge promptly; any 2xx accepted"
          }
        }
      }
    },
    "subscription.renewal_failed": {
      "post": {
        "summary": "subscription.renewal_failed",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "type",
                  "eventId",
                  "environment",
                  "livemode"
                ],
                "properties": {
                  "type": {
                    "type": "string"
                  },
                  "eventId": {
                    "type": "string"
                  },
                  "schemaVersion": {
                    "type": "string"
                  },
                  "createdAt": {
                    "type": "string"
                  },
                  "environment": {
                    "type": "string"
                  },
                  "livemode": {
                    "type": "boolean"
                  },
                  "orderId": {
                    "type": "integer"
                  },
                  "orderNo": {
                    "type": "string"
                  },
                  "productId": {
                    "type": "integer"
                  },
                  "priceId": {
                    "type": "integer"
                  },
                  "customerId": {
                    "type": "string"
                  },
                  "orderAmountMinor": {
                    "type": "integer"
                  },
                  "currency": {
                    "type": "string"
                  },
                  "checkoutSessionId": {
                    "type": "string"
                  },
                  "requestId": {
                    "type": "string"
                  },
                  "metadata": {
                    "type": "object"
                  },
                  "purchaseQuantity": {
                    "type": "integer"
                  },
                  "unitAmountMinor": {
                    "type": "integer"
                  },
                  "volumeDiscountMinor": {
                    "type": "integer"
                  },
                  "volumeDiscountPercent": {
                    "type": "integer"
                  },
                  "entitlementUnits": {
                    "type": "integer"
                  },
                  "recurringAmountMinor": {
                    "type": "integer"
                  },
                  "customAmountMinor": {
                    "type": "integer"
                  },
                  "customGrantMode": {
                    "type": "string"
                  },
                  "subscriptionId": {
                    "type": "integer"
                  },
                  "status": {
                    "type": "string"
                  },
                  "pendingPriceId": {
                    "type": "integer"
                  },
                  "currentPeriodStart": {
                    "type": "string"
                  },
                  "currentPeriodEnd": {
                    "type": "string"
                  },
                  "trialEnd": {
                    "type": "string"
                  },
                  "gracePeriodEnd": {
                    "type": "string"
                  },
                  "cancelAtPeriodEnd": {
                    "type": "boolean"
                  }
                }
              },
              "example": {
                "type": "subscription.renewal_failed",
                "eventId": "subscription.renewal_failed:example",
                "schemaVersion": "2026-11-16",
                "createdAt": "2026-11-16T08:00:00Z",
                "environment": "sandbox",
                "livemode": false,
                "orderId": 8001,
                "orderNo": "20261116080000123456789012",
                "productId": 26,
                "priceId": 22,
                "customerId": "user_123",
                "orderAmountMinor": 2900,
                "currency": "USD",
                "checkoutSessionId": "cs_example",
                "requestId": "app-order-1001",
                "metadata": {
                  "appOrderId": "1001",
                  "plan": "pro"
                },
                "purchaseQuantity": 1,
                "unitAmountMinor": 2900,
                "volumeDiscountMinor": 0,
                "volumeDiscountPercent": 0,
                "entitlementUnits": 0,
                "recurringAmountMinor": 2900,
                "customAmountMinor": 0,
                "customGrantMode": "",
                "subscriptionId": 301,
                "status": "past_due",
                "pendingPriceId": 0,
                "currentPeriodStart": "2026-11-16T08:00:00Z",
                "currentPeriodEnd": "2026-12-16T08:00:00Z",
                "trialEnd": "",
                "gracePeriodEnd": "2026-12-19T08:00:00Z",
                "cancelAtPeriodEnd": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Persist event idempotently and acknowledge promptly; any 2xx accepted"
          }
        }
      }
    },
    "subscription.expired": {
      "post": {
        "summary": "subscription.expired",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "type",
                  "eventId",
                  "environment",
                  "livemode"
                ],
                "properties": {
                  "type": {
                    "type": "string"
                  },
                  "eventId": {
                    "type": "string"
                  },
                  "schemaVersion": {
                    "type": "string"
                  },
                  "createdAt": {
                    "type": "string"
                  },
                  "environment": {
                    "type": "string"
                  },
                  "livemode": {
                    "type": "boolean"
                  },
                  "orderId": {
                    "type": "integer"
                  },
                  "orderNo": {
                    "type": "string"
                  },
                  "productId": {
                    "type": "integer"
                  },
                  "priceId": {
                    "type": "integer"
                  },
                  "customerId": {
                    "type": "string"
                  },
                  "orderAmountMinor": {
                    "type": "integer"
                  },
                  "currency": {
                    "type": "string"
                  },
                  "checkoutSessionId": {
                    "type": "string"
                  },
                  "requestId": {
                    "type": "string"
                  },
                  "metadata": {
                    "type": "object"
                  },
                  "purchaseQuantity": {
                    "type": "integer"
                  },
                  "unitAmountMinor": {
                    "type": "integer"
                  },
                  "volumeDiscountMinor": {
                    "type": "integer"
                  },
                  "volumeDiscountPercent": {
                    "type": "integer"
                  },
                  "entitlementUnits": {
                    "type": "integer"
                  },
                  "recurringAmountMinor": {
                    "type": "integer"
                  },
                  "customAmountMinor": {
                    "type": "integer"
                  },
                  "customGrantMode": {
                    "type": "string"
                  },
                  "subscriptionId": {
                    "type": "integer"
                  },
                  "status": {
                    "type": "string"
                  },
                  "pendingPriceId": {
                    "type": "integer"
                  },
                  "currentPeriodStart": {
                    "type": "string"
                  },
                  "currentPeriodEnd": {
                    "type": "string"
                  },
                  "trialEnd": {
                    "type": "string"
                  },
                  "gracePeriodEnd": {
                    "type": "string"
                  },
                  "cancelAtPeriodEnd": {
                    "type": "boolean"
                  }
                }
              },
              "example": {
                "type": "subscription.expired",
                "eventId": "subscription.expired:example",
                "schemaVersion": "2026-11-16",
                "createdAt": "2026-11-16T08:00:00Z",
                "environment": "sandbox",
                "livemode": false,
                "orderId": 8001,
                "orderNo": "20261116080000123456789012",
                "productId": 26,
                "priceId": 22,
                "customerId": "user_123",
                "orderAmountMinor": 2900,
                "currency": "USD",
                "checkoutSessionId": "cs_example",
                "requestId": "app-order-1001",
                "metadata": {
                  "appOrderId": "1001",
                  "plan": "pro"
                },
                "purchaseQuantity": 1,
                "unitAmountMinor": 2900,
                "volumeDiscountMinor": 0,
                "volumeDiscountPercent": 0,
                "entitlementUnits": 0,
                "recurringAmountMinor": 2900,
                "customAmountMinor": 0,
                "customGrantMode": "",
                "subscriptionId": 301,
                "status": "expired",
                "pendingPriceId": 0,
                "currentPeriodStart": "2026-11-16T08:00:00Z",
                "currentPeriodEnd": "2026-12-16T08:00:00Z",
                "trialEnd": "",
                "gracePeriodEnd": "2026-12-19T08:00:00Z",
                "cancelAtPeriodEnd": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Persist event idempotently and acknowledge promptly; any 2xx accepted"
          }
        }
      }
    },
    "refund.succeeded": {
      "post": {
        "summary": "refund.succeeded",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "type",
                  "eventId",
                  "environment",
                  "livemode"
                ],
                "properties": {
                  "type": {
                    "type": "string"
                  },
                  "eventId": {
                    "type": "string"
                  },
                  "schemaVersion": {
                    "type": "string"
                  },
                  "createdAt": {
                    "type": "string"
                  },
                  "environment": {
                    "type": "string"
                  },
                  "livemode": {
                    "type": "boolean"
                  },
                  "orderId": {
                    "type": "integer"
                  },
                  "orderNo": {
                    "type": "string"
                  },
                  "productId": {
                    "type": "integer"
                  },
                  "priceId": {
                    "type": "integer"
                  },
                  "customerId": {
                    "type": "string"
                  },
                  "orderAmountMinor": {
                    "type": "integer"
                  },
                  "currency": {
                    "type": "string"
                  },
                  "checkoutSessionId": {
                    "type": "string"
                  },
                  "requestId": {
                    "type": "string"
                  },
                  "metadata": {
                    "type": "object"
                  },
                  "purchaseQuantity": {
                    "type": "integer"
                  },
                  "unitAmountMinor": {
                    "type": "integer"
                  },
                  "volumeDiscountMinor": {
                    "type": "integer"
                  },
                  "volumeDiscountPercent": {
                    "type": "integer"
                  },
                  "entitlementUnits": {
                    "type": "integer"
                  },
                  "recurringAmountMinor": {
                    "type": "integer"
                  },
                  "customAmountMinor": {
                    "type": "integer"
                  },
                  "customGrantMode": {
                    "type": "string"
                  },
                  "refundId": {
                    "type": "integer"
                  },
                  "subscriptionId": {
                    "type": "integer"
                  },
                  "amountMinor": {
                    "type": "integer"
                  },
                  "reason": {
                    "type": "string"
                  },
                  "refundStatus": {
                    "type": "string"
                  },
                  "refundedAmountMinor": {
                    "type": "integer"
                  },
                  "fullRefund": {
                    "type": "boolean"
                  },
                  "subscriptionStatus": {
                    "type": "string"
                  }
                }
              },
              "example": {
                "type": "refund.succeeded",
                "eventId": "refund.succeeded:example",
                "schemaVersion": "2026-11-16",
                "createdAt": "2026-11-16T08:00:00Z",
                "environment": "sandbox",
                "livemode": false,
                "orderId": 8001,
                "orderNo": "20261116080000123456789012",
                "productId": 26,
                "priceId": 22,
                "customerId": "user_123",
                "orderAmountMinor": 2900,
                "currency": "USD",
                "checkoutSessionId": "cs_example",
                "requestId": "app-order-1001",
                "metadata": {
                  "appOrderId": "1001",
                  "plan": "pro"
                },
                "purchaseQuantity": 1,
                "unitAmountMinor": 2900,
                "volumeDiscountMinor": 0,
                "volumeDiscountPercent": 0,
                "entitlementUnits": 0,
                "recurringAmountMinor": 2900,
                "customAmountMinor": 0,
                "customGrantMode": "",
                "refundId": 501,
                "subscriptionId": 301,
                "amountMinor": 2900,
                "reason": "Customer requested refund",
                "refundStatus": "succeeded",
                "refundedAmountMinor": 2900,
                "fullRefund": true,
                "subscriptionStatus": "active"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Persist event idempotently and acknowledge promptly; any 2xx accepted"
          }
        }
      }
    },
    "invoice.created": {
      "post": {
        "summary": "invoice.created",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "type",
                  "eventId",
                  "environment",
                  "livemode"
                ],
                "properties": {
                  "type": {
                    "type": "string"
                  },
                  "eventId": {
                    "type": "string"
                  },
                  "schemaVersion": {
                    "type": "string"
                  },
                  "createdAt": {
                    "type": "string"
                  },
                  "environment": {
                    "type": "string"
                  },
                  "livemode": {
                    "type": "boolean"
                  },
                  "orderId": {
                    "type": "integer"
                  },
                  "orderNo": {
                    "type": "string"
                  },
                  "productId": {
                    "type": "integer"
                  },
                  "priceId": {
                    "type": "integer"
                  },
                  "customerId": {
                    "type": "string"
                  },
                  "orderAmountMinor": {
                    "type": "integer"
                  },
                  "currency": {
                    "type": "string"
                  },
                  "checkoutSessionId": {
                    "type": "string"
                  },
                  "requestId": {
                    "type": "string"
                  },
                  "metadata": {
                    "type": "object"
                  },
                  "purchaseQuantity": {
                    "type": "integer"
                  },
                  "unitAmountMinor": {
                    "type": "integer"
                  },
                  "volumeDiscountMinor": {
                    "type": "integer"
                  },
                  "volumeDiscountPercent": {
                    "type": "integer"
                  },
                  "entitlementUnits": {
                    "type": "integer"
                  },
                  "recurringAmountMinor": {
                    "type": "integer"
                  },
                  "customAmountMinor": {
                    "type": "integer"
                  },
                  "customGrantMode": {
                    "type": "string"
                  },
                  "invoiceId": {
                    "type": "integer"
                  },
                  "invoiceNo": {
                    "type": "string"
                  },
                  "totalMinor": {
                    "type": "integer"
                  }
                }
              },
              "example": {
                "type": "invoice.created",
                "eventId": "invoice.created:example",
                "schemaVersion": "2026-11-16",
                "createdAt": "2026-11-16T08:00:00Z",
                "environment": "sandbox",
                "livemode": false,
                "orderId": 8001,
                "orderNo": "20261116080000123456789012",
                "productId": 26,
                "priceId": 22,
                "customerId": "user_123",
                "orderAmountMinor": 2900,
                "currency": "USD",
                "checkoutSessionId": "cs_example",
                "requestId": "app-order-1001",
                "metadata": {
                  "appOrderId": "1001",
                  "plan": "pro"
                },
                "purchaseQuantity": 1,
                "unitAmountMinor": 2900,
                "volumeDiscountMinor": 0,
                "volumeDiscountPercent": 0,
                "entitlementUnits": 0,
                "recurringAmountMinor": 2900,
                "customAmountMinor": 0,
                "customGrantMode": "",
                "invoiceId": 601,
                "invoiceNo": "INV-EXAMPLE",
                "totalMinor": 2900
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Persist event idempotently and acknowledge promptly; any 2xx accepted"
          }
        }
      }
    },
    "license.issued": {
      "post": {
        "summary": "license.issued",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "type",
                  "eventId",
                  "environment",
                  "livemode"
                ],
                "properties": {
                  "type": {
                    "type": "string"
                  },
                  "eventId": {
                    "type": "string"
                  },
                  "schemaVersion": {
                    "type": "string"
                  },
                  "createdAt": {
                    "type": "string"
                  },
                  "environment": {
                    "type": "string"
                  },
                  "livemode": {
                    "type": "boolean"
                  },
                  "orderId": {
                    "type": "integer"
                  },
                  "orderNo": {
                    "type": "string"
                  },
                  "productId": {
                    "type": "integer"
                  },
                  "priceId": {
                    "type": "integer"
                  },
                  "customerId": {
                    "type": "string"
                  },
                  "orderAmountMinor": {
                    "type": "integer"
                  },
                  "currency": {
                    "type": "string"
                  },
                  "checkoutSessionId": {
                    "type": "string"
                  },
                  "requestId": {
                    "type": "string"
                  },
                  "metadata": {
                    "type": "object"
                  },
                  "purchaseQuantity": {
                    "type": "integer"
                  },
                  "unitAmountMinor": {
                    "type": "integer"
                  },
                  "volumeDiscountMinor": {
                    "type": "integer"
                  },
                  "volumeDiscountPercent": {
                    "type": "integer"
                  },
                  "entitlementUnits": {
                    "type": "integer"
                  },
                  "recurringAmountMinor": {
                    "type": "integer"
                  },
                  "customAmountMinor": {
                    "type": "integer"
                  },
                  "customGrantMode": {
                    "type": "string"
                  },
                  "licenseId": {
                    "type": "integer"
                  },
                  "licenseKey": {
                    "type": "string"
                  },
                  "featureKey": {
                    "type": "string"
                  },
                  "expiresAt": {
                    "type": "string"
                  }
                }
              },
              "example": {
                "type": "license.issued",
                "eventId": "license.issued:example",
                "schemaVersion": "2026-11-16",
                "createdAt": "2026-11-16T08:00:00Z",
                "environment": "sandbox",
                "livemode": false,
                "orderId": 8001,
                "orderNo": "20261116080000123456789012",
                "productId": 26,
                "priceId": 22,
                "customerId": "user_123",
                "orderAmountMinor": 2900,
                "currency": "USD",
                "checkoutSessionId": "cs_example",
                "requestId": "app-order-1001",
                "metadata": {
                  "appOrderId": "1001",
                  "plan": "pro"
                },
                "purchaseQuantity": 1,
                "unitAmountMinor": 2900,
                "volumeDiscountMinor": 0,
                "volumeDiscountPercent": 0,
                "entitlementUnits": 0,
                "recurringAmountMinor": 2900,
                "customAmountMinor": 0,
                "customGrantMode": "",
                "licenseId": 701,
                "licenseKey": "lic_example_not_valid",
                "featureKey": "pro",
                "expiresAt": ""
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Persist event idempotently and acknowledge promptly; any 2xx accepted"
          }
        }
      }
    },
    "dispute.opened": {
      "post": {
        "summary": "dispute.opened",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "type",
                  "eventId",
                  "environment",
                  "livemode"
                ],
                "properties": {
                  "type": {
                    "type": "string"
                  },
                  "eventId": {
                    "type": "string"
                  },
                  "schemaVersion": {
                    "type": "string"
                  },
                  "createdAt": {
                    "type": "string"
                  },
                  "environment": {
                    "type": "string"
                  },
                  "livemode": {
                    "type": "boolean"
                  },
                  "orderId": {
                    "type": "integer"
                  },
                  "orderNo": {
                    "type": "string"
                  },
                  "productId": {
                    "type": "integer"
                  },
                  "priceId": {
                    "type": "integer"
                  },
                  "customerId": {
                    "type": "string"
                  },
                  "orderAmountMinor": {
                    "type": "integer"
                  },
                  "currency": {
                    "type": "string"
                  },
                  "checkoutSessionId": {
                    "type": "string"
                  },
                  "requestId": {
                    "type": "string"
                  },
                  "metadata": {
                    "type": "object"
                  },
                  "purchaseQuantity": {
                    "type": "integer"
                  },
                  "unitAmountMinor": {
                    "type": "integer"
                  },
                  "volumeDiscountMinor": {
                    "type": "integer"
                  },
                  "volumeDiscountPercent": {
                    "type": "integer"
                  },
                  "entitlementUnits": {
                    "type": "integer"
                  },
                  "recurringAmountMinor": {
                    "type": "integer"
                  },
                  "customAmountMinor": {
                    "type": "integer"
                  },
                  "customGrantMode": {
                    "type": "string"
                  },
                  "disputeId": {
                    "type": "integer"
                  },
                  "amountMinor": {
                    "type": "integer"
                  },
                  "reason": {
                    "type": "string"
                  }
                }
              },
              "example": {
                "type": "dispute.opened",
                "eventId": "dispute.opened:example",
                "schemaVersion": "2026-11-16",
                "createdAt": "2026-11-16T08:00:00Z",
                "environment": "sandbox",
                "livemode": false,
                "orderId": 8001,
                "orderNo": "20261116080000123456789012",
                "productId": 26,
                "priceId": 22,
                "customerId": "user_123",
                "orderAmountMinor": 2900,
                "currency": "USD",
                "checkoutSessionId": "cs_example",
                "requestId": "app-order-1001",
                "metadata": {
                  "appOrderId": "1001",
                  "plan": "pro"
                },
                "purchaseQuantity": 1,
                "unitAmountMinor": 2900,
                "volumeDiscountMinor": 0,
                "volumeDiscountPercent": 0,
                "entitlementUnits": 0,
                "recurringAmountMinor": 2900,
                "customAmountMinor": 0,
                "customGrantMode": "",
                "disputeId": 901,
                "amountMinor": 2900,
                "reason": "customer_dispute"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Persist event idempotently and acknowledge promptly; any 2xx accepted"
          }
        }
      }
    },
    "usage.billed": {
      "post": {
        "summary": "usage.billed",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "type",
                  "eventId",
                  "environment",
                  "livemode"
                ],
                "properties": {
                  "type": {
                    "type": "string"
                  },
                  "eventId": {
                    "type": "string"
                  },
                  "schemaVersion": {
                    "type": "string"
                  },
                  "createdAt": {
                    "type": "string"
                  },
                  "environment": {
                    "type": "string"
                  },
                  "livemode": {
                    "type": "boolean"
                  },
                  "orderId": {
                    "type": "integer"
                  },
                  "orderNo": {
                    "type": "string"
                  },
                  "productId": {
                    "type": "integer"
                  },
                  "priceId": {
                    "type": "integer"
                  },
                  "customerId": {
                    "type": "string"
                  },
                  "orderAmountMinor": {
                    "type": "integer"
                  },
                  "currency": {
                    "type": "string"
                  },
                  "checkoutSessionId": {
                    "type": "string"
                  },
                  "requestId": {
                    "type": "string"
                  },
                  "metadata": {
                    "type": "object"
                  },
                  "purchaseQuantity": {
                    "type": "integer"
                  },
                  "unitAmountMinor": {
                    "type": "integer"
                  },
                  "volumeDiscountMinor": {
                    "type": "integer"
                  },
                  "volumeDiscountPercent": {
                    "type": "integer"
                  },
                  "entitlementUnits": {
                    "type": "integer"
                  },
                  "recurringAmountMinor": {
                    "type": "integer"
                  },
                  "customAmountMinor": {
                    "type": "integer"
                  },
                  "customGrantMode": {
                    "type": "string"
                  },
                  "usageBillId": {
                    "type": "integer"
                  },
                  "subscriptionId": {
                    "type": "integer"
                  },
                  "meterCode": {
                    "type": "string"
                  },
                  "quantity": {
                    "type": "integer"
                  },
                  "amountMinor": {
                    "type": "integer"
                  },
                  "periodStart": {
                    "type": "string"
                  },
                  "periodEnd": {
                    "type": "string"
                  },
                  "status": {
                    "type": "string"
                  }
                }
              },
              "example": {
                "type": "usage.billed",
                "eventId": "usage.billed:example",
                "schemaVersion": "2026-11-16",
                "createdAt": "2026-11-16T08:00:00Z",
                "environment": "sandbox",
                "livemode": false,
                "orderId": 8001,
                "orderNo": "20261116080000123456789012",
                "productId": 26,
                "priceId": 22,
                "customerId": "user_123",
                "orderAmountMinor": 2900,
                "currency": "USD",
                "checkoutSessionId": "cs_example",
                "requestId": "app-order-1001",
                "metadata": {
                  "appOrderId": "1001",
                  "plan": "pro"
                },
                "purchaseQuantity": 1,
                "unitAmountMinor": 2900,
                "volumeDiscountMinor": 0,
                "volumeDiscountPercent": 0,
                "entitlementUnits": 0,
                "recurringAmountMinor": 2900,
                "customAmountMinor": 0,
                "customGrantMode": "",
                "usageBillId": 801,
                "subscriptionId": 301,
                "meterCode": "api_calls",
                "quantity": 100,
                "amountMinor": 100,
                "periodStart": "2026-11-01T00:00:00Z",
                "periodEnd": "2026-12-01T00:00:00Z",
                "status": "draft"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Persist event idempotently and acknowledge promptly; any 2xx accepted"
          }
        }
      }
    }
  }
}
