Hi @sidharth_kothar
To add giftcard with cart, please use following API:
URL : /V1/carts/{cartId}/giftCards
Method : PUT
Token: Customer Token
Request:
{
"giftCardAccountData": {
"gift_cards": [
"string"
],
"gift_cards_amount": 0,
"base_gift_cards_amount": 0,
"gift_cards_amount_used": 0,
"base_gift_cards_amount_used": 0,
"extension_attributes": {}
}
}
This is the only way to apply giftcard coupon with cart for customer.
For adding a product to cart with custom options like receipent email or message, you need to call below url:
url : /V1/carts/mine/items
Method: post
Token: Customer
Request :
{
"cart_item": {
"quote_id": "9",
"sku": "24-MB01",
"qty": 1,
"productOption":{
"extensionAttributes":{
"customOptions":[
{
"optionId":"1",
"optionValue":"2"
}
]
}
}
}
}
If issue resolve, Please click on 'Kudos' & Accept as Solution!
Problem solved? Click Accept as Solution!