import cobo_waas2
from cobo_waas2.models.create_bulk_send_request import CreateBulkSendRequest
from cobo_waas2.models.payment_bulk_send import PaymentBulkSend
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_bulk_send_request = cobo_waas2.CreateBulkSendRequest(
source_account="M1001",
execution_mode="Strict",
payout_params=[
cobo_waas2.CreateBulkSendRequestPayoutParamsInner(
token_id="ETH_USDT",
receiving_address="0xabc123456789def0000000000000000000000000",
amount="500.00",
)
],
)
try:
# Create bulk send
api_response = api_instance.create_bulk_send(
create_bulk_send_request=create_bulk_send_request
)
print("The response of PaymentApi->create_bulk_send:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling PaymentApi->create_bulk_send: %s\n" % e)
// Import classes:
import com.cobo.waas2.ApiClient;
import com.cobo.waas2.ApiException;
import com.cobo.waas2.Configuration;
import com.cobo.waas2.Env;
import com.cobo.waas2.api.PaymentApi;
import com.cobo.waas2.model.*;
import java.util.Arrays;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Select the development environment. To use the production environment, replace `Env.DEV` with
// `Env.PROD
defaultClient.setEnv(Env.DEV);
// Replace `<YOUR_PRIVATE_KEY>` with your private key
defaultClient.setPrivKey("<YOUR_PRIVATE_KEY>");
PaymentApi apiInstance = new PaymentApi();
CreateBulkSendRequest createBulkSendRequest =
new CreateBulkSendRequest()
.sourceAccount("M1001")
.executionMode(PaymentBulkSendExecutionMode.STRICT)
.payoutParams(
Arrays.asList(
new CreateBulkSendRequestPayoutParamsInner()
.tokenId("ETH_USDT")
.receivingAddress("0xabc123456789def0000000000000000000000000")
.amount("500.00")));
try {
PaymentBulkSend result = apiInstance.createBulkSend(createBulkSendRequest);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling PaymentApi#createBulkSend");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
package main
import (
"context"
"fmt"
coboWaas2 "github.com/CoboGlobal/cobo-waas2-go-sdk/cobo_waas2"
"github.com/CoboGlobal/cobo-waas2-go-sdk/cobo_waas2/crypto"
"os"
)
func main() {
createBulkSendRequest := *coboWaas2.NewCreateBulkSendRequest("M1001", coboWaas2.PaymentBulkSendExecutionMode("Strict"), []coboWaas2.CreateBulkSendRequestPayoutParamsInner{*coboWaas2.NewCreateBulkSendRequestPayoutParamsInner("ETH_USDT", "0xabc123456789def0000000000000000000000000", "500.00")})
configuration := coboWaas2.NewConfiguration()
// Initialize the API client
apiClient := coboWaas2.NewAPIClient(configuration)
ctx := context.Background()
// Select the development environment. To use the production environment, replace coboWaas2.DevEnv with coboWaas2.ProdEnv
ctx = context.WithValue(ctx, coboWaas2.ContextEnv, coboWaas2.DevEnv)
// Replace `<YOUR_PRIVATE_KEY>` with your private key
ctx = context.WithValue(ctx, coboWaas2.ContextPortalSigner, crypto.Ed25519Signer{
Secret: "<YOUR_PRIVATE_KEY>",
})
resp, r, err := apiClient.PaymentAPI.CreateBulkSend(ctx).
CreateBulkSendRequest(createBulkSendRequest).
Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `PaymentAPI.CreateBulkSend``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `CreateBulkSend`: PaymentBulkSend
fmt.Fprintf(os.Stdout, "Response from `PaymentAPI.CreateBulkSend`: %v\n", resp)
}
const CoboWaas2 = require("@cobo/cobo-waas2");
// Initialize the API client
const apiClient = CoboWaas2.ApiClient.instance;
// Select the development environment. To use the production environment, replace `Env.DEV` with `Env.PROD`
apiClient.setEnv(CoboWaas2.Env.DEV);
// Replace `<YOUR_PRIVATE_KEY>` with your private key
apiClient.setPrivateKey("<YOUR_PRIVATE_KEY>");
// Call the API
const apiInstance = new CoboWaas2.PaymentApi();
const opts = {
CreateBulkSendRequest: CoboWaas2.CreateBulkSendRequest.constructFromObject({
source_account: "M1001",
execution_mode: "Strict",
payout_params: [
{
token_id: "ETH_USDT",
receiving_address: "0xabc123456789def0000000000000000000000000",
amount: "500.00",
},
],
}),
};
apiInstance.createBulkSend(opts).then(
(data) => {
console.log("API called successfully. Returned data: " + data);
},
(error) => {
console.error(error);
},
);
{
"bulk_send_id": "123e4567-e89b-12d3-a456-426614174003",
"source_account": "M1001",
"execution_mode": "Strict",
"status": "Pending",
"created_timestamp": 1744689600,
"updated_timestamp": 1744689600,
"request_id": "123e457-e89b-12d3-a456-426614174004",
"description": "Monthly vendor payments - January 2024",
"failed_reason": "Cannot charge payout fee: Fee Station balance is insufficient. Please add funds to Fee Station and try again.",
"commission_fee": {
"fee_amount": "<string>"
}
}{
"error_code": 123,
"error_message": "<string>",
"error_id": "0b6ddf19083c4bd1a9ca01bec44b24dd"
}{
"error_code": 123,
"error_message": "<string>",
"error_id": "0b6ddf19083c4bd1a9ca01bec44b24dd"
}Create bulk send
This operation creates a bulk send to transfer funds to multiple recipients in a single request.
import cobo_waas2
from cobo_waas2.models.create_bulk_send_request import CreateBulkSendRequest
from cobo_waas2.models.payment_bulk_send import PaymentBulkSend
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_bulk_send_request = cobo_waas2.CreateBulkSendRequest(
source_account="M1001",
execution_mode="Strict",
payout_params=[
cobo_waas2.CreateBulkSendRequestPayoutParamsInner(
token_id="ETH_USDT",
receiving_address="0xabc123456789def0000000000000000000000000",
amount="500.00",
)
],
)
try:
# Create bulk send
api_response = api_instance.create_bulk_send(
create_bulk_send_request=create_bulk_send_request
)
print("The response of PaymentApi->create_bulk_send:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling PaymentApi->create_bulk_send: %s\n" % e)
// Import classes:
import com.cobo.waas2.ApiClient;
import com.cobo.waas2.ApiException;
import com.cobo.waas2.Configuration;
import com.cobo.waas2.Env;
import com.cobo.waas2.api.PaymentApi;
import com.cobo.waas2.model.*;
import java.util.Arrays;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Select the development environment. To use the production environment, replace `Env.DEV` with
// `Env.PROD
defaultClient.setEnv(Env.DEV);
// Replace `<YOUR_PRIVATE_KEY>` with your private key
defaultClient.setPrivKey("<YOUR_PRIVATE_KEY>");
PaymentApi apiInstance = new PaymentApi();
CreateBulkSendRequest createBulkSendRequest =
new CreateBulkSendRequest()
.sourceAccount("M1001")
.executionMode(PaymentBulkSendExecutionMode.STRICT)
.payoutParams(
Arrays.asList(
new CreateBulkSendRequestPayoutParamsInner()
.tokenId("ETH_USDT")
.receivingAddress("0xabc123456789def0000000000000000000000000")
.amount("500.00")));
try {
PaymentBulkSend result = apiInstance.createBulkSend(createBulkSendRequest);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling PaymentApi#createBulkSend");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
package main
import (
"context"
"fmt"
coboWaas2 "github.com/CoboGlobal/cobo-waas2-go-sdk/cobo_waas2"
"github.com/CoboGlobal/cobo-waas2-go-sdk/cobo_waas2/crypto"
"os"
)
func main() {
createBulkSendRequest := *coboWaas2.NewCreateBulkSendRequest("M1001", coboWaas2.PaymentBulkSendExecutionMode("Strict"), []coboWaas2.CreateBulkSendRequestPayoutParamsInner{*coboWaas2.NewCreateBulkSendRequestPayoutParamsInner("ETH_USDT", "0xabc123456789def0000000000000000000000000", "500.00")})
configuration := coboWaas2.NewConfiguration()
// Initialize the API client
apiClient := coboWaas2.NewAPIClient(configuration)
ctx := context.Background()
// Select the development environment. To use the production environment, replace coboWaas2.DevEnv with coboWaas2.ProdEnv
ctx = context.WithValue(ctx, coboWaas2.ContextEnv, coboWaas2.DevEnv)
// Replace `<YOUR_PRIVATE_KEY>` with your private key
ctx = context.WithValue(ctx, coboWaas2.ContextPortalSigner, crypto.Ed25519Signer{
Secret: "<YOUR_PRIVATE_KEY>",
})
resp, r, err := apiClient.PaymentAPI.CreateBulkSend(ctx).
CreateBulkSendRequest(createBulkSendRequest).
Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `PaymentAPI.CreateBulkSend``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `CreateBulkSend`: PaymentBulkSend
fmt.Fprintf(os.Stdout, "Response from `PaymentAPI.CreateBulkSend`: %v\n", resp)
}
const CoboWaas2 = require("@cobo/cobo-waas2");
// Initialize the API client
const apiClient = CoboWaas2.ApiClient.instance;
// Select the development environment. To use the production environment, replace `Env.DEV` with `Env.PROD`
apiClient.setEnv(CoboWaas2.Env.DEV);
// Replace `<YOUR_PRIVATE_KEY>` with your private key
apiClient.setPrivateKey("<YOUR_PRIVATE_KEY>");
// Call the API
const apiInstance = new CoboWaas2.PaymentApi();
const opts = {
CreateBulkSendRequest: CoboWaas2.CreateBulkSendRequest.constructFromObject({
source_account: "M1001",
execution_mode: "Strict",
payout_params: [
{
token_id: "ETH_USDT",
receiving_address: "0xabc123456789def0000000000000000000000000",
amount: "500.00",
},
],
}),
};
apiInstance.createBulkSend(opts).then(
(data) => {
console.log("API called successfully. Returned data: " + data);
},
(error) => {
console.error(error);
},
);
{
"bulk_send_id": "123e4567-e89b-12d3-a456-426614174003",
"source_account": "M1001",
"execution_mode": "Strict",
"status": "Pending",
"created_timestamp": 1744689600,
"updated_timestamp": 1744689600,
"request_id": "123e457-e89b-12d3-a456-426614174004",
"description": "Monthly vendor payments - January 2024",
"failed_reason": "Cannot charge payout fee: Fee Station balance is insufficient. Please add funds to Fee Station and try again.",
"commission_fee": {
"fee_amount": "<string>"
}
}{
"error_code": 123,
"error_message": "<string>",
"error_id": "0b6ddf19083c4bd1a9ca01bec44b24dd"
}{
"error_code": 123,
"error_message": "<string>",
"error_id": "0b6ddf19083c4bd1a9ca01bec44b24dd"
}import cobo_waas2
from cobo_waas2.models.create_bulk_send_request import CreateBulkSendRequest
from cobo_waas2.models.payment_bulk_send import PaymentBulkSend
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_bulk_send_request = cobo_waas2.CreateBulkSendRequest(
source_account="M1001",
execution_mode="Strict",
payout_params=[
cobo_waas2.CreateBulkSendRequestPayoutParamsInner(
token_id="ETH_USDT",
receiving_address="0xabc123456789def0000000000000000000000000",
amount="500.00",
)
],
)
try:
# Create bulk send
api_response = api_instance.create_bulk_send(
create_bulk_send_request=create_bulk_send_request
)
print("The response of PaymentApi->create_bulk_send:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling PaymentApi->create_bulk_send: %s\n" % e)
// Import classes:
import com.cobo.waas2.ApiClient;
import com.cobo.waas2.ApiException;
import com.cobo.waas2.Configuration;
import com.cobo.waas2.Env;
import com.cobo.waas2.api.PaymentApi;
import com.cobo.waas2.model.*;
import java.util.Arrays;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Select the development environment. To use the production environment, replace `Env.DEV` with
// `Env.PROD
defaultClient.setEnv(Env.DEV);
// Replace `<YOUR_PRIVATE_KEY>` with your private key
defaultClient.setPrivKey("<YOUR_PRIVATE_KEY>");
PaymentApi apiInstance = new PaymentApi();
CreateBulkSendRequest createBulkSendRequest =
new CreateBulkSendRequest()
.sourceAccount("M1001")
.executionMode(PaymentBulkSendExecutionMode.STRICT)
.payoutParams(
Arrays.asList(
new CreateBulkSendRequestPayoutParamsInner()
.tokenId("ETH_USDT")
.receivingAddress("0xabc123456789def0000000000000000000000000")
.amount("500.00")));
try {
PaymentBulkSend result = apiInstance.createBulkSend(createBulkSendRequest);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling PaymentApi#createBulkSend");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
package main
import (
"context"
"fmt"
coboWaas2 "github.com/CoboGlobal/cobo-waas2-go-sdk/cobo_waas2"
"github.com/CoboGlobal/cobo-waas2-go-sdk/cobo_waas2/crypto"
"os"
)
func main() {
createBulkSendRequest := *coboWaas2.NewCreateBulkSendRequest("M1001", coboWaas2.PaymentBulkSendExecutionMode("Strict"), []coboWaas2.CreateBulkSendRequestPayoutParamsInner{*coboWaas2.NewCreateBulkSendRequestPayoutParamsInner("ETH_USDT", "0xabc123456789def0000000000000000000000000", "500.00")})
configuration := coboWaas2.NewConfiguration()
// Initialize the API client
apiClient := coboWaas2.NewAPIClient(configuration)
ctx := context.Background()
// Select the development environment. To use the production environment, replace coboWaas2.DevEnv with coboWaas2.ProdEnv
ctx = context.WithValue(ctx, coboWaas2.ContextEnv, coboWaas2.DevEnv)
// Replace `<YOUR_PRIVATE_KEY>` with your private key
ctx = context.WithValue(ctx, coboWaas2.ContextPortalSigner, crypto.Ed25519Signer{
Secret: "<YOUR_PRIVATE_KEY>",
})
resp, r, err := apiClient.PaymentAPI.CreateBulkSend(ctx).
CreateBulkSendRequest(createBulkSendRequest).
Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `PaymentAPI.CreateBulkSend``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `CreateBulkSend`: PaymentBulkSend
fmt.Fprintf(os.Stdout, "Response from `PaymentAPI.CreateBulkSend`: %v\n", resp)
}
const CoboWaas2 = require("@cobo/cobo-waas2");
// Initialize the API client
const apiClient = CoboWaas2.ApiClient.instance;
// Select the development environment. To use the production environment, replace `Env.DEV` with `Env.PROD`
apiClient.setEnv(CoboWaas2.Env.DEV);
// Replace `<YOUR_PRIVATE_KEY>` with your private key
apiClient.setPrivateKey("<YOUR_PRIVATE_KEY>");
// Call the API
const apiInstance = new CoboWaas2.PaymentApi();
const opts = {
CreateBulkSendRequest: CoboWaas2.CreateBulkSendRequest.constructFromObject({
source_account: "M1001",
execution_mode: "Strict",
payout_params: [
{
token_id: "ETH_USDT",
receiving_address: "0xabc123456789def0000000000000000000000000",
amount: "500.00",
},
],
}),
};
apiInstance.createBulkSend(opts).then(
(data) => {
console.log("API called successfully. Returned data: " + data);
},
(error) => {
console.error(error);
},
);
Authorizations
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
The request body to create a bulk send.
The source account from which the bulk send will be made.
- If the source account is a merchant account, provide the merchant's ID (e.g., "M1001").
- If the source account is the developer account, use the string
"developer".
"M1001"
Specifies how the batch handles item-level validation failures. The required
execution_mode field is a string enum and must be set to either Strict or
Partial; no default is applied if you omit it. It is not a strict_mode
boolean flag.
Strict: If any item in the batch fails validation, no items are executed. Every item is markedNotExecuted, and the batch fails. The batch also fails inStrictmode if the fund sweep needed to fund it only partially completes.Partial: Item validation failures are isolated to the affected items. Failed items are markedNotExecuted, while all other validated items in the batch continue to be processed normally.
Use Partial when one item's validation failure should not block the rest of
the batch. Because outcomes can differ by item, check each item's result and
validation_status individually instead of assuming that a batch-level
outcome applies to every item.
Strict, Partial "Strict"
The bulk send items.
Show child attributes
Show child attributes
The request ID that is used to track a bulk send request. The request ID is provided by you and must be unique within your system.
"123e457-e89b-12d3-a456-426614174004"
The description for the entire bulk send batch. Maximum length: 255 characters.
"Monthly vendor payments - January 2024"
Response
The bulk send was successfully created.
The bulk send ID.
"123e4567-e89b-12d3-a456-426614174003"
The source account from which the bulk send will be made.
- If the source account is a merchant account, provide the merchant's ID (e.g., "M1001").
- If the source account is the developer account, use the string
"developer".
"M1001"
Specifies how the batch handles item-level validation failures. The required
execution_mode field is a string enum and must be set to either Strict or
Partial; no default is applied if you omit it. It is not a strict_mode
boolean flag.
Strict: If any item in the batch fails validation, no items are executed. Every item is markedNotExecuted, and the batch fails. The batch also fails inStrictmode if the fund sweep needed to fund it only partially completes.Partial: Item validation failures are isolated to the affected items. Failed items are markedNotExecuted, while all other validated items in the batch continue to be processed normally.
Use Partial when one item's validation failure should not block the rest of
the batch. Because outcomes can differ by item, check each item's result and
validation_status individually instead of assuming that a batch-level
outcome applies to every item.
Strict, Partial "Strict"
The current status of the bulk send. Possible values include:
Pending: The bulk send has been created and is waiting to be processed.Validating: The bulk send items are being validated.Transferring: The bulk send items are being processed and funds are being transferred.Completed: All items in the bulk send have been successfully processed.PartiallyCompleted: Some items in the bulk send have been successfully processed, while others have failed.Failed: The bulk send has failed and no items were processed successfully.
Pending, Validating, Transferring, Completed, PartiallyCompleted, Failed "Pending"
The created time of the bulk send, represented as a UNIX timestamp in seconds.
1744689600
The updated time of the bulk send, represented as a UNIX timestamp in seconds.
1744689600
The request ID.
"123e457-e89b-12d3-a456-426614174004"
The description for the entire bulk send batch.
"Monthly vendor payments - January 2024"
The reason why the bulk send failed.
"Cannot charge payout fee: Fee Station balance is insufficient. Please add funds to Fee Station and try again."
The commission fee. Not returned when no fee has been incurred, the actual charged amount once incurred, or 0 if refunded.
Show child attributes
Show child attributes
