# AJAX API Docs

## Cart

{% embed url="<https://shopify.dev/api/ajax/reference/cart#add-a-selling-plan>" %}

### URL parameter version

`%26` = `&` needs to be used after `return_to`

#### Add single item&#x20;

`/cart/add?items[][id]=39967458000981&items[][quantity]=1&items[][selling_plan]=3766747221`

#### Clear cart -> add a single item

`/cart/clear?return_to=/cart/add?items[][id]=39967458000981%26items[][quantity]=1%26items[][selling_plan]=3766747221`

#### Clear cart -> add a single item -> go to checkout

`/cart/clear?return_to=/cart/add?items[][id]=39967458000981%26items[][quantity]=1%26items[][selling_plan]=3766747221%26return_to=/checkout`

#### Add multiple items

`/cart/add?items[0][id]=39967458000981&items[0][quantity]=1&items[0][selling_plan]=3766747221&items[1][id]=40066668691541&items[1][quantity]=1&items[1][selling_plan]=4186832981`

#### Clear cart -> add multiple items

`/cart/clear?return_to=/cart/add?items[0][id]=39967458000981%26items[0][quantity]=1%26items[0][selling_plan]=3766747221%26items[1][id]=40066668691541%26items[1][quantity]=1%26items[1][selling_plan]=4186832981`

#### Clear cart -> add multiple items -> go to checkout

`/cart/clear?return_to=/cart/add?items[0][id]=39967458000981%26items[0][quantity]=1%26items[0][selling_plan]=3766747221%26items[1][id]=40066668691541%26items[1][quantity]=1%26items[1][selling_plan]=4186832981%26return_to=/checkout`

## Product

{% embed url="<https://shopify.dev/api/ajax/reference/product#selling-plan-example>" %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://integrate.skio.com/skio/shopify-api-references/ajax-api-docs.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
