Skip to content

Cancel Order

Cancels an active order that has not yet been fully executed. Only orders with status ORDER_STATUS_PENDING, ORDER_STATUS_ACCEPTED, or ORDER_STATUS_PARTIALLY_FILLED can be cancelled. See Order Statuses for a complete reference of all available statuses.

Endpoint

Portfolio API: DELETE https://ddp.definitive.fi/v2/portfolio/trade/{orderId}

Organization API: Replace /v2/portfolio/ with /v2/organization/portfolios/{portfolioId}/. See Portfolio vs. Organization API.

Path Parameters

ParameterTypeRequiredDescription
orderIdstringYesUUID of the order to cancel

Examples

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

Response

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

Notes

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

References