Skip to content
Get started

Submit Position Instructions

PositionSubmitPositionInstructionsResponse v1().positions().submitPositionInstructions(PositionSubmitPositionInstructionsParamsparams, RequestOptionsrequestOptions = RequestOptions.none())
POST/v1/accounts/{account_id}/positions/instructions

Submit one or more position instructions (Exercise, Do-Not-Exercise, Contrary Exercise Advice) against the account.

Batch semantics:

  • All rows accepted200 OK. Every row is in data with status = SENT.
  • Partial success207 Multi-Status. data contains every row; rejected rows carry status = ENGINE_REJECTED (or REJECTED) and rejection_reason. The top-level error summarizes the batch failure.
  • All rows rejected4xx/5xx error response. The HTTP status reflects the underlying cause: 409 for duplicate instruction_id, 400 for validation failures such as DNE/CEA on a non-expiry day, 503 if the clearing service is unavailable. No data is returned.

Pre-flight validation (unknown instrument_id, unencodable quantity) short-circuits the whole batch with a 4xx before any row is submitted.

ParametersExpand Collapse
PositionSubmitPositionInstructionsParams params
Optional<Long> accountId
List<Instruction> instructions
PositionInstructionType instructionType

The action to take.

One of the following:
EXERCISE("EXERCISE")
DO_NOT_EXERCISE("DO_NOT_EXERCISE")
CONTRARY_EXERCISE("CONTRARY_EXERCISE")
String instrumentId

Identifier of the options contract to act on. Unknown ids return 404.

formatuuid
String quantity

Number of contracts to include in the instruction.

Optional<String> instructionId

Caller-supplied idempotency key. Echoed on the response. The server generates a unique id when omitted.

ReturnsExpand Collapse
class PositionSubmitPositionInstructionsResponse:
String id

Server-assigned id. Used as the path parameter on cancel.

formatuuid
long accountId

Account the instruction belongs to.

formatint64
String instructionId

Caller-supplied idempotency key echoed from the submit request; the server-assigned fallback when none was supplied.

PositionInstructionType instructionType

The action this instruction requests.

One of the following:
EXERCISE("EXERCISE")
DO_NOT_EXERCISE("DO_NOT_EXERCISE")
CONTRARY_EXERCISE("CONTRARY_EXERCISE")
String instrumentId

Identifier of the options contract this instruction acts on.

formatuuid
String quantity

Number of contracts included in the instruction.

Current lifecycle status.

One of the following:
SENT("SENT")
ACCEPTED("ACCEPTED")
REJECTED("REJECTED")
ENGINE_REJECTED("ENGINE_REJECTED")
CANCEL_REQUESTED("CANCEL_REQUESTED")
CANCELLED("CANCELLED")
CANCEL_FAILED("CANCEL_FAILED")
UNKNOWN("UNKNOWN")
String symbol

Options symbol (OSI) for display.

Optional<String> acceptedQuantity

Number of contracts accepted by the clearing venue. Populated once the instruction reaches ACCEPTED.

Optional<LocalDateTime> createdAt

When the instruction was first accepted by the service.

formatdate-time
Optional<String> rejectionReason

Human-readable explanation populated on any non-success terminal status — REJECTED, ENGINE_REJECTED, or CANCEL_FAILED. On a 207 Multi-Status batch submit the top-level error field summarizes the batch; per-row detail continues to live here.

Optional<LocalDateTime> updatedAt

When the instruction’s lifecycle state last changed.

formatdate-time

Submit Position Instructions

package com.clear_street.api.example;

import com.clear_street.api.client.ClearStreetClient;
import com.clear_street.api.client.okhttp.ClearStreetOkHttpClient;
import com.clear_street.api.models.v1.positions.PositionInstructionType;
import com.clear_street.api.models.v1.positions.PositionSubmitPositionInstructionsParams;
import com.clear_street.api.models.v1.positions.PositionSubmitPositionInstructionsResponse;

public final class Main {
    private Main() {}

    public static void main(String[] args) {
        ClearStreetClient client = ClearStreetOkHttpClient.builder()
            .fromEnv()
            .apiKey("My API Key")
            .build();

        PositionSubmitPositionInstructionsParams params = PositionSubmitPositionInstructionsParams.builder()
            .accountId(0L)
            .addInstruction(PositionSubmitPositionInstructionsParams.Instruction.builder()
                .instructionType(PositionInstructionType.EXERCISE)
                .instrumentId("0195f6d0-a1b2-7c3d-8e4f-5a6b7c8d9e02")
                .quantity("1")
                .build())
            .build();
        PositionSubmitPositionInstructionsResponse response = client.v1().positions().submitPositionInstructions(params);
    }
}
{
  "data": [
    {
      "account_id": 122503,
      "id": "0195f6d0-a1b2-7c3d-8e4f-5a6b7c8d9e02",
      "instruction_id": "ui-20260424-001",
      "instruction_type": "EXERCISE",
      "instrument_id": "0195f6d0-a1b2-7c3d-8e4f-5a6b7c8d9e01",
      "quantity": "1",
      "status": "SENT",
      "symbol": "AAPL  280121C00195000"
    }
  ],
  "metadata": {
    "request_id": "0a5c9ebf-a9a7-4f2d-9c7e-f2b5f0b1bd01"
  }
}
{
  "data": [
    {
      "account_id": 122503,
      "id": "0195f6d0-a1b2-7c3d-8e4f-5a6b7c8d9e02",
      "instruction_id": "ui-20260424-001",
      "instruction_type": "EXERCISE",
      "instrument_id": "0195f6d0-a1b2-7c3d-8e4f-5a6b7c8d9e01",
      "quantity": "1",
      "status": "SENT",
      "symbol": "AAPL  280121C00195000"
    },
    {
      "account_id": 122503,
      "id": "00000000-0000-0000-0000-000000000000",
      "instruction_id": "ui-20260424-001",
      "instruction_type": "EXERCISE",
      "instrument_id": "0195f6d0-a1b2-7c3d-8e4f-5a6b7c8d9e01",
      "quantity": "1",
      "rejection_reason": "Duplicate exercise instruction",
      "status": "ENGINE_REJECTED",
      "symbol": "AAPL  280121C00195000"
    }
  ],
  "error": {
    "code": 409,
    "message": "Duplicate exercise instruction"
  },
  "metadata": {
    "request_id": "0a5c9ebf-a9a7-4f2d-9c7e-f2b5f0b1bd02"
  }
}
{
  "error": {
    "code": 400,
    "message": "DO_NOT_EXERCISE must be submitted on the contract's expiration date"
  },
  "metadata": {
    "request_id": "0a5c9ebf-a9a7-4f2d-9c7e-f2b5f0b1bd03"
  }
}
{
  "error": {
    "code": 409,
    "message": "Duplicate exercise instruction"
  },
  "metadata": {
    "request_id": "0a5c9ebf-a9a7-4f2d-9c7e-f2b5f0b1bd04"
  }
}
Returns Examples
{
  "data": [
    {
      "account_id": 122503,
      "id": "0195f6d0-a1b2-7c3d-8e4f-5a6b7c8d9e02",
      "instruction_id": "ui-20260424-001",
      "instruction_type": "EXERCISE",
      "instrument_id": "0195f6d0-a1b2-7c3d-8e4f-5a6b7c8d9e01",
      "quantity": "1",
      "status": "SENT",
      "symbol": "AAPL  280121C00195000"
    }
  ],
  "metadata": {
    "request_id": "0a5c9ebf-a9a7-4f2d-9c7e-f2b5f0b1bd01"
  }
}
{
  "data": [
    {
      "account_id": 122503,
      "id": "0195f6d0-a1b2-7c3d-8e4f-5a6b7c8d9e02",
      "instruction_id": "ui-20260424-001",
      "instruction_type": "EXERCISE",
      "instrument_id": "0195f6d0-a1b2-7c3d-8e4f-5a6b7c8d9e01",
      "quantity": "1",
      "status": "SENT",
      "symbol": "AAPL  280121C00195000"
    },
    {
      "account_id": 122503,
      "id": "00000000-0000-0000-0000-000000000000",
      "instruction_id": "ui-20260424-001",
      "instruction_type": "EXERCISE",
      "instrument_id": "0195f6d0-a1b2-7c3d-8e4f-5a6b7c8d9e01",
      "quantity": "1",
      "rejection_reason": "Duplicate exercise instruction",
      "status": "ENGINE_REJECTED",
      "symbol": "AAPL  280121C00195000"
    }
  ],
  "error": {
    "code": 409,
    "message": "Duplicate exercise instruction"
  },
  "metadata": {
    "request_id": "0a5c9ebf-a9a7-4f2d-9c7e-f2b5f0b1bd02"
  }
}
{
  "error": {
    "code": 400,
    "message": "DO_NOT_EXERCISE must be submitted on the contract's expiration date"
  },
  "metadata": {
    "request_id": "0a5c9ebf-a9a7-4f2d-9c7e-f2b5f0b1bd03"
  }
}
{
  "error": {
    "code": 409,
    "message": "Duplicate exercise instruction"
  },
  "metadata": {
    "request_id": "0a5c9ebf-a9a7-4f2d-9c7e-f2b5f0b1bd04"
  }
}