Create Contact
Contacts API
Create Contact
Create a new contact for a company
POST
Create Contact
Create Contact
This endpoint allows you to create a new contact (customer or vendor) for a company in the accounting system.Headers
| Parameter | Type | Description |
|---|---|---|
| X-API-KEY | string | Formation API Key (required) |
| Content-Type | string | application/json |
Request Body
Required Fields
| Field | Type | Description |
|---|---|---|
| type | string | Contact type: “customer” or “vendor” |
| full_name | string | Full name of the contact |
| string | Email address of the contact | |
| company_id | string | ID of the company this contact belongs to |
Optional Fields
| Field | Type | Description |
|---|---|---|
| status | string | Contact status |
| description | string | Description or notes about the contact |
| cc_emails | array | Array of CC email addresses |
| bcc_emails | array | Array of BCC email addresses |
| billing | object | Billing information for the contact |
Billing Object Fields
| Field | Type | Description |
|---|---|---|
| string | Billing email address | |
| phone | string | Phone number |
| phone_code | string | Phone country code |
| iso_code | string | Country ISO code |
| country | string | Country name |
| address_1 | string | Address line 1 |
| address_2 | string | Address line 2 |
| postal_code | string | Postal code |
| district | string | District |
| state | string | State |
| province | string | Province |
| tax_id | string | Tax identification number |
Response
Response Parameters
| Parameter | Type | Description |
|---|---|---|
| success | boolean | Indicates if the operation was successful |
| message | string | Additional information about the operation |
| data | object | Response data for successful requests |
| data.id | string | Unique identifier for the created contact |
| data.created_at | integer | Creation timestamp |
| data.updated_at | integer | Last update timestamp |
| data.type | string | Contact type (“customer” or “vendor”) |
| data.status | string | Contact status |
| data.full_name | string | Full name of the contact |
| data.email | string | Email address |
| data.description | string | Contact description |
| data.cc_emails | array | CC email addresses |
| data.bcc_emails | array | BCC email addresses |
| data.billing | object | Billing information |
Error Responses
Invalid Request (400)
Unauthorized (401)
Company Not Found (404)
Internal Server Error (500)
Authorizations
Formation API key for authentication.
Body
application/json
Contact type
Available options:
customer, vendor Full name of the contact
Email address
Company ID
Contact status
Contact description
CC email addresses
BCC email addresses
Response
Contact created successfully
Example:
true
Example:
"Contact created successfully"
Example:
{
"id": "64b8f1a2e4b0c8d9f0123456",
"created_at": 1640995200,
"updated_at": 1640995200,
"type": "customer",
"status": "active",
"full_name": "John Doe",
"email": "[email protected]",
"description": "Primary contact for the company",
"cc_emails": ["[email protected]", "[email protected]"],
"bcc_emails": ["[email protected]", "[email protected]"],
"billing": {
"email": "[email protected]",
"phone": "1234567890",
"phone_code": "+1",
"iso_code": "US",
"country": "United States",
"address_1": "123 Main Street",
"address_2": "Suite 100",
"postal_code": "12345",
"district": "Downtown",
"state": "CA",
"province": "California",
"tax_id": "12-3456789"
}
}