Skip to main content

Close Positions

API URL: POST https://gateway-api-demo.s2f.projectx.com/api/Position/closeContract

API Reference: /api/position/closeContract

Description


Close a position.

Parameters


NameTypeDescriptionRequiredNullable
accountIdintegerThe account ID.Requiredfalse
contractIdstringThe contract ID.Requiredfalse

Example Usage


Example Request

curl -X 'POST' \
'https://gateway-api-demo.s2f.projectx.com/api/Position/partialCloseContract' \
-H 'accept: text/plain' \
-H 'Content-Type: application/json' \
-d '{
"accountId": 536,
"contractId": "CON.F.US.GMET.J25",
"size": 1
}'

Example Response

{
"success": true,
"errorCode": 0,
"errorMessage": null
}