Skip to content

Cancel Order

Cancels an active order that has not yet been fully executed. Only orders with status submitted, pending, or partially_filled can be cancelled.

Request URL

DELETE https://ddp.definitive.fi/v2/organization/portfolios/{portfolioId}/trade/{orderId}

Path Parameters

ParameterTypeRequiredDescription
portfolioIdstringYesUUID of the portfolio
orderIdstringYesUUID of the order to cancel

Example

const json = await AuthHelpers.signAndSend({
  path: "/v2/organization/portfolios/00000000-0000-0000-0000-000000000001/trade/00000000-0000-0000-0000-000000000005",
  method: "DELETE",
  organizationId: "00000000-0000-0000-0000-000000000000",
  apiKey: process.env.API_KEY,
  apiSecret: process.env.API_SECRET,
});
console.log(json);

Response

{
  success: true,
  message: "Order cancelled successfully"
}

Cancellation Rules

  • Only orders in one of these statuses can be cancelled:
    • submitted
    • pending
    • partially_filled
  • Orders that are filled, cancelled, failed, or expired cannot be cancelled
  • If successful, the API will confirm the cancellation with a success: true message

Notes

  • Use the Get Order Details endpoint to inspect the latest order status
  • Cancellations are final and cannot be undone