Skip to main content
PUT
/
bundles
/
{bundle_id}
Update bundle
curl --request PUT \
  --url https://{subdomain}.truust.io/2.0/bundles/{bundle_id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "New product name",
  "value": 10
}
'
import requests

url = "https://{subdomain}.truust.io/2.0/bundles/{bundle_id}"

payload = {
"name": "New product name",
"value": 10
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

response = requests.put(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: 'New product name', value: 10})
};

fetch('https://{subdomain}.truust.io/2.0/bundles/{bundle_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://{subdomain}.truust.io/2.0/bundles/{bundle_id}",
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([
'name' => 'New product name',
'value' => 10
]),
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://{subdomain}.truust.io/2.0/bundles/{bundle_id}"

payload := strings.NewReader("{\n \"name\": \"New product name\",\n \"value\": 10\n}")

req, _ := http.NewRequest("PUT", 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.put("https://{subdomain}.truust.io/2.0/bundles/{bundle_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"New product name\",\n \"value\": 10\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://{subdomain}.truust.io/2.0/bundles/{bundle_id}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"New product name\",\n \"value\": 10\n}"

response = http.request(request)
puts response.read_body
{
  "id": 123,
  "self": "<string>",
  "name": "<string>",
  "description": "<string>",
  "value": 123,
  "value_shipping": 123,
  "currency": "EUR",
  "amount": "<string>",
  "amount_shipping": "<string>",
  "buyer_link": "<string>",
  "images": [
    "<string>"
  ],
  "expiration": "2023-11-07T05:31:56Z",
  "expiration_unit": 123,
  "expiration_amount": 123,
  "is_expired": true,
  "is_active": true,
  "is_shippable": true,
  "tag": "<string>",
  "visits": 123,
  "metadata": {},
  "created_by": 123,
  "created_at": "2023-11-07T05:31:56Z",
  "updated_at": "2023-11-07T05:31:56Z",
  "qr_link": "<string>",
  "connections": {}
}
{
"message": "The given data was invalid.",
"errors": {
"name": [
"The name field is required."
]
}
}

Authorizations

Authorization
string
header
required

Use your account's Secret Key as the Bearer token.

Path Parameters

bundle_id
string
required

Bundle ID.

Body

application/json
name
string
Maximum string length: 120
Example:

"New product name"

description
string
Maximum string length: 255
value
number<float>
Required range: x >= 0
Example:

10

is_active
boolean
is_shippable
boolean
value_shipping
number<float>

Required if is_shippable is true.

Required range: x >= 0
tag
string
Maximum string length: 50
metadata
object
images
string[]
expiration
string<date-time>
expiration_unit
number
expiration_amount
number

Response

Updated bundle

id
integer
self
string
name
string
description
string | null
value
number
value_shipping
number | null
currency
string
Example:

"EUR"

amount
string | null

Formatted price with currency symbol.

amount_shipping
string | null
images
string[] | null
expiration
string<date-time> | null
expiration_unit
number | null
expiration_amount
number | null
is_expired
boolean
is_active
boolean
is_shippable
boolean
tag
string | null
visits
integer | null
metadata
object | null
created_by
integer | null
created_at
string<date-time> | null
updated_at
string<date-time> | null
connections
object

Hypermedia links to related resources.