> For the complete documentation index, see [llms.txt](https://woowup-docs.gitbook.io/woowup-developer-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://woowup-docs.gitbook.io/woowup-developer-docs/api/abandoned-carts.md).

# Abandoned carts

## Create abandoned cart

<mark style="color:green;">`POST`</mark> `https://api.woowup.com/apiv3/multiusers/abandoned-cart`

Create an abandoned cart

#### Request Body

| Name         | Type    | Description                                                                                               |
| ------------ | ------- | --------------------------------------------------------------------------------------------------------- |
| document     | string  | Customer's document                                                                                       |
| email        | string  | Customer's email                                                                                          |
| service\_uid | string  | Customer's id                                                                                             |
| total\_price | number  | Total cart's price                                                                                        |
| external\_id | string  | Cart's identifier                                                                                         |
| source       | string  | Source of the cart (e.g. "web")                                                                           |
| recovered    | boolean | If cart was already recovered                                                                             |
| recover\_url | string  | URL of the cart so the customer can recover it                                                            |
| products     | array   | List of products. Available properties for each one: sku (mandatory), quantity, unit\_price, offer\_price |
| createtime   | string  | Create time of the cart. Format: ISO-8061                                                                 |

{% tabs %}
{% tab title="201 Cart successfully created." %}

```javascript
{
    "payload": [],
    "message": "ok",
    "code": "ok",
    "time": "56ms"
}
```

{% endtab %}

{% tab title="400 Malformed JSON" %}

```javascript
{
    "payload": {
        "errors": [
            "[An error]"
        ]
    },
    "message": "bad request",
    "code": "bad_request",
    "time": "35ms"
}
```

{% endtab %}

{% tab title="404 Could not find customer." %}

```javascript
{
    "payload": [],
    "message": "User not found",
    "code": "user_not_found",
    "time": "34ms"
}
```

{% endtab %}
{% endtabs %}

**Example**

```javascript
curl -X POST \
  https://api.woowup.com/apiv3/multiusers/abandoned-cart \
  -H 'Accept: application/json' \
  -H 'Authorization: Basic xxxxxxxxxxxxx' \
  -H 'Content-Type: application/json' \
  -H 'cache-control: no-cache' \
  -d '{
    "email": "email@example.com",
    "external_id": "Cart-001",
    "source": "web",
    "recovered": false,
    "recover_url": "http://www.my-store.com/my-abandoned-cart",
    "createtime": "2019-07-10T19:12:53-03:00",
    "products": [
        {
            "sku": "12345",
            "quantity": 1,
            "unit_price": 699.0,
            "offer_price": 399.0
        }
    ],
    "total_price": 699.0
}'
```

**JSON schema**

```javascript
{
        "$schema": "http://json-schema.org/draft-04/schema#",
        "description": "A representation of an abandoned cart",
        "type": "object",
        "required": ["products"],
        "properties": {
            "service_uid": { "type": "string" },
            "email": { "type": "string" },
            "document": { "type": "string" },
            "total_price": { "type": "number"},
            "external_id": { "type": "string" },
            "source": { "type": "string" },
            "recovered": { "type": "boolean" },
            "recover_url": { "type": "string" },
            "products": {
                "type": "array",
                "items": {
                    "type": "object",
                    "required": [ "sku" ],
                    "properties": {
                        "sku": { "type": "string" },
                        "quantity": { "type": "number" },
                        "unit_price": { "type": "number" },
                        "offer_price": { "type": "number" }
                    }
                }
            },
            "createtime": { "type": "string" }
        }
    }
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://woowup-docs.gitbook.io/woowup-developer-docs/api/abandoned-carts.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
