curl --request PATCH \
--url https://api.sandbox.nevermined.app/api/v1/payment-methods/{paymentMethodId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"alias": "My Production Card",
"allowedApiKeyIds": [
"sk-abc123",
"sk-def456"
],
"orgId": "<string>"
}
'import requests
url = "https://api.sandbox.nevermined.app/api/v1/payment-methods/{paymentMethodId}"
payload = {
"alias": "My Production Card",
"allowedApiKeyIds": ["sk-abc123", "sk-def456"],
"orgId": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
alias: 'My Production Card',
allowedApiKeyIds: ['sk-abc123', 'sk-def456'],
orgId: '<string>'
})
};
fetch('https://api.sandbox.nevermined.app/api/v1/payment-methods/{paymentMethodId}', 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.sandbox.nevermined.app/api/v1/payment-methods/{paymentMethodId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'alias' => 'My Production Card',
'allowedApiKeyIds' => [
'sk-abc123',
'sk-def456'
],
'orgId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.sandbox.nevermined.app/api/v1/payment-methods/{paymentMethodId}"
payload := strings.NewReader("{\n \"alias\": \"My Production Card\",\n \"allowedApiKeyIds\": [\n \"sk-abc123\",\n \"sk-def456\"\n ],\n \"orgId\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.patch("https://api.sandbox.nevermined.app/api/v1/payment-methods/{paymentMethodId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"alias\": \"My Production Card\",\n \"allowedApiKeyIds\": [\n \"sk-abc123\",\n \"sk-def456\"\n ],\n \"orgId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.nevermined.app/api/v1/payment-methods/{paymentMethodId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"alias\": \"My Production Card\",\n \"allowedApiKeyIds\": [\n \"sk-abc123\",\n \"sk-def456\"\n ],\n \"orgId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "pm_1Abc2Def3Ghi4Jkl",
"type": "card",
"last4": "4242",
"brand": "visa",
"expMonth": 12,
"expYear": 2027,
"alias": "My Card",
"provider": "stripe",
"status": "Active",
"allowedApiKeyIds": [
"sk-abc123",
"sk-def456"
],
"orgId": "<string>"
}Update Payment Method
Updates a saved payment method, changing its friendly alias and/or the set of NVM API keys allowed to use it. Requires a Nevermined API key.
curl --request PATCH \
--url https://api.sandbox.nevermined.app/api/v1/payment-methods/{paymentMethodId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"alias": "My Production Card",
"allowedApiKeyIds": [
"sk-abc123",
"sk-def456"
],
"orgId": "<string>"
}
'import requests
url = "https://api.sandbox.nevermined.app/api/v1/payment-methods/{paymentMethodId}"
payload = {
"alias": "My Production Card",
"allowedApiKeyIds": ["sk-abc123", "sk-def456"],
"orgId": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
alias: 'My Production Card',
allowedApiKeyIds: ['sk-abc123', 'sk-def456'],
orgId: '<string>'
})
};
fetch('https://api.sandbox.nevermined.app/api/v1/payment-methods/{paymentMethodId}', 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.sandbox.nevermined.app/api/v1/payment-methods/{paymentMethodId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'alias' => 'My Production Card',
'allowedApiKeyIds' => [
'sk-abc123',
'sk-def456'
],
'orgId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.sandbox.nevermined.app/api/v1/payment-methods/{paymentMethodId}"
payload := strings.NewReader("{\n \"alias\": \"My Production Card\",\n \"allowedApiKeyIds\": [\n \"sk-abc123\",\n \"sk-def456\"\n ],\n \"orgId\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.patch("https://api.sandbox.nevermined.app/api/v1/payment-methods/{paymentMethodId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"alias\": \"My Production Card\",\n \"allowedApiKeyIds\": [\n \"sk-abc123\",\n \"sk-def456\"\n ],\n \"orgId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.nevermined.app/api/v1/payment-methods/{paymentMethodId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"alias\": \"My Production Card\",\n \"allowedApiKeyIds\": [\n \"sk-abc123\",\n \"sk-def456\"\n ],\n \"orgId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "pm_1Abc2Def3Ghi4Jkl",
"type": "card",
"last4": "4242",
"brand": "visa",
"expMonth": 12,
"expYear": 2027,
"alias": "My Card",
"provider": "stripe",
"status": "Active",
"allowedApiKeyIds": [
"sk-abc123",
"sk-def456"
],
"orgId": "<string>"
}Authorizations
Your Nevermined API Key (starts with 'nvm:'). Get one at nevermined.app under Settings > API Keys.
Path Parameters
Identifier of the payment method to update
"pm_1Abc2Def3Ghi4Jkl"
Body
Optional friendly name for the card
"My Production Card"
Array of NVM API Key skId values allowed to use this card. Null or empty = any key can use it.
["sk-abc123", "sk-def456"]
Move the card to an org (a valid orgId) or to personal (null). Omit to leave unchanged.
Response
The updated payment method
"pm_1Abc2Def3Ghi4Jkl"
"card"
"4242"
"visa"
12
2027
"My Card"
stripe, braintree, erc4337, visa, vgs "stripe"
Active, Revoked "Active"
NVM API Key IDs allowed to use this card. Null = any key can use it.
["sk-abc123", "sk-def456"]
Organization this card belongs to (null = personal).
Was this page helpful?