Adobe Commerce only. Learn more
removeStoreCreditFromCart mutation
The removeStoreCreditFromCart
mutation removes store credit previously applied to the specified cart with the applyStoreCreditToCart
mutation. The application 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.
Syntax
mutation: {removeStoreCreditFromCart(input: RemoveStoreCreditFromCartInput): {RemoveStoreCreditFromCartOutput}}
Reference
The removeStoreCreditFromCart
reference provides detailed information about the types and fields defined in this mutation.
Example usage
Request:
Copied to your clipboardmutation {removeStoreCreditFromCart(input: {cart_id: "4HHaKzxpKM2ZwD0IcheRfcPNBWS3OvRM"}) {cart {applied_store_credit {applied_balance {currencyvalue}current_balance {currencyvalue}}prices {grand_total {currencyvalue}}}}}
Response:
Copied to your clipboard{"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}}}}}}
Errors
Error | Description |
---|---|
Please specify a valid customer. | The mutation requires a valid authorization token. |
Required parameter "cart_id" is missing | The value specified in cart_id is empty. |