{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/rutter/json-schema/rutter-acpcheckout-session-schema.json",
  "title": "ACPCheckoutSession",
  "x-generated": "2026-11-05",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/rutter-commerce-api-openapi.yml#/components/schemas/ACPCheckoutSession",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "fulfillment_option_id": {
      "type": "string"
    },
    "currency": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "enum": [
        "not_ready_for_payment",
        "ready_for_payment",
        "completed",
        "canceled"
      ]
    },
    "links": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "terms_of_use",
              "privacy_policy",
              "seller_shop_policies"
            ]
          },
          "value": {
            "type": "string",
            "format": "uri"
          }
        },
        "required": [
          "type",
          "value"
        ],
        "additionalProperties": false
      }
    },
    "payment_provider": {
      "type": "object",
      "properties": {
        "provider": {
          "type": "string",
          "enum": [
            "stripe",
            "adyen"
          ]
        },
        "supported_payment_methods": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "card"
            ]
          }
        }
      },
      "required": [
        "provider",
        "supported_payment_methods"
      ],
      "additionalProperties": false
    },
    "totals": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "amount": {
            "type": "integer",
            "minimum": 0
          },
          "display_text": {
            "type": "string"
          },
          "type": {
            "type": "string"
          }
        },
        "required": [
          "amount",
          "display_text",
          "type"
        ],
        "additionalProperties": false
      }
    },
    "buyer": {
      "type": "object",
      "properties": {
        "email": {
          "type": "string",
          "format": "email",
          "maxLength": 256
        },
        "name": {
          "type": "string",
          "maxLength": 256
        },
        "phone_number": {
          "type": "string"
        }
      },
      "required": [
        "email",
        "name"
      ],
      "additionalProperties": false
    },
    "line_items": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "base_amount": {
            "type": "integer",
            "minimum": 0
          },
          "discount": {
            "type": "integer",
            "minimum": 0
          },
          "subtotal": {
            "type": "integer",
            "minimum": 0
          },
          "tax": {
            "type": "integer",
            "minimum": 0
          },
          "total": {
            "type": "integer",
            "minimum": 0
          },
          "item": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "quantity": {
                "type": "integer",
                "exclusiveMinimum": true,
                "minimum": 0
              }
            },
            "required": [
              "id",
              "quantity"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "id",
          "base_amount",
          "discount",
          "subtotal",
          "tax",
          "total",
          "item"
        ],
        "additionalProperties": false
      }
    },
    "fulfillment_address": {
      "type": "object",
      "properties": {
        "city": {
          "type": "string",
          "maxLength": 60
        },
        "country": {
          "type": "string"
        },
        "line_one": {
          "type": "string",
          "maxLength": 60
        },
        "name": {
          "type": "string",
          "maxLength": 256
        },
        "postal_code": {
          "type": "string",
          "maxLength": 20
        },
        "state": {
          "type": "string"
        },
        "line_two": {
          "type": "string",
          "maxLength": 60
        },
        "phone_number": {
          "type": "string"
        }
      },
      "required": [
        "city",
        "country",
        "line_one",
        "name",
        "postal_code",
        "state"
      ],
      "additionalProperties": false
    },
    "messages": {
      "type": "array",
      "items": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "content": {
                "type": "string"
              },
              "content_type": {
                "type": "string",
                "enum": [
                  "plain",
                  "markdown"
                ]
              },
              "param": {
                "type": "string"
              },
              "type": {
                "type": "string",
                "enum": [
                  "info"
                ]
              }
            },
            "required": [
              "content",
              "content_type",
              "param",
              "type"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "code": {
                "type": "string"
              },
              "content": {
                "type": "string"
              },
              "content_type": {
                "type": "string",
                "enum": [
                  "plain",
                  "markdown"
                ]
              },
              "param": {
                "type": "string"
              },
              "type": {
                "type": "string",
                "enum": [
                  "error"
                ]
              }
            },
            "required": [
              "code",
              "content",
              "content_type",
              "param",
              "type"
            ],
            "additionalProperties": false
          }
        ]
      }
    },
    "fulfillment_options": {
      "type": "array",
      "items": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "carrier_info": {
                "type": "string"
              },
              "earliest_delivery_time": {
                "type": "string"
              },
              "latest_delivery_time": {
                "type": "string"
              },
              "subtitle": {
                "type": "string"
              },
              "subtotal": {
                "type": "integer",
                "minimum": 0
              },
              "tax": {
                "type": "integer"
              },
              "title": {
                "type": "string"
              },
              "total": {
                "type": "integer"
              },
              "type": {
                "type": "string",
                "enum": [
                  "shipping"
                ]
              }
            },
            "required": [
              "id",
              "carrier_info",
              "earliest_delivery_time",
              "latest_delivery_time",
              "subtitle",
              "subtotal",
              "tax",
              "title",
              "total",
              "type"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "subtotal": {
                "type": "integer",
                "minimum": 0
              },
              "tax": {
                "type": "integer"
              },
              "title": {
                "type": "string"
              },
              "total": {
                "type": "integer"
              },
              "type": {
                "type": "string",
                "enum": [
                  "digital"
                ]
              },
              "subtitle": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "subtotal",
              "tax",
              "title",
              "total",
              "type"
            ],
            "additionalProperties": false
          }
        ]
      }
    }
  },
  "required": [
    "id",
    "currency",
    "status",
    "links",
    "payment_provider",
    "totals",
    "line_items",
    "messages",
    "fulfillment_options"
  ]
}