Coinbase CDP icon

Coinbase CDP

Interact with Coinbase CDP Advanced Trade API

Orders → Close Position

AI-generated

Summary

Close an existing open position in the Coinbase CDP Orders resource.

Inputs

  • requestOptions (required) — Collection of options to customize the request for closing the position.
  • requestOptions.batching — Batching configuration for request throttling including batch size and interval.
  • requestOptions.allowUnauthorizedCerts — Set to true to ignore SSL certificate issues.
  • requestOptions.proxy — Optional HTTP proxy to route the requests.
  • requestOptions.timeout — Timeout period in milliseconds for server response.

Output shape

no body — success/failure only

Handles success and failure responses based on the closing position request.

Examples

Example 1: Close a long position in Bitcoin with a batch size of 10 and a timeout of 5000 ms.

Set batching with 10 items and a timeout of 5000 ms, set the ignore SSL option to false.

Discussion