curl --request POST \
--url https://vouchers.api.jtl-software.com/v1/clients/connect \
--header 'Content-Type: application/json' \
--data '
{
"pin": "X53HI0"
}
'import requests
url = "https://vouchers.api.jtl-software.com/v1/clients/connect"
payload = { "pin": "X53HI0" }
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({pin: 'X53HI0'})
};
fetch('https://vouchers.api.jtl-software.com/v1/clients/connect', 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://vouchers.api.jtl-software.com/v1/clients/connect",
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([
'pin' => 'X53HI0'
]),
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://vouchers.api.jtl-software.com/v1/clients/connect"
payload := strings.NewReader("{\n \"pin\": \"X53HI0\"\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://vouchers.api.jtl-software.com/v1/clients/connect")
.header("Content-Type", "application/json")
.body("{\n \"pin\": \"X53HI0\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://vouchers.api.jtl-software.com/v1/clients/connect")
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 \"pin\": \"X53HI0\"\n}"
response = http.request(request)
puts response.read_body{
"id": "da39a3ee5eb28b7392ef5",
"client_group_id": "cff8784e5eb28b81ca02a",
"name": "Test-Client",
"secret": "VrhgrKVDTqjg1GVr3R6Juvx7FfHQK7Psim7ORAXm",
"scopes": [
"can_use"
],
"created_at": "2017-07-21T17:32:28+00:00",
"updated_at": "2017-07-21T17:32:28+00:00",
"connected_at": "2017-07-21T17:32:28+00:00",
"type": "pos"
}"Invalid pin or client was already registered"{
"status": 404,
"code": "VOUCHER.NOT_FOUND",
"message": "The requested Voucher was not found."
}{
"status": 422,
"code": "VOUCHER.CREATE.UNPROCESSABLE_ENTITY",
"message": "The given data was invalid.",
"errors": [
{
"code": "VOUCHER.CREATE.CURRENCY.VALID_CURRENCY",
"property": "currency",
"rule": "valid_currency",
"message": "Currency must be a valid currency code"
}
]
}Connects a client
Exchanges temporary pin for full oauth client credentials
curl --request POST \
--url https://vouchers.api.jtl-software.com/v1/clients/connect \
--header 'Content-Type: application/json' \
--data '
{
"pin": "X53HI0"
}
'import requests
url = "https://vouchers.api.jtl-software.com/v1/clients/connect"
payload = { "pin": "X53HI0" }
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({pin: 'X53HI0'})
};
fetch('https://vouchers.api.jtl-software.com/v1/clients/connect', 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://vouchers.api.jtl-software.com/v1/clients/connect",
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([
'pin' => 'X53HI0'
]),
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://vouchers.api.jtl-software.com/v1/clients/connect"
payload := strings.NewReader("{\n \"pin\": \"X53HI0\"\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://vouchers.api.jtl-software.com/v1/clients/connect")
.header("Content-Type", "application/json")
.body("{\n \"pin\": \"X53HI0\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://vouchers.api.jtl-software.com/v1/clients/connect")
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 \"pin\": \"X53HI0\"\n}"
response = http.request(request)
puts response.read_body{
"id": "da39a3ee5eb28b7392ef5",
"client_group_id": "cff8784e5eb28b81ca02a",
"name": "Test-Client",
"secret": "VrhgrKVDTqjg1GVr3R6Juvx7FfHQK7Psim7ORAXm",
"scopes": [
"can_use"
],
"created_at": "2017-07-21T17:32:28+00:00",
"updated_at": "2017-07-21T17:32:28+00:00",
"connected_at": "2017-07-21T17:32:28+00:00",
"type": "pos"
}"Invalid pin or client was already registered"{
"status": 404,
"code": "VOUCHER.NOT_FOUND",
"message": "The requested Voucher was not found."
}{
"status": 422,
"code": "VOUCHER.CREATE.UNPROCESSABLE_ENTITY",
"message": "The given data was invalid.",
"errors": [
{
"code": "VOUCHER.CREATE.CURRENCY.VALID_CURRENCY",
"property": "currency",
"rule": "valid_currency",
"message": "Currency must be a valid currency code"
}
]
}Body
Client connect request body
Previously temporarily issued PIN from the Voucher Admin UI (30 minutes validity)
255"X53HI0"
Response
OK
Primary identification key - will be used in client calls
"da39a3ee5eb28b7392ef5"
Primary identification key from the selected group (id)
"cff8784e5eb28b81ca02a"
Naming or description of the client
255"Test-Client"
secret
255"VrhgrKVDTqjg1GVr3R6Juvx7FfHQK7Psim7ORAXm"
can_use, can_manage created_at - datetime in RFC3339 format, see https://tools.ietf.org/html/rfc3339
"2017-07-21T17:32:28+00:00"
updated_at - datetime in RFC3339 format, see https://tools.ietf.org/html/rfc3339
"2017-07-21T17:32:28+00:00"
connected_at - datetime in RFC3339 format, see https://tools.ietf.org/html/rfc3339
"2017-07-21T17:32:28+00:00"
The type of this client
"pos"
Was this page helpful?