API3
opencartcity at August 23rd, 2018 07:35 — #1
Hello,
How can we add new items for deal via api?
Thanks!
kevin at August 23rd, 2018 11:18 — #2
Hi opencartcity
I am really glad you noticed our new deal items feature on the API which was just release this morning!
As deal items has just been released, it is subject to minor changes in the coming weeks. Therefore there is no official documentation for deal items API as of yet.
Having said that, here is a sneak preview on how you can view and create/update deal items on the API.
To create a deal that contains deal items, simply preform a post request to the deals endpoint just like how you would have created deals up until now and add the following additional fields to add deal items:
1) 'has_deal_items' and set to true.
2) 'deal_items' which contains an array of hash's. Each hash is a deal item that contains key-value pairs. The possible keys are name, description, cost (if enabled in settings), price, amount and qty.
If you want to see a sample of how a deal that contains deal items looks on the API, you could create a dummy deal that contains deal items on the web app, and then preform a get request for that deal via the API.
Don't forget to set the partial=true flag if preforming a partial update to a deal.
As this has just been release, the above is subject to minor changes. We will release official API documentation once finalized.
I have left myself a reminder to post a message here notifying you when this documentation has been released.
Thank you for your interest in deal items.
Hope you are having a great day!
Kevin
opencartcity at August 24th, 2018 02:15 — #3
We will wait for your official document. So please inform us when you add this in your official document.
awicrm at April 29th, 2020 19:51 — #4
I still don't see how to add deal items in the API v3.0 Docs. Is this still not possible?
vladimir at August 17th, 2020 07:45 — #5
Hi opencartcity, awicrm!
Here https://developer.onepagecrm.com/api/#/Deals/put_deals__deal_id_ you can find a way to manage deal items in a deal. Kevin briefly described above how to use this feature. You should specify to following params:
{
name: 'A deal',
has_deal_items: true
deal_items: [
{deal_item_specification_1}, # see the docs
{deal_item_specification_2}
],
deal_items_to_delete: [1, 2, 3] #optional
...
}
Please don't hesitate to contact us if you have any questions
Vladimir
Powered by Discourse, best viewed with JavaScript enabled