---
title: "Partially closes a contract position based on the provided request."
method: POST
path: "/api/Position/partialCloseContract"
tags: ["Position"]
---

# Partially closes a contract position based on the provided request.

`POST /api/Position/partialCloseContract`

## Request body

- PartialCloseContractPositionRequest
  - `accountId` integer, required
  - `contractId` string, required
  - `size` integer, required

## Response `200`

A response indicating the success or failure of the partial close operation.

- PartialClosePositionResponse
  - `success` boolean, required
  - `errorCode` 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9, required — 0 = Success 1 = AccountNotFound 2 = PositionNotFound 3 = ContractNotFound 4 = ContractNotActive 5 = InvalidCloseSize 6 = OrderRejected 7 = OrderPending 8 = UnknownError 9 = AccountRejected
  - `errorMessage` string

---

[API](https://skmtc.dev/topstepx/apis/projectx-gateway-api.md) · [All operations](https://skmtc.dev/topstepx/apis/projectx-gateway-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/topstepx/projectx-gateway-api/revisions/688252f4f704/schema)
