Skip to content

cartPaymentRemove

Mutationin Cart

Remove a payment that has only reserved money from the cart, such as a gift card, and give the reservation back. A payment whose money has been taken, or that is still being decided by its provider, cannot be removed.

Arguments

ArgumentTypeDescription
idID!
versionString
paymentIdID!

Returns

CartPaymentRemoveResponse!

FieldTypeDescription
cartCartCart information after the payment is removed
cartErrors[CartPaymentRemoveError!]Error details if the payment could not be removed

Example

mutation CartPaymentRemove($id: ID!, $version: String, $paymentId: ID!) {
cartPaymentRemove(id: $id, version: $version, paymentId: $paymentId) {
cart {
id
version
createdAt
lastModifiedAt
currency
customerEmail
isGuest
totalQuantity
deliveryRemarks
vatNumber
purchaseOrderNumber
deliverySplit
requestedDeliveryDate
earliestCompleteDeliveryDate
name
defaultName
status
}
cartErrors {
__typename
... on ValidationError {
message
}
... on CartError {
message
code
}
}
}
}

The query selects the return type's fields two levels deep; pick the ones you need. The response shows its shape with placeholder values.

Served by

@evolve-framework/commercetoolsResolved
@evolve-framework/medusaResolved
@evolve-framework/sfccNot resolved

Used by

The storefront packages that send it, in these GraphQL documents: