{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://raw.githubusercontent.com/api-evangelist/verifone/refs/heads/main/json-schema/ecommerce-api-affirmpaymentinitiationresponse.json",
  "title": "Affirm Initiate Payment Result",
  "description": "affirmPaymentInitiationResponse from Verifone eCommerce API",
  "type": "object",
  "properties": {
    "id": {
      "title": "Transaction ID",
      "type": "string",
      "description": "The ID of the transaction.",
      "format": "uuid-flexible"
    },
    "checkout_id": {
      "title": "Checkout Id",
      "description": "A unique identifier representing the Payment Host checkout ID. This value is optional and available only in `MODAL` mode.",
      "type": "string"
    },
    "public_api_key": {
      "description": "The merchants public api key. This value is optional and available only in `MODAL` mode.",
      "type": "string"
    },
    "payment_url": {
      "description": "The payment URL can be used to redirect to transfer the money.",
      "type": "string",
      "format": "uri"
    },
    "amount": {
      "type": "integer",
      "description": "Amount is charged without a decimal place e.g. $1.5 = 150. Currencies can have different decimals/exponentials, see Currencies Section for more details. For Account Verification transactions, provide 0 as value for this field."
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "description": "The time at which the transaction was created."
    },
    "customer": {
      "description": "The ID of a customer",
      "type": "string"
    },
    "merchant_reference": {
      "type": "string",
      "description": "A reference specified by the merchant to identify the transaction.",
      "maxLength": 50
    },
    "processor": {
      "description": "The name of the processor used for this transaction",
      "type": "string",
      "default": "AFFIRM"
    },
    "payment_product": {
      "description": "The payment product corresponding to this transaction",
      "type": "string",
      "default": "AFFIRM"
    },
    "payment_product_type": {
      "$ref": "#/components/schemas/PaymentProductType"
    },
    "status": {
      "type": "string",
      "description": "The outcome of the payment request.",
      "title": "Ecommerce Transaction Status",
      "enum": [
        "INITIATED",
        "AUTHORIZED",
        "AUTHORIZATION_VOIDED",
        "CANCELLED",
        "CUSTOMER_ACCEPTED",
        "REFUNDED",
        "FAILED",
        "PENDING",
        "DECLINED",
        "SETTLEMENT_CANCELLED",
        "SETTLEMENT_REQUESTED",
        "SETTLEMENT_SUBMITTED",
        "SETTLEMENT_COMPLETED",
        "SETTLEMENT_PARTIAL",
        "SETTLEMENT_DECLINED",
        "VOIDED",
        "UNKNOWN"
      ]
    },
    "status_reason": {
      "type": "string",
      "description": "Message provided by the 3rd party service as additional information, when the transaction does not succeed."
    },
    "geo_location": {
      "type": "array",
      "description": "The latitude / longitude resolved from the customer's ip address.",
      "items": {
        "type": "number"
      }
    },
    "city": {
      "type": "string",
      "description": "The city resolved from the customer's ip address."
    },
    "country_code": {
      "title": "Country Code",
      "type": "string",
      "description": "The [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code.<blockquote><strong>Note:</strong> The country code for Great Britain is <code>GB</code> and not <code>UK</code> as is used in that country's top-level domain names.</blockquote>."
    }
  }
}