{
  "openapi": "3.1.0",
  "info": {
    "title": "All Asia Connect agent API",
    "version": "1.0.0",
    "description": "The same tools as the MCP server at https://www.allasiaconnect.com/mcp and the WebMCP tools on https://www.allasiaconnect.com, with identical names and parameters. Prices are public retail prices in VND including VAT. Guide: https://www.allasiaconnect.com/developers",
    "contact": {
      "name": "All Asia Connect",
      "email": "cass@allasiaconnect.com",
      "url": "https://www.allasiaconnect.com/contact"
    }
  },
  "servers": [
    {
      "url": "https://www.allasiaconnect.com"
    }
  ],
  "paths": {
    "/api/agent/search_products": {
      "post": {
        "operationId": "search_products",
        "summary": "Search products",
        "description": "Search the All Asia Connect shop (Rascals diapers, MONDAY Haircare, Little Blossom baby snacks) by text, brand and/or category. Returns up to `limit` products with the public retail price in VND (VAT included), stock status, image and product URL. Use get_product for full details and add_to_cart to put one in the cart.",
        "tags": [
          "Public"
        ],
        "security": [
          {},
          {
            "supabaseBearer": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "query": {
                    "description": "What the shopper is looking for, e.g. \"tape diapers size M\" or \"volume shampoo\". Leave out to list a brand or category.",
                    "type": "string",
                    "minLength": 2,
                    "maxLength": 80
                  },
                  "brand": {
                    "type": "string",
                    "enum": [
                      "rascals",
                      "monday",
                      "blossom"
                    ],
                    "description": "Brand: rascals (baby diapers and pants), monday (MONDAY Haircare shampoo and conditioner), blossom (Little Blossom organic baby snacks)."
                  },
                  "category": {
                    "description": "Category page: ta-dan (tape diapers), ta-quan (diaper pants), dau-goi (shampoo), dau-xa (conditioner), banh-an-dam (baby snacks).",
                    "type": "string",
                    "enum": [
                      "ta-dan",
                      "ta-quan",
                      "dau-goi",
                      "dau-xa",
                      "banh-an-dam"
                    ]
                  },
                  "in_stock_only": {
                    "default": false,
                    "description": "Only products that are in stock.",
                    "type": "boolean"
                  },
                  "limit": {
                    "default": 6,
                    "description": "Number of results, 1 to 12.",
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 12
                  },
                  "language": {
                    "default": "vi",
                    "description": "Language of names, descriptions and URLs: vi (Vietnamese, default) or en (English).",
                    "type": "string",
                    "enum": [
                      "vi",
                      "en"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success: JSON object with ok: true.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "const": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/agent/get_product": {
      "post": {
        "operationId": "get_product",
        "summary": "Product details",
        "description": "Full details of one product by slug or SKU: name, brand, public retail price in VND (VAT included), stock status, description, images and the product URL. Next step: add_to_cart.",
        "tags": [
          "Public"
        ],
        "security": [
          {},
          {
            "supabaseBearer": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "slug": {
                    "description": "Product slug, as returned by search_products (the last part of the product URL).",
                    "type": "string",
                    "minLength": 2,
                    "maxLength": 120
                  },
                  "sku": {
                    "description": "Product SKU, as returned by search_products.",
                    "type": "string",
                    "minLength": 2,
                    "maxLength": 60
                  },
                  "language": {
                    "default": "vi",
                    "description": "Language of names, descriptions and URLs: vi (Vietnamese, default) or en (English).",
                    "type": "string",
                    "enum": [
                      "vi",
                      "en"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success: JSON object with ok: true.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "const": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/agent/list_brands_and_categories": {
      "post": {
        "operationId": "list_brands_and_categories",
        "summary": "Brands and categories",
        "description": "The three brands and the product categories of the shop, with a short description, the number of products and the page URL. Use the brand and category keys in search_products.",
        "tags": [
          "Public"
        ],
        "security": [
          {},
          {
            "supabaseBearer": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "language": {
                    "default": "vi",
                    "description": "Language of names, descriptions and URLs: vi (Vietnamese, default) or en (English).",
                    "type": "string",
                    "enum": [
                      "vi",
                      "en"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success: JSON object with ok: true.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "const": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/agent/get_delivery_info": {
      "post": {
        "operationId": "get_delivery_info",
        "summary": "Delivery, returns, payment and contact",
        "description": "Facts exactly as published on the site: shipping fee, free-shipping threshold, delivery times and coverage, the return and refund policy, payment methods and how to reach customer service, each with the page URL as source.",
        "tags": [
          "Public"
        ],
        "security": [
          {},
          {
            "supabaseBearer": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "topic": {
                    "default": "all",
                    "description": "Which facts to return.",
                    "type": "string",
                    "enum": [
                      "shipping",
                      "returns",
                      "payment",
                      "contact",
                      "all"
                    ]
                  },
                  "language": {
                    "default": "vi",
                    "description": "Language of names, descriptions and URLs: vi (Vietnamese, default) or en (English).",
                    "type": "string",
                    "enum": [
                      "vi",
                      "en"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success: JSON object with ok: true.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "const": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/agent/track_order": {
      "post": {
        "operationId": "track_order",
        "summary": "Track an order",
        "description": "Status and delivery tracking of an order by order number plus the phone number used for that order (no account needed, same as the /track page). Returns order status, payment status, items and quantities, courier and tracking events. Never returns an address or amounts.",
        "tags": [
          "Public"
        ],
        "security": [
          {},
          {
            "supabaseBearer": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "order_code": {
                    "type": "string",
                    "minLength": 4,
                    "maxLength": 40,
                    "description": "Order number, e.g. AAC-3F9C21."
                  },
                  "phone": {
                    "type": "string",
                    "minLength": 6,
                    "maxLength": 20,
                    "description": "Phone number given with the order."
                  },
                  "language": {
                    "default": "vi",
                    "description": "Language of names, descriptions and URLs: vi (Vietnamese, default) or en (English).",
                    "type": "string",
                    "enum": [
                      "vi",
                      "en"
                    ]
                  }
                },
                "required": [
                  "order_code",
                  "phone"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success: JSON object with ok: true.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "const": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/api/agent/my_orders": {
      "post": {
        "operationId": "my_orders",
        "summary": "My orders",
        "description": "Orders of the signed-in shopper, newest first: order number, date, status, payment status, items and delivery tracking. Requires the shopper to be signed in on the site (two-hop: their own access token); without it the answer is AUTH_REQUIRED.",
        "tags": [
          "Login required"
        ],
        "security": [
          {
            "supabaseBearer": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "order_code": {
                    "description": "Only this order number.",
                    "type": "string",
                    "minLength": 4,
                    "maxLength": 40
                  },
                  "limit": {
                    "default": 5,
                    "description": "Number of orders, 1 to 20.",
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 20
                  },
                  "language": {
                    "default": "vi",
                    "description": "Language of names, descriptions and URLs: vi (Vietnamese, default) or en (English).",
                    "type": "string",
                    "enum": [
                      "vi",
                      "en"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success: JSON object with ok: true.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "const": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          },
          "429": {
            "$ref": "#/components/responses/Error"
          },
          "503": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "supabaseBearer": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "description": "The signed-in shopper's own access token (two-hop). Only needed for private tools; public tools work without it."
      }
    },
    "responses": {
      "Error": {
        "description": "Error: { ok: false, code, message }. Codes: VALIDATION, AUTH_REQUIRED, FORBIDDEN, NOT_FOUND, UNKNOWN_TOOL, UNAVAILABLE.",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "ok",
                "code",
                "message"
              ],
              "properties": {
                "ok": {
                  "const": false
                },
                "code": {
                  "enum": [
                    "VALIDATION",
                    "AUTH_REQUIRED",
                    "FORBIDDEN",
                    "NOT_FOUND",
                    "UNKNOWN_TOOL",
                    "UNAVAILABLE"
                  ]
                },
                "message": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    }
  }
}