By Virajee Amarasinghe on
I'm using Drupal commerce + commerce API modules in decoupled Drupal project. When doing the checkout frontend (in Angular) will call some third-party APIs and get some discounts for each order items. I need to update those discount details in Drupal DB.
I tried this with /jsonapi/checkout/{order_uuid} API like below. But this does not update anything in the DB.
{
"data": {
"type": "order--default",
"id": "f22a4510-3477-42e3-9dfc-7dd5bba9d39e",
"attributes": {
"order_total": {
"adjustments": [
{
"type": "promotion",
"label": "seasonal_promo",
"amount": {
"number": "1000.00",
"currency_code": "LKR",
"formatted": "LKR1,000.00"
}
}
]
}
}
}
}can I know, is this feasible to do with Commerce API without writing any custom logic?
Thank you.
Comments
can I know, is this feasible
You have posted in the section of the forum that is for help with writing custom logic! If you move this post to the 'Post Installation' forum, you will be more likely to get support that does not involve coding.
Contact me to contract me for D7 -> D10/11 migrations.
Thank you for the guidance!!
Thank you for the guidance!!