Update a Card Product
curl --request PATCH \
--url https://api.treasuryprime.com/cardproduct/{id} \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"card_controls": {
"card_controls": {
"controls": [
{
"amount": "3000.00",
"interval": "rolling",
"type": "spend_limit",
"version": 1,
"window": 1
}
],
"name": "example_control1"
}
}
}
'import requests
url = "https://api.treasuryprime.com/cardproduct/{id}"
payload = { "card_controls": { "card_controls": {
"controls": [
{
"amount": "3000.00",
"interval": "rolling",
"type": "spend_limit",
"version": 1,
"window": 1
}
],
"name": "example_control1"
} } }
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
card_controls: {
card_controls: {
controls: [
{
amount: '3000.00',
interval: 'rolling',
type: 'spend_limit',
version: 1,
window: 1
}
],
name: 'example_control1'
}
}
})
};
fetch('https://api.treasuryprime.com/cardproduct/{id}', 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.treasuryprime.com/cardproduct/{id}",
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([
'card_controls' => [
'card_controls' => [
'controls' => [
[
'amount' => '3000.00',
'interval' => 'rolling',
'type' => 'spend_limit',
'version' => 1,
'window' => 1
]
],
'name' => 'example_control1'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"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.treasuryprime.com/cardproduct/{id}"
payload := strings.NewReader("{\n \"card_controls\": {\n \"card_controls\": {\n \"controls\": [\n {\n \"amount\": \"3000.00\",\n \"interval\": \"rolling\",\n \"type\": \"spend_limit\",\n \"version\": 1,\n \"window\": 1\n }\n ],\n \"name\": \"example_control1\"\n }\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
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.treasuryprime.com/cardproduct/{id}")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"card_controls\": {\n \"card_controls\": {\n \"controls\": [\n {\n \"amount\": \"3000.00\",\n \"interval\": \"rolling\",\n \"type\": \"spend_limit\",\n \"version\": 1,\n \"window\": 1\n }\n ],\n \"name\": \"example_control1\"\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.treasuryprime.com/cardproduct/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"card_controls\": {\n \"card_controls\": {\n \"controls\": [\n {\n \"amount\": \"3000.00\",\n \"interval\": \"rolling\",\n \"type\": \"spend_limit\",\n \"version\": 1,\n \"window\": 1\n }\n ],\n \"name\": \"example_control1\"\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"card_auth_loop_endpoint_id": null,
"card_back_image_file_id": null,
"card_controls": {
"card_controls": {
"controls": [
{
"amount": "3000.00",
"interval": "rolling",
"type": "spend_limit",
"version": 1,
"window": 1
}
],
"name": "example_control1"
}
},
"card_front_image_file_id": null,
"created_at": "2021-02-09T18:58:31Z",
"id": "cdpt_zuhqnmz7e085",
"status": "active",
"three_domain_secure_config": null,
"type": "virtual",
"updated_at": "2021-02-09T18:58:31Z",
"userdata": null
}Card Product
Update a Card Product
PATCH
/
cardproduct
/
{id}
Update a Card Product
curl --request PATCH \
--url https://api.treasuryprime.com/cardproduct/{id} \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"card_controls": {
"card_controls": {
"controls": [
{
"amount": "3000.00",
"interval": "rolling",
"type": "spend_limit",
"version": 1,
"window": 1
}
],
"name": "example_control1"
}
}
}
'import requests
url = "https://api.treasuryprime.com/cardproduct/{id}"
payload = { "card_controls": { "card_controls": {
"controls": [
{
"amount": "3000.00",
"interval": "rolling",
"type": "spend_limit",
"version": 1,
"window": 1
}
],
"name": "example_control1"
} } }
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
card_controls: {
card_controls: {
controls: [
{
amount: '3000.00',
interval: 'rolling',
type: 'spend_limit',
version: 1,
window: 1
}
],
name: 'example_control1'
}
}
})
};
fetch('https://api.treasuryprime.com/cardproduct/{id}', 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.treasuryprime.com/cardproduct/{id}",
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([
'card_controls' => [
'card_controls' => [
'controls' => [
[
'amount' => '3000.00',
'interval' => 'rolling',
'type' => 'spend_limit',
'version' => 1,
'window' => 1
]
],
'name' => 'example_control1'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"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.treasuryprime.com/cardproduct/{id}"
payload := strings.NewReader("{\n \"card_controls\": {\n \"card_controls\": {\n \"controls\": [\n {\n \"amount\": \"3000.00\",\n \"interval\": \"rolling\",\n \"type\": \"spend_limit\",\n \"version\": 1,\n \"window\": 1\n }\n ],\n \"name\": \"example_control1\"\n }\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
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.treasuryprime.com/cardproduct/{id}")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"card_controls\": {\n \"card_controls\": {\n \"controls\": [\n {\n \"amount\": \"3000.00\",\n \"interval\": \"rolling\",\n \"type\": \"spend_limit\",\n \"version\": 1,\n \"window\": 1\n }\n ],\n \"name\": \"example_control1\"\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.treasuryprime.com/cardproduct/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"card_controls\": {\n \"card_controls\": {\n \"controls\": [\n {\n \"amount\": \"3000.00\",\n \"interval\": \"rolling\",\n \"type\": \"spend_limit\",\n \"version\": 1,\n \"window\": 1\n }\n ],\n \"name\": \"example_control1\"\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"card_auth_loop_endpoint_id": null,
"card_back_image_file_id": null,
"card_controls": {
"card_controls": {
"controls": [
{
"amount": "3000.00",
"interval": "rolling",
"type": "spend_limit",
"version": 1,
"window": 1
}
],
"name": "example_control1"
}
},
"card_front_image_file_id": null,
"created_at": "2021-02-09T18:58:31Z",
"id": "cdpt_zuhqnmz7e085",
"status": "active",
"three_domain_secure_config": null,
"type": "virtual",
"updated_at": "2021-02-09T18:58:31Z",
"userdata": null
}Authorizations
basicAuthapiKey
Body
application/json
The cardproduct to update
Response
200 - application/json
The cardproduct updated
Was this page helpful?