{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/rutter/json-schema/rutter-ucpcancel-checkout-session-response-schema.json",
  "title": "UCPCancelCheckoutSessionResponse",
  "x-generated": "2026-11-05",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/rutter-commerce-api-openapi.yml#/components/schemas/UCPCancelCheckoutSessionResponse",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "enum": [
        "incomplete",
        "completed",
        "canceled"
      ]
    },
    "order": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "permalink_url": {
          "type": "string"
        }
      },
      "required": [
        "id"
      ],
      "additionalProperties": false
    },
    "links": {
      "type": "object",
      "properties": {
        "privacy": {
          "type": "string"
        },
        "terms": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "totals": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "amount": {
            "type": "number"
          },
          "type": {
            "type": "string",
            "enum": [
              "subtotal",
              "shipping",
              "tax",
              "total",
              "discount"
            ]
          },
          "display_text": {
            "type": "string"
          }
        },
        "required": [
          "amount",
          "type"
        ],
        "additionalProperties": false
      }
    },
    "ucp": {
      "type": "object",
      "properties": {
        "version": {
          "type": "string"
        },
        "capabilities": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "version": {
                "type": "string"
              }
            },
            "required": [
              "name",
              "version"
            ],
            "additionalProperties": false
          }
        }
      },
      "required": [
        "version",
        "capabilities"
      ],
      "additionalProperties": false
    },
    "buyer": {
      "type": "object",
      "properties": {
        "email": {
          "type": "string",
          "format": "email"
        },
        "first_name": {
          "type": "string"
        },
        "last_name": {
          "type": "string"
        },
        "phone": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "line_items": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "base_amount": {
            "type": "number"
          },
          "quantity": {
            "type": "integer"
          },
          "subtotal": {
            "type": "number"
          },
          "total": {
            "type": "number"
          },
          "item": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "title": {
                "type": "string"
              },
              "price": {
                "type": "number"
              }
            },
            "required": [
              "id",
              "title"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "id",
          "base_amount",
          "quantity",
          "subtotal",
          "total",
          "item"
        ],
        "additionalProperties": false
      }
    },
    "payment": {
      "type": "object",
      "properties": {
        "selected_instrument_id": {
          "type": "string"
        },
        "instruments": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "handler_id": {
                "type": "string"
              },
              "type": {
                "type": "string",
                "enum": [
                  "card",
                  "wallet",
                  "bank_account"
                ]
              },
              "brand": {
                "type": "string"
              },
              "last_digits": {
                "type": "string"
              },
              "rich_text_description": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "handler_id",
              "type"
            ],
            "additionalProperties": false
          }
        },
        "handlers": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "config": {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "api_version": {
                        "type": "number"
                      },
                      "api_version_minor": {
                        "type": "number"
                      },
                      "allowed_payment_methods": {
                        "type": "array"
                      },
                      "merchant_info": {
                        "type": "object",
                        "properties": {
                          "merchant_id": {
                            "type": "string"
                          },
                          "merchant_name": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "merchant_id",
                          "merchant_name"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "required": [
                      "api_version",
                      "api_version_minor",
                      "allowed_payment_methods",
                      "merchant_info"
                    ],
                    "additionalProperties": false
                  },
                  {
                    "type": "object",
                    "additionalProperties": {}
                  }
                ]
              }
            },
            "required": [
              "id",
              "name"
            ],
            "additionalProperties": false
          }
        }
      },
      "additionalProperties": false
    },
    "fulfillment": {
      "type": "object",
      "properties": {
        "methods": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "selected_destination_id": {
                "type": "string"
              },
              "selected_option_id": {
                "type": "string"
              },
              "type": {
                "type": "string",
                "enum": [
                  "shipping",
                  "pickup",
                  "digital"
                ]
              },
              "line_item_ids": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "options": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "amount": {
                      "type": "number"
                    },
                    "title": {
                      "type": "string"
                    },
                    "description": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "amount",
                    "title"
                  ],
                  "additionalProperties": false
                }
              },
              "destinations": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "address_country": {
                      "type": "string"
                    },
                    "address_locality": {
                      "type": "string"
                    },
                    "address_region": {
                      "type": "string"
                    },
                    "country": {
                      "type": "string"
                    },
                    "postal_code": {
                      "type": "string"
                    },
                    "street_address": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "required": [
              "type"
            ],
            "additionalProperties": false
          }
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "id"
  ]
}