Create account
curl --request POST \
--url https://{subdomain}.truust.io/2.0/accounts \
--header 'Content-Type: application/json' \
--data '
{
"name": "My Company",
"slug": "my_company",
"country_code": "ES",
"email": "owner@mycompany.com",
"password": "Str0ng!Pass",
"locale": "es"
}
'import requests
url = "https://{subdomain}.truust.io/2.0/accounts"
payload = {
"name": "My Company",
"slug": "my_company",
"country_code": "ES",
"email": "owner@mycompany.com",
"password": "Str0ng!Pass",
"locale": "es"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'My Company',
slug: 'my_company',
country_code: 'ES',
email: 'owner@mycompany.com',
password: 'Str0ng!Pass',
locale: 'es'
})
};
fetch('https://{subdomain}.truust.io/2.0/accounts', 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",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'My Company',
'slug' => 'my_company',
'country_code' => 'ES',
'email' => 'owner@mycompany.com',
'password' => 'Str0ng!Pass',
'locale' => 'es'
]),
CURLOPT_HTTPHEADER => [
"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"
payload := strings.NewReader("{\n \"name\": \"My Company\",\n \"slug\": \"my_company\",\n \"country_code\": \"ES\",\n \"email\": \"owner@mycompany.com\",\n \"password\": \"Str0ng!Pass\",\n \"locale\": \"es\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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.post("https://{subdomain}.truust.io/2.0/accounts")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"My Company\",\n \"slug\": \"my_company\",\n \"country_code\": \"ES\",\n \"email\": \"owner@mycompany.com\",\n \"password\": \"Str0ng!Pass\",\n \"locale\": \"es\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{subdomain}.truust.io/2.0/accounts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"My Company\",\n \"slug\": \"my_company\",\n \"country_code\": \"ES\",\n \"email\": \"owner@mycompany.com\",\n \"password\": \"Str0ng!Pass\",\n \"locale\": \"es\"\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>",
"allow_shipping": 0,
"value_shipping": 123,
"is_active": true,
"psd2_enabled": 0,
"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."
]
}
}Account
Create Account
Registers a new merchant account and its associated manager.
POST
/
accounts
Create account
curl --request POST \
--url https://{subdomain}.truust.io/2.0/accounts \
--header 'Content-Type: application/json' \
--data '
{
"name": "My Company",
"slug": "my_company",
"country_code": "ES",
"email": "owner@mycompany.com",
"password": "Str0ng!Pass",
"locale": "es"
}
'import requests
url = "https://{subdomain}.truust.io/2.0/accounts"
payload = {
"name": "My Company",
"slug": "my_company",
"country_code": "ES",
"email": "owner@mycompany.com",
"password": "Str0ng!Pass",
"locale": "es"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'My Company',
slug: 'my_company',
country_code: 'ES',
email: 'owner@mycompany.com',
password: 'Str0ng!Pass',
locale: 'es'
})
};
fetch('https://{subdomain}.truust.io/2.0/accounts', 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",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'My Company',
'slug' => 'my_company',
'country_code' => 'ES',
'email' => 'owner@mycompany.com',
'password' => 'Str0ng!Pass',
'locale' => 'es'
]),
CURLOPT_HTTPHEADER => [
"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"
payload := strings.NewReader("{\n \"name\": \"My Company\",\n \"slug\": \"my_company\",\n \"country_code\": \"ES\",\n \"email\": \"owner@mycompany.com\",\n \"password\": \"Str0ng!Pass\",\n \"locale\": \"es\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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.post("https://{subdomain}.truust.io/2.0/accounts")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"My Company\",\n \"slug\": \"my_company\",\n \"country_code\": \"ES\",\n \"email\": \"owner@mycompany.com\",\n \"password\": \"Str0ng!Pass\",\n \"locale\": \"es\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{subdomain}.truust.io/2.0/accounts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"My Company\",\n \"slug\": \"my_company\",\n \"country_code\": \"ES\",\n \"email\": \"owner@mycompany.com\",\n \"password\": \"Str0ng!Pass\",\n \"locale\": \"es\"\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>",
"allow_shipping": 0,
"value_shipping": 123,
"is_active": true,
"psd2_enabled": 0,
"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."
]
}
}Body
application/json
Response
Account created
