{
  "openapi": "3.1.0",
  "info": {
    "title": "WooApp native backend",
    "version": "2.0.1",
    "description": "WooApp v1 custom endpoints. Use WooCommerce Store API for catalog, filters, cart items, coupons, shipping and addresses. Customer bearer tokens are scoped to WooApp v1 and wc/store/v1 only. Dedicated Stripe and PayPal adapters use server-side credentials and verified provider events."
  },
  "servers": [
    {
      "url": "https://{store}/wp-json/wooapp/v1",
      "variables": {
        "store": {
          "default": "store.example"
        }
      }
    },
    {
      "url": "http://localhost:8088/wp-json/wooapp/v1",
      "description": "Local development only"
    }
  ],
  "paths": {
    "/bootstrap": {
      "get": {
        "operationId": "get_bootstrap",
        "summary": "Read bootstrap",
        "security": [],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "additionalProperties": true,
                      "properties": {
                        "branding": {
                          "$ref": "#/components/schemas/AppBranding"
                        },
                        "checkout": {
                          "type": "object",
                          "additionalProperties": true,
                          "properties": {
                            "countries": {
                              "type": "object",
                              "additionalProperties": {
                                "type": "string"
                              },
                              "description": "Allowed WooCommerce country codes mapped to display labels."
                            },
                            "default_country": {
                              "type": "string",
                              "description": "Allowed store base country, otherwise the first allowed country; empty if the store has none."
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "data": {
                    "api_version": "1",
                    "plugin_version": "2.0.1",
                    "branding": {
                      "logo_id": 0,
                      "logo_height": 44,
                      "logo_width": 180,
                      "font": "editorial",
                      "palette": "citrus",
                      "tagline": "YOUR NEXT GOOD FIND",
                      "logo": {},
                      "colors": {
                        "name": "Olive & citrus",
                        "ink": "#232923",
                        "paper": "#FAF9F5",
                        "muted": "#73786F",
                        "line": "#E7E7DF",
                        "accent": "#DDEE9B",
                        "clay": "#A8583C"
                      }
                    },
                    "store": {
                      "name": "Your Store",
                      "url": "https://your-store.com/",
                      "rest_url": "https://your-store.com/wp-json/",
                      "currency": "USD",
                      "currency_minor_unit": 2,
                      "locale": "en_US",
                      "direction": "ltr",
                      "timezone": "UTC"
                    },
                    "features": {
                      "wishlist": true,
                      "orders": true,
                      "customer_auth": "opaque_bearer",
                      "native_auth": true,
                      "push": false,
                      "guest_checkout": true,
                      "registration": true
                    },
                    "checkout": {
                      "mode": "native",
                      "countries": {
                        "US": "United States (US)"
                      },
                      "default_country": "US",
                      "ready": true,
                      "supported_gateways": [
                        "cod",
                        "stripe",
                        "paypal"
                      ],
                      "configured_online_gateways": [],
                      "options_url": "https://your-store.com/wp-json/wooapp/v1/checkout/options",
                      "gateway_targets": [
                        "cod",
                        "stripe",
                        "paypal"
                      ],
                      "website_fallback": false
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Structured error; 400 validation, 401 session, 403 ownership, 404 hidden resource, 409 conflict, 429 throttle, 502 provider, 503 setup.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/home": {
      "get": {
        "operationId": "get_home",
        "summary": "Read home",
        "security": [],
        "parameters": [
          {
            "name": "locale",
            "in": "query",
            "schema": {
              "enum": [
                "en",
                "ar"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "sections": {
                          "type": "array",
                          "items": {
                            "oneOf": [
                              {
                                "$ref": "#/components/schemas/HomeProductSection"
                              },
                              {
                                "$ref": "#/components/schemas/HomeBanner"
                              }
                            ]
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "data": {
                    "sections": [
                      {
                        "id": "featured",
                        "type": "product_rail",
                        "title": "Featured collection",
                        "subtitle": "Our favorites",
                        "layout": "carousel",
                        "product_ids": [
                          10,
                          11
                        ]
                      }
                    ]
                  }
                }
              }
            }
          },
          "default": {
            "description": "Structured error; 400 validation, 401 session, 403 ownership, 404 hidden resource, 409 conflict, 429 throttle, 502 provider, 503 setup.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "description": "Ordered visible product collections with grid/carousel/list layouts, followed by WooApp banners. Empty or disabled collections are omitted; latest products are returned when no visible collection has products. Flutter places the hero and category strip above the collections."
      }
    },
    "/auth/login": {
      "post": {
        "operationId": "post_auth_login",
        "summary": "Sign in a customer",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "login": {
                    "type": "string",
                    "maxLength": 254
                  },
                  "password": {
                    "type": "string",
                    "maxLength": 4096
                  },
                  "device": {
                    "type": "string",
                    "maxLength": 100
                  }
                },
                "required": [
                  "login",
                  "password"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "session": {
                          "$ref": "#/components/schemas/Session"
                        },
                        "customer": {
                          "$ref": "#/components/schemas/Customer"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "data": {
                    "session": {
                      "token_type": "Bearer",
                      "access_token": "EXAMPLE_ACCESS_TOKEN",
                      "expires_in": 900,
                      "refresh_token": "EXAMPLE_REFRESH_TOKEN",
                      "refresh_expires_at": "2026-11-21T12:00:00+00:00",
                      "session_id": "11111111-2222-4333-8444-555555555555"
                    },
                    "customer": {
                      "id": 42,
                      "email": "customer@example.com",
                      "first_name": "Alex",
                      "last_name": "Morgan",
                      "display_name": "Alex Morgan",
                      "avatar_url": "https://your-store.com/avatar.png"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Structured error; 400 validation, 401 session, 403 ownership, 404 hidden resource, 409 conflict, 429 throttle, 502 provider, 503 setup.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/auth/register": {
      "post": {
        "operationId": "post_auth_register",
        "summary": "Register when enabled by the merchant",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "email": {
                    "type": "string",
                    "format": "email"
                  },
                  "password": {
                    "type": "string",
                    "minLength": 12,
                    "maxLength": 4096
                  },
                  "first_name": {
                    "type": "string",
                    "maxLength": 100
                  },
                  "last_name": {
                    "type": "string",
                    "maxLength": 100
                  },
                  "device": {
                    "type": "string",
                    "maxLength": 100
                  }
                },
                "required": [
                  "email",
                  "password"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "session": {
                          "$ref": "#/components/schemas/Session"
                        },
                        "customer": {
                          "$ref": "#/components/schemas/Customer"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "data": {
                    "session": {
                      "token_type": "Bearer",
                      "access_token": "EXAMPLE_ACCESS_TOKEN",
                      "expires_in": 900,
                      "refresh_token": "EXAMPLE_REFRESH_TOKEN",
                      "refresh_expires_at": "2026-11-21T12:00:00+00:00",
                      "session_id": "11111111-2222-4333-8444-555555555555"
                    },
                    "customer": {
                      "id": 42,
                      "email": "customer@example.com",
                      "first_name": "Alex",
                      "last_name": "Morgan",
                      "display_name": "Alex Morgan",
                      "avatar_url": "https://your-store.com/avatar.png"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Structured error; 400 validation, 401 session, 403 ownership, 404 hidden resource, 409 conflict, 429 throttle, 502 provider, 503 setup.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/auth/refresh": {
      "post": {
        "operationId": "post_auth_refresh",
        "summary": "Rotate the session; replay revokes its family",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "refresh_token": {
                    "type": "string",
                    "maxLength": 100
                  }
                },
                "required": [
                  "refresh_token"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "session": {
                          "$ref": "#/components/schemas/Session"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "data": {
                    "session": {
                      "token_type": "Bearer",
                      "access_token": "EXAMPLE_ACCESS_TOKEN",
                      "expires_in": 900,
                      "refresh_token": "EXAMPLE_REFRESH_TOKEN",
                      "refresh_expires_at": "2026-11-21T12:00:00+00:00",
                      "session_id": "11111111-2222-4333-8444-555555555555"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Structured error; 400 validation, 401 session, 403 ownership, 404 hidden resource, 409 conflict, 429 throttle, 502 provider, 503 setup.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/auth/logout": {
      "post": {
        "operationId": "post_auth_logout",
        "summary": "Revoke this mobile session",
        "security": [
          {
            "CustomerBearer": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  }
                },
                "example": {
                  "data": {
                    "signed_out": true
                  }
                }
              }
            }
          },
          "default": {
            "description": "Structured error; 400 validation, 401 session, 403 ownership, 404 hidden resource, 409 conflict, 429 throttle, 502 provider, 503 setup.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/auth/logout-all": {
      "post": {
        "operationId": "post_auth_logout_all",
        "summary": "Revoke all mobile sessions",
        "security": [
          {
            "CustomerBearer": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  }
                },
                "example": {
                  "data": {
                    "signed_out": true
                  }
                }
              }
            }
          },
          "default": {
            "description": "Structured error; 400 validation, 401 session, 403 ownership, 404 hidden resource, 409 conflict, 429 throttle, 502 provider, 503 setup.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/auth/password/forgot": {
      "post": {
        "operationId": "post_auth_password_forgot",
        "summary": "Send the WordPress password reset email without exposing account existence",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "email": {
                    "type": "string",
                    "format": "email"
                  }
                },
                "required": [
                  "email"
                ]
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  }
                },
                "example": {
                  "data": {
                    "message": "If the account exists, password reset instructions will be emailed."
                  }
                }
              }
            }
          },
          "default": {
            "description": "Structured error; 400 validation, 401 session, 403 ownership, 404 hidden resource, 409 conflict, 429 throttle, 502 provider, 503 setup.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/auth/password/reset": {
      "post": {
        "operationId": "post_auth_password_reset",
        "summary": "Consume a WordPress reset key and revoke mobile sessions",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "login": {
                    "type": "string",
                    "maxLength": 254
                  },
                  "key": {
                    "type": "string",
                    "maxLength": 254
                  },
                  "password": {
                    "type": "string",
                    "minLength": 12,
                    "maxLength": 4096
                  }
                },
                "required": [
                  "login",
                  "key",
                  "password"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  }
                },
                "example": {
                  "data": {
                    "password_reset": true,
                    "sign_in_required": true
                  }
                }
              }
            }
          },
          "default": {
            "description": "Structured error; 400 validation, 401 session, 403 ownership, 404 hidden resource, 409 conflict, 429 throttle, 502 provider, 503 setup.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/me": {
      "get": {
        "operationId": "get_me",
        "summary": "Read the signed-in customer",
        "security": [
          {
            "CustomerBearer": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Customer"
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": 42,
                    "email": "customer@example.com",
                    "first_name": "Alex",
                    "last_name": "Morgan",
                    "display_name": "Alex Morgan",
                    "avatar_url": "https://your-store.com/avatar.png"
                  }
                }
              }
            }
          },
          "default": {
            "description": "Structured error; 400 validation, 401 session, 403 ownership, 404 hidden resource, 409 conflict, 429 throttle, 502 provider, 503 setup.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "patch_me",
        "summary": "Update safe profile fields",
        "security": [
          {
            "CustomerBearer": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "first_name": {
                    "type": "string",
                    "maxLength": 100
                  },
                  "last_name": {
                    "type": "string",
                    "maxLength": 100
                  },
                  "display_name": {
                    "type": "string",
                    "maxLength": 100
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Customer"
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": 42,
                    "email": "customer@example.com",
                    "first_name": "Alex",
                    "last_name": "Morgan",
                    "display_name": "Alex Morgan",
                    "avatar_url": "https://your-store.com/avatar.png"
                  }
                }
              }
            }
          },
          "default": {
            "description": "Structured error; 400 validation, 401 session, 403 ownership, 404 hidden resource, 409 conflict, 429 throttle, 502 provider, 503 setup.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/me/password": {
      "post": {
        "operationId": "post_me_password",
        "summary": "Change password and require sign-in again",
        "security": [
          {
            "CustomerBearer": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "current_password": {
                    "type": "string",
                    "maxLength": 4096
                  },
                  "password": {
                    "type": "string",
                    "minLength": 12,
                    "maxLength": 4096
                  }
                },
                "required": [
                  "current_password",
                  "password"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  }
                },
                "example": {
                  "data": {
                    "password_changed": true,
                    "sign_in_required": true
                  }
                }
              }
            }
          },
          "default": {
            "description": "Structured error; 400 validation, 401 session, 403 ownership, 404 hidden resource, 409 conflict, 429 throttle, 502 provider, 503 setup.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/me/addresses": {
      "get": {
        "operationId": "get_me_addresses",
        "summary": "Read saved addresses",
        "security": [
          {
            "CustomerBearer": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "billing": {
                          "$ref": "#/components/schemas/Address"
                        },
                        "shipping": {
                          "$ref": "#/components/schemas/Address"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "data": {
                    "billing": {
                      "first_name": "Alex",
                      "last_name": "Morgan",
                      "company": "",
                      "address_1": "123 Example Street",
                      "address_2": "",
                      "city": "Los Angeles",
                      "state": "CA",
                      "postcode": "90001",
                      "country": "US",
                      "email": "customer@example.com",
                      "phone": "2025550100"
                    },
                    "shipping": {
                      "first_name": "Alex",
                      "last_name": "Morgan",
                      "company": "",
                      "address_1": "123 Example Street",
                      "address_2": "",
                      "city": "Los Angeles",
                      "state": "CA",
                      "postcode": "90001",
                      "country": "US",
                      "phone": "2025550100"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Structured error; 400 validation, 401 session, 403 ownership, 404 hidden resource, 409 conflict, 429 throttle, 502 provider, 503 setup.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/me/addresses/{type}": {
      "put": {
        "operationId": "put_me_addresses_type_",
        "summary": "Update supplied fields of the saved address",
        "security": [
          {
            "CustomerBearer": []
          }
        ],
        "description": "Unknown identity/role fields are ignored. Saved account addresses and active Store API cart addresses are separate; update the cart before checkout.",
        "parameters": [
          {
            "name": "type",
            "in": "path",
            "required": true,
            "schema": {
              "enum": [
                "billing",
                "shipping"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Address"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Address"
                    }
                  }
                },
                "example": {
                  "data": {
                    "first_name": "Alex",
                    "last_name": "Morgan",
                    "company": "",
                    "address_1": "123 Example Street",
                    "address_2": "",
                    "city": "Los Angeles",
                    "state": "CA",
                    "postcode": "90001",
                    "country": "US",
                    "email": "customer@example.com",
                    "phone": "2025550100"
                  }
                }
              }
            }
          },
          "default": {
            "description": "Structured error; 400 validation, 401 session, 403 ownership, 404 hidden resource, 409 conflict, 429 throttle, 502 provider, 503 setup.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/address-schema": {
      "get": {
        "operationId": "get_address_schema",
        "summary": "Read WooCommerce address fields and country states",
        "security": [],
        "parameters": [
          {
            "name": "country",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Z]{2}$"
            }
          },
          {
            "name": "type",
            "in": "query",
            "schema": {
              "enum": [
                "billing",
                "shipping"
              ],
              "default": "billing"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  }
                },
                "example": {
                  "data": {
                    "countries": {
                      "US": "United States (US)"
                    },
                    "states": {
                      "CA": "California"
                    },
                    "fields": {
                      "billing_first_name": {
                        "label": "First name",
                        "required": true,
                        "type": "text"
                      },
                      "billing_country": {
                        "label": "Country / Region",
                        "required": true,
                        "type": "country"
                      }
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Structured error; 400 validation, 401 session, 403 ownership, 404 hidden resource, 409 conflict, 429 throttle, 502 provider, 503 setup.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/me/email": {
      "post": {
        "operationId": "post_me_email",
        "summary": "Email a purpose-bound confirmation code to a new address",
        "security": [
          {
            "CustomerBearer": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "email": {
                    "type": "string",
                    "format": "email"
                  },
                  "current_password": {
                    "type": "string",
                    "maxLength": 4096
                  }
                },
                "required": [
                  "email",
                  "current_password"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  }
                },
                "example": {
                  "data": {
                    "verification_required": true
                  }
                }
              }
            }
          },
          "default": {
            "description": "Structured error; 400 validation, 401 session, 403 ownership, 404 hidden resource, 409 conflict, 429 throttle, 502 provider, 503 setup.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/me/email/verify": {
      "post": {
        "operationId": "post_me_email_verify",
        "summary": "Confirm the new email and revoke sessions",
        "security": [
          {
            "CustomerBearer": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "token": {
                    "type": "string",
                    "maxLength": 100
                  }
                },
                "required": [
                  "token"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  }
                },
                "example": {
                  "data": {
                    "email_changed": true,
                    "sign_in_required": true
                  }
                }
              }
            }
          },
          "default": {
            "description": "Structured error; 400 validation, 401 session, 403 ownership, 404 hidden resource, 409 conflict, 429 throttle, 502 provider, 503 setup.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/me/orders": {
      "get": {
        "operationId": "get_me_orders",
        "summary": "Read owned orders",
        "security": [
          {
            "CustomerBearer": []
          }
        ],
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "default": 1,
              "minimum": 1,
              "maximum": 100000
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "schema": {
              "type": "integer",
              "default": 20,
              "minimum": 1,
              "maximum": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    }
                  }
                },
                "example": {
                  "data": [
                    {
                      "id": 123,
                      "number": "123",
                      "status": "processing",
                      "status_label": "Processing",
                      "created_at": "2026-10-22T12:00:00+00:00",
                      "currency": "USD",
                      "amount_format": "decimal",
                      "total": "35.00",
                      "total_tax": "0",
                      "shipping_total": "5.00",
                      "discount_total": "0",
                      "payment_method": "cod",
                      "payment_method_title": "Cash on delivery",
                      "paid_at": null,
                      "items": [
                        {
                          "id": 1,
                          "product_id": 10,
                          "variation_id": 0,
                          "name": "Linen shirt",
                          "quantity": 1,
                          "subtotal": "30.00",
                          "total": "30.00",
                          "total_tax": "0"
                        }
                      ]
                    }
                  ],
                  "pagination": {
                    "page": 1,
                    "per_page": 20,
                    "total": 1,
                    "total_pages": 1
                  }
                }
              }
            }
          },
          "default": {
            "description": "Structured error; 400 validation, 401 session, 403 ownership, 404 hidden resource, 409 conflict, 429 throttle, 502 provider, 503 setup.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/me/downloads": {
      "get": {
        "operationId": "get_me_downloads",
        "summary": "Read owned downloads",
        "security": [
          {
            "CustomerBearer": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    }
                  }
                },
                "example": {
                  "data": [
                    {
                      "download_id": "example-file-id",
                      "product_id": 10,
                      "product_name": "Guide",
                      "download_name": "Guide PDF",
                      "download_url": "https://your-store.com/?download_file=10&key=EXAMPLE",
                      "downloads_remaining": "2",
                      "access_expires": "2026-12-01",
                      "order_id": 123
                    }
                  ]
                }
              }
            }
          },
          "default": {
            "description": "Structured error; 400 validation, 401 session, 403 ownership, 404 hidden resource, 409 conflict, 429 throttle, 502 provider, 503 setup.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/me/wishlist": {
      "get": {
        "operationId": "get_me_wishlist",
        "summary": "Read owned wishlist",
        "security": [
          {
            "CustomerBearer": []
          }
        ],
        "description": "Returns product_id entries; pagination is beside data.",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "default": 1,
              "minimum": 1,
              "maximum": 100000
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "schema": {
              "type": "integer",
              "default": 20,
              "minimum": 1,
              "maximum": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    }
                  }
                },
                "example": {
                  "data": [
                    {
                      "product_id": 10
                    }
                  ],
                  "pagination": {
                    "page": 1,
                    "per_page": 20,
                    "total": 1,
                    "total_pages": 1
                  }
                }
              }
            }
          },
          "default": {
            "description": "Structured error; 400 validation, 401 session, 403 ownership, 404 hidden resource, 409 conflict, 429 throttle, 502 provider, 503 setup.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/me/orders/{id}": {
      "get": {
        "operationId": "get_me_orders_id_",
        "summary": "Read one owned order; other customers receive 404",
        "security": [
          {
            "CustomerBearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": 123,
                    "number": "123",
                    "status": "processing",
                    "status_label": "Processing",
                    "created_at": "2026-10-22T12:00:00+00:00",
                    "currency": "USD",
                    "amount_format": "decimal",
                    "total": "35.00",
                    "total_tax": "0",
                    "shipping_total": "5.00",
                    "discount_total": "0",
                    "payment_method": "cod",
                    "payment_method_title": "Cash on delivery",
                    "paid_at": null,
                    "items": [
                      {
                        "id": 1,
                        "product_id": 10,
                        "variation_id": 0,
                        "name": "Linen shirt",
                        "quantity": 1,
                        "subtotal": "30.00",
                        "total": "30.00",
                        "total_tax": "0"
                      }
                    ]
                  }
                }
              }
            }
          },
          "default": {
            "description": "Structured error; 400 validation, 401 session, 403 ownership, 404 hidden resource, 409 conflict, 429 throttle, 502 provider, 503 setup.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/me/deletion-request": {
      "post": {
        "operationId": "post_me_deletion_request",
        "summary": "Request email-confirmed permanent customer account deletion",
        "security": [
          {
            "CustomerBearer": []
          }
        ],
        "description": "Requires the signed-in customer current password. Sends a confirmation link to the existing account email. WordPress validates the link before WooApp permanently deletes that login, saved addresses, favorites and sessions. Unconfirmed requests do not delete accounts. Required WooCommerce orders are preserved with the customer ID detached; the merchant processes remaining retained personal data through Tools > Erase Personal Data and the published privacy procedure. A generic WordPress erasure request alone does not authorize login deletion.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "current_password": {
                    "type": "string",
                    "maxLength": 4096
                  }
                },
                "required": [
                  "current_password"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  }
                },
                "example": {
                  "data": {
                    "confirmation_required": true,
                    "account_deleted_after_confirmation": true,
                    "message": "Confirm the email to permanently delete your sign-in account. The store processes remaining personal data and required order retention separately."
                  }
                }
              }
            }
          },
          "default": {
            "description": "Structured error; 400 validation, 401 session, 403 ownership, 404 hidden resource, 409 conflict, 429 throttle, 502 provider, 503 setup.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/products/{id}/variations": {
      "get": {
        "operationId": "get_products_id_variations",
        "summary": "Read published visible variations",
        "security": [],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "default": 1,
              "minimum": 1,
              "maximum": 100000
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "schema": {
              "type": "integer",
              "default": 20,
              "minimum": 1,
              "maximum": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": true
                      }
                    },
                    "attributes": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "key",
                          "name",
                          "cart_name",
                          "taxonomy",
                          "terms"
                        ],
                        "properties": {
                          "key": {
                            "type": "string",
                            "description": "Exact WooCommerce variation key, including attribute_ prefix."
                          },
                          "name": {
                            "type": "string",
                            "description": "Merchant-facing display label."
                          },
                          "cart_name": {
                            "type": "string",
                            "description": "Exact name to send as the cart variation attribute."
                          },
                          "taxonomy": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "terms": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "slug": {
                                  "type": "string"
                                },
                                "name": {
                                  "type": "string"
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "data": [
                    {
                      "id": 11,
                      "attributes": {
                        "attribute_pa_size": "m"
                      },
                      "price": "30.00",
                      "regular_price": "35.00",
                      "sale_price": "30.00",
                      "currency": "USD",
                      "amount_format": "decimal",
                      "purchasable": true,
                      "in_stock": true,
                      "image_url": "https://your-store.com/uploads/shirt.jpg"
                    }
                  ],
                  "pagination": {
                    "page": 1,
                    "per_page": 20,
                    "total": 1,
                    "total_pages": 1
                  },
                  "attributes": [
                    {
                      "key": "attribute_pa_size",
                      "name": "Size",
                      "cart_name": "pa_size",
                      "taxonomy": "pa_size",
                      "terms": [
                        {
                          "slug": "m",
                          "name": "Medium"
                        }
                      ]
                    }
                  ]
                }
              }
            }
          },
          "default": {
            "description": "Structured error; 400 validation, 401 session, 403 ownership, 404 hidden resource, 409 conflict, 429 throttle, 502 provider, 503 setup.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "description": "Published visible variation rows plus parent attribute descriptors. Use descriptors for exact keys, readable labels, all wildcard choices and case-sensitive cart names. Global cart values use term slugs; product-specific values use exact option names."
      }
    },
    "/products/{id}/reviews": {
      "post": {
        "operationId": "post_products_id_reviews",
        "summary": "Submit a moderated review as the current customer",
        "security": [
          {
            "CustomerBearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "review": {
                    "type": "string",
                    "maxLength": 5000
                  },
                  "rating": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 5
                  }
                },
                "required": [
                  "review",
                  "rating"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": 7,
                    "status": "pending"
                  }
                }
              }
            }
          },
          "default": {
            "description": "Structured error; 400 validation, 401 session, 403 ownership, 404 hidden resource, 409 conflict, 429 throttle, 502 provider, 503 setup.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/cart": {
      "get": {
        "operationId": "get_cart",
        "summary": "Create or load a native cart capability",
        "security": [
          {},
          {
            "CartToken": []
          },
          {
            "CustomerBearer": [],
            "CartToken": []
          }
        ],
        "description": "On first use omit Cart-Token. Later use both customer bearer and owned Cart-Token for customer carts. A guest cart must be explicitly merged after sign-in.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "cart": {
                          "type": "object",
                          "additionalProperties": true
                        },
                        "cart_token": {
                          "type": "string"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "data": {
                    "cart": {
                      "items": [],
                      "coupons": [],
                      "fees": [],
                      "totals": {
                        "total_items": "0",
                        "total_shipping": "0",
                        "total_price": "0",
                        "currency_code": "USD",
                        "currency_minor_unit": 2
                      },
                      "shipping_rates": []
                    },
                    "cart_token": "EXAMPLE_CART_TOKEN"
                  }
                }
              }
            }
          },
          "default": {
            "description": "Structured error; 400 validation, 401 session, 403 ownership, 404 hidden resource, 409 conflict, 429 throttle, 502 provider, 503 setup.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "Cart-Token",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "WooCommerce cart token. Customer-owned carts also require their customer bearer session."
          }
        ]
      }
    },
    "/cart/merge": {
      "post": {
        "operationId": "post_cart_merge",
        "summary": "Consume a guest cart into the current customer cart",
        "security": [
          {
            "CustomerBearer": [],
            "CartToken": []
          }
        ],
        "description": "Send the guest Cart-Token with the customer bearer. Successful replay is idempotent; transfer validates standard simple/variable items. Coupon codes are reapplied explicitly to the resulting cart.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  }
                },
                "example": {
                  "data": {
                    "cart": {
                      "items": [],
                      "coupons": [],
                      "fees": [],
                      "totals": {
                        "total_items": "0",
                        "total_shipping": "0",
                        "total_price": "0",
                        "currency_code": "USD",
                        "currency_minor_unit": 2
                      },
                      "shipping_rates": []
                    },
                    "cart_token": "EXAMPLE_CUSTOMER_CART_TOKEN"
                  }
                }
              }
            }
          },
          "default": {
            "description": "Structured error; 400 validation, 401 session, 403 ownership, 404 hidden resource, 409 conflict, 429 throttle, 502 provider, 503 setup.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "Cart-Token",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "WooCommerce cart token. Customer-owned carts also require their customer bearer session."
          }
        ]
      }
    },
    "/checkout/options": {
      "get": {
        "operationId": "get_checkout_options",
        "summary": "Get cart-specific enabled methods and the current WooCommerce cart",
        "security": [
          {
            "CartToken": []
          },
          {
            "CustomerBearer": [],
            "CartToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  }
                },
                "example": {
                  "data": {
                    "payment_methods": [
                      {
                        "id": "cod",
                        "title": "Cash on delivery",
                        "requires_sdk": false
                      }
                    ],
                    "cart": {
                      "items": [],
                      "coupons": [],
                      "fees": [],
                      "totals": {
                        "total_items": "0",
                        "total_shipping": "0",
                        "total_price": "0",
                        "currency_code": "USD",
                        "currency_minor_unit": 2
                      },
                      "shipping_rates": []
                    },
                    "terms_url": "https://your-store.com/terms/",
                    "privacy_url": "https://your-store.com/privacy/",
                    "terms_required": true,
                    "website_fallback": false
                  }
                }
              }
            }
          },
          "default": {
            "description": "Structured error; 400 validation, 401 session, 403 ownership, 404 hidden resource, 409 conflict, 429 throttle, 502 provider, 503 setup.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "Cart-Token",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "WooCommerce cart token. Customer-owned carts also require their customer bearer session."
          }
        ]
      }
    },
    "/checkout/attempts": {
      "post": {
        "operationId": "post_checkout_attempts",
        "summary": "Create or resume one immutable checkout attempt",
        "security": [
          {
            "CartToken": []
          },
          {
            "CustomerBearer": [],
            "CartToken": []
          }
        ],
        "description": "Always retry the exact same body and key after uncertain responses. expected_total is the Store API minor-unit total_price. Response totals are decimal strings. Positive COD orders are confirmed and unpaid. Online attempts expire after 30 minutes; cancel before starting a different payment.",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{16,128}$"
            }
          },
          {
            "name": "Cart-Token",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "WooCommerce cart token. Customer-owned carts also require their customer bearer session."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateAttempt"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Attempt"
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "11111111-2222-4333-8444-555555555555",
                    "order_id": 123,
                    "order_number": "123",
                    "state": "confirmed",
                    "payment_method": "cod",
                    "currency": "USD",
                    "total": "35.00",
                    "amount_format": "decimal",
                    "paid": false,
                    "payment_collected": false,
                    "next_action": null
                  }
                }
              }
            }
          },
          "default": {
            "description": "Structured error; 400 validation, 401 session, 403 ownership, 404 hidden resource, 409 conflict, 429 throttle, 502 provider, 503 setup.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/checkout/attempts/{id}": {
      "get": {
        "operationId": "get_checkout_attempts_id_",
        "summary": "Read an attempt with matching cart and identity",
        "security": [
          {
            "CartToken": []
          },
          {
            "CustomerBearer": [],
            "CartToken": []
          }
        ],
        "description": "Reads status only. Replay the original creation request to retrieve an SDK next_action.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Cart-Token",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "WooCommerce cart token. Customer-owned carts also require their customer bearer session."
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Attempt"
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "11111111-2222-4333-8444-555555555555",
                    "order_id": 123,
                    "order_number": "123",
                    "state": "confirmed",
                    "payment_method": "cod",
                    "currency": "USD",
                    "total": "35.00",
                    "amount_format": "decimal",
                    "paid": false,
                    "payment_collected": false,
                    "next_action": null
                  }
                }
              }
            }
          },
          "default": {
            "description": "Structured error; 400 validation, 401 session, 403 ownership, 404 hidden resource, 409 conflict, 429 throttle, 502 provider, 503 setup.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/checkout/attempts/{id}/confirm": {
      "post": {
        "operationId": "post_checkout_attempts_id_confirm",
        "summary": "Verify server-side provider status and capture approved PayPal payments",
        "security": [
          {
            "CartToken": []
          },
          {
            "CustomerBearer": [],
            "CartToken": []
          }
        ],
        "description": "No client payment status, provider ID, or order total is trusted.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Cart-Token",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "WooCommerce cart token. Customer-owned carts also require their customer bearer session."
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Attempt"
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "11111111-2222-4333-8444-555555555555",
                    "order_id": 123,
                    "order_number": "123",
                    "state": "confirmed",
                    "payment_method": "cod",
                    "currency": "USD",
                    "total": "35.00",
                    "amount_format": "decimal",
                    "paid": false,
                    "payment_collected": false,
                    "next_action": null
                  }
                }
              }
            }
          },
          "default": {
            "description": "Structured error; 400 validation, 401 session, 403 ownership, 404 hidden resource, 409 conflict, 429 throttle, 502 provider, 503 setup.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/checkout/attempts/{id}/cancel": {
      "post": {
        "operationId": "post_checkout_attempts_id_cancel",
        "summary": "Cancel an unpaid attempt safely",
        "security": [
          {
            "CartToken": []
          },
          {
            "CustomerBearer": [],
            "CartToken": []
          }
        ],
        "description": "No client payment status, provider ID, or order total is trusted.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Cart-Token",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "WooCommerce cart token. Customer-owned carts also require their customer bearer session."
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Attempt"
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "11111111-2222-4333-8444-555555555555",
                    "order_id": 123,
                    "order_number": "123",
                    "state": "cancelled",
                    "payment_method": "cod",
                    "currency": "USD",
                    "total": "35.00",
                    "amount_format": "decimal",
                    "paid": false,
                    "payment_collected": false,
                    "next_action": null
                  }
                }
              }
            }
          },
          "default": {
            "description": "Structured error; 400 validation, 401 session, 403 ownership, 404 hidden resource, 409 conflict, 429 throttle, 502 provider, 503 setup.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/webhooks/stripe": {
      "post": {
        "operationId": "post_webhooks_stripe",
        "summary": "Receive a verified stripe webhook",
        "security": [],
        "parameters": [
          {
            "name": "Stripe-Signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "received": {
                      "const": true
                    }
                  }
                },
                "example": {
                  "received": true
                }
              }
            }
          },
          "default": {
            "description": "Structured error; 400 validation, 401 session, 403 ownership, 404 hidden resource, 409 conflict, 429 throttle, 502 provider, 503 setup.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/webhooks/paypal": {
      "post": {
        "operationId": "post_webhooks_paypal",
        "summary": "Receive a verified paypal webhook",
        "security": [],
        "parameters": [
          {
            "name": "PAYPAL-AUTH-ALGO",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "PAYPAL-CERT-URL",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "PAYPAL-TRANSMISSION-ID",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "PAYPAL-TRANSMISSION-SIG",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "PAYPAL-TRANSMISSION-TIME",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "received": {
                      "const": true
                    }
                  }
                },
                "example": {
                  "received": true
                }
              }
            }
          },
          "default": {
            "description": "Structured error; 400 validation, 401 session, 403 ownership, 404 hidden resource, 409 conflict, 429 throttle, 502 provider, 503 setup.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/me/wishlist/{product_id}": {
      "put": {
        "operationId": "put_me_wishlist_id_",
        "summary": "Add a public product idempotently",
        "security": [
          {
            "CustomerBearer": []
          }
        ],
        "parameters": [
          {
            "name": "product_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  }
                },
                "example": {
                  "data": {
                    "product_id": 10,
                    "saved": true
                  }
                }
              }
            }
          },
          "default": {
            "description": "Structured error; 400 validation, 401 session, 403 ownership, 404 hidden resource, 409 conflict, 429 throttle, 502 provider, 503 setup.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "delete_me_wishlist_id_",
        "summary": "Remove an owned membership idempotently",
        "security": [
          {
            "CustomerBearer": []
          }
        ],
        "parameters": [
          {
            "name": "product_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  }
                },
                "example": {
                  "data": {
                    "product_id": 10,
                    "saved": false
                  }
                }
              }
            }
          },
          "default": {
            "description": "Structured error; 400 validation, 401 session, 403 ownership, 404 hidden resource, 409 conflict, 429 throttle, 502 provider, 503 setup.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "CustomerBearer": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "Opaque 256-bit token"
      },
      "CartToken": {
        "type": "apiKey",
        "in": "header",
        "name": "Cart-Token"
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "properties": {
          "attempt_id": {
            "type": "string",
            "description": "Checkout attempt identifier when available."
          },
          "attempt_retained": {
            "type": "boolean",
            "description": "True when an order was bound and the original request/key must be retained. False permits editing after validation failed before order binding."
          },
          "code": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "data": {
            "type": "object",
            "properties": {
              "status": {
                "type": "integer"
              }
            }
          }
        },
        "required": [
          "code",
          "message"
        ]
      },
      "Session": {
        "type": "object",
        "properties": {
          "token_type": {
            "const": "Bearer"
          },
          "access_token": {
            "type": "string"
          },
          "expires_in": {
            "const": 900
          },
          "refresh_token": {
            "type": "string"
          },
          "refresh_expires_at": {
            "type": "string",
            "format": "date-time"
          },
          "session_id": {
            "type": "string",
            "format": "uuid"
          }
        },
        "required": [
          "access_token",
          "refresh_token",
          "expires_in"
        ]
      },
      "Customer": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "email": {
            "type": "string",
            "format": "email"
          },
          "first_name": {
            "type": "string"
          },
          "last_name": {
            "type": "string"
          },
          "display_name": {
            "type": "string"
          },
          "avatar_url": {
            "type": "string"
          }
        }
      },
      "Address": {
        "type": "object",
        "properties": {
          "first_name": {
            "type": "string",
            "maxLength": 200
          },
          "last_name": {
            "type": "string",
            "maxLength": 200
          },
          "company": {
            "type": "string",
            "maxLength": 200
          },
          "address_1": {
            "type": "string",
            "maxLength": 200
          },
          "address_2": {
            "type": "string",
            "maxLength": 200
          },
          "city": {
            "type": "string",
            "maxLength": 200
          },
          "state": {
            "type": "string",
            "maxLength": 200
          },
          "postcode": {
            "type": "string",
            "maxLength": 200
          },
          "country": {
            "type": "string",
            "maxLength": 200
          },
          "email": {
            "type": "string",
            "maxLength": 200
          },
          "phone": {
            "type": "string",
            "maxLength": 200
          }
        }
      },
      "Attempt": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "order_id": {
            "type": "integer"
          },
          "order_number": {
            "type": "string"
          },
          "state": {
            "type": "string",
            "enum": [
              "pending",
              "confirmed",
              "paid",
              "expired",
              "cancelled",
              "failed",
              "checkout-draft",
              "manual_review",
              "on-hold",
              "processing",
              "completed",
              "refunded"
            ]
          },
          "payment_method": {
            "enum": [
              "cod",
              "stripe",
              "paypal"
            ]
          },
          "currency": {
            "type": "string"
          },
          "total": {
            "type": "string"
          },
          "amount_format": {
            "const": "decimal"
          },
          "paid": {
            "type": "boolean"
          },
          "next_action": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/StripeAction"
              },
              {
                "$ref": "#/components/schemas/PayPalAction"
              }
            ]
          },
          "payment_collected": {
            "type": "boolean"
          }
        }
      },
      "StripeAction": {
        "type": "object",
        "properties": {
          "type": {
            "const": "stripe_payment_sheet"
          },
          "payment_intent_client_secret": {
            "type": "string"
          },
          "publishable_key": {
            "type": "string"
          },
          "mode": {
            "enum": [
              "sandbox",
              "live"
            ]
          }
        }
      },
      "PayPalAction": {
        "type": "object",
        "properties": {
          "type": {
            "const": "paypal_approve"
          },
          "paypal_order_id": {
            "type": "string"
          },
          "client_id": {
            "type": "string"
          },
          "mode": {
            "enum": [
              "sandbox",
              "live"
            ]
          }
        }
      },
      "CreateAttempt": {
        "type": "object",
        "properties": {
          "payment_method": {
            "enum": [
              "cod",
              "stripe",
              "paypal"
            ]
          },
          "billing_address": {
            "$ref": "#/components/schemas/Address"
          },
          "shipping_address": {
            "$ref": "#/components/schemas/Address"
          },
          "customer_note": {
            "type": "string",
            "maxLength": 2000
          },
          "additional_fields": {
            "type": "object",
            "additionalProperties": true
          },
          "expected_total": {
            "type": "string",
            "pattern": "^[0-9]{1,12}$"
          },
          "terms_accepted": {
            "type": "boolean"
          }
        },
        "required": [
          "payment_method",
          "billing_address",
          "expected_total",
          "terms_accepted"
        ]
      },
      "Pagination": {
        "type": "object",
        "properties": {
          "page": {
            "type": "integer"
          },
          "per_page": {
            "type": "integer"
          },
          "total": {
            "type": "integer"
          },
          "total_pages": {
            "type": "integer"
          }
        }
      },
      "HomeProductSection": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "type",
          "title",
          "subtitle",
          "layout",
          "product_ids"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "product_rail"
            ]
          },
          "title": {
            "type": "string"
          },
          "subtitle": {
            "type": "string"
          },
          "layout": {
            "type": "string",
            "enum": [
              "grid",
              "carousel",
              "list"
            ]
          },
          "product_ids": {
            "type": "array",
            "maxItems": 100,
            "uniqueItems": true,
            "items": {
              "type": "integer",
              "minimum": 1
            }
          }
        }
      },
      "HomeBanner": {
        "type": "object",
        "required": [
          "id",
          "type",
          "title",
          "image",
          "action",
          "subtitle",
          "badge",
          "cta_label",
          "media_type",
          "video"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "banner"
            ]
          },
          "title": {
            "type": "string"
          },
          "image": {
            "type": "string",
            "description": "Poster image URL, also required for video banners."
          },
          "action": {
            "type": [
              "object",
              "null"
            ],
            "description": "Typed product/category ID or search query, when configured."
          },
          "subtitle": {
            "type": "string"
          },
          "badge": {
            "type": "string"
          },
          "cta_label": {
            "type": "string"
          },
          "media_type": {
            "enum": [
              "image",
              "video"
            ]
          },
          "video": {
            "type": "string",
            "description": "MP4 or WebM media URL for a video banner; empty for an image banner."
          }
        },
        "description": "Published banners in saved display order; up to 20. Protected or invalid-media banners are omitted."
      },
      "AppBranding": {
        "type": "object",
        "description": "Public storefront presentation configured in WooApp > General settings. Refresh bootstrap to apply changes.",
        "required": [
          "logo",
          "logo_height",
          "logo_width",
          "font",
          "palette",
          "tagline",
          "colors"
        ],
        "properties": {
          "logo_id": {
            "type": "integer",
            "minimum": 0
          },
          "logo": {
            "type": "object",
            "description": "Empty object when no valid logo is configured.",
            "properties": {
              "id": {
                "type": "integer"
              },
              "url": {
                "type": "string"
              },
              "width": {
                "type": "integer",
                "minimum": 1
              },
              "height": {
                "type": "integer",
                "minimum": 1
              }
            }
          },
          "logo_height": {
            "type": "integer",
            "minimum": 24,
            "maximum": 88
          },
          "logo_width": {
            "type": "integer",
            "minimum": 80,
            "maximum": 240
          },
          "font": {
            "enum": [
              "editorial",
              "modern",
              "system"
            ]
          },
          "palette": {
            "enum": [
              "citrus",
              "ocean",
              "rose",
              "earth",
              "lavender",
              "mono"
            ]
          },
          "tagline": {
            "type": "string",
            "maxLength": 70
          },
          "colors": {
            "type": "object",
            "required": [
              "ink",
              "paper",
              "muted",
              "line",
              "accent",
              "clay"
            ],
            "properties": {
              "ink": {
                "type": "string",
                "pattern": "^#[0-9A-Fa-f]{6}$"
              },
              "paper": {
                "type": "string",
                "pattern": "^#[0-9A-Fa-f]{6}$"
              },
              "muted": {
                "type": "string",
                "pattern": "^#[0-9A-Fa-f]{6}$"
              },
              "line": {
                "type": "string",
                "pattern": "^#[0-9A-Fa-f]{6}$"
              },
              "accent": {
                "type": "string",
                "pattern": "^#[0-9A-Fa-f]{6}$"
              },
              "clay": {
                "type": "string",
                "pattern": "^#[0-9A-Fa-f]{6}$"
              }
            }
          }
        }
      }
    }
  }
}
