> For the complete documentation index, see [llms.txt](https://docs.udara360.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.udara360.io/udara360-docs-1/cards/providus/setcardpin.md).

# SetCardPIN

The "SetCardPIN" endpoint allows customers to set the PIN for a card, or have one auto-generated.

<mark style="color:blue;">`PUT`</mark> `/api/Card/v{{version}}/Providus/SetCardPIN`

Provide the `cardId` of the card, and a `pin` , or pass `pin` as `null` to have the system auto-generate one.

**Headers**

| Name                                           | Value              |
| ---------------------------------------------- | ------------------ |
| Content-Type<mark style="color:red;">\*</mark> | `application/json` |
| Request-Reference                              | `unique_string`    |

**Body**

<table><thead><tr><th>Name</th><th>Data Type</th><th data-type="checkbox">Required/Optional</th><th>Description</th></tr></thead><tbody><tr><td><code>cardId</code></td><td><em>string</em></td><td>true</td><td>The <code>cardId</code> field from the SearchCards endpoint response.</td></tr><tr><td><code>pin</code></td><td><em>string</em></td><td>false</td><td>The PIN to set for the card. Pass as <code>null</code> to have the system auto-generate a PIN.</td></tr></tbody></table>

Here is an example request and response with a sample payload sent to the endpoint in Curl format.

<details>

<summary>Sample Request</summary>

```json
curl --location -g '{{baseUrl}}/api/Card/v{{version}}/Providus/SetCardPIN' \
--header 'Content-Type: application/json' \
--data '{
  //"cardRecordId": "b6adc86a-750d-436a-9625-b35400c5ed58" //Id field in the SearchCards endpoint response
  "cardId":"76b0c321-9376-4bde-b4e6-f4740189ed40", //cardId field in the SearchCards endpoint response,
  "pin" : null //if set as null, the system will auto generate a PIN
}'
```

</details>

<details>

<summary>Response: <code>200</code></summary>

```json
{
  "status": true,
  "message": "Request successful",
  "data": {
    "responseCode": "00",
    "responseMessage": "Request successful",
    "pin": "1111"
  }
}
```

</details>
