Contacts

Contacts represent customers, vendors, suppliers, employees, and other business relationships in Crane Ledger. Each contact can be associated with transactions, invoices, bills, and other financial activities.

The Contact Object

GET/organizations/:organization_id/contacts/:contact_id
Auth required

A contact represents a business relationship or person.

{
  "id": "con_xxxxxxxxxxxxxxxx",
  "object": "contact",
  "organization_id": "org_xxxxxxxxxxxxxxxx",
  "contact_type": "customer",
  "name": "Acme Industries Inc.",
  "email": "billing@acmeindustries.com",
  "phone": "+1-555-0123",
  "website": "https://acmeindustries.com",
  "tax_number": "US123456789",
  "reference": "CUST-001",
  "address": "123 Business St",
  "city": "San Francisco",
  "state": "CA",
  "zip_code": "94105",
  "country": "US",
  "currency_id": "CUR_USD",
  "enabled": true,
  "created_by": "usr_xxxxxxxxxxxxxxxx",
  "created_at": "2024-01-15T10:30:00Z",
  "updated_at": "2024-01-20T14:22:00Z",
  "metadata": {
    "industry": "manufacturing",
    "payment_terms": "net_30"
  }
}

Attributes

AttributeTypeDescription
idstringUnique identifier with con_ prefix
organization_idstringThe organization this contact belongs to
contact_typeenumcustomer, vendor, employee, or other
namestringFull contact name or company name
emailstringContact email address
phonestringContact phone number
websitestringContact website URL
tax_numberstringTax/VAT registration number
referencestringCustom reference number
addressstringStreet address
citystringCity
statestringState/Province
zip_codestringPostal/ZIP code
countrystringCountry code (ISO 3166-1 alpha-2)
currency_idstringDefault currency for this contact
enabledbooleanWhether the contact is active
created_bystringAPI key that created the contact
metadataobjectAdditional contact data

Create Contact

POST/organizations/:organization_id/contacts
Auth required
1 credits

Creates a new contact (customer, vendor, employee, or other) for an organization.

Path Parameters

ParameterTypeRequiredDescription
organization_idstringYesThe ID of the organization

Request Body

ParameterTypeRequiredDescription
contact_typestringYesType: customer, vendor, employee, other
namestringYesFull contact name or company name
emailstringNoContact email address
phonestringNoContact phone number
websitestringNoContact website URL
tax_numberstringNoTax/VAT registration number
referencestringNoCustom reference number
addressstringNoStreet address
citystringNoCity
statestringNoState/Province
zip_codestringNoPostal/ZIP code
countrystringNoCountry code (ISO 3166-1 alpha-2)
currency_idstringNoDefault currency ID

Response

{
  "request_id": "req_xxxxxxxxxxxxxxxx",
  "success": true,
  "data": {
    "status": "queued",
    "estimated_completion": "2024-01-15T10:30:05Z"
  },
  "error": null,
  "duration_ms": 0,
  "credit_cost": 1
}

Asynchronous Processing

Contact creation is processed asynchronously. The response includes a request_id that can be used to check the status of the operation. The contact will be available for use once processing is complete.


Get Contact

GET/organizations/:organization_id/contacts/:contact_id
Auth required

Retrieves the details of an existing contact.

Path Parameters

ParameterTypeRequiredDescription
organization_idstringYesThe ID of the organization
contact_idstringYesThe ID of the contact to retrieve

Response

Returns the complete contact object as shown in the contact object example above.


List Contacts

GET/organizations/:organization_id/contacts
Auth required

Returns a list of contacts for the organization. The contacts are returned sorted by creation date.

Path Parameters

ParameterTypeRequiredDescription
organization_idstringYesThe ID of the organization

Query Parameters

ParameterTypeDescription
contact_typeenumFilter by contact type (customer, vendor, employee, other)
enabledbooleanFilter by enabled status (default: true)
searchstringSearch in name, email, or reference
limitintegerNumber of results (default: 20, max: 100)
offsetintegerPagination offset (default: 0)

Response

[
  {
    "id": "con_xxxxxxxxxxxxxxxx",
    "contact_type": "customer",
    "name": "Acme Industries Inc.",
    "email": "billing@acmeindustries.com",
    "phone": "+1-555-0123",
    "reference": "CUST-001",
    "enabled": true,
    "created_at": "2024-01-15T10:30:00Z"
  },
  {
    "id": "con_yyyyyyyyyyyyyyyy",
    "contact_type": "customer",
    "name": "TechCorp Solutions",
    "email": "accounts@techcorp.com",
    "phone": "+1-555-0456",
    "reference": "CUST-002",
    "enabled": true,
    "created_at": "2024-01-16T09:15:00Z"
  }
]

Contact Summary Response

The list endpoint returns a summary view of contacts with key information. Use the individual contact endpoint to get full details including address and metadata.


Update Contact

PUT/organizations/:organization_id/contacts/:contact_id
Auth required
1 credits

Updates the specified contact by setting the values of the parameters passed. Any parameters not provided will be left unchanged.

Path Parameters

ParameterTypeRequiredDescription
organization_idstringYesThe ID of the organization
contact_idstringYesThe ID of the contact to update

Request Body

ParameterTypeRequiredDescription
namestringNoFull contact name or company name
emailstringNoContact email address
phonestringNoContact phone number
websitestringNoContact website URL
tax_numberstringNoTax/VAT registration number
referencestringNoCustom reference number
addressstringNoStreet address
citystringNoCity
statestringNoState/Province
zip_codestringNoPostal/ZIP code
countrystringNoCountry code (ISO 3166-1 alpha-2)
currency_idstringNoDefault currency ID
enabledbooleanNoWhether the contact is active

Response

{
  "request_id": "req_yyyyyyyyyyyyyyyy",
  "success": true,
  "data": {
    "status": "queued",
    "estimated_completion": "2024-01-15T10:30:03Z"
  },
  "error": null,
  "duration_ms": 0,
  "credit_cost": 1
}

Delete Contact

DELETE/organizations/:organization_id/contacts/:contact_id
Auth required
1 credits

Deletes the specified contact. This action cannot be undone.

Path Parameters

ParameterTypeRequiredDescription
organization_idstringYesThe ID of the organization
contact_idstringYesThe ID of the contact to delete

Permanent Deletion

Deleting a contact is permanent and cannot be undone. Make sure the contact is not referenced by any active transactions, invoices, or bills before deletion.

Response

{
  "request_id": "req_zzzzzzzzzzzzzzzz",
  "success": true,
  "data": {
    "status": "queued",
    "estimated_completion": "2024-01-15T10:30:02Z"
  },
  "error": null,
  "duration_ms": 0,
  "credit_cost": 1
}

Contact Types

Crane Ledger supports four types of contacts:

TypeDescriptionCommon Use Cases
customerOrganizations or individuals who purchase from youB2B clients, retail customers, subscribers
vendorOrganizations or individuals you purchase fromSuppliers, contractors, service providers
employeePeople employed by your organizationStaff, payroll recipients
otherAny other business relationshipPartners, consultants, affiliates

Contact Validation Rules

  • Name: Required, 1-255 characters
  • Email: Optional, must be valid email format if provided
  • Phone: Optional, stored as string (no format validation)
  • Tax Number: Optional, used for tax reporting
  • Reference: Optional, unique within organization
  • Country: Optional, should be ISO 3166-1 alpha-2 code if provided

Business Logic

  • Contacts can be disabled but not deleted if they have associated transactions
  • Default currency is inherited from organization if not specified
  • Tax numbers are used for automated tax calculation on invoices/bills
  • Reference numbers help with external system integration

Need help?

Create a free account to access our support portal. Once signed in, use the Support tab in your dashboard to submit a support ticket — our team typically responds within 24 hours.