Skip to content

orderRevise

Mutationin Checkout

Reopen an unpaid order for editing: a new cart holding the same contents, and the order cancelled. One mutation rather than a replicate-then-cancel pair, because half of it is not recoverable by the buyer -- replicating without cancelling leaves a duplicate order, and cancelling without replicating strands them with nothing to edit.

Available while the payment is still open as well as once it has failed: the buyer who presses back at the provider is standing on the resume page asking for their basket, and no outcome has been reported yet.

Arguments

ArgumentTypeDescription
orderIdID!

Returns

OrderReviseResponse!

FieldTypeDescription
cartCartA new cart holding the same contents as the order that was closed
orderErrors[OrderReviseError!]Error details if the order could not be reopened

Example

mutation OrderRevise($orderId: ID!) {
orderRevise(orderId: $orderId) {
cart {
id
version
createdAt
lastModifiedAt
currency
customerEmail
isGuest
totalQuantity
deliveryRemarks
vatNumber
purchaseOrderNumber
deliverySplit
requestedDeliveryDate
earliestCompleteDeliveryDate
name
defaultName
status
}
orderErrors {
__typename
... on OrderError {
code
message
}
... on ValidationError {
message
}
}
}
}

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/medusaNot resolved
@evolve-framework/sfccNot resolved

Used by

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