requestGuestOrderCancel mutation

The requestGuestOrderCancel mutation allows a guest customer to request for cancelling an order, passing the order token and a cancellation reason.

A guest customer can request for the cancellation of an order only if the following conditions are true:

The mutation returns an error if the order cannot be cancelled.

Syntax

mutation: { requestGuestOrderCancel(input: GuestOrderCancelInput!) {CancelOrderOutput}}

Reference

The requestGuestOrderCancel reference provides detailed information about the types and fields defined in this mutation.

Example usage

The following example cancels order with token 0:3:LCFJT5Gbt1iGgeJJ2PWDA0yAQ+Z7yRZy3Ne7wjxG5QwHGsZgoXm1mACd5EHPZe6V5z9uR48EswbB and includes the cancellation reason.

Request:

mutation {
    requestGuestOrderCancel(
        input: {
            reason: "Other",
            token: "0:3:LCFJT5Gbt1iGgeJJ2PWDA0yAQ+Z7yRZy3Ne7wjxG5QwHGsZgoXm1mACd5EHPZe6V5z9uR48EswbB"
        }
    ){
        error
        errorV2 {
            code
            message
        }
        order {
            status
        }
    }
}

Response:

{
  "data": {
    "requestGuestOrderCancel": {
      "error": null,
      "errorV2": null,
      "order": {
        "status": "Pending"
      }
    }
  }
}