Creating Corporations
Create a corporation and its owner through the API, with no wallet deployment and no on-chain call, then log the owner in.
Before You Start
Read the following guides before proceeding:
| Guide | Why |
|---|---|
| Overview | Understand Master Account mode |
| Authentication | How to obtain the partner token |
Onboarding Flow Comparison
Standard Flow
1. Deploy the corporation wallet (on-chain)
2. Install the executor, corporate policy and CorporateValidator (on-chain)
3. createCorporationForCorporateWallet (on-chain)
4. POST /api/v1/corporations/register
5. POST /api/v1/corporations/login
6. Complete KYB
Master Account Flow
1. POST /api/v1/token
2. POST /api/v1/corporations
3. POST /api/v1/corporations/login
4. Complete KYB
No blockchain interaction is required during onboarding.
Create a Corporation
Create the corporation and its owner with the partner token. The route is available only to companies
in Master Account mode.
POST /api/v1/corporations
Headers:
| Header | Required | Value |
|---|---|---|
Authorization | Yes | Bearer <partner_token> |
X-User-Wallet | Yes | Owner wallet. An EVM address: 0x and 40 hex characters, not the zero address. You must hold its key |
X-User-Email | Yes | Owner email |
X-Chain-Id | No | Defaults to the platform default chain. It must be your company's default chain |
Request
{
"corporation_name": "ACME. Inc",
"corporation_registration_number": "HRB-123456",
"corporation_registration_country": "DE"
}| Field | Type | Required | Description |
|---|---|---|---|
corporation_name | string | Yes | Full legal name. Same format rule as corporation_name on Registering a Corporation: ^[A-Za-z0-9&.,'’\-/() :+#]{2,100}$ |
corporation_registration_number | string | Yes | Upper-case letters, digits and -, 6 to 15 characters: ^[A-Z0-9\-]{6,15}$ |
corporation_registration_country | string | Yes | Two upper-case letters, the ISO 3166-1 alpha-2 country code: ^[A-Z]{2}$ |
Capabilities depend on
corporation_registration_country. It decides which features KYB can
unlock for the corporation. Send the country of registration.
The company is taken from the partner token. You do not send a corporation_address: Wirex assigns it.
Response
{
"corporation_address": "0xd1345700A38493e5E2195B80413f9f6546eDc767",
"corporation_id": "6f1c2b0e-3a5d-4c7e-9b8a-2d4f6e8a1c3b",
"owner_employee_id": "9b2e4d6f-8a1c-4e3b-a5d7-c9e1f3a5b7d9"
}| Field | Type | Description |
|---|---|---|
corporation_address | string | Corporation identifier, assigned by Wirex. Send it as corporation_address to POST /api/v1/corporations/login |
corporation_id | string (UUID) | Corporation id |
owner_employee_id | string (UUID) | The owner's employee id |
Keep all three. corporation_id is the user_id Wirex sends to your
Card Authorization API.
corporation_addressis an identifier, not a wallet. Never send funds to it. Every charge and
credit of the corporation runs through the Master Account.
Idempotency and Concurrency
The corporation is identified by four values: your company, X-User-Wallet,
corporation_registration_country and corporation_registration_number.
- Sending the same four again returns the same corporation. A retry after any failure, including a
network error, is safe. - Sending two requests for the same corporation at the same time is not safe. Send one at a time, and
wait for the response before retrying.
On a 500 ErrorGeneral with Corporation registration did not complete, the corporation exists but its
registration did not finish. Send the same request again.
Code
const response = await fetch(`${baseUrl}/api/v1/corporations`, {
method: 'POST',
headers: {
'Authorization': `Bearer ${partnerToken}`,
'Content-Type': 'application/json',
'X-User-Wallet': ownerEoaAddress,
'X-User-Email': ownerEmail,
'X-Chain-Id': chainId
},
body: JSON.stringify({
corporation_name: 'ACME. Inc',
corporation_registration_number: 'HRB-123456',
corporation_registration_country: 'DE'
})
});
const {
corporation_address: corporationAddress,
corporation_id: corporationId,
owner_employee_id: ownerEmployeeId
} = await response.json();response = requests.post(
f"{base_url}/api/v1/corporations",
headers={
"Authorization": f"Bearer {partner_token}",
"Content-Type": "application/json",
"X-User-Wallet": owner_eoa_address,
"X-User-Email": owner_email,
"X-Chain-Id": chain_id,
},
json={
"corporation_name": "ACME. Inc",
"corporation_registration_number": "HRB-123456",
"corporation_registration_country": "DE",
},
)
corporation = response.json()
corporation_address = corporation["corporation_address"]
corporation_id = corporation["corporation_id"]
owner_employee_id = corporation["owner_employee_id"]body, _ := json.Marshal(map[string]string{
"corporation_name": "ACME. Inc",
"corporation_registration_number": "HRB-123456",
"corporation_registration_country": "DE",
})
req, _ := http.NewRequest("POST", baseURL+"/api/v1/corporations", bytes.NewBuffer(body))
req.Header.Set("Authorization", "Bearer "+partnerToken)
req.Header.Set("Content-Type", "application/json")
req.Header.Set("X-User-Wallet", ownerEoaAddress)
req.Header.Set("X-User-Email", ownerEmail)
req.Header.Set("X-Chain-Id", chainId)
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
var corporation struct {
CorporationAddress string `json:"corporation_address"`
CorporationId string `json:"corporation_id"`
OwnerEmployeeId string `json:"owner_employee_id"`
}
json.NewDecoder(resp.Body).Decode(&corporation)The errors this route returns are listed in
Unsupported Features and Errors.
Log the Owner In
POST /api/v1/corporations/login
Log in with the partner token and the same X-User-Wallet, X-User-Email and X-Chain-Id you sent to
the create route.
Headers:
| Header | Value |
|---|---|
Authorization | Bearer <partner_token> |
X-User-Wallet | The owner wallet sent at creation |
X-User-Email | The owner email sent at creation |
X-Chain-Id | Your company's default chain, or leave it out if the platform default is the same chain |
Request body:
{
"corporation_address": "0xd1345700A38493e5E2195B80413f9f6546eDc767"
}| Field | Type | Required | Description |
|---|---|---|---|
corporation_address | string | Yes | The corporation_address returned by POST /api/v1/corporations |
Response:
{
"access_token": "eyJhbGciOiJSUzI1NiIs..."
}| Field | Description |
|---|---|
access_token | Corporation token. Read the exp claim for its expiry |
In Master Account mode:
- Only the owner can log in. Any other employee is refused with
401 ErrorGeneraland
Only the corporation owner can log in. - Only your company's default chain is accepted. Any other chain is refused with
400 ErrorNotSupported,error_detailschain_id=Only chain <id> is supported. - The token's
corporation_account_addressclaim carries the corporation address, not a wallet
address. Read the Master Account address fromGET /api/v1/wallets.
Every other claim, and the way the token is used, is described in
Authentication. The token types are listed in
Auth Tokens.
Keep the corporation token on your backend. It reaches every money route, and every money route
debits the Master Account.
KYB Verification
After login, complete KYB with the owner's corporation token. The KYB process is identical to the
standard corporate integration.
See Verification (KYB).
What's Different
| Aspect | Standard | Master Account |
|---|---|---|
| Wallet webhook | /v2/webhooks/wallets is delivered when the corporation wallet is created or its confirmation status changes | Not applicable — the corporation has no wallet of its own |
| Corporation address | The corporation wallet address, created on-chain | An identifier assigned by Wirex. Not a wallet: never send funds to it |
| Owner | The creator recorded on-chain at wallet deployment | The X-User-Wallet and X-User-Email sent to POST /api/v1/corporations. You hold the wallet key |
| On-chain call | createCorporationForCorporateWallet | None |
Updated 8 days ago

