API Reference
Get Company
Retrieve a single company by CVR number
Endpoint
GET /api/v1/companies/{cvr}Description
Returns details for a specific company identified by its CVR number.
Authentication
Required - Include X-API-Key header
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
cvr | string | Yes | 8-digit Danish CVR number |
Request
curl -X GET "https://betalink.dev/api/v1/companies/12345678" \
-H "X-API-Key: your-api-key"Response
Success (200 OK)
{
"id": "comp_abc123def456",
"cvr": "12345678",
"name": "Acme ApS",
"address": "Hovedgaden 1, 1000 Copenhagen",
"startDate": "2024-01-01",
"endDate": "2099-12-31",
"status": "REGISTERED",
"senderRegNumber": "1234",
"senderAccountNumber": "0012345678",
"receiverRegNumber": "5678",
"receiverAccountNumber": "0087654321",
"defaultAmountCents": 10000,
"createdAt": "2024-01-15T10:30:00Z",
"updatedAt": "2024-06-20T14:45:00Z"
}Response Fields
| Field | Type | Description |
|---|---|---|
id | string | Unique company identifier |
cvr | string | 8-digit Danish CVR number |
name | string | Company name |
address | string | null | Company address |
startDate | string | Registration start date |
endDate | string | Registration end date |
status | string | Disposition status |
senderRegNumber | string | null | Sender bank registration number |
senderAccountNumber | string | null | Sender bank account number |
receiverRegNumber | string | null | Receiver bank registration number |
receiverAccountNumber | string | null | Receiver bank account number |
defaultAmountCents | number | null | Default transaction amount in cents |
createdAt | string | ISO 8601 creation timestamp |
updatedAt | string | ISO 8601 last update timestamp |
Error Responses
401 Unauthorized
{
"error": {
"code": "UNAUTHORIZED",
"message": "Invalid or missing API key"
}
}404 Not Found
{
"error": {
"code": "COMPANY_NOT_FOUND",
"message": "No company found with CVR 12345678"
}
}400 Bad Request
{
"error": {
"code": "BAD_REQUEST",
"message": "Invalid CVR format. Expected 8 digits."
}
}Code Example
import {
createBetalinkClient,
CompanyNotFoundError,
} from "@betalink/api-client";
const client = createBetalinkClient({
baseUrl: "https://betalink.dev/api",
apiKey: "your-api-key",
});
try {
const company = await client.getCompany("12345678");
console.log(`Company: ${company.name}`);
console.log(`Status: ${company.status}`);
console.log(`Address: ${company.address ?? "N/A"}`);
if (company.status === "REGISTERED") {
console.log("Company is active and registered with Mastercard");
}
} catch (error) {
if (error instanceof CompanyNotFoundError) {
console.error(`Company not found: ${error.cvr}`);
} else {
throw error;
}
}CVR Validation
The CVR number must be exactly 8 digits:
// Valid
await client.getCompany("12345678");
// Invalid - will return 400 Bad Request
await client.getCompany("1234567"); // Too short
await client.getCompany("123456789"); // Too long
await client.getCompany("1234567A"); // Contains letter