---
title: "Create entity references"
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.sureshake.com/llms.txt
> Use this file to discover all available pages before exploring further.

Path: Sureshake API › entities

`POST /v2/entities/{entityId}/references`

## Path parameters

- `entityId` (`entity-references-create.path.entityId`; string, required)
  - format `uuid`

## Request body

_Required._

- `toEntityId` (`entity-references-create.toEntityId`; string, required)
  - format `uuid`
- `referenceType` (`entity-references-create.referenceType`; string, required)
  - one of `"credit"`, `"customer"`
- `relationshipStatus` (`entity-references-create.relationshipStatus`; string, optional)
  - one of `"active"`, `"inactive"`, `"past"`
- `rating` (`entity-references-create.rating`; string, optional)
  - one of `"excellent"`, `"good"`, `"fair"`, `"poor"`
- `paymentTerms` (`entity-references-create.paymentTerms`; string, optional)
- `creditLimit` (`entity-references-create.creditLimit`; number, optional)
- `relationshipSince` (`entity-references-create.relationshipSince`; string, optional)
- `notes` (`entity-references-create.notes`; string, optional)
- `contactName` (`entity-references-create.contactName`; string, optional)
- `contactTitle` (`entity-references-create.contactTitle`; string, optional)
- `contactEmail` (`entity-references-create.contactEmail`; string, optional)
  - format `email`
- `contactPhone` (`entity-references-create.contactPhone`; string, optional)

## Example request

```json
{
  "toEntityId": "c7699d66-6699-43d4-9906-91b0d00fa0a4",
  "referenceType": "credit",
  "relationshipStatus": "active",
  "rating": "excellent",
  "paymentTerms": "string",
  "creditLimit": 0,
  "relationshipSince": "string",
  "notes": "string",
  "contactName": "string",
  "contactTitle": "string",
  "contactEmail": "user@example.com",
  "contactPhone": "string"
}
```

## Code samples

### cURL

```bash
curl --request POST \
  --url 'https://api.sureshake.com/v2/entities/<entityId>/references' \
  --header 'Content-Type: application/json' \
  --data '
{
  "toEntityId": "c7699d66-6699-43d4-9906-91b0d00fa0a4",
  "referenceType": "credit",
  "relationshipStatus": "active",
  "rating": "excellent",
  "paymentTerms": "string",
  "creditLimit": 0,
  "relationshipSince": "string",
  "notes": "string",
  "contactName": "string",
  "contactTitle": "string",
  "contactEmail": "user@example.com",
  "contactPhone": "string"
}
'
```

### TypeScript

```typescript
const url = 'https://api.sureshake.com/v2/entities/<entityId>/references';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: JSON.stringify({
    toEntityId: 'c7699d66-6699-43d4-9906-91b0d00fa0a4',
    referenceType: 'credit',
    relationshipStatus: 'active',
    rating: 'excellent',
    paymentTerms: 'string',
    creditLimit: 0,
    relationshipSince: 'string',
    notes: 'string',
    contactName: 'string',
    contactTitle: 'string',
    contactEmail: 'user@example.com',
    contactPhone: 'string'
  })
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://api.sureshake.com/v2/entities/<entityId>/references"

payload = {
    "toEntityId": "c7699d66-6699-43d4-9906-91b0d00fa0a4",
    "referenceType": "credit",
    "relationshipStatus": "active",
    "rating": "excellent",
    "paymentTerms": "string",
    "creditLimit": 0,
    "relationshipSince": "string",
    "notes": "string",
    "contactName": "string",
    "contactTitle": "string",
    "contactEmail": "user@example.com",
    "contactPhone": "string"
}
headers = {"Content-Type": "application/json"}

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

print(response.text)
```

## Responses

### 200

Default Response

#### Example

```json
{
  "success": true
}
```

- `success` (`entity-references-create.response.200.success`; boolean, required)

### 400

Default Response

#### Example

```json
{
  "error": {
    "code": "string",
    "message": "string",
    "details": null,
    "traceId": "string"
  }
}
```

- `error` (`entity-references-create.response.400.error`; object, required)
  - `code` (`entity-references-create.response.400.error.code`; string, required) — Machine-readable error code (e.g., NOT_FOUND)
  - `message` (`entity-references-create.response.400.error.message`; string, required) — Human-readable error message
  - `details` (`entity-references-create.response.400.error.details`; unknown, optional) — Optional structured error details
  - `traceId` (`entity-references-create.response.400.error.traceId`; string, optional) — Unique ID for log correlation

### 401

Default Response

#### Example

```json
{
  "error": {
    "code": "string",
    "message": "string",
    "details": null,
    "traceId": "string"
  }
}
```

- `error` (`entity-references-create.response.401.error`; object, required)
  - `code` (`entity-references-create.response.401.error.code`; string, required) — Machine-readable error code (e.g., NOT_FOUND)
  - `message` (`entity-references-create.response.401.error.message`; string, required) — Human-readable error message
  - `details` (`entity-references-create.response.401.error.details`; unknown, optional) — Optional structured error details
  - `traceId` (`entity-references-create.response.401.error.traceId`; string, optional) — Unique ID for log correlation

### 403

Default Response

#### Example

```json
{
  "error": {
    "code": "string",
    "message": "string",
    "details": null,
    "traceId": "string"
  }
}
```

- `error` (`entity-references-create.response.403.error`; object, required)
  - `code` (`entity-references-create.response.403.error.code`; string, required) — Machine-readable error code (e.g., NOT_FOUND)
  - `message` (`entity-references-create.response.403.error.message`; string, required) — Human-readable error message
  - `details` (`entity-references-create.response.403.error.details`; unknown, optional) — Optional structured error details
  - `traceId` (`entity-references-create.response.403.error.traceId`; string, optional) — Unique ID for log correlation

### 404

Default Response

#### Example

```json
{
  "error": {
    "code": "string",
    "message": "string",
    "details": null,
    "traceId": "string"
  }
}
```

- `error` (`entity-references-create.response.404.error`; object, required)
  - `code` (`entity-references-create.response.404.error.code`; string, required) — Machine-readable error code (e.g., NOT_FOUND)
  - `message` (`entity-references-create.response.404.error.message`; string, required) — Human-readable error message
  - `details` (`entity-references-create.response.404.error.details`; unknown, optional) — Optional structured error details
  - `traceId` (`entity-references-create.response.404.error.traceId`; string, optional) — Unique ID for log correlation

### 409

Default Response

#### Example

```json
{
  "error": {
    "code": "string",
    "message": "string",
    "details": null,
    "traceId": "string"
  }
}
```

- `error` (`entity-references-create.response.409.error`; object, required)
  - `code` (`entity-references-create.response.409.error.code`; string, required) — Machine-readable error code (e.g., NOT_FOUND)
  - `message` (`entity-references-create.response.409.error.message`; string, required) — Human-readable error message
  - `details` (`entity-references-create.response.409.error.details`; unknown, optional) — Optional structured error details
  - `traceId` (`entity-references-create.response.409.error.traceId`; string, optional) — Unique ID for log correlation

### 500

Default Response

#### Example

```json
{
  "error": {
    "code": "string",
    "message": "string",
    "details": null,
    "traceId": "string"
  }
}
```

- `error` (`entity-references-create.response.500.error`; object, required)
  - `code` (`entity-references-create.response.500.error.code`; string, required) — Machine-readable error code (e.g., NOT_FOUND)
  - `message` (`entity-references-create.response.500.error.message`; string, required) — Human-readable error message
  - `details` (`entity-references-create.response.500.error.details`; unknown, optional) — Optional structured error details
  - `traceId` (`entity-references-create.response.500.error.traceId`; string, optional) — Unique ID for log correlation

### 503

Default Response

#### Example

```json
{
  "error": {
    "code": "string",
    "message": "string",
    "details": null,
    "traceId": "string"
  }
}
```

- `error` (`entity-references-create.response.503.error`; object, required)
  - `code` (`entity-references-create.response.503.error.code`; string, required) — Machine-readable error code (e.g., NOT_FOUND)
  - `message` (`entity-references-create.response.503.error.message`; string, required) — Human-readable error message
  - `details` (`entity-references-create.response.503.error.details`; unknown, optional) — Optional structured error details
  - `traceId` (`entity-references-create.response.503.error.traceId`; string, optional) — Unique ID for log correlation


Source: https://docs.sureshake.com/reference/entity-references-create/index.md
