{
  "components": {
    "headers": {
      "API-Version": {
        "description": "Version of the API that served the response.",
        "schema": {
          "example": "0.1.0",
          "type": "string"
        }
      },
      "Deprecation": {
        "description": "RFC 9745 deprecation timestamp when an endpoint is scheduled for replacement.",
        "schema": {
          "type": "string"
        }
      },
      "RateLimit-Limit": {
        "description": "Maximum number of requests permitted in the current rate-limit window.",
        "schema": {
          "minimum": 1,
          "type": "integer"
        }
      },
      "RateLimit-Policy": {
        "description": "IETF RateLimit policy declaration (for example `600;w=60`).",
        "schema": {
          "type": "string"
        }
      },
      "RateLimit-Remaining": {
        "description": "Number of requests remaining in the current rate-limit window.",
        "schema": {
          "minimum": 0,
          "type": "integer"
        }
      },
      "RateLimit-Reset": {
        "description": "Seconds until the rate-limit quota resets.",
        "schema": {
          "minimum": 0,
          "type": "integer"
        }
      },
      "Retry-After": {
        "description": "Seconds to wait before retrying after a 429 Too Many Requests response.",
        "schema": {
          "minimum": 1,
          "type": "integer"
        }
      },
      "Sunset": {
        "description": "RFC 8594 HTTP-date after which a deprecated endpoint will be removed (at least 90 days notice).",
        "schema": {
          "type": "string"
        }
      }
    },
    "parameters": {
      "ApiVersion": {
        "description": "Requested API version label (defaults to the current stable version).",
        "in": "header",
        "name": "API-Version",
        "required": false,
        "schema": {
          "default": "0.1.0",
          "type": "string"
        }
      }
    },
    "schemas": {
      "ProblemDetails": {
        "properties": {
          "code": {
            "description": "Machine-readable error code.",
            "type": "string"
          },
          "detail": {
            "description": "Explanation of this specific error.",
            "type": "string"
          },
          "hint": {
            "description": "Actionable recovery guidance for callers.",
            "type": "string"
          },
          "status": {
            "description": "HTTP status code.",
            "type": "integer"
          },
          "title": {
            "description": "Short summary of the error.",
            "type": "string"
          },
          "type": {
            "description": "Stable URI identifying the error class.",
            "type": "string"
          }
        },
        "required": [
          "type",
          "title",
          "status",
          "detail"
        ],
        "type": "object"
      }
    },
    "securitySchemes": {
      "oauth2": {
        "description": "Least-privilege OAuth 2.1 scopes for authenticated operations; public read operations also accept anonymous requests.",
        "flows": {
          "authorizationCode": {
            "authorizationUrl": "https://acme.ferrite.run/oauth/authorize",
            "scopes": {
              "apps:discover": "Discover available operations, schemas, and public metadata.",
              "apps:read": "Read-only access to declared GET and read-only operations.",
              "apps:write": "Invoke mutating operations and asynchronous jobs."
            },
            "tokenUrl": "https://acme.ferrite.run/oauth/token"
          }
        },
        "type": "oauth2"
      }
    }
  },
  "info": {
    "description": "Acme Store is a demonstration shop that people and agents share: eighteen products in eleven collections, with search, colours and sizes, a cart and a checkout. Use it to find a product, compare prices, fill a cart or place an order. The checkout is a sandbox: it records the order and takes the stock, and it never takes a payment or ships anything. Every change runs through the same replay-safe actions the shop's own buttons use.\n\nVersioning and deprecation policy: endpoints are versioned via URL path and the optional `API-Version` header (current version: 0.1.0). Deprecated endpoints emit RFC 9745 `Deprecation` and RFC 8594 `Sunset` response headers at least 90 days before removal. Rate limits are communicated via IETF `RateLimit-Limit`, `RateLimit-Remaining`, `RateLimit-Reset`, `RateLimit-Policy`, and `Retry-After` headers.",
    "title": "acme",
    "version": "0.1.0"
  },
  "openapi": "3.1.0",
  "paths": {
    "/api/cart": {
      "get": {
        "operationId": "get_cart",
        "parameters": [
          {
            "in": "query",
            "name": "cart_id",
            "required": false,
            "schema": {
              "description": "the cart.id that add_to_cart returned; leave out in a browser, which sends its own cart cookie",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "description": "getCart() → Cart | undefined when no cartId cookie names one.",
                  "properties": {
                    "cart": {
                      "oneOf": [
                        {
                          "description": "Upstream Cart.",
                          "properties": {
                            "checkout_url": {
                              "type": "string"
                            },
                            "cost": {
                              "description": "Upstream cart cost.",
                              "properties": {
                                "subtotal_amount": {
                                  "description": "Upstream Money.",
                                  "properties": {
                                    "amount": {
                                      "description": "A decimal string, exactly as Shopify sends it (\"20.0\").",
                                      "type": "string"
                                    },
                                    "currency_code": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "amount",
                                    "currency_code"
                                  ],
                                  "type": "object"
                                },
                                "total_amount": {
                                  "description": "Upstream Money.",
                                  "properties": {
                                    "amount": {
                                      "description": "A decimal string, exactly as Shopify sends it (\"20.0\").",
                                      "type": "string"
                                    },
                                    "currency_code": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "amount",
                                    "currency_code"
                                  ],
                                  "type": "object"
                                },
                                "total_tax_amount": {
                                  "description": "Upstream Money.",
                                  "properties": {
                                    "amount": {
                                      "description": "A decimal string, exactly as Shopify sends it (\"20.0\").",
                                      "type": "string"
                                    },
                                    "currency_code": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "amount",
                                    "currency_code"
                                  ],
                                  "type": "object"
                                }
                              },
                              "required": [
                                "subtotal_amount",
                                "total_amount",
                                "total_tax_amount"
                              ],
                              "type": "object"
                            },
                            "id": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "lines": {
                              "items": {
                                "description": "Upstream CartItem. id is optional: an optimistic line has none.",
                                "properties": {
                                  "cost": {
                                    "properties": {
                                      "total_amount": {
                                        "description": "Upstream Money.",
                                        "properties": {
                                          "amount": {
                                            "description": "A decimal string, exactly as Shopify sends it (\"20.0\").",
                                            "type": "string"
                                          },
                                          "currency_code": {
                                            "type": "string"
                                          }
                                        },
                                        "required": [
                                          "amount",
                                          "currency_code"
                                        ],
                                        "type": "object"
                                      }
                                    },
                                    "required": [
                                      "total_amount"
                                    ],
                                    "type": "object"
                                  },
                                  "id": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "merchandise": {
                                    "description": "Upstream cart-line merchandise.",
                                    "properties": {
                                      "id": {
                                        "type": "string"
                                      },
                                      "product": {
                                        "description": "Upstream CartProduct — the trimmed product a cart line carries.",
                                        "properties": {
                                          "featured_image": {
                                            "description": "Upstream Image.",
                                            "properties": {
                                              "alt_text": {
                                                "type": "string"
                                              },
                                              "height": {
                                                "type": "integer"
                                              },
                                              "url": {
                                                "type": "string"
                                              },
                                              "width": {
                                                "type": "integer"
                                              }
                                            },
                                            "required": [
                                              "url",
                                              "alt_text",
                                              "width",
                                              "height"
                                            ],
                                            "type": "object"
                                          },
                                          "handle": {
                                            "type": "string"
                                          },
                                          "id": {
                                            "type": "string"
                                          },
                                          "title": {
                                            "type": "string"
                                          }
                                        },
                                        "required": [
                                          "id",
                                          "handle",
                                          "title",
                                          "featured_image"
                                        ],
                                        "type": "object"
                                      },
                                      "selected_options": {
                                        "items": {
                                          "description": "Upstream { name, value } selected-option pair.",
                                          "properties": {
                                            "name": {
                                              "type": "string"
                                            },
                                            "value": {
                                              "type": "string"
                                            }
                                          },
                                          "required": [
                                            "name",
                                            "value"
                                          ],
                                          "type": "object"
                                        },
                                        "type": "array"
                                      },
                                      "title": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "id",
                                      "title",
                                      "selected_options",
                                      "product"
                                    ],
                                    "type": "object"
                                  },
                                  "quantity": {
                                    "type": "integer"
                                  }
                                },
                                "required": [
                                  "quantity",
                                  "cost",
                                  "merchandise"
                                ],
                                "type": "object"
                              },
                              "type": "array"
                            },
                            "total_quantity": {
                              "type": "integer"
                            }
                          },
                          "required": [
                            "checkout_url",
                            "cost",
                            "lines",
                            "total_quantity"
                          ],
                          "type": "object"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Success",
            "headers": {
              "API-Version": {
                "$ref": "#/components/headers/API-Version"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              }
            }
          },
          "400": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            },
            "description": "Invalid request parameters or body (RFC 9457 problem details)"
          },
          "404": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            },
            "description": "Resource not found (RFC 9457 problem details)"
          },
          "429": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            },
            "description": "Rate limit exceeded; wait Retry-After seconds before retrying",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            },
            "description": "Error (RFC 9457 problem details)"
          }
        },
        "summary": "Read a cart and what it would cost. Use it to check the lines before place_order. Returns the cart with its lines, quantities and totals, or a null cart when no open cart matches.",
        "x-idempotent": true,
        "x-read-only": true
      }
    },
    "/api/cart/items": {
      "post": {
        "operationId": "add_to_cart",
        "parameters": [
          {
            "description": "Retry-safe: a request repeating this key returns the first result instead of running again.",
            "in": "header",
            "name": "idempotency-key",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "cart_id": {
                    "description": "the cart.id from an earlier add_to_cart; leave out to open a new cart",
                    "type": "string"
                  },
                  "variant_id": {
                    "description": "the id of the chosen variant, from get_product",
                    "examples": [
                      "acme-mug-variant-1"
                    ],
                    "type": "string"
                  }
                },
                "required": [
                  "variant_id"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "description": "The string | undefined an upstream cart action resolves to, plus the authoritative cart so useOptimistic settles against server truth without a second round trip.",
                  "properties": {
                    "cart": {
                      "oneOf": [
                        {
                          "description": "Upstream Cart.",
                          "properties": {
                            "checkout_url": {
                              "type": "string"
                            },
                            "cost": {
                              "description": "Upstream cart cost.",
                              "properties": {
                                "subtotal_amount": {
                                  "description": "Upstream Money.",
                                  "properties": {
                                    "amount": {
                                      "description": "A decimal string, exactly as Shopify sends it (\"20.0\").",
                                      "type": "string"
                                    },
                                    "currency_code": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "amount",
                                    "currency_code"
                                  ],
                                  "type": "object"
                                },
                                "total_amount": {
                                  "description": "Upstream Money.",
                                  "properties": {
                                    "amount": {
                                      "description": "A decimal string, exactly as Shopify sends it (\"20.0\").",
                                      "type": "string"
                                    },
                                    "currency_code": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "amount",
                                    "currency_code"
                                  ],
                                  "type": "object"
                                },
                                "total_tax_amount": {
                                  "description": "Upstream Money.",
                                  "properties": {
                                    "amount": {
                                      "description": "A decimal string, exactly as Shopify sends it (\"20.0\").",
                                      "type": "string"
                                    },
                                    "currency_code": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "amount",
                                    "currency_code"
                                  ],
                                  "type": "object"
                                }
                              },
                              "required": [
                                "subtotal_amount",
                                "total_amount",
                                "total_tax_amount"
                              ],
                              "type": "object"
                            },
                            "id": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "lines": {
                              "items": {
                                "description": "Upstream CartItem. id is optional: an optimistic line has none.",
                                "properties": {
                                  "cost": {
                                    "properties": {
                                      "total_amount": {
                                        "description": "Upstream Money.",
                                        "properties": {
                                          "amount": {
                                            "description": "A decimal string, exactly as Shopify sends it (\"20.0\").",
                                            "type": "string"
                                          },
                                          "currency_code": {
                                            "type": "string"
                                          }
                                        },
                                        "required": [
                                          "amount",
                                          "currency_code"
                                        ],
                                        "type": "object"
                                      }
                                    },
                                    "required": [
                                      "total_amount"
                                    ],
                                    "type": "object"
                                  },
                                  "id": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "merchandise": {
                                    "description": "Upstream cart-line merchandise.",
                                    "properties": {
                                      "id": {
                                        "type": "string"
                                      },
                                      "product": {
                                        "description": "Upstream CartProduct — the trimmed product a cart line carries.",
                                        "properties": {
                                          "featured_image": {
                                            "description": "Upstream Image.",
                                            "properties": {
                                              "alt_text": {
                                                "type": "string"
                                              },
                                              "height": {
                                                "type": "integer"
                                              },
                                              "url": {
                                                "type": "string"
                                              },
                                              "width": {
                                                "type": "integer"
                                              }
                                            },
                                            "required": [
                                              "url",
                                              "alt_text",
                                              "width",
                                              "height"
                                            ],
                                            "type": "object"
                                          },
                                          "handle": {
                                            "type": "string"
                                          },
                                          "id": {
                                            "type": "string"
                                          },
                                          "title": {
                                            "type": "string"
                                          }
                                        },
                                        "required": [
                                          "id",
                                          "handle",
                                          "title",
                                          "featured_image"
                                        ],
                                        "type": "object"
                                      },
                                      "selected_options": {
                                        "items": {
                                          "description": "Upstream { name, value } selected-option pair.",
                                          "properties": {
                                            "name": {
                                              "type": "string"
                                            },
                                            "value": {
                                              "type": "string"
                                            }
                                          },
                                          "required": [
                                            "name",
                                            "value"
                                          ],
                                          "type": "object"
                                        },
                                        "type": "array"
                                      },
                                      "title": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "id",
                                      "title",
                                      "selected_options",
                                      "product"
                                    ],
                                    "type": "object"
                                  },
                                  "quantity": {
                                    "type": "integer"
                                  }
                                },
                                "required": [
                                  "quantity",
                                  "cost",
                                  "merchandise"
                                ],
                                "type": "object"
                              },
                              "type": "array"
                            },
                            "total_quantity": {
                              "type": "integer"
                            }
                          },
                          "required": [
                            "checkout_url",
                            "cost",
                            "lines",
                            "total_quantity"
                          ],
                          "type": "object"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "error": {
                      "description": "Upstream's error string (\"Error adding item to cart\", ...); absent on success.",
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Success",
            "headers": {
              "API-Version": {
                "$ref": "#/components/headers/API-Version"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              }
            }
          },
          "400": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            },
            "description": "Invalid request parameters or body (RFC 9457 problem details)"
          },
          "404": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            },
            "description": "Resource not found (RFC 9457 problem details)"
          },
          "429": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            },
            "description": "Rate limit exceeded; wait Retry-After seconds before retrying",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            },
            "description": "Error (RFC 9457 problem details)"
          }
        },
        "summary": "Put one unit of a variant in a cart. Use it after get_product has given you the variant id, and keep cart.id from the answer for the next call. Returns the whole cart, or an error when the variant is unknown or out of stock.",
        "x-idempotent": true,
        "x-read-only": false
      }
    },
    "/api/cart/items/update": {
      "post": {
        "operationId": "update_cart_item",
        "parameters": [
          {
            "description": "Retry-safe: a request repeating this key returns the first result instead of running again.",
            "in": "header",
            "name": "idempotency-key",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "cart_id": {
                    "description": "the cart.id that add_to_cart returned; leave out in a browser, which sends its own cart cookie",
                    "type": "string"
                  },
                  "quantity": {
                    "description": "the new number of units; 0 removes the line",
                    "examples": [
                      2
                    ],
                    "maximum": 50,
                    "minimum": 0,
                    "type": "integer"
                  },
                  "variant_id": {
                    "description": "the variant to change",
                    "examples": [
                      "acme-mug-variant-1"
                    ],
                    "type": "string"
                  }
                },
                "required": [
                  "variant_id",
                  "quantity"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "description": "The string | undefined an upstream cart action resolves to, plus the authoritative cart so useOptimistic settles against server truth without a second round trip.",
                  "properties": {
                    "cart": {
                      "oneOf": [
                        {
                          "description": "Upstream Cart.",
                          "properties": {
                            "checkout_url": {
                              "type": "string"
                            },
                            "cost": {
                              "description": "Upstream cart cost.",
                              "properties": {
                                "subtotal_amount": {
                                  "description": "Upstream Money.",
                                  "properties": {
                                    "amount": {
                                      "description": "A decimal string, exactly as Shopify sends it (\"20.0\").",
                                      "type": "string"
                                    },
                                    "currency_code": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "amount",
                                    "currency_code"
                                  ],
                                  "type": "object"
                                },
                                "total_amount": {
                                  "description": "Upstream Money.",
                                  "properties": {
                                    "amount": {
                                      "description": "A decimal string, exactly as Shopify sends it (\"20.0\").",
                                      "type": "string"
                                    },
                                    "currency_code": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "amount",
                                    "currency_code"
                                  ],
                                  "type": "object"
                                },
                                "total_tax_amount": {
                                  "description": "Upstream Money.",
                                  "properties": {
                                    "amount": {
                                      "description": "A decimal string, exactly as Shopify sends it (\"20.0\").",
                                      "type": "string"
                                    },
                                    "currency_code": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "amount",
                                    "currency_code"
                                  ],
                                  "type": "object"
                                }
                              },
                              "required": [
                                "subtotal_amount",
                                "total_amount",
                                "total_tax_amount"
                              ],
                              "type": "object"
                            },
                            "id": {
                              "type": [
                                "string",
                                "null"
                              ]
                            },
                            "lines": {
                              "items": {
                                "description": "Upstream CartItem. id is optional: an optimistic line has none.",
                                "properties": {
                                  "cost": {
                                    "properties": {
                                      "total_amount": {
                                        "description": "Upstream Money.",
                                        "properties": {
                                          "amount": {
                                            "description": "A decimal string, exactly as Shopify sends it (\"20.0\").",
                                            "type": "string"
                                          },
                                          "currency_code": {
                                            "type": "string"
                                          }
                                        },
                                        "required": [
                                          "amount",
                                          "currency_code"
                                        ],
                                        "type": "object"
                                      }
                                    },
                                    "required": [
                                      "total_amount"
                                    ],
                                    "type": "object"
                                  },
                                  "id": {
                                    "type": [
                                      "string",
                                      "null"
                                    ]
                                  },
                                  "merchandise": {
                                    "description": "Upstream cart-line merchandise.",
                                    "properties": {
                                      "id": {
                                        "type": "string"
                                      },
                                      "product": {
                                        "description": "Upstream CartProduct — the trimmed product a cart line carries.",
                                        "properties": {
                                          "featured_image": {
                                            "description": "Upstream Image.",
                                            "properties": {
                                              "alt_text": {
                                                "type": "string"
                                              },
                                              "height": {
                                                "type": "integer"
                                              },
                                              "url": {
                                                "type": "string"
                                              },
                                              "width": {
                                                "type": "integer"
                                              }
                                            },
                                            "required": [
                                              "url",
                                              "alt_text",
                                              "width",
                                              "height"
                                            ],
                                            "type": "object"
                                          },
                                          "handle": {
                                            "type": "string"
                                          },
                                          "id": {
                                            "type": "string"
                                          },
                                          "title": {
                                            "type": "string"
                                          }
                                        },
                                        "required": [
                                          "id",
                                          "handle",
                                          "title",
                                          "featured_image"
                                        ],
                                        "type": "object"
                                      },
                                      "selected_options": {
                                        "items": {
                                          "description": "Upstream { name, value } selected-option pair.",
                                          "properties": {
                                            "name": {
                                              "type": "string"
                                            },
                                            "value": {
                                              "type": "string"
                                            }
                                          },
                                          "required": [
                                            "name",
                                            "value"
                                          ],
                                          "type": "object"
                                        },
                                        "type": "array"
                                      },
                                      "title": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "id",
                                      "title",
                                      "selected_options",
                                      "product"
                                    ],
                                    "type": "object"
                                  },
                                  "quantity": {
                                    "type": "integer"
                                  }
                                },
                                "required": [
                                  "quantity",
                                  "cost",
                                  "merchandise"
                                ],
                                "type": "object"
                              },
                              "type": "array"
                            },
                            "total_quantity": {
                              "type": "integer"
                            }
                          },
                          "required": [
                            "checkout_url",
                            "cost",
                            "lines",
                            "total_quantity"
                          ],
                          "type": "object"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "error": {
                      "description": "Upstream's error string (\"Error adding item to cart\", ...); absent on success.",
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Success",
            "headers": {
              "API-Version": {
                "$ref": "#/components/headers/API-Version"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              }
            }
          },
          "400": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            },
            "description": "Invalid request parameters or body (RFC 9457 problem details)"
          },
          "404": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            },
            "description": "Resource not found (RFC 9457 problem details)"
          },
          "429": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            },
            "description": "Rate limit exceeded; wait Retry-After seconds before retrying",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            },
            "description": "Error (RFC 9457 problem details)"
          }
        },
        "summary": "Set how many units of a variant a cart holds. Use it to buy several of one thing, or to take a line out with quantity 0. Returns the whole cart, or an error when there is not that much stock or no open cart.",
        "x-idempotent": true,
        "x-read-only": false
      }
    },
    "/api/collections": {
      "get": {
        "operationId": "list_collections",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "collections": {
                      "items": {
                        "description": "Upstream Collection (reshaped: path added).",
                        "properties": {
                          "description": {
                            "type": "string"
                          },
                          "handle": {
                            "type": "string"
                          },
                          "path": {
                            "type": "string"
                          },
                          "seo": {
                            "description": "Upstream SEO.",
                            "properties": {
                              "description": {
                                "type": "string"
                              },
                              "title": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "title",
                              "description"
                            ],
                            "type": "object"
                          },
                          "title": {
                            "type": "string"
                          },
                          "updated_at": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "handle",
                          "title",
                          "description",
                          "seo",
                          "updated_at",
                          "path"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "collections"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Success",
            "headers": {
              "API-Version": {
                "$ref": "#/components/headers/API-Version"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              }
            }
          },
          "400": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            },
            "description": "Invalid request parameters or body (RFC 9457 problem details)"
          },
          "404": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            },
            "description": "Resource not found (RFC 9457 problem details)"
          },
          "429": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            },
            "description": "Rate limit exceeded; wait Retry-After seconds before retrying",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            },
            "description": "Error (RFC 9457 problem details)"
          }
        },
        "summary": "List the shop's collections, such as shirts, headwear and drinkware. Use it to see what the shop sells before reading one collection. Returns each collection's handle, title, description and page.",
        "x-idempotent": true,
        "x-read-only": true
      }
    },
    "/api/collections/{handle}/products": {
      "get": {
        "operationId": "list_collection_products",
        "parameters": [
          {
            "in": "path",
            "name": "handle",
            "required": true,
            "schema": {
              "description": "the collection handle, from list_collections",
              "examples": [
                "shirts"
              ],
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "sort",
            "required": false,
            "schema": {
              "description": "the order of the products; leave out for the shop's own order",
              "enum": [
                "trending-desc",
                "latest-desc",
                "price-asc",
                "price-desc"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "collection": {
                      "description": "Upstream Collection (reshaped: path added).",
                      "properties": {
                        "description": {
                          "type": "string"
                        },
                        "handle": {
                          "type": "string"
                        },
                        "path": {
                          "type": "string"
                        },
                        "seo": {
                          "description": "Upstream SEO.",
                          "properties": {
                            "description": {
                              "type": "string"
                            },
                            "title": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "title",
                            "description"
                          ],
                          "type": "object"
                        },
                        "title": {
                          "type": "string"
                        },
                        "updated_at": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "handle",
                        "title",
                        "description",
                        "seo",
                        "updated_at",
                        "path"
                      ],
                      "type": "object"
                    },
                    "products": {
                      "items": {
                        "properties": {
                          "available_for_sale": {
                            "type": "boolean"
                          },
                          "description": {
                            "type": "string"
                          },
                          "handle": {
                            "description": "Pass to get_product as handle.",
                            "type": "string"
                          },
                          "path": {
                            "description": "The product's page in the shop.",
                            "type": "string"
                          },
                          "price_range": {
                            "description": "Upstream { maxVariantPrice, minVariantPrice }.",
                            "properties": {
                              "max_variant_price": {
                                "description": "Upstream Money.",
                                "properties": {
                                  "amount": {
                                    "description": "A decimal string, exactly as Shopify sends it (\"20.0\").",
                                    "type": "string"
                                  },
                                  "currency_code": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "amount",
                                  "currency_code"
                                ],
                                "type": "object"
                              },
                              "min_variant_price": {
                                "description": "Upstream Money.",
                                "properties": {
                                  "amount": {
                                    "description": "A decimal string, exactly as Shopify sends it (\"20.0\").",
                                    "type": "string"
                                  },
                                  "currency_code": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "amount",
                                  "currency_code"
                                ],
                                "type": "object"
                              }
                            },
                            "required": [
                              "max_variant_price",
                              "min_variant_price"
                            ],
                            "type": "object"
                          },
                          "tags": {
                            "items": {
                              "type": "string"
                            },
                            "type": "array"
                          },
                          "title": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "handle",
                          "title",
                          "description",
                          "available_for_sale",
                          "price_range",
                          "tags",
                          "path"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "collection",
                    "products"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Success",
            "headers": {
              "API-Version": {
                "$ref": "#/components/headers/API-Version"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              }
            }
          },
          "400": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            },
            "description": "Invalid request parameters or body (RFC 9457 problem details)"
          },
          "404": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            },
            "description": "Resource not found (RFC 9457 problem details)"
          },
          "429": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            },
            "description": "Rate limit exceeded; wait Retry-After seconds before retrying",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            },
            "description": "Error (RFC 9457 problem details)"
          }
        },
        "summary": "List the products in one collection. Use it when somebody asks for a kind of product rather than a name. Returns the collection and its products in the same short form as search_products.",
        "x-idempotent": true,
        "x-read-only": true
      }
    },
    "/api/orders": {
      "post": {
        "operationId": "place_order",
        "parameters": [
          {
            "description": "Retry-safe: a request repeating this key returns the first result instead of running again.",
            "in": "header",
            "name": "idempotency-key",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "cart_id": {
                    "description": "the cart.id that add_to_cart returned; leave out in a browser, which sends its own cart cookie",
                    "type": "string"
                  },
                  "email": {
                    "description": "an email address for the order; no message is sent to it",
                    "examples": [
                      "ada@example.com"
                    ],
                    "type": "string"
                  },
                  "name": {
                    "description": "the customer's name, 1 to 120 characters",
                    "examples": [
                      "Ada Example"
                    ],
                    "type": "string"
                  }
                },
                "required": [
                  "email",
                  "name"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "description": "The order, or upstream-style error prose when the cart cannot be placed (empty, unknown line, or not enough stock).",
                  "properties": {
                    "error": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "order": {
                      "oneOf": [
                        {
                          "description": "A placed order.",
                          "properties": {
                            "cancelled": {
                              "description": "True only after every line has been restored. Original prices are retained.",
                              "type": "boolean"
                            },
                            "confirmation_path": {
                              "description": "The confirmation page for this order, carrying its receipt key.",
                              "type": "string"
                            },
                            "email": {
                              "type": "string"
                            },
                            "id": {
                              "type": "string"
                            },
                            "lines": {
                              "items": {
                                "description": "One line of a placed order, priced at the moment of placement.",
                                "properties": {
                                  "merchandise_id": {
                                    "type": "string"
                                  },
                                  "product_title": {
                                    "type": "string"
                                  },
                                  "quantity": {
                                    "type": "integer"
                                  },
                                  "total_amount": {
                                    "description": "Upstream Money.",
                                    "properties": {
                                      "amount": {
                                        "description": "A decimal string, exactly as Shopify sends it (\"20.0\").",
                                        "type": "string"
                                      },
                                      "currency_code": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "amount",
                                      "currency_code"
                                    ],
                                    "type": "object"
                                  },
                                  "unit_amount": {
                                    "description": "Upstream Money.",
                                    "properties": {
                                      "amount": {
                                        "description": "A decimal string, exactly as Shopify sends it (\"20.0\").",
                                        "type": "string"
                                      },
                                      "currency_code": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "amount",
                                      "currency_code"
                                    ],
                                    "type": "object"
                                  },
                                  "variant_title": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "merchandise_id",
                                  "product_title",
                                  "variant_title",
                                  "quantity",
                                  "unit_amount",
                                  "total_amount"
                                ],
                                "type": "object"
                              },
                              "type": "array"
                            },
                            "name": {
                              "type": "string"
                            },
                            "number": {
                              "description": "The human order number (AC-1F3A9C).",
                              "type": "string"
                            },
                            "payment_mode": {
                              "description": "sandbox: recorded, stock taken, nothing charged.",
                              "type": "string"
                            },
                            "payment_status": {
                              "description": "no-charge for a sandbox order.",
                              "type": "string"
                            },
                            "placed_at_ms": {
                              "description": "a 64-bit integer, carried as a decimal string because it exceeds Number.MAX_SAFE_INTEGER",
                              "type": "string"
                            },
                            "subtotal_amount": {
                              "description": "Upstream Money.",
                              "properties": {
                                "amount": {
                                  "description": "A decimal string, exactly as Shopify sends it (\"20.0\").",
                                  "type": "string"
                                },
                                "currency_code": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "amount",
                                "currency_code"
                              ],
                              "type": "object"
                            },
                            "total_amount": {
                              "description": "Upstream Money.",
                              "properties": {
                                "amount": {
                                  "description": "A decimal string, exactly as Shopify sends it (\"20.0\").",
                                  "type": "string"
                                },
                                "currency_code": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "amount",
                                "currency_code"
                              ],
                              "type": "object"
                            }
                          },
                          "required": [
                            "id",
                            "number",
                            "email",
                            "name",
                            "lines",
                            "subtotal_amount",
                            "total_amount",
                            "payment_mode",
                            "payment_status",
                            "cancelled",
                            "placed_at_ms",
                            "confirmation_path"
                          ],
                          "type": "object"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Success",
            "headers": {
              "API-Version": {
                "$ref": "#/components/headers/API-Version"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              }
            }
          },
          "400": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            },
            "description": "Invalid request parameters or body (RFC 9457 problem details)"
          },
          "404": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            },
            "description": "Resource not found (RFC 9457 problem details)"
          },
          "429": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            },
            "description": "Rate limit exceeded; wait Retry-After seconds before retrying",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            },
            "description": "Error (RFC 9457 problem details)"
          }
        },
        "summary": "Turn a cart into an order. Use it once get_cart shows what the customer wants; the checkout is a sandbox, so no payment is taken and nothing is shipped. Returns the order with its number, totals and confirmation_path, or an error when the cart is empty or the stock is gone.",
        "x-idempotent": true,
        "x-read-only": false
      }
    },
    "/api/orders/{order_id}/cancel": {
      "post": {
        "operationId": "cancel_order",
        "parameters": [
          {
            "in": "path",
            "name": "order_id",
            "required": true,
            "schema": {
              "description": "the order id, from place_order",
              "examples": [
                "o0123456789abcdef"
              ],
              "type": "string"
            }
          },
          {
            "description": "Retry-safe: a request repeating this key returns the first result instead of running again.",
            "in": "header",
            "name": "idempotency-key",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "order_id": {
                    "description": "the order id, from place_order",
                    "examples": [
                      "o0123456789abcdef"
                    ],
                    "type": "string"
                  },
                  "receipt_key": {
                    "description": "the value of key in the order's confirmation_path",
                    "examples": [
                      "0123456789abcdef"
                    ],
                    "type": "string"
                  }
                },
                "required": [
                  "order_id",
                  "receipt_key"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "description": "The order, or upstream-style error prose when the cart cannot be placed (empty, unknown line, or not enough stock).",
                  "properties": {
                    "error": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "order": {
                      "oneOf": [
                        {
                          "description": "A placed order.",
                          "properties": {
                            "cancelled": {
                              "description": "True only after every line has been restored. Original prices are retained.",
                              "type": "boolean"
                            },
                            "confirmation_path": {
                              "description": "The confirmation page for this order, carrying its receipt key.",
                              "type": "string"
                            },
                            "email": {
                              "type": "string"
                            },
                            "id": {
                              "type": "string"
                            },
                            "lines": {
                              "items": {
                                "description": "One line of a placed order, priced at the moment of placement.",
                                "properties": {
                                  "merchandise_id": {
                                    "type": "string"
                                  },
                                  "product_title": {
                                    "type": "string"
                                  },
                                  "quantity": {
                                    "type": "integer"
                                  },
                                  "total_amount": {
                                    "description": "Upstream Money.",
                                    "properties": {
                                      "amount": {
                                        "description": "A decimal string, exactly as Shopify sends it (\"20.0\").",
                                        "type": "string"
                                      },
                                      "currency_code": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "amount",
                                      "currency_code"
                                    ],
                                    "type": "object"
                                  },
                                  "unit_amount": {
                                    "description": "Upstream Money.",
                                    "properties": {
                                      "amount": {
                                        "description": "A decimal string, exactly as Shopify sends it (\"20.0\").",
                                        "type": "string"
                                      },
                                      "currency_code": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "amount",
                                      "currency_code"
                                    ],
                                    "type": "object"
                                  },
                                  "variant_title": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "merchandise_id",
                                  "product_title",
                                  "variant_title",
                                  "quantity",
                                  "unit_amount",
                                  "total_amount"
                                ],
                                "type": "object"
                              },
                              "type": "array"
                            },
                            "name": {
                              "type": "string"
                            },
                            "number": {
                              "description": "The human order number (AC-1F3A9C).",
                              "type": "string"
                            },
                            "payment_mode": {
                              "description": "sandbox: recorded, stock taken, nothing charged.",
                              "type": "string"
                            },
                            "payment_status": {
                              "description": "no-charge for a sandbox order.",
                              "type": "string"
                            },
                            "placed_at_ms": {
                              "description": "a 64-bit integer, carried as a decimal string because it exceeds Number.MAX_SAFE_INTEGER",
                              "type": "string"
                            },
                            "subtotal_amount": {
                              "description": "Upstream Money.",
                              "properties": {
                                "amount": {
                                  "description": "A decimal string, exactly as Shopify sends it (\"20.0\").",
                                  "type": "string"
                                },
                                "currency_code": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "amount",
                                "currency_code"
                              ],
                              "type": "object"
                            },
                            "total_amount": {
                              "description": "Upstream Money.",
                              "properties": {
                                "amount": {
                                  "description": "A decimal string, exactly as Shopify sends it (\"20.0\").",
                                  "type": "string"
                                },
                                "currency_code": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "amount",
                                "currency_code"
                              ],
                              "type": "object"
                            }
                          },
                          "required": [
                            "id",
                            "number",
                            "email",
                            "name",
                            "lines",
                            "subtotal_amount",
                            "total_amount",
                            "payment_mode",
                            "payment_status",
                            "cancelled",
                            "placed_at_ms",
                            "confirmation_path"
                          ],
                          "type": "object"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "type": "object"
                }
              }
            },
            "description": "Success",
            "headers": {
              "API-Version": {
                "$ref": "#/components/headers/API-Version"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              }
            }
          },
          "400": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            },
            "description": "Invalid request parameters or body (RFC 9457 problem details)"
          },
          "404": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            },
            "description": "Resource not found (RFC 9457 problem details)"
          },
          "429": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            },
            "description": "Rate limit exceeded; wait Retry-After seconds before retrying",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            },
            "description": "Error (RFC 9457 problem details)"
          }
        },
        "summary": "Cancel a sandbox order and put its stock back. Use it to undo place_order; the order stays on record with its original prices. Returns the cancelled order, or a 403 problem when the receipt key does not match.",
        "x-idempotent": true,
        "x-read-only": false
      }
    },
    "/api/products": {
      "get": {
        "operationId": "search_products",
        "parameters": [
          {
            "in": "query",
            "name": "q",
            "required": false,
            "schema": {
              "description": "part of a product name, description or tag; leave out to list every product",
              "examples": [
                "mug"
              ],
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "sort",
            "required": false,
            "schema": {
              "description": "the order of the products; leave out for the shop's own order",
              "enum": [
                "trending-desc",
                "latest-desc",
                "price-asc",
                "price-desc"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "products": {
                      "items": {
                        "properties": {
                          "available_for_sale": {
                            "type": "boolean"
                          },
                          "description": {
                            "type": "string"
                          },
                          "handle": {
                            "description": "Pass to get_product as handle.",
                            "type": "string"
                          },
                          "path": {
                            "description": "The product's page in the shop.",
                            "type": "string"
                          },
                          "price_range": {
                            "description": "Upstream { maxVariantPrice, minVariantPrice }.",
                            "properties": {
                              "max_variant_price": {
                                "description": "Upstream Money.",
                                "properties": {
                                  "amount": {
                                    "description": "A decimal string, exactly as Shopify sends it (\"20.0\").",
                                    "type": "string"
                                  },
                                  "currency_code": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "amount",
                                  "currency_code"
                                ],
                                "type": "object"
                              },
                              "min_variant_price": {
                                "description": "Upstream Money.",
                                "properties": {
                                  "amount": {
                                    "description": "A decimal string, exactly as Shopify sends it (\"20.0\").",
                                    "type": "string"
                                  },
                                  "currency_code": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "amount",
                                  "currency_code"
                                ],
                                "type": "object"
                              }
                            },
                            "required": [
                              "max_variant_price",
                              "min_variant_price"
                            ],
                            "type": "object"
                          },
                          "tags": {
                            "items": {
                              "type": "string"
                            },
                            "type": "array"
                          },
                          "title": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "handle",
                          "title",
                          "description",
                          "available_for_sale",
                          "price_range",
                          "tags",
                          "path"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "products"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Success",
            "headers": {
              "API-Version": {
                "$ref": "#/components/headers/API-Version"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              }
            }
          },
          "400": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            },
            "description": "Invalid request parameters or body (RFC 9457 problem details)"
          },
          "404": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            },
            "description": "Resource not found (RFC 9457 problem details)"
          },
          "429": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            },
            "description": "Rate limit exceeded; wait Retry-After seconds before retrying",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            },
            "description": "Error (RFC 9457 problem details)"
          }
        },
        "summary": "Search product titles, descriptions and tags, ignoring case. Use it first to find a product's handle; without q it lists the whole catalogue. Returns each product's handle, title, description, price range, availability and page.",
        "x-idempotent": true,
        "x-read-only": true
      }
    },
    "/api/products/{handle}": {
      "get": {
        "operationId": "get_product",
        "parameters": [
          {
            "in": "path",
            "name": "handle",
            "required": true,
            "schema": {
              "description": "the product handle, from a search or a collection",
              "examples": [
                "acme-mug"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "product": {
                      "description": "Upstream Product (the reshaped one the UI consumes).",
                      "properties": {
                        "available_for_sale": {
                          "type": "boolean"
                        },
                        "description": {
                          "type": "string"
                        },
                        "description_html": {
                          "type": "string"
                        },
                        "featured_image": {
                          "description": "Upstream Image.",
                          "properties": {
                            "alt_text": {
                              "type": "string"
                            },
                            "height": {
                              "type": "integer"
                            },
                            "url": {
                              "type": "string"
                            },
                            "width": {
                              "type": "integer"
                            }
                          },
                          "required": [
                            "url",
                            "alt_text",
                            "width",
                            "height"
                          ],
                          "type": "object"
                        },
                        "handle": {
                          "type": "string"
                        },
                        "id": {
                          "type": "string"
                        },
                        "images": {
                          "items": {
                            "description": "Upstream Image.",
                            "properties": {
                              "alt_text": {
                                "type": "string"
                              },
                              "height": {
                                "type": "integer"
                              },
                              "url": {
                                "type": "string"
                              },
                              "width": {
                                "type": "integer"
                              }
                            },
                            "required": [
                              "url",
                              "alt_text",
                              "width",
                              "height"
                            ],
                            "type": "object"
                          },
                          "type": "array"
                        },
                        "options": {
                          "items": {
                            "description": "Upstream ProductOption.",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              },
                              "values": {
                                "items": {
                                  "type": "string"
                                },
                                "type": "array"
                              }
                            },
                            "required": [
                              "id",
                              "name",
                              "values"
                            ],
                            "type": "object"
                          },
                          "type": "array"
                        },
                        "price_range": {
                          "description": "Upstream { maxVariantPrice, minVariantPrice }.",
                          "properties": {
                            "max_variant_price": {
                              "description": "Upstream Money.",
                              "properties": {
                                "amount": {
                                  "description": "A decimal string, exactly as Shopify sends it (\"20.0\").",
                                  "type": "string"
                                },
                                "currency_code": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "amount",
                                "currency_code"
                              ],
                              "type": "object"
                            },
                            "min_variant_price": {
                              "description": "Upstream Money.",
                              "properties": {
                                "amount": {
                                  "description": "A decimal string, exactly as Shopify sends it (\"20.0\").",
                                  "type": "string"
                                },
                                "currency_code": {
                                  "type": "string"
                                }
                              },
                              "required": [
                                "amount",
                                "currency_code"
                              ],
                              "type": "object"
                            }
                          },
                          "required": [
                            "max_variant_price",
                            "min_variant_price"
                          ],
                          "type": "object"
                        },
                        "seo": {
                          "description": "Upstream SEO.",
                          "properties": {
                            "description": {
                              "type": "string"
                            },
                            "title": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "title",
                            "description"
                          ],
                          "type": "object"
                        },
                        "tags": {
                          "items": {
                            "type": "string"
                          },
                          "type": "array"
                        },
                        "title": {
                          "type": "string"
                        },
                        "updated_at": {
                          "type": "string"
                        },
                        "variants": {
                          "items": {
                            "description": "Upstream ProductVariant.",
                            "properties": {
                              "available_for_sale": {
                                "type": "boolean"
                              },
                              "id": {
                                "type": "string"
                              },
                              "price": {
                                "description": "Upstream Money.",
                                "properties": {
                                  "amount": {
                                    "description": "A decimal string, exactly as Shopify sends it (\"20.0\").",
                                    "type": "string"
                                  },
                                  "currency_code": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "amount",
                                  "currency_code"
                                ],
                                "type": "object"
                              },
                              "selected_options": {
                                "items": {
                                  "description": "Upstream { name, value } selected-option pair.",
                                  "properties": {
                                    "name": {
                                      "type": "string"
                                    },
                                    "value": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "name",
                                    "value"
                                  ],
                                  "type": "object"
                                },
                                "type": "array"
                              },
                              "title": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "id",
                              "title",
                              "available_for_sale",
                              "selected_options",
                              "price"
                            ],
                            "type": "object"
                          },
                          "type": "array"
                        }
                      },
                      "required": [
                        "id",
                        "handle",
                        "available_for_sale",
                        "title",
                        "description",
                        "description_html",
                        "options",
                        "price_range",
                        "variants",
                        "featured_image",
                        "images",
                        "seo",
                        "tags",
                        "updated_at"
                      ],
                      "type": "object"
                    },
                    "related": {
                      "items": {
                        "properties": {
                          "available_for_sale": {
                            "type": "boolean"
                          },
                          "description": {
                            "type": "string"
                          },
                          "handle": {
                            "description": "Pass to get_product as handle.",
                            "type": "string"
                          },
                          "path": {
                            "description": "The product's page in the shop.",
                            "type": "string"
                          },
                          "price_range": {
                            "description": "Upstream { maxVariantPrice, minVariantPrice }.",
                            "properties": {
                              "max_variant_price": {
                                "description": "Upstream Money.",
                                "properties": {
                                  "amount": {
                                    "description": "A decimal string, exactly as Shopify sends it (\"20.0\").",
                                    "type": "string"
                                  },
                                  "currency_code": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "amount",
                                  "currency_code"
                                ],
                                "type": "object"
                              },
                              "min_variant_price": {
                                "description": "Upstream Money.",
                                "properties": {
                                  "amount": {
                                    "description": "A decimal string, exactly as Shopify sends it (\"20.0\").",
                                    "type": "string"
                                  },
                                  "currency_code": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "amount",
                                  "currency_code"
                                ],
                                "type": "object"
                              }
                            },
                            "required": [
                              "max_variant_price",
                              "min_variant_price"
                            ],
                            "type": "object"
                          },
                          "tags": {
                            "items": {
                              "type": "string"
                            },
                            "type": "array"
                          },
                          "title": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "handle",
                          "title",
                          "description",
                          "available_for_sale",
                          "price_range",
                          "tags",
                          "path"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "product",
                    "related"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Success",
            "headers": {
              "API-Version": {
                "$ref": "#/components/headers/API-Version"
              },
              "Deprecation": {
                "$ref": "#/components/headers/Deprecation"
              },
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "Sunset": {
                "$ref": "#/components/headers/Sunset"
              }
            }
          },
          "400": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            },
            "description": "Invalid request parameters or body (RFC 9457 problem details)"
          },
          "404": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            },
            "description": "Resource not found (RFC 9457 problem details)"
          },
          "429": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            },
            "description": "Rate limit exceeded; wait Retry-After seconds before retrying",
            "headers": {
              "RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimit-Limit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimit-Remaining"
              },
              "RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimit-Reset"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            }
          },
          "default": {
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            },
            "description": "Error (RFC 9457 problem details)"
          }
        },
        "summary": "Read one product with its options and variants. Use it before add_to_cart, which needs the id of one variant. Returns the product with every variant's id, options, price and availability, plus related products.",
        "x-idempotent": true,
        "x-read-only": true
      }
    }
  },
  "security": [
    {},
    {
      "oauth2": [
        "apps:discover",
        "apps:read",
        "apps:write"
      ]
    }
  ],
  "servers": [
    {
      "url": "https://acme.ferrite.run"
    }
  ],
  "x-agent-card": "https://acme.ferrite.run/.well-known/agent-card.json",
  "x-ard-catalog": "https://acme.ferrite.run/.well-known/ard.json",
  "x-llms-txt": "https://acme.ferrite.run/llms.txt",
  "x-mcp-endpoint": "https://acme.ferrite.run/mcp",
  "x-webmcp": "https://acme.ferrite.run/.well-known/webmcp.js"
}