> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.alphax.asia/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.alphax.asia/_mcp/server.

# Onboard a company

POST https://public-api.alphax.com/v1/companies
Content-Type: application/json

Onboards a new company and links it to your partner account. Provisioning
(KYB profile, spending account) continues asynchronously; watch the
`company.onboarding_status_changed` webhook for progress. Address lines
are limited to 30 characters.


Reference: https://docs.alphax.asia/api-reference/card-api/companies/create-company

## Authentication

- `X-API-Key` header (required) — Your partner API key.

## Servers

- `https://public-api.alphax.com` (Production server, default)
- `https://public-api.demo.alphax.asia` (Staging (sandbox) server)

## Request

### Body (application/json)

- `name` (string, required)
- `countryCode` (string, required)
- `directorName` (string, required)
- `directorEmail` (string, required)
- `directorPhone` (string, required)
- `addressLine1` (string, required)
- `city` (string, required)
- `state` (string, required)
- `postalCode` (string, required)
- `addressLine2` (string, optional)
- `products` (list of enum, optional) — Products to onboard the company onto.
  - Allowed values: `Card`

## Response

### 201

Company created

- `company` (object, optional)
  - `id` (string, optional)
  - `name` (string, optional)
  - `countryCode` (string, optional)
  - `status` (string, optional) — Onboarding status.
  - `createdAt` (datetime, optional)

## Examples

**Request**

```json
{
  "name": "Acme Ltd",
  "countryCode": "HK",
  "directorName": "Jane Director",
  "directorEmail": "jane@acme.example",
  "directorPhone": "+85251234567",
  "addressLine1": "10 Queen's Road",
  "city": "Hong Kong",
  "state": "Hong Kong",
  "postalCode": "999077"
}
```

**Response**

```json
{
  "company": {
    "id": "01KZ2WJKWVFPCVAB6MY106QRZV",
    "name": "Acme Ltd",
    "countryCode": "HK",
    "status": "ACTIVE",
    "createdAt": "2024-01-15T09:30:00Z"
  }
}
```

**SDK Code**

```python
import requests

url = "https://public-api.alphax.com/v1/companies"

payload = {
    "name": "Acme Ltd",
    "countryCode": "HK",
    "directorName": "Jane Director",
    "directorEmail": "jane@acme.example",
    "directorPhone": "+85251234567",
    "addressLine1": "10 Queen's Road",
    "city": "Hong Kong",
    "state": "Hong Kong",
    "postalCode": "999077"
}
headers = {
    "X-API-Key": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://public-api.alphax.com/v1/companies';
const options = {
  method: 'POST',
  headers: {'X-API-Key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"name":"Acme Ltd","countryCode":"HK","directorName":"Jane Director","directorEmail":"jane@acme.example","directorPhone":"+85251234567","addressLine1":"10 Queen\'s Road","city":"Hong Kong","state":"Hong Kong","postalCode":"999077"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://public-api.alphax.com/v1/companies"

	payload := strings.NewReader("{\n  \"name\": \"Acme Ltd\",\n  \"countryCode\": \"HK\",\n  \"directorName\": \"Jane Director\",\n  \"directorEmail\": \"jane@acme.example\",\n  \"directorPhone\": \"+85251234567\",\n  \"addressLine1\": \"10 Queen's Road\",\n  \"city\": \"Hong Kong\",\n  \"state\": \"Hong Kong\",\n  \"postalCode\": \"999077\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("X-API-Key", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://public-api.alphax.com/v1/companies")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"name\": \"Acme Ltd\",\n  \"countryCode\": \"HK\",\n  \"directorName\": \"Jane Director\",\n  \"directorEmail\": \"jane@acme.example\",\n  \"directorPhone\": \"+85251234567\",\n  \"addressLine1\": \"10 Queen's Road\",\n  \"city\": \"Hong Kong\",\n  \"state\": \"Hong Kong\",\n  \"postalCode\": \"999077\"\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://public-api.alphax.com/v1/companies")
  .header("X-API-Key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"name\": \"Acme Ltd\",\n  \"countryCode\": \"HK\",\n  \"directorName\": \"Jane Director\",\n  \"directorEmail\": \"jane@acme.example\",\n  \"directorPhone\": \"+85251234567\",\n  \"addressLine1\": \"10 Queen's Road\",\n  \"city\": \"Hong Kong\",\n  \"state\": \"Hong Kong\",\n  \"postalCode\": \"999077\"\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://public-api.alphax.com/v1/companies', [
  'body' => '{
  "name": "Acme Ltd",
  "countryCode": "HK",
  "directorName": "Jane Director",
  "directorEmail": "jane@acme.example",
  "directorPhone": "+85251234567",
  "addressLine1": "10 Queen\'s Road",
  "city": "Hong Kong",
  "state": "Hong Kong",
  "postalCode": "999077"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'X-API-Key' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://public-api.alphax.com/v1/companies");
var request = new RestRequest(Method.POST);
request.AddHeader("X-API-Key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"name\": \"Acme Ltd\",\n  \"countryCode\": \"HK\",\n  \"directorName\": \"Jane Director\",\n  \"directorEmail\": \"jane@acme.example\",\n  \"directorPhone\": \"+85251234567\",\n  \"addressLine1\": \"10 Queen's Road\",\n  \"city\": \"Hong Kong\",\n  \"state\": \"Hong Kong\",\n  \"postalCode\": \"999077\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "X-API-Key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "name": "Acme Ltd",
  "countryCode": "HK",
  "directorName": "Jane Director",
  "directorEmail": "jane@acme.example",
  "directorPhone": "+85251234567",
  "addressLine1": "10 Queen's Road",
  "city": "Hong Kong",
  "state": "Hong Kong",
  "postalCode": "999077"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://public-api.alphax.com/v1/companies")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```