Skip to main content
PUT
/
accounts
/
me
Update current account
curl --request PUT \
  --url https://{subdomain}.truust.io/2.0/accounts/me \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "My Company",
  "allow_shipping": 0,
  "business_phone": "+34666999666",
  "business_description": "Description of the business"
}
'
import requests

url = "https://{subdomain}.truust.io/2.0/accounts/me"

payload = {
"name": "My Company",
"allow_shipping": 0,
"business_phone": "+34666999666",
"business_description": "Description of the business"
}
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: 'My Company',
allow_shipping: 0,
business_phone: '+34666999666',
business_description: 'Description of the business'
})
};

fetch('https://{subdomain}.truust.io/2.0/accounts/me', 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/accounts/me",
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' => 'My Company',
'allow_shipping' => 0,
'business_phone' => '+34666999666',
'business_description' => 'Description of the business'
]),
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/accounts/me"

payload := strings.NewReader("{\n \"name\": \"My Company\",\n \"allow_shipping\": 0,\n \"business_phone\": \"+34666999666\",\n \"business_description\": \"Description of the business\"\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/accounts/me")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"My Company\",\n \"allow_shipping\": 0,\n \"business_phone\": \"+34666999666\",\n \"business_description\": \"Description of the business\"\n}")
.asString();
require 'uri'
require 'net/http'

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

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\": \"My Company\",\n \"allow_shipping\": 0,\n \"business_phone\": \"+34666999666\",\n \"business_description\": \"Description of the business\"\n}"

response = http.request(request)
puts response.read_body
{
  "self": "/2.0/accounts/me",
  "merchant_id": "<string>",
  "name": "My Company",
  "email": "jsmith@example.com",
  "currency": "EUR",
  "country_code": "ES",
  "business_url": "<string>",
  "business_phone": "<string>",
  "business_description": "<string>",
  "image_url": "<string>",
  "public_key": "<string>",
  "secret_key": "<string>",
  "value_shipping": 123,
  "is_active": true,
  "allowed_gateways": [
    "<string>"
  ],
  "gateways": [
    {}
  ],
  "default_gateway": "<string>",
  "created_at": "2023-11-07T05:31:56Z"
}
{
"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.

Body

application/json
allow_shipping
enum<integer>
required

Required. Set to 1 to allow shipping on orders.

Available options:
0,
1
name
string
Maximum string length: 255
value_shipping
number

Required when allow_shipping is 1. Shipping fee value.

fee_shipping
number

Shipping fee amount (alternative to value_shipping).

business_phone
string

Must be a valid phone number.

business_description
string

Description of the account/business.

image
string

Base64-encoded image or URL for the account logo.

custom_domain
string

Custom domain URL.

addon_account
string

Addon's account credential.

subaccounts
integer[]

Array of subaccount IDs associated with this account.

allowed_gateways
string[]

Array of allowed gateways for the account.

default_gateway
enum<string>

Default payment gateway.

Available options:
ADDON,
ADDON_V2,
ADDON_ICE,
ADDON_HPP,
ADDON_APPLE_PAY,
AZUPAY,
BANKWIRE,
WALLET,
DCP,
EPX,
REDSYS_V2,
REDSYS_APPLE_PAY,
REDSYS_AUTH,
STRIPE,
DOCOMO,
SIBS_MBWAY,
SIBS_MULTIBANCO,
SEQURA,
UNNAX,
PAYPAL,
BIZUM,
INESPAY
psd2_enabled
enum<integer>
Available options:
0,
1
metadata
object

Response

Updated account

self
string
Example:

"/2.0/accounts/me"

merchant_id
string

Unique merchant identifier (addon_key).

name
string
Example:

"My Company"

email
string<email>
currency
string
Example:

"EUR"

country_code
string
Example:

"ES"

business_url
string | null
business_phone
string | null
business_description
string | null
image_url
string | null
public_key
string
secret_key
string

Secret API key. Only visible to the account owner.

allow_shipping
enum<integer>
Available options:
0,
1
value_shipping
number
is_active
boolean
psd2_enabled
enum<integer>
Available options:
0,
1
allowed_gateways
string[]
gateways
object[] | null

List of configured payment gateway objects for the account.

default_gateway
string | null
created_at
string<date-time> | null