--- title: "CancelOrder API Request" slug: "cancelorder-api-request" updated: 2022-08-12T19:32:46Z published: 2022-08-12T19:32:46Z canonical: "mercurydocs.landmarkglobal.com/cancelorder-api-request" --- > ## Documentation Index > Fetch the complete documentation index at: https://mercurydocs.landmarkglobal.com/llms.txt > Use this file to discover all available pages before exploring further. # CancelOrder API Request The following details how to cancel a fulfillment order with Mercury via an [**API request**](https://mercurydocs.landmarkglobal.com/docs/api-specifications). The CancelOrder API request should not be confused with the [Cancel API](/v1/docs/cancel-api-request) request, which is used to unprocess standard (non-fulfillment) shipments. #### Overview The protocol is based on XML data exchange with HTTP used as a transport. A non-validating parser is used and hence no internal or external DTD needs to be specified. The data must be well formed and all validation is handled at the application (not parser) level. Error handling will be done by always including the container in the response. The Errors element will not be returned if no errors are found. #### **Connection** To connect to the site, use the following HTTPS URL via regular POST method with the parameter RQXML= **[https://api.landmarkglobal.com/v2/CancelOrder.php](https://api.landmarkglobal.com/v2/CancelOrder.php)** #### **Encoding** Mercury uses UTF-8 for character encoding. If your system outputs in an encoding other than UTF-8, please include an encoding flag in your XML header. Example: Example: #### **Test Mode** When first given access to the API, the client will be placed in Test mode. Requests made while in test mode will not act on live data. After approval has been received to go live from Landmark, all requests are active unless the flag is passed. During a test API call orders will not be cancelled but errors will be reported when appropriate. #### **CancelOrderRequest** This request will cancel a fulfillment order so long as the corresponding shipment has not yet been allocated or processed. The canceled order will be deleted and will no longer remain in the fulfillment queue. Standard (non-fulfillment) shipments may be held before processing. Standard shipments will not be cancelled by this API. This would typically be used to cancel order before the label has been processed. demoapi demo123 true ** 218 ** ** <*!-- Optional -->* #### **CancelOrderResponse** ** Duplicate More than one shipment found with that reference (use TrackingNumber true Successfully unprocessed shipment with reference 3245325 #### **Possible Errors** This table lists all errors that may be returned by the CancelOrder API endpoint. [Brackets] in the ErrorMessage are used to represent to the value passed for the related element. An example is provided when an ErrorMessage is variable. | Related Element(s) | ErrorMessage | Details/Action | | --- | --- | --- | | General Errors | | User, API | User [username] does not have permissions to this API | | | Failure authenticating user | | | User is not available. Check your username/password | | | N/A | Unable to parse characters | Ensure that special characters are properly encoded and an encoding flag is included in your XML header. *Example:* *Example:* | | Errors | | Login | Required element Login not found | Provide login credentials and verify the XML can be parsed | | Login name not provided | | User, ClientID | Request is missing client ID | | | Unable to authenticate the user credentials | | | Client is inactive | | | Client has been deactivated. Permission denied | | | User [username] does not have permissions to client: [clientID] | | | Unable to determine desired client for this user | If user has access to more than one client, the ClientID is required | | Username, password | The username/password combination provided is invalid | | | The username/password combination provided is disabled | | | Password not provided | | | Errors Specific to CancelOrder API | | Reference, PackageReference, TrackingNumber | A Landmark tracking number, shipment reference, or package reference must be provided | | | ClientID, shipment | Unable to retrieve a shipment for ClientID [client id] | | | Shipment | Shipment [tracking number] has already been processed and cannot be cancelled | | | Shipment [tracking number] has already been held from processing | | | Failed to hold the shipment [tracking number] | | | Failed to load a shipment with the given parameters | | | More than one shipment was found under this criteria. Please refine the search | | | N/A | Failed to cancel. [error details] | |