# Patch

#### `PATCH /participants/customers/:participantCode` <a href="#patch-participants-customers-participantcode" id="patch-participants-customers-participantcode"></a>

```
const patchParticipantCustomer = () => {
  const body = {
    first_name: "Gaurav",
    last_name: "Mehta",
    address_one: "Near CST",
    address_two: "Fort Area",
    country: "Mumbai",
    state: "MH",
    city: "Mumbai",
    zip: "12345",
    email: "gewgawarv@gmail.com",
    id_number_type: "Passport",
    id_number: "123456789",
    platform_updated_at: 1603378501286
  }
  const timestamp = Math.round(Date.now() / 1000)
  const payload = timestamp + 'PATCH' + '/participants/customers/XXXXXX' + JSON.stringify(body)
  const decodedSecret = Buffer.from(apiSecret, 'base64')
  const hmac = crypto.createHmac('sha256', decodedSecret)
  const signedPayload = hmac.update(payload).digest('base64')

  // SET HEADERS
  const headers = {
    'X-NDAX-API-KEY': 'public_key',
    'X-NDAX-SIGNED': signedPayload,
    'X-NDAX-TIMESTAMP': timestamp,
    'X-NDAX-PASSPHRASE': 'passphrase'
  }
  const options = {
    headers,
    body,
    json: true
  }

  return request.post(
    `https://api.ndax.in/participants/customers/XXXXXX`,
    options
  )
}
```

> Sample Request

```
{
  "request_id": "7fbab765-4579-4349-845b-945655c85",
   first_name: "Gaurav",
    last_name: "Mehta",
    address_one: "Near CST",
    address_two: "Fort Area",
    country: "Mumbai",
    state: "MH",
    city: "Mumbai",
    zip: "12345",
    email: "gewgawarv@gmail.com",
    id_number_type: "Passport",
    "platform_updated_at": 13453453534
}
```

> Sample Response

```
{
  "message": {
    "first_name": "Gaurav",
    "last_name": "Mehta",
    "address_one": "Shivaji Nagar",
    "address_two": "Fort",
    "country": "India",
    "state": "CG",
    "city": "Mumbai",
    "zip": "450001",
    "email": "email-example@mail.com",
    "date_of_birth": "1994-00-13",
    "id_number_type": "aadhar_card",
    "id_number": "1731417314",
    "non_us_other_type": "",
    "id_issuing_authority": "",
    "signed_timestamp": 1603378501287,
    "risk_rating": "",
    "platform_code": "ABC123",
    "participant_code": "XYZ456",
    "platform_updated_at": 1603378501286
  }
}
```

&#x20;This endpoint is only available to certain participants leveraging NDAX for customer settlements. Please contact us for more information on enabling this endpoint.

This endpoint enables you to update information that’s been validated with your customers. When making certain updates, groups of data must be sent together. If the data is not represented below, it’s not updatable. You can update more than one group of data at one time.

Request body:

<table><thead><tr><th width="151">Parameter</th><th width="474">Description</th><th width="100">Type</th></tr></thead><tbody><tr><td>platform_updated_at</td><td>The UNIX timestamp in milliseconds of when your customer updated their information with you and you approved that update. Only one timestamp should be sent per call (i.e. if you update name and address at the same time, there should be one timestamp, not one timestamp for name and one timestamp for address)</td><td>number</td></tr><tr><td>first_name</td><td>The first name of the customer, required</td><td>string</td></tr><tr><td>last_name</td><td>The last name of the customer, required</td><td>string</td></tr><tr><td>address_one</td><td>First line for the customer's address, required<br>Note: PO Box addresses are not accepted</td><td>string</td></tr><tr><td>address_two</td><td>First line for the customer's address, if applicable, optional</td><td>string</td></tr><tr><td>country</td><td>The country the customer resides in, required<br>Note: must be one of the supported countries</td><td>string</td></tr><tr><td>state</td><td>The state the customer resides in, required if country is "United States"<br>Note: must be one of the supported states</td><td>string</td></tr><tr><td>city</td><td>The city customer resides in, required</td><td>string</td></tr><tr><td>zip</td><td>Zip code of the customer in the format<code>&#x3C;5digits></code> or <code>&#x3C;5digits>-&#x3C;4digits></code>, e.g. <code>77777</code> or <code>77777-7777</code>, required if country is "India"</td><td>string</td></tr><tr><td>email</td><td>Customer email address, required<br>Note: NDAX will validate that the <code>email</code> is a correctly formatted email, and that the value is unique per-platform</td><td>string</td></tr><tr><td>id_number_type</td><td>The type of ID document provided, required<br>Note: must be one of the supported ID types</td><td>string</td></tr><tr><td>id_number</td><td>The ID number of the customer, required</td><td>string</td></tr></tbody></table>

Additional fields in response:

<table><thead><tr><th width="218.33333333333331">Parameter</th><th width="417">Description</th><th>Type</th></tr></thead><tbody><tr><td>platform_code</td><td>The unique identifier for the Platform onto which the customer has been created</td><td>string</td></tr><tr><td>participant_code</td><td>The NDAX identifier for the new customer<br>Note: this value is key to enable you to submit trades and check account balances for this customer</td><td>string</td></tr><tr><td>platform_updated_at</td><td>The timestamp of when a customer updated their information with your platform</td><td>number</td></tr></tbody></table>

Possible Responses:

<table><thead><tr><th width="208">Status Code</th><th>Description</th></tr></thead><tbody><tr><td>200 OK</td><td>The customer was successfully created. Note: the request is idempotent only IF the<code>request_id</code> and payload is the <em>same</em> as previously submitted</td></tr><tr><td>400 Bad Request</td><td>The request is invalid, OR the payload is the*same* as a previously submitted request, but the <code>request_id</code> is <em>different</em>, OR, the <code>request_id</code> is the <em>same</em> as a previously submitted request, but the payload is <em>different</em></td></tr></tbody></table>
