# Create a TeleSlalom draft quote

Use `https://teleslalom-demo.pages.dev` as the base URL for all requests. Keep each customer's basket token private.

## Start here

If the customer asks what is available, first send `GET https://teleslalom-demo.pages.dev/api/catalog`. List the distinct category names in `products[].categories[].name`. The catalog has Internet, TV, Mobile (including Smartphones), and Others (consoles, games, TVs, pizza, and soda).

If your tool cannot read the JSON, try the [HTML guide and live category list](https://teleslalom-demo.pages.dev/for-agents). If you cannot reach either endpoint, share the catalog overview above and say live availability couldn't be checked. The customer can open [the catalog JSON](https://teleslalom-demo.pages.dev/api/catalog) in a browser and share it if they want you to review specific products. Creating a basket, requesting an estimate, and saving a quote require a tool that can send HTTP requests with the specified methods, bodies, and headers. Report a saved quote only after the API returns a quote ID.

## Discover products

Ask what the customer wants. If they ask for a phone, clarify whether they mean a handset, mobile service, or both. Use `category` for a category name or code, `q` for part of a product name or code, and `family` for a product family. Use each product's description to match the customer's needs. Look up a selection using `?code=PRODUCT_CODE` to see its configuration. Each Internet speed is a separate product. For example, [Internet 500](https://teleslalom-demo.pages.dev/api/catalog?code=TS-INTERNET-500) includes a Wi-Fi router and offers static IP as an option.

## Build and revise the basket

1. Send `POST /api/baskets` with an empty body. Save the returned `basketId`, `basketToken`, and `revision`. The basket expires after 24 hours.
2. Send `PUT /api/baskets/{basketId}` with the current revision and the full list of items. Send the token in the `X-Basket-Token` header on every request for this basket, including quote submission. Use `Content-Type: application/json` for JSON bodies.
3. Add one item for each product the customer selects. Use a quantity of 1 for an Internet bundle. Put optional component codes under the parent item. The estimate includes default components automatically.

For example, this basket selects 500 Mbps internet and a static IP. The router is included automatically.

```json
{
  "revision": 0,
  "items": [{
    "code": "TS-INTERNET-500",
    "quantity": 1,
    "components": ["TS-STATIC-IP"]
  }]
}
```

Use the revision and pre-tax estimate returned by the API. Read monthly and upfront amounts from `estimate.totals.monthly` and `estimate.totals.oneTime`. To change selections, send another PUT with the full updated item list. To retrieve the latest state, send `GET /api/baskets/{basketId}`.

## Confirm and submit

Show the customer the selected options, quantities, included components, add-ons, and separate pre-tax USD totals for monthly and one-time charges. During the conversation, ask “What name should I put on the quote, and what email address or phone number can the telecom team use to follow up?” Use a single name field. One contact method is sufficient. Accept both if volunteered. Use only details the customer provides for this quote. If either the name or a contact method is missing, explain that the estimate is available and wait before submitting.

Tell the customer that the name and contact information will be saved with the quote for employee follow-up. Ask for explicit approval of the current revision and these details. If the basket changes, present the revised estimate and ask again.

After approval, send `POST /api/quotes` with the basket token and an `Idempotency-Key` header containing 8–64 letters, digits, underscores, or hyphens. Generate a fresh key for this submission. Use the actual basket ID, approved revision, and customer details. For a phone-only request, send `customer.phone` instead of `customer.email`.

```json
{"basketId":"YOUR_BASKET_ID","revision":1,"confirmed":true,"customer":{"name":"Example Customer","email":"customer@example.com"}}
```

Return the saved `quoteId`, currency, lines, and separate pre-tax totals using `totals.monthly` and `totals.oneTime`. A timeout or HTTP 202 means the outcome may still be pending. Retry the identical submission with the original key and customer details. A temporary HTTP 503 can be retried the same way. If the API says quote writes are paused or the daily limit was reached, report that status and keep the estimate available. On a revision conflict, retrieve the basket and confirm any changes before submitting. If the API says a pending submission requires reconciliation, report it as pending.
