group | title | ee_only |
---|---|---|
graphql |
removeStoreCreditFromCart mutation |
true |
The removeStoreCreditFromCart
mutation removes store credit previously applied to the specified cart with the applyStoreCreditToCart
mutation. Magento restores the customer's available store credit to its original amount and recalculates all cart totals.
Store credit must be enabled on the store to run this mutation.
mutation {
removeStoreCreditFromCart(
input: RemoveStoreCreditFromCartInput
) {
RemoveStoreCreditFromCartOutput
}
}
Request:
mutation {
removeStoreCreditFromCart(
input: {
cart_id: "4HHaKzxpKM2ZwD0IcheRfcPNBWS3OvRM"
}
) {
cart {
applied_store_credit {
applied_balance {
currency
value
}
current_balance {
currency
value
}
}
prices {
grand_total {
currency
value
}
}
}
}
}
Response:
{
"data": {
"removeStoreCreditFromCart": {
"cart": {
"applied_store_credit": {
"applied_balance": {
"currency": "USD",
"value": 0
},
"current_balance": {
"currency": "USD",
"value": 10
}
},
"prices": {
"grand_total": {
"currency": "USD",
"value": 34.64
}
}
}
}
}
}
The RemoveStoreCreditFromCartInput
object must contain the following attributes.
Attribute | Data Type | Description |
---|---|---|
cart_id |
String! | The unique ID that identifies the customer’s cart |
The RemoveStoreCreditFromCartOutput
object returns the Cart
object.
Attribute | Data Type | Description |
---|---|---|
cart |
Cart! | Describes the contents of the specified shopping cart |
{% include graphql/cart-object.md %}
Cart query output provides more information about the Cart
object.