# Orders

### **About Orders**

Sharing your customer's order details with GetReviews is optional, but does have a few benefits.

1. If your survey offers respondents a giveaway for their feedback, providing Order IDs allows us to validate the review before triggering integrations with 3PL, etc.
2. If you want to enforce customers to wait `X` days before writing reviews, providing Order IDs allows us to enforce this delay.
3. You may **auto-identify customers** during survey initialization, skipping the data-gathering steps (product purchased, customer name / email, etc) as well as validating reviewer authenticity (benefits 1-2 above)

To provide order data itself you may upload CSVs inside our Upload Center or send data programmatically via our API.

### **Create an Order**

Endpoint: `/orders`\
Method: `POST`

Sample Body:

```json
{
    "order_id": "888-888-123456779",
    "order_date": "2023-04-24",
    "name": "Tommy Tutone",
    "email": "tommy@heath.com",
    "phone": "+15558675309",
    "marketplace_id": 10,
    "survey_code": "9594fc",
    "product_id": 3189,
    "campaign_id": 9
}
```

Sample Response:

```json
{"status"=>true,
 "data"=>
  {"id"=>717066,
   "order_id"=>"888-888-123456779",
   "order_date"=>nil,
   "marketplace_id"=>10,
   "name"=>"Tommy Tutone",
   "email"=>"tommy@heath.com",
   "phone"=>"+15558675309",
   "code"=>"qwerty",
   "survey_url"=>"https://app.getreviews.ai/survey/redirect/qwerty"}
}
```

| Parameter       | Status   | Description                                                                                                  |
| --------------- | -------- | ------------------------------------------------------------------------------------------------------------ |
| order\_id       | required | your platform's unique ID for this order                                                                     |
| order\_date     | optional | date in YYYY-MM-DD format on which order was placed                                                          |
| name            | optional | customer name                                                                                                |
| email           | optional | customer email; will be used to request review from customer if attached to Campaign.                        |
| phone           | optional | customer phone; will be used to request review from customer if attached to Campaign                         |
| marketplace\_id | required | GetReviews Marketplace primary key ID; used to pre-populate survey details                                   |
| survey\_code    | required | GetReviews survey hash that this user should be redirected to complete                                       |
| product\_id     | optional | used to pre-populate the product a customer purchased, if survey has multiple products                       |
| campaign\_id    | optional | if you create an Outbound campaign (email, sms), this will associate the order with that campaign automation |

#### **Notes**&#x20;

Order records will be de-duplicated based on the `order_id` attribute. If 2+ payloads are received with the same order\_id value, only the first will be used to create an Order.

### Error Messages

```
"Marketplace with ID: X doesn't exist" // marketplace not found

"{{ Marketplace Name }} isn't enabled on this account" // marketplace not enabled

"Survey code is mandatory" // survey_code param not included 

"Survey with code: X doesn't exist // survey not found

"Order already exists" // an order with this order_id already exists on the account
```


---

# 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://docs.getreviews.ai/getreviews/orders.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.
