{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://artifacts.apis.io/breezecash/json-schema/breezecash-create-gateway-payment-response-schema.json",
  "title": "CreateGatewayPaymentResponse",
  "x-generated": "2026-10-29",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/breezecash-breeze-api-openapi.yml#/components/schemas/CreateGatewayPaymentResponse",
  "type": "object",
  "properties": {
    "pageId": {
      "type": "string",
      "description": "Payin identifier (`page_*`)."
    },
    "paymentId": {
      "type": "string",
      "description": "Payment attempt identifier (`py_*`)."
    },
    "status": {
      "type": "string",
      "enum": [
        "OPEN",
        "EXPIRED",
        "FIAT_CONFIRMED",
        "AUTHORIZING",
        "PENDING_CAPTURE",
        "CONFIRMING",
        "CONFIRMED",
        "REFUNDED",
        "REFUND_PROCESSING",
        "SETTLING",
        "SETTLED",
        "FAILED",
        "SETTLE_FAILED",
        "SUBSCRIPTION_CANCELLED",
        "MANUAL_INSPECTION_REQUIRED",
        "CANCELLED",
        "ACTION_REQUIRED"
      ],
      "description": "Current payment status."
    },
    "amount": {
      "type": "number",
      "description": "Echoed from the request — minor units."
    },
    "currency": {
      "type": "string",
      "description": "Echoed from the request — ISO 4217 alpha-3."
    },
    "description": {
      "type": "string",
      "description": "Echoed from the request."
    },
    "createdAt": {
      "type": "number",
      "description": "Unix timestamp in milliseconds when the payment was created."
    },
    "updatedAt": {
      "type": "number",
      "description": "Unix timestamp in milliseconds when the payment was last updated. Use this field when polling to detect state changes."
    },
    "customerId": {
      "type": "string",
      "description": "Breeze customer identifier (`cus_*`) associated with the payment, when one is resolved."
    },
    "savedPaymentMethodId": {
      "type": "string",
      "description": "Saved payment method identifier when `storeFutureUsage` was set on the request."
    },
    "schemeTransactionId": {
      "type": "string",
      "description": "Scheme transaction ID returned by the card network. Merchants must persist this to chain MIT transactions."
    },
    "nextAction": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "REDIRECT_TO_URL",
            "AUTHENTICATION_REQUIRED"
          ],
          "description": "Action the merchant must take to progress the payment."
        },
        "redirectUrl": {
          "type": "string",
          "description": "Redirect URL — present when `type` is `REDIRECT_TO_URL`."
        }
      },
      "required": [
        "type"
      ],
      "description": "Action the merchant must take when `status` is `ACTION_REQUIRED`."
    },
    "metadata": {
      "type": "object",
      "additionalProperties": {
        "type": "string"
      },
      "description": "Echoed from the request."
    },
    "taxDetails": {
      "type": "object",
      "properties": {
        "amount": {
          "type": "number",
          "description": "Merchant-calculated tax amount in minor units. Included in `request.amount`; use `0` when no tax is due. `0 ≤ amount < request.amount`."
        },
        "mode": {
          "type": "string",
          "const": "merchant_calculated"
        },
        "location": {
          "type": "object",
          "properties": {
            "country": {
              "type": "string",
              "description": "ISO 3166-1 alpha-2 country code."
            },
            "postalCode": {
              "type": "string",
              "description": "ZIP / postal code used for tax jurisdiction resolution. Required for US and CA."
            }
          },
          "required": [
            "country"
          ],
          "description": "Tax jurisdiction Breeze persists and remits on (BREEZ-11376). Country is always required; postalCode is required for US and CA. The merchant must assert the jurisdiction explicitly; the customer billing address is NOT used as a fallback."
        }
      },
      "required": [
        "amount",
        "mode",
        "location"
      ],
      "description": "Merchant-supplied tax when provided on create — amount, mode, and the resolved jurisdiction nested under `location` (BREEZ-11376)."
    },
    "errorCode": {
      "type": "string",
      "description": "Merchant-facing result code surfaced when the payment failed."
    },
    "failureReason": {
      "type": "string",
      "description": "Human-readable failure reason corresponding to `errorCode`."
    },
    "adviceCode": {
      "type": "string",
      "description": "Retry-advice hint corresponding to `errorCode` (e.g. `try_again_later`, `try_again_later_delayed`, `do_not_try_again`, `confirm_card_data`). Omitted when no advice is defined."
    }
  },
  "required": [
    "pageId",
    "paymentId",
    "status",
    "amount",
    "currency",
    "createdAt"
  ],
  "definitions": {}
}