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
}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
Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.
Path Parameters
Unique identifier for object
Body
The cardproduct to update
The ID of the Card Auth Loop Endpoint object to be used to approve or reject a card transaction
An object that defines rules for how this card can be used
Show child attributes
Show child attributes
An object defining 3DS configuration
Show child attributes
Show child attributes
Optional arbitrary user data
Response
The cardproduct updated
The ID of the Card Auth Loop Endpoint object to be used to approve or reject a card transaction
The ID of a File object containing the image defining the design for the back of the card, if applicable
An object that defines rules for how this card can be used
Show child attributes
Show child attributes
The ID of a File object containing the image defining the design for the front of the card, if applicable
An object defining additional card configuration
Unique identifier for object
Optional name used to identify the object
One of: active, inactive. Filterable.
An object defining 3DS configuration
Show child attributes
Show child attributes
One of: physical, virtual. Filterable.
Optional arbitrary user data
Was this page helpful?