Set or update the PIN for a payment card by providing the card ID and new PIN with confirmation.
Set PIN for Payment Card
The Set PIN endpoint allows users to securely set a new PIN or update the existing PIN for a payment card. The request requires both the new PIN and a confirmation value to prevent errors during the update. All PIN changes are subject to security validation to ensure compliance with PIN complexity and length requirements.
Endpoint
POST /api/paymentCards/setPinForPaymentCard
Authentication
Bearer token required. Obtain via:
POST https://api.banking.netevia.dev/api/auth/v2
Include in header: Authorization: Bearer {token}
Token lifetime: 10 minutes. Refresh via POST /api/auth/refresh.
When to use
Use this endpoint when a cardholder needs to set a PIN on a newly issued card before first use, or when they want to change an existing PIN for security purposes. This applies to physical, virtual, and burner payment cards that support PIN-based transactions. Integrating this endpoint into your card management flow ensures cardholders can independently manage their card security at any time.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
| paymentCardId | string | Yes | Unique identifier of the payment card for which the PIN is being set |
| newPin | string | Yes | The new PIN to assign to the card. Must be 1 to 4 digits in length |
| pinConfirm | string | Yes | Confirmation of the new PIN. Must exactly match newPin to prevent accidental changes |
{
"paymentCardId": "card_a1b2c3d4e5f6",
"newPin": "7492",
"pinConfirm": "7492"
}Response
200 OK
A 200 response indicates the PIN was successfully set or updated. The response body on success is empty.
{}Error Codes
| Code | When it happens |
|---|---|
| 400 | Missing required fields, PIN and confirmation do not match, or PIN does not meet length requirements |
| 401 | Token missing, expired, or invalid |
| 403 | Insufficient permissions to update the card PIN |
| 404 | Payment card not found for the provided paymentCardId |
| 500 | Internal server error |
Common Mistakes
- Sending a
newPinandpinConfirmthat do not match — both fields must be identical or the request will be rejected with a 400 error. - Providing a PIN longer than 4 characters — the
newPinandpinConfirmfields each enforce a maximum length of 4 characters. - Using an expired or missing Bearer token — ensure the token is refreshed before making requests, as the token lifetime is only 10 minutes.
- Passing an incorrect or non-existent
paymentCardId— verify the card ID belongs to the authenticated user's account before submitting.
Related Endpoints
POST /api/paymentCards/createPaymentCard— create a new physical, virtual, or burner payment cardGET /api/paymentCards/getPaymentCards— retrieve a list of payment cards associated with a customerPOST /api/paymentCards/lockPaymentCard— lock a payment card to temporarily prevent transactionsPOST /api/paymentCards/unlockPaymentCard— unlock a previously locked payment card
Example
curl -X POST https://api.banking.netevia.dev/api/paymentCards/setPinForPaymentCard \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"paymentCardId": "card_a1b2c3d4e5f6",
"newPin": "7492",
"pinConfirm": "7492"
}' 200Success
