Skip to main content
POST
/
payments
/
force_sweep_requests
import cobo_waas2
from cobo_waas2.models.forced_sweep import ForcedSweep
from cobo_waas2.models.forced_sweep_request import ForcedSweepRequest
from cobo_waas2.rest import ApiException
from pprint import pprint

# See configuration.py for a list of all supported configurations.
configuration = cobo_waas2.Configuration(
    # Replace `<YOUR_PRIVATE_KEY>` with your private key
    api_private_key="<YOUR_PRIVATE_KEY>",
    # Select the development environment. To use the production environment, change the URL to https://api.cobo.com/v2.
    host="https://api.dev.cobo.com/v2",
)
# Enter a context with an instance of the API client
with cobo_waas2.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = cobo_waas2.PaymentApi(api_client)
    forced_sweep_request = cobo_waas2.ForcedSweepRequest(
        request_id="123e4567-e89b-12d3-a456-426614174002",
        wallet_id="f47ac10b-58cc-4372-a567-0e02b2c3d479",
        token_id="ETH_USDT",
        amount="10.5",
    )

    try:
        # Create forced sweep
        api_response = api_instance.create_forced_sweep_request(
            forced_sweep_request=forced_sweep_request
        )
        print("The response of PaymentApi->create_forced_sweep_request:\n")
        pprint(api_response)
    except Exception as e:
        print(
            "Exception when calling PaymentApi->create_forced_sweep_request: %s\n" % e
        )

{
  "forced_sweep_id": "aff0e1cb-15b2-4e1f-9b9d-a9133715986f",
  "request_id": "123e4567-e89b-12d3-a456-426614174002",
  "wallet_id": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
  "token_id": "ETH_USDT",
  "amount": "10.5",
  "status": "Pending",
  "created_timestamp": 1744689600,
  "updated_timestamp": 1744689600
}
import cobo_waas2
from cobo_waas2.models.forced_sweep import ForcedSweep
from cobo_waas2.models.forced_sweep_request import ForcedSweepRequest
from cobo_waas2.rest import ApiException
from pprint import pprint

# See configuration.py for a list of all supported configurations.
configuration = cobo_waas2.Configuration(
    # Replace `<YOUR_PRIVATE_KEY>` with your private key
    api_private_key="<YOUR_PRIVATE_KEY>",
    # Select the development environment. To use the production environment, change the URL to https://api.cobo.com/v2.
    host="https://api.dev.cobo.com/v2",
)
# Enter a context with an instance of the API client
with cobo_waas2.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = cobo_waas2.PaymentApi(api_client)
    forced_sweep_request = cobo_waas2.ForcedSweepRequest(
        request_id="123e4567-e89b-12d3-a456-426614174002",
        wallet_id="f47ac10b-58cc-4372-a567-0e02b2c3d479",
        token_id="ETH_USDT",
        amount="10.5",
    )

    try:
        # Create forced sweep
        api_response = api_instance.create_forced_sweep_request(
            forced_sweep_request=forced_sweep_request
        )
        print("The response of PaymentApi->create_forced_sweep_request:\n")
        pprint(api_response)
    except Exception as e:
        print(
            "Exception when calling PaymentApi->create_forced_sweep_request: %s\n" % e
        )

Authorizations

BIZ-API-KEY
string
header
required

The API key. For more details, refer to API key.

In the API playground, enter your API secret, and your API key will be accordingly calculated.

Body

application/json

The request body for forced sweep.

request_id
string
required

The request ID that is used to track a forced sweep. The request ID is provided by you and must be unique.

Example:

"123e4567-e89b-12d3-a456-426614174002"

wallet_id
string<uuid>
required

The ID of the wallet in which the funds will be forcefully swept.

Example:

"f47ac10b-58cc-4372-a567-0e02b2c3d479"

token_id
string
required

The ID of the token to be forcefully swept.

Example:

"ETH_USDT"

amount
string
required

The amount of the token to be forcefully swept.

Example:

"10.5"

Response

Forced sweep created successfully.

forced_sweep_id
string<uuid>
required

The forced sweep ID generated by Cobo.

Example:

"aff0e1cb-15b2-4e1f-9b9d-a9133715986f"

request_id
string
required

The request ID provided by you when creating the forced sweep.

Example:

"123e4567-e89b-12d3-a456-426614174002"

status
enum<string>
required

The current status of the forced sweep:

  • Pending: The forced sweep has been created and is awaiting processing.
  • Processing: The forced sweep is currently being processed.
  • Completed: The requested forced sweep has been completed.
Available options:
Pending,
Processing,
Completed
Example:

"Pending"

wallet_id
string<uuid>

The ID of the wallet in which the funds have been forcefully swept.

Example:

"f47ac10b-58cc-4372-a567-0e02b2c3d479"

token_id
string

The ID of the token that has been forcefully swept.

Example:

"ETH_USDT"

amount
string

The amount of token that has been forcefully swept.

Example:

"10.5"

created_timestamp
integer

The creation time of the forced sweep, represented as a UNIX timestamp in seconds.

Example:

1744689600

updated_timestamp
integer

The update time of the forced sweep, represented as a UNIX timestamp in seconds.

Example:

1744689600