I hope this message finds you well. I am currently experiencing an issue while attempting to create orders in my e-commerce platform using your API. Despite having a correct authentication token, I am encountering an error that I am unable to resolve. Here are the details of the error I am encountering:
**Error Details:** ```json { "message": "400 Bad Request", "error": { "type": "invalid_request_error", "code": "invalid_request", "message": "Please provide a valid collection of items for this order" } }
I am using Postman for testing, and it seems that the API is responding with a "400 Bad Request" error, specifying that a valid collection of items is required for the order.
Request Information:
method : 'POST' ,
url : 'https://scl-sandbox.dev.clover.com/v1/orders' ,
headers : {
accept : 'application/json' ,
'content-type' : 'application/json' ,
authorization : `Bearer ${ config . get ( 'clover.accessToken' ) } ` , },
data :
{ orderData , }, };
```
{
"currency": "cad",
"customer": "dharamveer bangar",
"email": "smartstar8@gmail.com",
"expand": ["test"],
"items": [
{
"amount": 0,
"currency": "cad",
"description": "test",
"inventory_id": "123",
"quantity": 1,
"tax_rates": [
{ "name": "one test", "rate": 0 },
{ "name": "two test", "tax_amount": 0 },
{ "name": "two test test", "tax_rate_uuid": "123" }
],
"type": "shipping"
}
],
"metadata": {
"additionalProp": "hello world"
},
"shipping": {
"address": {
"city": "jalandhar",
"country": "india",
"line1": "jalandhar punjab india",
"line2": "jalandhar punjab india",
"postal_code": "144801",
"state": "punjab"
},
"name": "hello world",
"phone": "+911232123123"
}
}
```
- I have double-checked the authentication token and the request payload, but the error persists. I suspect there might be an issue with the way I am providing the collection of items for the order.