swap.quickswap.v1.QuickSwapBrokerService
CreateAffiliateVault
CreateAffiliateVault creates, or returns, the affiliate vault with label. Create a vault before the first QuickSwap that credits it: a QuickSwap naming a vault that does not exist yet is refused. Concurrent and repeated requests with the same label return the same vault. No step-up proof is needed. Errors: - NOT_FOUND: BROKER_NOT_FOUND. - PERMISSION_DENIED: ACTION_DENIED. - RESOURCE_EXHAUSTED: BROKER_LIMIT, the broker's vault limit.
Request
curl --request POST \ \
--url 'https://api.testnet.polyester.com/swap.quickswap.v1.QuickSwapBrokerService/CreateAffiliateVault' \
--header 'Content-Type: application/json' \
--header 'Connect-Protocol-Version: 1' \
--data '{
"broker": "value",
"label": "Name Of My Subaccount"
}'Responses
{
"created": false,
"vault": {
"accountId": "7563897446546",
"createdAt": "2025-01-01T00:00:00Z",
"label": "Name Of My Subaccount",
"status": "VAULT_ACTIVE",
"updatedAt": "2025-01-01T00:00:00Z"
}
}swap.quickswap.v1.CreateAffiliateVaultRequestswap.quickswap.v1.CreateAffiliateVaultResponseBroker name. A broker API key may name only its own broker.
Label, 1 to 64 characters without leading or trailing whitespace, unique per broker. The same label always returns the same vault.
Public sub-account ID of the vault; name it in AffiliateShare.account_id.
Broker-chosen label, unique per broker.
Whether new QuickSwaps can name the vault.
When the vault was created.
When the vault was last changed.
Whether this request created it.
| Key | HTTP status | Connect code | Error | When |
|---|---|---|---|---|
| unauthenticated | 401 | unauthenticated | Unauthenticated | Authentication required. |
| permission-denied | 403 | permission_denied | Permission Denied | Permission denied. |
| invalid-argument | 400 | invalid_argument | Invalid Argument | Invalid argument. |
| not-found | 404 | not_found | Not Found | Not found. |
| unavailable | 503 | unavailable | Unavailable | Service unavailable. |