Set a card's PIN
curl --request POST \
--url https://api.banking.v2.portao3.com.br/realms/{realmId}/organizations/{organizationId}/accounts/{accountId}/wallets/{walletId}/cards/{cardId}/pin \
--header 'Content-Type: application/json' \
--data '{
"pin": "4096"
}'import requests
url = "https://api.banking.v2.portao3.com.br/realms/{realmId}/organizations/{organizationId}/accounts/{accountId}/wallets/{walletId}/cards/{cardId}/pin"
payload = { "pin": "4096" }
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({pin: '4096'})
};
fetch('https://api.banking.v2.portao3.com.br/realms/{realmId}/organizations/{organizationId}/accounts/{accountId}/wallets/{walletId}/cards/{cardId}/pin', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.banking.v2.portao3.com.br/realms/{realmId}/organizations/{organizationId}/accounts/{accountId}/wallets/{walletId}/cards/{cardId}/pin",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'pin' => '4096'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.banking.v2.portao3.com.br/realms/{realmId}/organizations/{organizationId}/accounts/{accountId}/wallets/{walletId}/cards/{cardId}/pin"
payload := strings.NewReader("{\n \"pin\": \"4096\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.banking.v2.portao3.com.br/realms/{realmId}/organizations/{organizationId}/accounts/{accountId}/wallets/{walletId}/cards/{cardId}/pin")
.header("Content-Type", "application/json")
.body("{\n \"pin\": \"4096\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.banking.v2.portao3.com.br/realms/{realmId}/organizations/{organizationId}/accounts/{accountId}/wallets/{walletId}/cards/{cardId}/pin")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"pin\": \"4096\"\n}"
response = http.request(request)
puts response.read_body{
"traceId": "1-68ee2a1b-3c4d5e6f7a8b9c0d1e2f3a4b",
"code": "INVALID_CARD_TYPE",
"origin": "BANKING",
"message": "Card type is invalid"
}{
"traceId": "1-68ee2a1b-3c4d5e6f7a8b9c0d1e2f3a4b",
"code": "ACCOUNT_NOT_FOUND",
"origin": "BANKING",
"message": "Account not found"
}{
"traceId": "1-68ee2a1b-3c4d5e6f7a8b9c0d1e2f3a4b",
"code": "BAD_REQUEST",
"origin": "BANKING",
"message": "Bad Request: Your request is invalid or incomplete. Please make sure you are requesting with the right fields.",
"fields": [
{
"field": "pin",
"message": "Invalid input: expected string, received undefined",
"code": "PIN_REQUIRED"
}
]
}{
"traceId": "1-68ee2a1b-3c4d5e6f7a8b9c0d1e2f3a4b",
"code": "BANKING_PROVIDER_UNAVAILABLE",
"origin": "BANKING",
"message": "Banking provider temporarily unavailable, please retry"
}{
"traceId": "1-68ee2a1b-3c4d5e6f7a8b9c0d1e2f3a4b",
"code": "BANKING_PROVIDER_UNAVAILABLE",
"origin": "BANKING",
"message": "Banking provider temporarily unavailable, please retry"
}{
"traceId": "1-68ee2a1b-3c4d5e6f7a8b9c0d1e2f3a4b",
"code": "BANKING_PROVIDER_UNAVAILABLE",
"origin": "BANKING",
"message": "Banking provider temporarily unavailable, please retry"
}{
"traceId": "1-68ee2a1b-3c4d5e6f7a8b9c0d1e2f3a4b",
"code": "BANKING_PROVIDER_UNAVAILABLE",
"origin": "BANKING",
"message": "Banking provider did not respond in time, please retry"
}Set a card's PIN
Sets the PIN of a physical card.
POST
/
realms
/
{realmId}
/
organizations
/
{organizationId}
/
accounts
/
{accountId}
/
wallets
/
{walletId}
/
cards
/
{cardId}
/
pin
Set a card's PIN
curl --request POST \
--url https://api.banking.v2.portao3.com.br/realms/{realmId}/organizations/{organizationId}/accounts/{accountId}/wallets/{walletId}/cards/{cardId}/pin \
--header 'Content-Type: application/json' \
--data '{
"pin": "4096"
}'import requests
url = "https://api.banking.v2.portao3.com.br/realms/{realmId}/organizations/{organizationId}/accounts/{accountId}/wallets/{walletId}/cards/{cardId}/pin"
payload = { "pin": "4096" }
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({pin: '4096'})
};
fetch('https://api.banking.v2.portao3.com.br/realms/{realmId}/organizations/{organizationId}/accounts/{accountId}/wallets/{walletId}/cards/{cardId}/pin', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.banking.v2.portao3.com.br/realms/{realmId}/organizations/{organizationId}/accounts/{accountId}/wallets/{walletId}/cards/{cardId}/pin",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'pin' => '4096'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.banking.v2.portao3.com.br/realms/{realmId}/organizations/{organizationId}/accounts/{accountId}/wallets/{walletId}/cards/{cardId}/pin"
payload := strings.NewReader("{\n \"pin\": \"4096\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.banking.v2.portao3.com.br/realms/{realmId}/organizations/{organizationId}/accounts/{accountId}/wallets/{walletId}/cards/{cardId}/pin")
.header("Content-Type", "application/json")
.body("{\n \"pin\": \"4096\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.banking.v2.portao3.com.br/realms/{realmId}/organizations/{organizationId}/accounts/{accountId}/wallets/{walletId}/cards/{cardId}/pin")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"pin\": \"4096\"\n}"
response = http.request(request)
puts response.read_body{
"traceId": "1-68ee2a1b-3c4d5e6f7a8b9c0d1e2f3a4b",
"code": "INVALID_CARD_TYPE",
"origin": "BANKING",
"message": "Card type is invalid"
}{
"traceId": "1-68ee2a1b-3c4d5e6f7a8b9c0d1e2f3a4b",
"code": "ACCOUNT_NOT_FOUND",
"origin": "BANKING",
"message": "Account not found"
}{
"traceId": "1-68ee2a1b-3c4d5e6f7a8b9c0d1e2f3a4b",
"code": "BAD_REQUEST",
"origin": "BANKING",
"message": "Bad Request: Your request is invalid or incomplete. Please make sure you are requesting with the right fields.",
"fields": [
{
"field": "pin",
"message": "Invalid input: expected string, received undefined",
"code": "PIN_REQUIRED"
}
]
}{
"traceId": "1-68ee2a1b-3c4d5e6f7a8b9c0d1e2f3a4b",
"code": "BANKING_PROVIDER_UNAVAILABLE",
"origin": "BANKING",
"message": "Banking provider temporarily unavailable, please retry"
}{
"traceId": "1-68ee2a1b-3c4d5e6f7a8b9c0d1e2f3a4b",
"code": "BANKING_PROVIDER_UNAVAILABLE",
"origin": "BANKING",
"message": "Banking provider temporarily unavailable, please retry"
}{
"traceId": "1-68ee2a1b-3c4d5e6f7a8b9c0d1e2f3a4b",
"code": "BANKING_PROVIDER_UNAVAILABLE",
"origin": "BANKING",
"message": "Banking provider temporarily unavailable, please retry"
}{
"traceId": "1-68ee2a1b-3c4d5e6f7a8b9c0d1e2f3a4b",
"code": "BANKING_PROVIDER_UNAVAILABLE",
"origin": "BANKING",
"message": "Banking provider did not respond in time, please retry"
}Send the new four-digit PIN; it replaces the current one, and the cardholder uses it at the next purchase or withdrawal that asks for it. Only
EMBOSSED cards have a PIN. Use default as walletId for the organization’s main wallet, and send x-environment: LIVE for a production card.
Any member of the organization can set a card’s PIN.Headers
Environment of the card: LIVE (production) or TEST (sandbox). When you omit it, the request runs in TEST; any other value is rejected.
Available options:
LIVE, TEST Path Parameters
ID of your realm.
Format: UUID
ID of the organization the card belongs to.
Format: UUID
ID of the organization's account (24 hexadecimal characters).
Pattern:
^[0-9a-fA-F]{24}$ID of the card's wallet (24 hexadecimal characters), or default for the organization's main wallet.
Pattern:
^([0-9a-fA-F]{24}|default)$ID of the physical card (24 hexadecimal characters).
Pattern:
^[0-9a-fA-F]{24}$Body
application/json
New PIN of the card: exactly four digits, sent as a string.
Minimum string length:
1Pattern:
^\d{4}$Example:
"4096"
Response
No Content. The operation succeeded and the response has no body.