Skip to main content

Business API

The Business API provides endpoints for managing your business profile, settings, and configuration.

Endpoints Overview

MethodEndpointDescription
GET/api/business/my-businessGet current business
POST/api/businessRegister new business
PUT/api/businessUpdate business
GET/api/business/soft-checkCheck if business exists
GET/api/business/default-configurationGet default settings
GET/api/business/generate-api-tokenGenerate API token
GET/api/business/tokensList API tokens

Get Current Business

Retrieve your business profile information.

GET /api/business/my-business

Response

{
"data": {
"guid": "uuid",
"name": "Your Business Name",
"email": "contact@yourbusiness.com",
"phone": "+1234567890",
"address": {
"street": "123 Main St",
"city": "City",
"state": "State",
"postalCode": "12345",
"country": "Country"
},
"settings": {
"timezone": "America/New_York",
"currency": "USD"
}
},
"success": true
}

Register Business

Create a new business account.

POST /api/business

Request Body

{
"name": "Business Name",
"email": "admin@business.com",
"phone": "+1234567890",
"address": {
"street": "123 Main St",
"city": "City",
"state": "State",
"postalCode": "12345",
"country": "Country"
}
}

Response

{
"data": {
"guid": "new-business-uuid",
"name": "Business Name"
},
"success": true
}

Update Business

Update business profile information.

PUT /api/business

Request Body

{
"guid": "business-uuid",
"name": "Updated Business Name",
"email": "updated@business.com",
"phone": "+1234567890"
}

Response

{
"success": true
}

Soft Check

Check if a business exists by email.

GET /api/business/soft-check?emailAddress=check@email.com

Query Parameters

ParameterTypeDescription
emailAddressstringEmail to check

Response

true

Returns true if business exists, false otherwise.

Get Default Configuration

Retrieve default business settings.

GET /api/business/default-configuration

Response

{
"data": {
"defaultCarrier": "uuid-or-null",
"defaultServiceLevel": "standard",
"defaultDimensions": {
"length": 10,
"width": 10,
"height": 10,
"unit": "cm"
},
"notifications": {
"emailEnabled": true,
"pushEnabled": true
}
},
"success": true
}

Generate API Token

Generate a new API access token.

GET /api/business/generate-api-token

Response

{
"data": {
"token": "eyJhbGciOiJIUzI1NiIs...",
"createdAt": "2024-01-15T10:30:00Z",
"expiresAt": null
},
"success": true
}
warning

The token is only shown once. Store it securely.

List API Tokens

Get all API tokens for your business.

GET /api/business/tokens

Response

{
"data": [
{
"guid": "token-uuid",
"name": "Production API",
"createdAt": "2024-01-15T10:30:00Z",
"lastUsed": "2024-01-16T14:20:00Z"
}
],
"page": 1,
"pageSize": 50,
"totalCount": 1,
"success": true
}

Error Responses

401 Unauthorized

{
"success": false,
"error": {
"code": "UNAUTHORIZED",
"message": "Authentication required"
}
}

404 Not Found

{
"success": false,
"error": {
"code": "NOT_FOUND",
"message": "Business not found"
}
}

400 Bad Request

{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "Invalid request data",
"details": {
"email": "Email is required"
}
}
}