# Shopify Native Actions - Orders

Flexito OmniAI streamlines your Shopify order management with a suite of powerful actions. Whether you're creating draft orders, applying discounts, or fetching order details, our tools simplify these processes, saving you time and effort. Discover how each action can enhance your workflow and improve customer satisfaction.

In this section, we'll explore the various order-related actions supported by Flexito OmniAI for customer management.

- Retrieve shop information
- Check discount code
- Generate discount code
- Find draft orders
- Create draft order for a single product
- Create draft order for multiple products
- Create draft order with custom products
- Issue an invoice for the draft order
- Apply a discount to a draft order
- Finalize draft order
- Retrieve draft order details
- Retrieve order details

Let's examine each of these actions in detail.

- Input details (#ShopifyNativeActions-Orders-Input.1)
- Response details (#ShopifyNativeActions-Orders-ResponsePayload.1)

- Input details (#ShopifyNativeActions-Orders-Input.2)
- Response details (#ShopifyNativeActions-Orders-ResponsePayload.2)

- Input details (#ShopifyNativeActions-Orders-Input.3)
- Response details (#ShopifyNativeActions-Orders-ReponsePayload)

- Input details (#ShopifyNativeActions-Orders-Input.4)
- Response details (#ShopifyNativeActions-Orders-ResponsePayload.3)

- Input details (#ShopifyNativeActions-Orders-Input.5)
- Response details (#ShopifyNativeActions-Orders-ResponsePayload.4)

- Input details (#ShopifyNativeActions-Orders-Input.6)
- Response details (#ShopifyNativeActions-Orders-ResponsePayload.5)

- Input details (#ShopifyNativeActions-Orders-Input.7)
- Response details (#ShopifyNativeActions-Orders-ResponsePayload.6)

- Input details (#ShopifyNativeActions-Orders-Input.8)
- Response details (#ShopifyNativeActions-Orders-ResponsePayload.7)

## Retrieve Shop Information

Use this action to access information about your Shopify store.

### Input

### Response Payload

| {  <br><br>"shop": {  <br><br>"id":,  <br><br>"name": "CONNECTDOTS DEMO STORE",  <br><br>"email": "",  <br><br>"domain": "Flexito OmniAI Shopify Demo ",  <br><br>"province": "Queensland",  <br><br>"country": "AU",  <br><br>"address1": "49 payne st",  <br><br>"zip": "4068",  <br><br>"city": "indooroopilly",  <br><br>"phone": "",  <br><br>"latitude": -,  <br><br>"longitude":,  <br><br>"primary\_locale": "en",  <br><br>"address2": "",  <br><br>"country\_code": "AU",  <br><br>"country\_name": "Australia",  <br><br>"currency": "AUD",  <br><br>"customer\_email": "",  <br><br>"timezone": "(GMT-05:00) America/New\_York",  <br><br>"iana\_timezone": "America/New\_York",  <br><br>"shop\_owner": "CONNECTDOTS DEMO STORE Admin",  <br><br>"myshopify\_domain": "Flexito OmniAI Shopify Demo "  <br><br>}  <br><br>} |
| --- |

## Create Draft Order for a Single Product

This action allows you to create a draft order for a customer using their customer ID and a product variant ID.

### Input

### Response Payload

| {  <br><br>"draft\_order": {  <br><br>"id":,  <br><br>"note": "",  <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-06T23:21:38-04:00",  <br><br>"updated\_at": "2023-04-06T23:21:38-04:00",  <br><br>"tax\_exempt": false,  <br><br>"completed\_at": null,  <br><br>"name": "#D127",  <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": "Flexito OmniAI Shopify Demo ",  <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": "45.90",  <br><br>"subtotal\_price": "45.90",  <br><br>"total\_tax": "0.00",  <br><br>"payment\_terms": null,  <br><br>"admin\_graphql\_api\_id": "gid://shopify/DraftOrder/"  <br><br>}  <br><br>} |
| --- |

## Create Draft Order for Multiple Products

Use this action to create a draft order that includes multiple products for a customer, using their customer ID.

### Input

### Response Payload

| {  <br><br>"draft\_order": {  <br><br>"id":,  <br><br>"note": "",  <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-07T00:18:51-04:00",  <br><br>"updated\_at": "2023-04-07T00:18:51-04:00",  <br><br>"tax\_exempt": false,  <br><br>"completed\_at": null,  <br><br>"name": "#D128",  <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": "Flexito OmniAI Shopify Demo ",  <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": "45.90",  <br><br>"subtotal\_price": "45.90",  <br><br>"total\_tax": "0.00",  <br><br>"payment\_terms": null,  <br><br>"admin\_graphql\_api\_id": "gid://shopify/DraftOrder/"  <br><br>}  <br><br>} |
| --- |

## Create Draft Order with Custom Product

This action enables you to create a draft order using a custom product.

### Input

### Reponse Payload

| {  <br><br>"draft\_order": {  <br><br>"id":,  <br><br>"note": "",  <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-07T04:17:52-04:00",  <br><br>"updated\_at": "2023-04-07T04:17:52-04:00",  <br><br>"tax\_exempt": false,  <br><br>"completed\_at": null,  <br><br>"name": "#D129",  <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>{...} // 3 keys  <br><br>\],  <br><br>"tags": "",  <br><br>"note\_attributes": \[  <br><br>\],  <br><br>"total\_price": "22.00",  <br><br>"subtotal\_price": "20.00",  <br><br>"total\_tax": "2.00",  <br><br>"payment\_terms": null,  <br><br>"admin\_graphql\_api\_id": "gid://shopify/DraftOrder/"  <br><br>}  <br><br>} |
| --- |

## Send a Draft Order Invoice

This action allows you to send an invoice for the created draft order to the customer. Ensure the email used is associated with a staff member or someone with staff privileges.

### Input

### Response Payload

| {  <br><br>"draft\_order\_invoice": {  <br><br>"to": "",  <br><br>"from": "",  <br><br>"subject": "Invoice",  <br><br>"custom\_message": "This is a test message",  <br><br>"bcc": \[  <br><br>\]  <br><br>}  <br><br>} |
| --- |

## Apply Discount to a Draft Order

Use this action to apply a discount code or offer to an existing draft order.

### Input

### Response Payload

| {  <br><br>"draft\_order": {  <br><br>"id":,  <br><br>"note": "",  <br><br>"email": null,  <br><br>"taxes\_included": false,  <br><br>"currency": "AUD",  <br><br>"invoice\_sent\_at": "2023-04-07T04:24:24-04:00",  <br><br>"created\_at": "2023-04-07T04:17:52-04:00",  <br><br>"updated\_at": "2023-04-07T04:29:06-04:00",  <br><br>"tax\_exempt": false,  <br><br>"completed\_at": null,  <br><br>"name": "#D129",  <br><br>"status": "invoice\_sent",  <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": {  <br><br>"description": "Start of summer clearance",  <br><br>"value": "20.0",  <br><br>"title": "Summer sale",  <br><br>"amount": "4.00",  <br><br>"value\_type": "percentage"  <br><br>},  <br><br>"order\_id": null,  <br><br>"shipping\_line": null,  <br><br>"tax\_lines": \[  <br><br>{...} // 3 keys  <br><br>\],  <br><br>"tags": "",  <br><br>"note\_attributes": \[  <br><br>\],  <br><br>"total\_price": "17.60",  <br><br>"subtotal\_price": "16.00",  <br><br>"total\_tax": "1.60",  <br><br>"payment\_terms": null,  <br><br>"admin\_graphql\_api\_id": "gid://shopify/DraftOrder/"  <br><br>}  <br><br>} |
| --- |

## Finalize Draft Order

This action lets you mark a draft order as either paid or unpaid.

### Input

### Response Payload

| {  <br><br>"draft\_order": {  <br><br>"id":,  <br><br>"note": "",  <br><br>"email": null,  <br><br>"taxes\_included": false,  <br><br>"currency": "AUD",  <br><br>"invoice\_sent\_at": "2023-04-07T04:24:24-04:00",  <br><br>"created\_at": "2023-04-07T04:17:52-04:00",  <br><br>"updated\_at": "2023-04-07T04:35:41-04:00",  <br><br>"tax\_exempt": false,  <br><br>"completed\_at": "2023-04-07T04:35:41-04:00",  <br><br>"name": "#D129",  <br><br>"status": "completed",  <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": {  <br><br>"description": "Start of summer clearance",  <br><br>"value": "20.0",  <br><br>"title": "Summer sale",  <br><br>"amount": "4.00",  <br><br>"value\_type": "percentage"  <br><br>},  <br><br>"order\_id":,  <br><br>"shipping\_line": null,  <br><br>"tax\_lines": \[  <br><br>{...} // 3 keys  <br><br>\],  <br><br>"tags": "",  <br><br>"note\_attributes": \[  <br><br>\],  <br><br>"total\_price": "17.60",  <br><br>"subtotal\_price": "16.00",  <br><br>"total\_tax": "1.60",  <br><br>"payment\_terms": null,  <br><br>"admin\_graphql\_api\_id": "gid://shopify/DraftOrder/"  <br><br>}  <br><br>} |
| --- |

Delete Draft Order

Use this action to delete a draft order using its draft order ID.

Input

Respone Payload

| \[<br> <br>\] |
| --- |

## Retrieve Draft Order Information

This action fetches details of a specific draft order using its draft order ID.

### Input

### Response Payload

| {  <br><br>"draft\_order": {  <br><br>"id":,  <br><br>"note": "",  <br><br>"email": null,  <br><br>"currency": "AUD",  <br><br>"invoice\_sent\_at": null,  <br><br>"created\_at": "2023-04-07T04:44:07-04:00",  <br><br>"updated\_at": "2023-04-07T04:44:07-04:00",  <br><br>"status": "open",  <br><br>"line\_items": \[  <br><br>{...} // 20 keys  <br><br>\],  <br><br>"invoice\_url": "Flexito OmniAI Shopify Demo ",  <br><br>"subtotal\_price": "20.00"  <br><br>}  <br><br>} |
| --- |

## Retrieve Order Information

Use this action to obtain information about a specific order using its order ID.

### Input

### Response Payload

| {  <br><br>"order": {  <br><br>"id":,  <br><br>"cancelled\_at": null,  <br><br>"closed\_at": null,  <br><br>"confirmed": true,  <br><br>"contact\_email": "",  <br><br>"created\_at": "2023-03-27T18:03:31-04:00",  <br><br>"currency": "AUD",  <br><br>"email": "",  <br><br>"financial\_status": "pending",  <br><br>"fulfillment\_status": null,  <br><br>"name": "#1036",  <br><br>"number": 36,  <br><br>"order\_number": 1036,  <br><br>"order\_status\_url": "Thank you Test! - CONNECTDOTS DEMO STORE - Checkout ",  <br><br>"phone": null,  <br><br>"processed\_at": "2023-03-27T18:03:30-04:00",  <br><br>"reference": "019761d686838bd5f9056c44b791e4ac",  <br><br>"subtotal\_price": "24.87",  <br><br>"tax\_lines": \[  <br><br>\],  <br><br>"total\_discounts": "0.00",  <br><br>"total\_line\_items\_price": "24.87",  <br><br>"total\_price": "44.87",  <br><br>"updated\_at": "2023-03-27T18:03:32-04:00"  <br><br>}  <br><br>} |
| --- |
