Skip to main content

Cancel Order

Cancels an existing hardware order. The order must be in PENDING or QUOTED status and belong to the authenticated company.

Authentication

This endpoint requires authentication. See Authentication for details.

Parameters

FieldTypeRequiredDescription
idstringYesUUID of the order request to be cancelled
companyCodestringYesCompany code of the authenticated company

Request

Production URL: https://orchestrator.tecspal.com/
Sandbox URL: https://tecspal-orchestrator.sandbox.lexartlabs.uy/
Endpoint: POST /orders/cancel

Example Request

{
"data": {
"id": "3178e7e9-0fe9-47ad-b69a-e5604a990822",
"companyCode": "DM1"
},
"request": "orders/cancel",
"vendor": "tecspal",
"verb": "POST"
}

Response Schema

PropertyTypeDescription
statusCodenumberHTTP status code of the response (200 on success)
messagestringDescription of the response status (e.g. Request successful)
enveloparrayArray containing the cancelled order minimal data

Envelope Item Properties

Cada item dentro de envelop terá apenas os campos essenciais da order cancelada:

PropertyTypeDescription
idstringUnique identifier of the order
statusstringFinal status of the order (CANCELLED)

Example Response

{
"statusCode": 200,
"message": "Request successful",
"envelop": [
{
"id": "3178e7e9-0fe9-47ad-b69a-e5604a990822",
"status": "CANCELLED"
}
]
}

Error Responses

Bad Request (400) - Missing ID

{
"error": "Bad Request",
"message": "id is required",
"statusCode": 400
}

Invalid Company or Order (400)

{
"error": "Bad Request",
"message": "Order request not found",
"statusCode": 400
}

Invalid Status (400)

{
"error": "Bad Request",
"message": "The Order cannot be cancelled. Only orders with status PENDING or QUOTED can be cancelled",
"statusCode": 400
}

Unauthorized (401)

{
"error": "Unauthorized",
"message": "Unauthorized access",
"statusCode": 401
}

Notes

  • Only orders with status PENDING or QUOTED can be cancelled via this endpoint.
  • Cancelling the order updates its status to CANCELLED.
  • The companyCode provided must match the company associated with the order.
  • If the order is already in CANCELLED status, the endpoint will return the same id and status without making changes (idempotent behavior).
  • A status history record is created when an order is cancelled.
  • The company associated with the order will receive a notification when the order is cancelled.