Skip to content

Update Case Customer

This API endpoint enables you to update existing customer related to a case.

Input


Endpoint

Post /cases/{caseId}/customers/{customerID}


HTTP request headers

Content-Type  string

Setting to application/json is required.

Authorization  string

This is the token you fetched e.g. Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJS…


Path parameters

caseID  string - Required

The unique case ID for which you intend to generate a new appointment.

customerID  string - Required

The unique customer ID for which you intend update.


Body parameters

title  string - Required

first_names  string - Required

middle_names  string

last_name  string - Required

date_of_birth  string

Accepted format YYYY-MM-DD - e.g. 1990-07-20

gender  string

tel_1  string

tel_2  string

email  string

occupation  string

marital_status  string

Allowed values are single,married,civil,cohabiting,divorced,separated,other

address_1  string

address_2  string

address_3  string

postcode  string

Output


Http status codes
Status CodeDescription
200OK
400Bad Request
404Resource not found
500Internal Server Error

Request example

bash
curl  -X PATCH \
  'https://client.willsuite.co.uk/engine/api/cases/d57bc3b7-4f44-4846-9741-985db9af9b61/customers/012ad872-39d1-4414-8c32-afd4c20bd091' \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9...' \
  --data-raw '{
  "middle_names": "Price",
  "last_name": "Johanson",
  "date_of_birth": "1990-07-20",
  "gender": "male",
  "tel_1": "01632 960401",
  "occupation": "doctor",
  "marital_status": "married",
  "address_1": "Willsuite Ltd",
  "address_2": "33a The Square",
  "address_3": "Beeston, Nottingham",
  "postcode": "NG9 2JJ"
  } '
php
<?php

$client = new http\Client;
$request = new http\Client\Request;

$body = new http\Message\Body;
$body->append('{
 "middle_names": "Price",
 "last_name": "Johanson",
 "date_of_birth": "1990-07-20",
 "gender": "male",
 "tel_1": "01632 960401",
 "occupation": "doctor",
 "marital_status": "married",
 "address_1": "Willsuite Ltd",
 "address_2": "33a The Square",
 "address_3": "Beeston, Nottingham",
 "postcode": "NG9 2JJ"
} ');


$request->setRequestUrl('https://client.willsuite.co.uk/engine/api/cases/d57bc3b7-4f44-4846-9741-985db9af9b61/customers/012ad872-39d1-4414-8c32-afd4c20bd091');
$request->setRequestMethod('POST');
$request->setBody($body);

$request->setHeaders([
  'Content-Type' => 'application/json',
  'Authorization' => 'Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9...'
]);

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();

Response

json
{
  "id": "012ad872-39d1-4414-8c32-afd4c20bd091",
  "customer_case_id": "d57bc3b7-4f44-4846-9741-985db9af9b61",
  "title": "Mr",
  "first_names": "John",
  "middle_names": "Price",
  "last_name": "Johanson",
  "date_of_birth": "1990-07-20",
  "gender": "male",
  "tel_1": "01632 960401",
  "tel_2": null,
  "email": null,
  "occupation": "doctor",
  "marital_status": "married",
  "address_1": "Willsuite Ltd",
  "address_2": "33a The Square",
  "address_3": "Beeston, Nottingham",
  "postcode": "NG9 2JJ"
}
json
{
  "type": "object",
  "properties": {
    "id": { "type": "string" },
    "customer_case_id": { "type": "string" },
    "title": { "type": "string" },
    "first_names": { "type": "string" },
    "middle_names": { "type": ["string", "null"] },
    "last_name": { "type": "string" },
    "date_of_birth": { "type": "string", "format": "date" },
    "gender": { "type": "string", "enum": ["male", "female", "other", "prefer_not_to_say"] },
    "tel_1": { "type": ["string", "null"] },
    "tel_2": { "type": ["string", "null"] },
    "email": { "type": ["string", "null"] },
    "occupation": { "type": ["string", "null"] },
    "marital_status": { "type": ["string", "null"] },
    "address_1": { "type": ["string", "null"] },
    "address_2": { "type": ["string", "null"] },
    "address_3": { "type": ["string", "null"] },
    "postcode": { "type": ["string", "null"] }
  },
  "required": [
    "id",
    "customer_case_id",
    "title",
    "first_names",
    "last_name",
    "date_of_birth",
    "gender",
    "tel_1",
    "occupation",
    "marital_status",
    "address_1",
    "postcode"
  ],
  "additionalProperties": false
}