# Shopify Native Actions - Ecommerce Actions

Flexito's OmniAI offers a range of eCommerce actions that streamline the shopping experience for both businesses and customers. These features allow for efficient cart management, from adding and removing items to creating draft orders, ensuring a seamless and user-friendly interaction.

This section covers the eCommerce actions supported by Flexito's OmniAI for customer interactions.

- Add to Cart
- Remove from Cart
- Empty Cart
- Get Cart Items
- Create Draft Order From Cart

Let's explore each of these actions in detail.

## Add to Cart

Use this action to add a product to a user's cart by employing the bot user's NS and the product's variant ID.

### Input

### Response Payload

| {  <br><br>"variant\_id":,  <br><br>"product\_id":,  <br><br>"quantity": 2,  <br><br>"previous\_quantity": 1  <br><br>} |
| --- |

## Remove from Cart

This action removes an item from the cart using the user's NS and variant ID.

### Input

### Response Payload

| {  <br><br>"variant\_id":,  <br><br>"product\_id":,  <br><br>"quantity": 1,  <br><br>"previous\_quantity": 2  <br><br>} |
| --- |

## Empty Cart

This action completely empties a user's cart using their user NS.

### Input

### Response Payload

| {  <br><br>"status": "ok"  <br><br>} |
| --- |

## Get Cart Items

This action retrieves cart details for a bot user using their user NS.

### Input

### Response Payload

| {  <br><br>"note": "f12372u",  <br><br>"taxes\_included": false,  <br><br>"currency": "AUD",  <br><br>"tax\_exempt": false,  <br><br>"name": "#D131",  <br><br>"line\_items": \[  <br><br>{  <br><br>"id":,  <br><br>"variant\_id":,  <br><br>"product\_id":,  <br><br>"title": "2 in 1 Gold MacBook Riser & Stand",  <br><br>"variant\_title": "silver",  <br><br>"sku": "-silver",  <br><br>"vendor": "hapans",  <br><br>"quantity": 3,  <br><br>"requires\_shipping": true,  <br><br>"taxable": false,  <br><br>"gift\_card": false,  <br><br>"fulfillment\_service": "manual",  <br><br>"grams": 0,  <br><br>"tax\_lines": \[...\], // 0 items  <br><br>"applied\_discount": null,  <br><br>"name": "2 in 1 Gold MacBook Riser & Stand - silver",  <br><br>"properties": \[...\], // 0 items  <br><br>"custom": false,  <br><br>"price": "47.99",  <br><br>"admin\_graphql\_api\_id": "gid://shopify/DraftOrderLineItem/"  <br><br>}  <br><br>\],  <br><br>"tax\_lines": \[  <br><br>\],  <br><br>"total\_price": "143.97",  <br><br>"subtotal\_price": "143.97",  <br><br>"total\_tax": "0.00"  <br><br>} |
| --- |

## Create Draft Order From Cart

This action creates a draft order using the line items present in the cart.

### Input

### Response Payload

| {  <br><br>"draft\_order": {  <br><br>"id":,  <br><br>"note": "f12372u",  <br><br>"email": null,  <br><br>"taxes\_included": false,  <br><br>"currency": "AUD",  <br><br>"invoice\_sent\_at": null,  <br><br>"created\_at": "2023-04-07T05:13:45-04:00",  <br><br>"updated\_at": "2023-04-07T05:13:45-04:00",  <br><br>"tax\_exempt": false,  <br><br>"completed\_at": null,  <br><br>"name": "#D132",  <br><br>"status": "open",  <br><br>"line\_items": \[  <br><br>{...} // 20 keys  <br><br>\],  <br><br>"shipping\_address": null,  <br><br>"billing\_address": null,  <br><br>"invoice\_url": "",  <br><br>"applied\_discount": null,  <br><br>"order\_id": null,  <br><br>"shipping\_line": null,  <br><br>"tax\_lines": \[  <br><br>\],  <br><br>"tags": "",  <br><br>"note\_attributes": \[  <br><br>\],  <br><br>"total\_price": "143.97",  <br><br>"subtotal\_price": "143.97",  <br><br>"total\_tax": "0.00",  <br><br>"payment\_terms": null,  <br><br>"admin\_graphql\_api\_id": "gid://shopify/DraftOrder/"  <br><br>}  <br><br>} |
| --- |

- Input (#ShopifyNativeActions-EcommerceActions-Input.1)
- Response Payload (#ShopifyNativeActions-EcommerceActions-ResponsePayload.1)

- Input (#ShopifyNativeActions-EcommerceActions-Input.2)
- Response Payload (#ShopifyNativeActions-EcommerceActions-ResponsePayload.2)

- Input (#ShopifyNativeActions-EcommerceActions-Input.3)
- Response Payload (#ShopifyNativeActions-EcommerceActions-ResponsePayload.3)

- Input (#ShopifyNativeActions-EcommerceActions-Input.4)
- Response Payload (#ShopifyNativeActions-EcommerceActions-ResponsePayload.4)
