# Set Card Pin

This API is used for setting the pin of a card for the first time or updating the pin of a card later

* **Path: /api/v1/card/setPin**
* **Method: POST**
* **Content-Type**

  application/json
* **Headers**

| Key           | Type   | Required | Comments             |
| ------------- | ------ | -------- | -------------------- |
| authorization | string | YES      | Authorization Header |

* **Body**

| Key         | Type   | Required | Comments                                                                                  |
| ----------- | ------ | -------- | ----------------------------------------------------------------------------------------- |
| api\_key    | string | YES      | api key                                                                                   |
| request\_id | string | YES      | Unique id; the shortest is 20 characters, the longest is 64 characters                    |
| timestamp   | string | YES      | 13-digit; Valid for plus or minus 30 seconds                                              |
| username    | string | YES      | Unique username of the account.                                                           |
| kit\_number | string | YES      | Show on card                                                                              |
| pin         | string | YES      | The pin number which will be used for card transactions.Character length is 4.number only |
| sign        | string | YES      | sign: MD5(api\_key+username+timestamp+secret+request\_id)lowercase hex                    |

* **Example**

  ```js
  {
    api_key: 'fd01a53d7834b06c080cd1024ae9c60a',
    request_id: '1b608ec128f34834a176f70d7ca6e3f7',
    timestamp: '1683293970762',
    username: 'lili12',
    kit_number: '111111',
    pin: '1223',
    sign: '6d97e5373268d92bf9e799121899b7f4'
  }
  ```

  **signature example**:MD5(fd01a53d7834b06c080cd1024ae9c60alili12168329397076216388ce4331b35e8e0d32777ba57d7d91b608ec128f34834a176f70d7ca6e3f7)
* **Response**

| Key  | Type   | Comments         |
| ---- | ------ | ---------------- |
| code | number | Response code    |
| msg  | string | Response message |

* **Example**

  ```js
  {
    "code": 10200,
    "msg": "ok"
  }
  ```
