{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/adadiamonds-com/json-schema/adadiamonds-com-acp-checkout-session-schema.json",
  "title": "AcpCheckoutSession",
  "x-generated": "2026-10-31",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/adadiamonds-com-openapi.json#/components/schemas/AcpCheckoutSession",
  "type": "object",
  "required": [
    "id",
    "status",
    "currency",
    "line_items",
    "fulfillment_options",
    "totals",
    "messages",
    "links"
  ],
  "properties": {
    "id": {
      "type": "string"
    },
    "protocol": {
      "type": "object",
      "properties": {
        "version": {
          "type": "string"
        }
      },
      "description": "2026-04-17"
    },
    "capabilities": {
      "type": "object",
      "description": "2026-04-17",
      "properties": {
        "payment": {
          "type": "object",
          "properties": {
            "handlers": {
              "type": "array",
              "items": {
                "$ref": "#/$defs/AcpPaymentHandler"
              }
            }
          }
        }
      }
    },
    "payment_provider": {
      "type": "object",
      "description": "2025-09-12",
      "properties": {
        "provider": {
          "type": "string",
          "enum": [
            "stripe"
          ]
        },
        "supported_payment_methods": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "buyer": {
      "$ref": "#/$defs/AcpBuyer"
    },
    "status": {
      "type": "string",
      "enum": [
        "not_ready_for_payment",
        "ready_for_payment",
        "in_progress",
        "completed",
        "canceled"
      ]
    },
    "currency": {
      "type": "string",
      "enum": [
        "usd"
      ]
    },
    "line_items": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/AcpLineItem"
      }
    },
    "fulfillment_details": {
      "$ref": "#/$defs/AcpFulfillmentDetails"
    },
    "fulfillment_address": {
      "$ref": "#/$defs/AcpAddress"
    },
    "fulfillment_options": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/AcpFulfillmentOption"
      }
    },
    "selected_fulfillment_options": {
      "type": "array",
      "items": {
        "type": "object"
      }
    },
    "fulfillment_option_id": {
      "type": "string"
    },
    "totals": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/AcpTotal"
      }
    },
    "messages": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/AcpMessage"
      }
    },
    "links": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "type",
          "url"
        ],
        "properties": {
          "type": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          }
        }
      }
    },
    "expires_at": {
      "type": "string",
      "format": "date-time"
    },
    "order": {
      "$ref": "#/$defs/AcpOrder"
    }
  },
  "$defs": {
    "AcpAddress": {
      "type": "object",
      "required": [
        "line_one",
        "city",
        "state",
        "country",
        "postal_code"
      ],
      "properties": {
        "name": {
          "type": "string"
        },
        "line_one": {
          "type": "string"
        },
        "line_two": {
          "type": "string"
        },
        "city": {
          "type": "string"
        },
        "state": {
          "type": "string",
          "description": "ISO 3166-2 region code, e.g. NY"
        },
        "country": {
          "type": "string",
          "description": "ISO 3166-1 alpha-2"
        },
        "postal_code": {
          "type": "string"
        },
        "phone_number": {
          "type": "string",
          "description": "E.164"
        }
      }
    },
    "AcpBuyer": {
      "type": "object",
      "description": "2026-04-17 shape. With API-Version 2025-09-12 send `{name, email, phone_number}` instead.",
      "properties": {
        "first_name": {
          "type": "string"
        },
        "last_name": {
          "type": "string"
        },
        "full_name": {
          "type": "string"
        },
        "name": {
          "type": "string",
          "description": "2025-09-12 only"
        },
        "email": {
          "type": "string",
          "format": "email"
        },
        "phone_number": {
          "type": "string"
        }
      }
    },
    "AcpFulfillmentDetails": {
      "type": "object",
      "description": "2026-04-17. With API-Version 2025-09-12 send the address directly as `fulfillment_address`.",
      "properties": {
        "name": {
          "type": "string"
        },
        "phone_number": {
          "type": "string"
        },
        "email": {
          "type": "string"
        },
        "address": {
          "$ref": "#/$defs/AcpAddress"
        }
      }
    },
    "AcpFulfillmentOption": {
      "type": "object",
      "required": [
        "type",
        "id",
        "title"
      ],
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "shipping"
          ]
        },
        "id": {
          "type": "string"
        },
        "title": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "subtitle": {
          "type": "string",
          "description": "2025-09-12"
        },
        "carrier": {
          "type": "string"
        },
        "earliest_delivery_time": {
          "type": "string",
          "format": "date-time"
        },
        "latest_delivery_time": {
          "type": "string",
          "format": "date-time"
        },
        "totals": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/AcpTotal"
          }
        },
        "subtotal": {
          "type": "integer",
          "description": "2025-09-12. Integer minor units (cents)."
        },
        "tax": {
          "type": "integer",
          "description": "2025-09-12. Integer minor units (cents)."
        },
        "total": {
          "type": "integer",
          "description": "2025-09-12. Integer minor units (cents)."
        }
      }
    },
    "AcpLineItem": {
      "type": "object",
      "required": [
        "id",
        "item"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "item": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string"
            },
            "quantity": {
              "type": "integer"
            },
            "name": {
              "type": "string"
            },
            "unit_amount": {
              "type": "integer",
              "description": "Unit price. Integer minor units (cents)."
            }
          }
        },
        "quantity": {
          "type": "integer"
        },
        "name": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "images": {
          "type": "array",
          "items": {
            "type": "string",
            "format": "uri"
          }
        },
        "unit_amount": {
          "type": "integer",
          "description": "Unit price. Integer minor units (cents)."
        },
        "sku": {
          "type": "string"
        },
        "totals": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/AcpTotal"
          },
          "description": "2026-04-17"
        },
        "base_amount": {
          "type": "integer",
          "description": "2025-09-12. Integer minor units (cents)."
        },
        "discount": {
          "type": "integer",
          "description": "2025-09-12. Integer minor units (cents)."
        },
        "subtotal": {
          "type": "integer",
          "description": "2025-09-12. Integer minor units (cents)."
        },
        "tax": {
          "type": "integer",
          "description": "2025-09-12. Integer minor units (cents)."
        },
        "total": {
          "type": "integer",
          "description": "2025-09-12. Integer minor units (cents)."
        }
      }
    },
    "AcpMessage": {
      "type": "object",
      "required": [
        "type",
        "content_type",
        "content"
      ],
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "info",
            "error"
          ]
        },
        "code": {
          "type": "string",
          "enum": [
            "missing",
            "invalid",
            "out_of_stock",
            "payment_declined",
            "requires_sign_in",
            "requires_3ds",
            "quantity_exceeded",
            "not_found",
            "expired",
            "conflict",
            "unsupported"
          ]
        },
        "param": {
          "type": "string"
        },
        "content_type": {
          "type": "string",
          "enum": [
            "plain",
            "markdown"
          ]
        },
        "content": {
          "type": "string"
        },
        "resolution": {
          "type": "string",
          "enum": [
            "recoverable",
            "requires_buyer_input",
            "requires_buyer_review"
          ],
          "description": "2026-04-17 only"
        }
      }
    },
    "AcpOrder": {
      "type": "object",
      "required": [
        "id",
        "checkout_session_id",
        "permalink_url"
      ],
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "order"
          ]
        },
        "id": {
          "type": "string"
        },
        "checkout_session_id": {
          "type": "string"
        },
        "order_number": {
          "type": "string"
        },
        "permalink_url": {
          "type": "string",
          "format": "uri"
        },
        "status": {
          "type": "string",
          "enum": [
            "created",
            "confirmed",
            "manual_review",
            "processing",
            "shipped",
            "completed",
            "canceled"
          ]
        }
      }
    },
    "AcpPaymentHandler": {
      "type": "object",
      "required": [
        "id",
        "name",
        "version",
        "spec",
        "requires_delegate_payment",
        "requires_pci_compliance",
        "psp",
        "config_schema",
        "instrument_schemas",
        "config"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "display_name": {
          "type": "string"
        },
        "version": {
          "type": "string"
        },
        "spec": {
          "type": "string",
          "format": "uri"
        },
        "requires_delegate_payment": {
          "type": "boolean"
        },
        "requires_pci_compliance": {
          "type": "boolean"
        },
        "psp": {
          "type": "string"
        },
        "config_schema": {
          "type": "string",
          "format": "uri"
        },
        "instrument_schemas": {
          "type": "array",
          "items": {
            "type": "string",
            "format": "uri"
          }
        },
        "config": {
          "type": "object"
        },
        "display_order": {
          "type": "integer"
        }
      }
    },
    "AcpTotal": {
      "type": "object",
      "required": [
        "type",
        "display_text",
        "amount"
      ],
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "items_base_amount",
            "items_discount",
            "subtotal",
            "discount",
            "fulfillment",
            "tax",
            "fee",
            "total"
          ]
        },
        "display_text": {
          "type": "string"
        },
        "amount": {
          "type": "integer",
          "description": "Amount. Integer minor units (cents)."
        }
      }
    }
  }
}