Skip to main content
POST
/
payments
/
batch_allocations
import cobo_waas2
from cobo_waas2.models.batch_allocation import BatchAllocation
from cobo_waas2.models.create_batch_allocation_request import (
    CreateBatchAllocationRequest,
)
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)
    create_batch_allocation_request = cobo_waas2.CreateBatchAllocationRequest(
        request_id="123e457-e89b-12d3-a456-426614174004",
        allocation_params=[
            cobo_waas2.AllocationParam(
                token_id="ETH_USDT",
                amount="500.00",
                source_account="M1001",
                destination_account="developer",
                description="example_string",
            )
        ],
    )

    try:
        # Create batch allocation
        api_response = api_instance.create_batch_allocation(
            create_batch_allocation_request=create_batch_allocation_request
        )
        print("The response of PaymentApi->create_batch_allocation:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling PaymentApi->create_batch_allocation: %s\n" % e)

{
  "batch_allocation_id": "123e457-e89b-12d3-a456-426614174004",
  "request_id": "123e457-e89b-12d3-a456-426614174004",
  "created_timestamp": 1744689600,
  "updated_timestamp": 1744689600,
  "allocation_params": [
    {
      "token_id": "ETH_USDT",
      "amount": "500.00",
      "source_account": "<string>",
      "destination_account": "<string>",
      "description": "<string>"
    }
  ],
  "initiator": "b2ae1b5aaade686c968ef2bbd31cc75ba94e5a85fd9cb0b35b81dcc15f520e9d"
}
import cobo_waas2
from cobo_waas2.models.batch_allocation import BatchAllocation
from cobo_waas2.models.create_batch_allocation_request import (
    CreateBatchAllocationRequest,
)
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)
    create_batch_allocation_request = cobo_waas2.CreateBatchAllocationRequest(
        request_id="123e457-e89b-12d3-a456-426614174004",
        allocation_params=[
            cobo_waas2.AllocationParam(
                token_id="ETH_USDT",
                amount="500.00",
                source_account="M1001",
                destination_account="developer",
                description="example_string",
            )
        ],
    )

    try:
        # Create batch allocation
        api_response = api_instance.create_batch_allocation(
            create_batch_allocation_request=create_batch_allocation_request
        )
        print("The response of PaymentApi->create_batch_allocation:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling PaymentApi->create_batch_allocation: %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 to create a batch allocation request.

request_id
string
required

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

Example:

"123e457-e89b-12d3-a456-426614174004"

allocation_params
object[]
required

Response

The allocation request was successfully created.

batch_allocation_id
string
required

The batch allocation ID generated by Cobo.

Example:

"123e457-e89b-12d3-a456-426614174004"

request_id
string
required

The request ID provided by you when creating the batch allocation.

Example:

"123e457-e89b-12d3-a456-426614174004"

created_timestamp
integer
required

The created time of the batch allocation, represented as a UNIX timestamp in seconds.

Example:

1744689600

updated_timestamp
integer
required

The updated time of the batch allocation, represented as a UNIX timestamp in seconds.

Example:

1744689600

allocation_params
object[]
initiator
string

The initiator of this batch allocation, usually the API key you used to create the batch allocation.

Example:

"b2ae1b5aaade686c968ef2bbd31cc75ba94e5a85fd9cb0b35b81dcc15f520e9d"