Add gift card to the cart.
application/json
POST
/V1/carts/guest-carts/{cartId}/giftCards
cURL (application/json)
curl \
--request POST 'https://magento2.winkelstraat.mac/rest/all/V1/carts/guest-carts/{cartId}/giftCards' \
--header "Content-Type: application/json" \
--data '{"giftCardAccountData":{"gift_cards":["string"],"gift_cards_amount":42.0,"base_gift_cards_amount":42.0,"gift_cards_amount_used":42.0,"base_gift_cards_amount_used":42.0,"extension_attributes":{}}}'
curl \
--request POST 'https://magento2.winkelstraat.mac/rest/all/V1/carts/guest-carts/{cartId}/giftCards' \
--header "Content-Type: application/xml"
Request examples
{
"giftCardAccountData": {
"gift_cards": [
"string"
],
"gift_cards_amount": 42.0,
"base_gift_cards_amount": 42.0,
"gift_cards_amount_used": 42.0,
"base_gift_cards_amount_used": 42.0,
"extension_attributes": {}
}
}
Request examples
<?xml version="1.0" encoding="UTF-8"?>
<root>
<giftCardAccountData>
<gift-cards type="array">
<gift-card>string</gift-card>
</gift-cards>
<gift-cards-amount type="float">42.0</gift-cards-amount>
<base-gift-cards-amount type="float">42.0</base-gift-cards-amount>
<gift-cards-amount-used type="float">42.0</gift-cards-amount-used>
<base-gift-cards-amount-used type="float">42.0</base-gift-cards-amount-used>
<extension-attributes>
</extension-attributes>
</giftCardAccountData>
</root>
Response examples (200)
true
Response examples (200)
true
Response examples (500)
{
"message": "string",
"errors": [
{
"message": "string",
"parameters": [
{
"resources": "string",
"fieldName": "string",
"fieldValue": "string"
}
]
}
],
"code": 42,
"parameters": [
{
"resources": "string",
"fieldName": "string",
"fieldValue": "string"
}
],
"trace": "string"
}
Response examples (500)
<?xml version="1.0" encoding="UTF-8"?>
<root>
<message>string</message>
<errors type="array">
<error>
<message>string</message>
<parameters type="array">
<parameter>
<resources>string</resources>
<fieldName>string</fieldName>
<fieldValue>string</fieldValue>
</parameter>
</parameters>
</error>
</errors>
<code type="integer">42</code>
<parameters type="array">
<parameter>
<resources>string</resources>
<fieldName>string</fieldName>
<fieldValue>string</fieldValue>
</parameter>
</parameters>
<trace>string</trace>
</root>
Response examples (default)
{
"message": "string",
"errors": [
{
"message": "string",
"parameters": [
{
"resources": "string",
"fieldName": "string",
"fieldValue": "string"
}
]
}
],
"code": 42,
"parameters": [
{
"resources": "string",
"fieldName": "string",
"fieldValue": "string"
}
],
"trace": "string"
}
Response examples (default)
<?xml version="1.0" encoding="UTF-8"?>
<root>
<message>string</message>
<errors type="array">
<error>
<message>string</message>
<parameters type="array">
<parameter>
<resources>string</resources>
<fieldName>string</fieldName>
<fieldValue>string</fieldValue>
</parameter>
</parameters>
</error>
</errors>
<code type="integer">42</code>
<parameters type="array">
<parameter>
<resources>string</resources>
<fieldName>string</fieldName>
<fieldValue>string</fieldValue>
</parameter>
</parameters>
<trace>string</trace>
</root>