Payment Method Session - Update a saved payment method
curl --request PUT \
--url https://sandbox.orchestratorx.com/v2/payment-method-sessions/{id}/update-saved-payment-method \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--header 'X-Profile-Id: <x-profile-id>' \
--data '
{
"payment_method_data": {
"card": {
"card_cvc": "456",
"card_holder_name": "Narayan Bhat"
}
},
"payment_method_token": "token_9wcXDRVkfEtLEsSnYKgQ"
}
'import requests
url = "https://sandbox.orchestratorx.com/v2/payment-method-sessions/{id}/update-saved-payment-method"
payload = {
"payment_method_data": { "card": {
"card_cvc": "456",
"card_holder_name": "Narayan Bhat"
} },
"payment_method_token": "token_9wcXDRVkfEtLEsSnYKgQ"
}
headers = {
"X-Profile-Id": "<x-profile-id>",
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
'X-Profile-Id': '<x-profile-id>',
Authorization: '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
payment_method_data: {card: {card_cvc: '456', card_holder_name: 'Narayan Bhat'}},
payment_method_token: 'token_9wcXDRVkfEtLEsSnYKgQ'
})
};
fetch('https://sandbox.orchestratorx.com/v2/payment-method-sessions/{id}/update-saved-payment-method', 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://sandbox.orchestratorx.com/v2/payment-method-sessions/{id}/update-saved-payment-method",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'payment_method_data' => [
'card' => [
'card_cvc' => '456',
'card_holder_name' => 'Narayan Bhat'
]
],
'payment_method_token' => 'token_9wcXDRVkfEtLEsSnYKgQ'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json",
"X-Profile-Id: <x-profile-id>"
],
]);
$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://sandbox.orchestratorx.com/v2/payment-method-sessions/{id}/update-saved-payment-method"
payload := strings.NewReader("{\n \"payment_method_data\": {\n \"card\": {\n \"card_cvc\": \"456\",\n \"card_holder_name\": \"Narayan Bhat\"\n }\n },\n \"payment_method_token\": \"token_9wcXDRVkfEtLEsSnYKgQ\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("X-Profile-Id", "<x-profile-id>")
req.Header.Add("Authorization", "<api-key>")
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.put("https://sandbox.orchestratorx.com/v2/payment-method-sessions/{id}/update-saved-payment-method")
.header("X-Profile-Id", "<x-profile-id>")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"payment_method_data\": {\n \"card\": {\n \"card_cvc\": \"456\",\n \"card_holder_name\": \"Narayan Bhat\"\n }\n },\n \"payment_method_token\": \"token_9wcXDRVkfEtLEsSnYKgQ\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.orchestratorx.com/v2/payment-method-sessions/{id}/update-saved-payment-method")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["X-Profile-Id"] = '<x-profile-id>'
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"payment_method_data\": {\n \"card\": {\n \"card_cvc\": \"456\",\n \"card_holder_name\": \"Narayan Bhat\"\n }\n },\n \"payment_method_token\": \"token_9wcXDRVkfEtLEsSnYKgQ\"\n}"
response = http.request(request)
puts response.read_body{
"id": "12345_pms_01926c58bc6e77c09e809964e72af8c8",
"expires_at": "2023-01-18T11:04:09.922Z",
"client_secret": "cs_9wcXDRVkfEtLEsSnYKgQ",
"storage_type": "volatile",
"keep_alive": true,
"customer_id": "12345_cus_01926c58bc6e77c09e809964e72af8c8",
"billing": {
"address": {
"city": "New York",
"country": "AF",
"line1": "123, King Street",
"line2": "Powelson Avenue",
"line3": "Bridgewater",
"zip": "08807",
"state": "New York",
"first_name": "John",
"last_name": "Doe",
"origin_zip": "08807"
},
"phone": {
"number": "9123456789",
"country_code": "+1"
},
"email": "<string>"
},
"psp_tokenization": {
"tokenization_type": "single_use",
"connector_id": "mca_28a7367sad8239s67"
},
"network_tokenization": {
"enable": "Enable"
},
"tokenization_data": "<unknown>",
"return_url": "https://merchant-website.com/return",
"next_action": {
"redirect_to_url": "https://example.com/redirect",
"type": "redirect_to_url"
},
"authentication_details": {
"status": "succeeded",
"error": {
"code": "card_declined",
"message": "The card was declined.",
"reason": "The card was declined.",
"unified_code": "card_declined",
"unified_message": "The card was declined.",
"network_advice_code": "01",
"network_decline_code": "05",
"network_error_message": "Do not retry"
}
},
"associated_payment_methods": [
{
"payment_method_token": {
"type": "payment_method_session_token",
"data": "token_9wcXDRVkfEtLEsSnYKgQ"
}
}
],
"associated_token_id": "12345_tok_01926c58bc6e77c09e809964e72af8c8",
"card_cvc_token_storage": {
"is_stored": true,
"expires_at": "2024-02-24T11:04:09.922Z"
},
"payment_method_data": {
"card": {
"saved_to_locker": true,
"issuer_country": "AF",
"last4_digits": "4242",
"expiry_month": "10",
"expiry_year": "25",
"card_holder_name": "John Doe",
"card_fingerprint": "fingerprint_12345",
"nick_name": "Card",
"card_network": "Visa",
"card_isin": "4567890",
"card_issuer": "Issuer Bank",
"card_type": "Credit"
}
},
"sdk_authorization": "cHJvZmlsZV9pZD0uLi4=",
"network_tokenization_data": {
"payment_method_data": {
"last4_digits": "4242",
"issuer_country": "AF",
"network_token_expiry_month": "05",
"network_token_expiry_year": "27",
"nick_name": "Card",
"card_holder_name": "John Doe",
"card_isin": "16712672",
"card_issuer": "Bank of America",
"card_network": "Visa",
"card_type": "Credit",
"saved_to_locker": true,
"par": "522134KAVJ1JPZ8L77N0Z2LRYZS7J"
}
}
}Payment Method Session
Payment Method Session - Update a saved payment method
Update a saved payment method from the given payment method session.
PUT
/
v2
/
payment-method-sessions
/
{id}
/
update-saved-payment-method
Payment Method Session - Update a saved payment method
curl --request PUT \
--url https://sandbox.orchestratorx.com/v2/payment-method-sessions/{id}/update-saved-payment-method \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--header 'X-Profile-Id: <x-profile-id>' \
--data '
{
"payment_method_data": {
"card": {
"card_cvc": "456",
"card_holder_name": "Narayan Bhat"
}
},
"payment_method_token": "token_9wcXDRVkfEtLEsSnYKgQ"
}
'import requests
url = "https://sandbox.orchestratorx.com/v2/payment-method-sessions/{id}/update-saved-payment-method"
payload = {
"payment_method_data": { "card": {
"card_cvc": "456",
"card_holder_name": "Narayan Bhat"
} },
"payment_method_token": "token_9wcXDRVkfEtLEsSnYKgQ"
}
headers = {
"X-Profile-Id": "<x-profile-id>",
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
'X-Profile-Id': '<x-profile-id>',
Authorization: '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
payment_method_data: {card: {card_cvc: '456', card_holder_name: 'Narayan Bhat'}},
payment_method_token: 'token_9wcXDRVkfEtLEsSnYKgQ'
})
};
fetch('https://sandbox.orchestratorx.com/v2/payment-method-sessions/{id}/update-saved-payment-method', 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://sandbox.orchestratorx.com/v2/payment-method-sessions/{id}/update-saved-payment-method",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'payment_method_data' => [
'card' => [
'card_cvc' => '456',
'card_holder_name' => 'Narayan Bhat'
]
],
'payment_method_token' => 'token_9wcXDRVkfEtLEsSnYKgQ'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json",
"X-Profile-Id: <x-profile-id>"
],
]);
$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://sandbox.orchestratorx.com/v2/payment-method-sessions/{id}/update-saved-payment-method"
payload := strings.NewReader("{\n \"payment_method_data\": {\n \"card\": {\n \"card_cvc\": \"456\",\n \"card_holder_name\": \"Narayan Bhat\"\n }\n },\n \"payment_method_token\": \"token_9wcXDRVkfEtLEsSnYKgQ\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("X-Profile-Id", "<x-profile-id>")
req.Header.Add("Authorization", "<api-key>")
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.put("https://sandbox.orchestratorx.com/v2/payment-method-sessions/{id}/update-saved-payment-method")
.header("X-Profile-Id", "<x-profile-id>")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"payment_method_data\": {\n \"card\": {\n \"card_cvc\": \"456\",\n \"card_holder_name\": \"Narayan Bhat\"\n }\n },\n \"payment_method_token\": \"token_9wcXDRVkfEtLEsSnYKgQ\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.orchestratorx.com/v2/payment-method-sessions/{id}/update-saved-payment-method")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["X-Profile-Id"] = '<x-profile-id>'
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"payment_method_data\": {\n \"card\": {\n \"card_cvc\": \"456\",\n \"card_holder_name\": \"Narayan Bhat\"\n }\n },\n \"payment_method_token\": \"token_9wcXDRVkfEtLEsSnYKgQ\"\n}"
response = http.request(request)
puts response.read_body{
"id": "12345_pms_01926c58bc6e77c09e809964e72af8c8",
"expires_at": "2023-01-18T11:04:09.922Z",
"client_secret": "cs_9wcXDRVkfEtLEsSnYKgQ",
"storage_type": "volatile",
"keep_alive": true,
"customer_id": "12345_cus_01926c58bc6e77c09e809964e72af8c8",
"billing": {
"address": {
"city": "New York",
"country": "AF",
"line1": "123, King Street",
"line2": "Powelson Avenue",
"line3": "Bridgewater",
"zip": "08807",
"state": "New York",
"first_name": "John",
"last_name": "Doe",
"origin_zip": "08807"
},
"phone": {
"number": "9123456789",
"country_code": "+1"
},
"email": "<string>"
},
"psp_tokenization": {
"tokenization_type": "single_use",
"connector_id": "mca_28a7367sad8239s67"
},
"network_tokenization": {
"enable": "Enable"
},
"tokenization_data": "<unknown>",
"return_url": "https://merchant-website.com/return",
"next_action": {
"redirect_to_url": "https://example.com/redirect",
"type": "redirect_to_url"
},
"authentication_details": {
"status": "succeeded",
"error": {
"code": "card_declined",
"message": "The card was declined.",
"reason": "The card was declined.",
"unified_code": "card_declined",
"unified_message": "The card was declined.",
"network_advice_code": "01",
"network_decline_code": "05",
"network_error_message": "Do not retry"
}
},
"associated_payment_methods": [
{
"payment_method_token": {
"type": "payment_method_session_token",
"data": "token_9wcXDRVkfEtLEsSnYKgQ"
}
}
],
"associated_token_id": "12345_tok_01926c58bc6e77c09e809964e72af8c8",
"card_cvc_token_storage": {
"is_stored": true,
"expires_at": "2024-02-24T11:04:09.922Z"
},
"payment_method_data": {
"card": {
"saved_to_locker": true,
"issuer_country": "AF",
"last4_digits": "4242",
"expiry_month": "10",
"expiry_year": "25",
"card_holder_name": "John Doe",
"card_fingerprint": "fingerprint_12345",
"nick_name": "Card",
"card_network": "Visa",
"card_isin": "4567890",
"card_issuer": "Issuer Bank",
"card_type": "Credit"
}
},
"sdk_authorization": "cHJvZmlsZV9pZD0uLi4=",
"network_tokenization_data": {
"payment_method_data": {
"last4_digits": "4242",
"issuer_country": "AF",
"network_token_expiry_month": "05",
"network_token_expiry_year": "27",
"nick_name": "Card",
"card_holder_name": "John Doe",
"card_isin": "16712672",
"card_issuer": "Bank of America",
"card_network": "Visa",
"card_type": "Credit",
"saved_to_locker": true,
"par": "522134KAVJ1JPZ8L77N0Z2LRYZS7J"
}
}
}Authorizations
Format: publishable-key=<publishable-key>,client-secret=<client-secret>
Publishable keys are a type of keys that can be public and have limited scope of usage. Client Secret provide temporary access to singular data, such as access to a single customer object for a short period of time. This authentication scheme is used by the SDK.
Body
application/json
Response
The payment method has been updated successfully