Create relationship

POST /api/v2/clients/{ClientGUID}/relationships

This endpoint allows users to create a new relationship between two clients.

application/json

Body Required

  • ClientGUID string(uuid) Required
  • RelatedClientGUID string(uuid) Required

    RelatedClientGUID must be different from ClientGUID

  • RelationshipID integer Required

    This sets the relationship the client specified by the RelatedClientGUID has to the client specified by ClientGUID. For example RelationshipID 3 and 4 are "Parent Child" and "Child Parent" respectively. RelationshipID = 3 would set RelatedClientGUID as the parent and ClientGUID as the child. RelationshipID = 4 would set RelatedClientGUID as the child and ClientGUID as the parent.

    To retrieve a comprehensive list of acceptable values and their corresponding formatted values, you may make a request to the designated endpoint: /api/v2/clients/relationships/options

Responses

POST /api/v2/clients/{ClientGUID}/relationships
curl \
 -X POST https://api.fincalc.co.uk/api/v2/clients/{ClientGUID}/relationships \
 -H "Authorization: Bearer $ACCESS_TOKEN" \
 -H "Content-Type: application/json" \
 -d '{"ClientGUID":"3F0B1C88-6D80-4C17-BB3E-1D68E6D26405","RelatedClientGUID":"4G0B1C88-6D80-4C17-BB3E-2D68E6D26406","RelationshipID":1}'
Request examples
{
  "ClientGUID": "3F0B1C88-6D80-4C17-BB3E-1D68E6D26405",
  "RelatedClientGUID": "4G0B1C88-6D80-4C17-BB3E-2D68E6D26406",
  "RelationshipID": 1
}
Response examples (201)
{
  "success": true,
  "data": {
    "FirstName": "Mark",
    "Surname": "Phillips",
    "ClientGUID": "3F0B1C88-6D80-4C17-BB3E-1D68E6D26405",
    "RelationshipID": 1,
    "FormattedValues": {
      "ClientGUID": "Mark Phillips",
      "RelationshipID": "Spouse"
    }
  },
  "message": "Client relationship created successfully."
}
Response examples (403)
{
  "success": false,
  "message": "You do not have permission to edit the client."
}
Response examples (404)
{
  "success": false,
  "message": "Client not found."
}
Response examples (409)
{
  "success": false,
  "message": "Clients are already in a relationship."
}
Response examples (422)
{
  "success": false,
  "message": "Validation Error.",
  "data": {
    "ClientGUID": [
      "The client guid field is required."
    ],
    "RelatedClientGUID": [
      "The related client guid field is required."
    ],
    "RelationshipID": [
      "The relationship id field is required."
    ]
  }
}