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.

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"
}

References

Notes

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