POST
/account-sets/{accountSetId}/membersAdd an account or nested set to this account set
Add a member to the account set
Parameters
| Name | In | Type | Description |
|---|---|---|---|
accountSetIdrequired | path | string uuid | Account Set UUID |
Request bodyrequired
| Field | Type | Description |
|---|---|---|
member_typerequired | string enum: account | account_set | |
member_idrequired | string uuid | UUID of account or account set |
Responses
200Member added
{
"success": true,
"data": {
"member_type": "account",
"member_id": "01997c1e-4d2a-7c3e-9a1b-2f0e8c6d4b5a"
}
} 400Validation error
{
"success": false,
"message": "Validation failed",
"code": "VALIDATION_ERROR"
} 401Unauthenticated
{
"success": false,
"message": "Validation failed",
"code": "VALIDATION_ERROR"
} 403Forbidden
{
"success": false,
"message": "Validation failed",
"code": "VALIDATION_ERROR"
} 404Account set not found
{
"success": false,
"message": "Validation failed",
"code": "VALIDATION_ERROR"
} Examples
curl -X POST https://ledga.io/api/v1/account-sets/{accountSetId}/members \
-H "Authorization: Bearer sk_xxxxxxxx_your_secret" \
-H "Content-Type: application/json" \
-d '{
"member_type": "account",
"member_id": "01997c1e-4d2a-7c3e-9a1b-2f0e8c6d4b5a"
}' use Ledga\Api\LedgaClient;
$ledga = new LedgaClient('sk_xxxxxxxx_your_secret');
use Ledga\Api\Enums\AccountSetMemberType;
$ledga->accountSets->addMember($setId, AccountSetMemberType::Account, $accountId);