HTTP POST needs UUID

I am trying to POST to an API. However I am getting an error in the HTTP see screenshot

It requires a UUID. I used the one provided by Make but this does not work.

Hey there,

which API are you trying to access and what are you currently mapping in that field?

Here is the url and I want to POST

https://api.salesplaypos.com/v1.0/products

{
“product_code”: “{{7.Code}}”,
“product_name”: “{{7.Name}}”,
“barcode”: “”,
“description”: “{{7.Description}}”,
“category_id”: “”,
“sub_category_id”: “”,
“measurement_id”: “”,
“cost”: “0”,
“stock_control”: true,
“product_price_change”: true,
“qty_change_option”: true,
“expire_mode”: true,
“is_composite”: true,
“use_production”: true,
“is_variant”: true,
“components”: [
{}
],
“tax_ids”: [
“0”
],
“modifiers_ids”: [
“”
],
“option1_name”: “”,
“option2_name”: “”,
“option3_name”: “”,
“created_at”: “{{now}}”,
“updated_at”: “{{now}}”,
“variants”: [
{
“product_code”: “”,
“option1_value”: “”,
“option2_value”: “”,
“option3_value”: “”,
“barcode”: “”,
“default_cost”: 0,
“shops”: [
{
“store_id”: “{{8.data.products.shops.shop_id}}”,
“price”: “{{7.SalesDetails.UnitPrice}}”,
“available_for_sale”: true,
“safety_stock”: “0”
}
]
}
],
“shops”: [
{
“shop_id”: “{{8.data.products.shops.shop_id}}”,
“price”: “{{7.SalesDetails.UnitPrice}}”,
“available_for_sale”: true,
“safety_stock”: “0”
}
]
}

From your input it looks like you have mapped in an array for the tax_ids field, when it’s expecting a uuid which should either be a number or plain text.

1 Like

I have removed the brackets […] for the tax_ids and the error went away. However I am facing the same problem with shop_id. I did the same and still getting the same error.

It looks like you are now facing issues with JSON encoding.

I would use a Create JSON module before your HTTP module.
Once you define the data structure, that will take care of formatting and encoding with numbers, strings, arrays, etc… the API is rejecting your requests so you need to be sure to get the data type correct on every single key.

Look into the Sales Play POS API and find out exactly what is a “UUID”, but the API should clearly tell you what type of data is each key.

Thanks alot I created the JSON first before the HTTP and it worked.

1 Like