I am trying to create line_items to be later associated to a deal, but get "Bad Request" response.
The same response comes back for create single as well as batch line_items.
To be transparent, that's not how our example JSON is meant to be used. While an API demo account exists, its objects and values have been modified so many times by public users that many endpoints won't work with the hapikey=demo value and the example JSON provided.
Instead, it's best practice is to use a test account's API key as you'll have access to all the necessary tools and scopes without the interference of other users.
You mention that you tried the JSON against your production account, but if you simply pasted it into a client and sent the request, it would also fail because you wouldn't have a product with an hs_product_id equal to 1642736.
If you experience the same issue trying to update one of your own products (with the correct hs_product_id), please share the Hub ID and POST JSON and I'll take a look.
To be transparent, that's not how our example JSON is meant to be used. While an API demo account exists, its objects and values have been modified so many times by public users that many endpoints won't work with the hapikey=demo value and the example JSON provided.
Instead, it's best practice is to use a test account's API key as you'll have access to all the necessary tools and scopes without the interference of other users.
You mention that you tried the JSON against your production account, but if you simply pasted it into a client and sent the request, it would also fail because you wouldn't have a product with an hs_product_id equal to 1642736.
If you experience the same issue trying to update one of your own products (with the correct hs_product_id), please share the Hub ID and POST JSON and I'll take a look.
Hi Isaac, I am getting "Bad Request" on other PUT calls to create association between Deal and Company.
How can I get more details on what is wrong with the request? It is a simple JSON sent.
Example POST JSON:
[
{
"name": "hs_product_id",
"value": "1642736"
},
{
"name": "quantity",
"value": "50"
},
{
"name": "price",
"value": "9.50"
},
{
"name": "name",
"value": "A custom name for the product for this line item. Discounting 5% on bulk purchase."
}
]