Sign a merchant up under an agency (send code, verify, create the store)
The three steps an agency’s own signup page performs, selected by action:
send— emails a six-digit code to the merchant’s address.verify— checks the code and confirms the address.provision— creates the store with its defaults and returns a session, so the merchant lands in the admin signed in.
No API key. The agency is resolved from the Origin or Referer of the browser call, or from the x-agency-signup-key
header on a server-side call (which may also pass the end user’s address in x-end-user-ip). A body-supplied agency id is ignored.
Plan, period and offer code. provision accepts an optional plan (one of the agency’s plan or tier slugs), period
(monthly or annual) and offer_code. They are carried to the merchant’s first checkout, which opens on that plan and period with the
code applied. The price and any discount are resolved when the merchant checks out; a value the agency does not sell is ignored.
The response returns the values that were kept in checkout_intent.
Rate limited per address, per mailbox and per agency.
curl --request POST \
--url https://api.tybritelabs.com/v1/agency/merchant-signup \
--header 'Content-Type: application/json' \
--data '
{
"email": "jsmith@example.com",
"password": "<string>",
"name": "<string>",
"code": "<string>",
"store_name": "<string>",
"store_code": "<string>",
"business_type": "<string>",
"country": "<string>",
"currency": "<string>",
"phone": "<string>",
"address": "<string>",
"store_email": "jsmith@example.com",
"plan": "<string>",
"offer_code": "<string>"
}
'import requests
url = "https://api.tybritelabs.com/v1/agency/merchant-signup"
payload = {
"email": "jsmith@example.com",
"password": "<string>",
"name": "<string>",
"code": "<string>",
"store_name": "<string>",
"store_code": "<string>",
"business_type": "<string>",
"country": "<string>",
"currency": "<string>",
"phone": "<string>",
"address": "<string>",
"store_email": "jsmith@example.com",
"plan": "<string>",
"offer_code": "<string>"
}
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({
email: 'jsmith@example.com',
password: '<string>',
name: '<string>',
code: '<string>',
store_name: '<string>',
store_code: '<string>',
business_type: '<string>',
country: '<string>',
currency: '<string>',
phone: '<string>',
address: '<string>',
store_email: 'jsmith@example.com',
plan: '<string>',
offer_code: '<string>'
})
};
fetch('https://api.tybritelabs.com/v1/agency/merchant-signup', 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.tybritelabs.com/v1/agency/merchant-signup",
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([
'email' => 'jsmith@example.com',
'password' => '<string>',
'name' => '<string>',
'code' => '<string>',
'store_name' => '<string>',
'store_code' => '<string>',
'business_type' => '<string>',
'country' => '<string>',
'currency' => '<string>',
'phone' => '<string>',
'address' => '<string>',
'store_email' => 'jsmith@example.com',
'plan' => '<string>',
'offer_code' => '<string>'
]),
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://api.tybritelabs.com/v1/agency/merchant-signup"
payload := strings.NewReader("{\n \"email\": \"jsmith@example.com\",\n \"password\": \"<string>\",\n \"name\": \"<string>\",\n \"code\": \"<string>\",\n \"store_name\": \"<string>\",\n \"store_code\": \"<string>\",\n \"business_type\": \"<string>\",\n \"country\": \"<string>\",\n \"currency\": \"<string>\",\n \"phone\": \"<string>\",\n \"address\": \"<string>\",\n \"store_email\": \"jsmith@example.com\",\n \"plan\": \"<string>\",\n \"offer_code\": \"<string>\"\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://api.tybritelabs.com/v1/agency/merchant-signup")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"jsmith@example.com\",\n \"password\": \"<string>\",\n \"name\": \"<string>\",\n \"code\": \"<string>\",\n \"store_name\": \"<string>\",\n \"store_code\": \"<string>\",\n \"business_type\": \"<string>\",\n \"country\": \"<string>\",\n \"currency\": \"<string>\",\n \"phone\": \"<string>\",\n \"address\": \"<string>\",\n \"store_email\": \"jsmith@example.com\",\n \"plan\": \"<string>\",\n \"offer_code\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tybritelabs.com/v1/agency/merchant-signup")
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 \"email\": \"jsmith@example.com\",\n \"password\": \"<string>\",\n \"name\": \"<string>\",\n \"code\": \"<string>\",\n \"store_name\": \"<string>\",\n \"store_code\": \"<string>\",\n \"business_type\": \"<string>\",\n \"country\": \"<string>\",\n \"currency\": \"<string>\",\n \"phone\": \"<string>\",\n \"address\": \"<string>\",\n \"store_email\": \"jsmith@example.com\",\n \"plan\": \"<string>\",\n \"offer_code\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"ok": true,
"verified": true,
"store": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"store_name": "<string>",
"store_code": "<string>"
},
"checkout_intent": {
"plan": "<string>",
"period": "<string>",
"offer_code": "<string>"
},
"session": {}
}{
"error": {
"code": "invalid_request",
"message": "Missing required field",
"details": "The 'email' field is required",
"hint": "<string>",
"available_stock": 123,
"current_cart_quantity": 123,
"limit": 123,
"remaining": 123,
"reset": 123
}
}{
"error": {
"code": "invalid_request",
"message": "Missing required field",
"details": "The 'email' field is required",
"hint": "<string>",
"available_stock": 123,
"current_cart_quantity": 123,
"limit": 123,
"remaining": 123,
"reset": 123
}
}{
"error": {
"code": "invalid_request",
"message": "Missing required field",
"details": "The 'email' field is required",
"hint": "<string>",
"available_stock": 123,
"current_cart_quantity": 123,
"limit": 123,
"remaining": 123,
"reset": 123
}
}Headers
Body
Response
The step succeeded
curl --request POST \
--url https://api.tybritelabs.com/v1/agency/merchant-signup \
--header 'Content-Type: application/json' \
--data '
{
"email": "jsmith@example.com",
"password": "<string>",
"name": "<string>",
"code": "<string>",
"store_name": "<string>",
"store_code": "<string>",
"business_type": "<string>",
"country": "<string>",
"currency": "<string>",
"phone": "<string>",
"address": "<string>",
"store_email": "jsmith@example.com",
"plan": "<string>",
"offer_code": "<string>"
}
'import requests
url = "https://api.tybritelabs.com/v1/agency/merchant-signup"
payload = {
"email": "jsmith@example.com",
"password": "<string>",
"name": "<string>",
"code": "<string>",
"store_name": "<string>",
"store_code": "<string>",
"business_type": "<string>",
"country": "<string>",
"currency": "<string>",
"phone": "<string>",
"address": "<string>",
"store_email": "jsmith@example.com",
"plan": "<string>",
"offer_code": "<string>"
}
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({
email: 'jsmith@example.com',
password: '<string>',
name: '<string>',
code: '<string>',
store_name: '<string>',
store_code: '<string>',
business_type: '<string>',
country: '<string>',
currency: '<string>',
phone: '<string>',
address: '<string>',
store_email: 'jsmith@example.com',
plan: '<string>',
offer_code: '<string>'
})
};
fetch('https://api.tybritelabs.com/v1/agency/merchant-signup', 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.tybritelabs.com/v1/agency/merchant-signup",
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([
'email' => 'jsmith@example.com',
'password' => '<string>',
'name' => '<string>',
'code' => '<string>',
'store_name' => '<string>',
'store_code' => '<string>',
'business_type' => '<string>',
'country' => '<string>',
'currency' => '<string>',
'phone' => '<string>',
'address' => '<string>',
'store_email' => 'jsmith@example.com',
'plan' => '<string>',
'offer_code' => '<string>'
]),
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://api.tybritelabs.com/v1/agency/merchant-signup"
payload := strings.NewReader("{\n \"email\": \"jsmith@example.com\",\n \"password\": \"<string>\",\n \"name\": \"<string>\",\n \"code\": \"<string>\",\n \"store_name\": \"<string>\",\n \"store_code\": \"<string>\",\n \"business_type\": \"<string>\",\n \"country\": \"<string>\",\n \"currency\": \"<string>\",\n \"phone\": \"<string>\",\n \"address\": \"<string>\",\n \"store_email\": \"jsmith@example.com\",\n \"plan\": \"<string>\",\n \"offer_code\": \"<string>\"\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://api.tybritelabs.com/v1/agency/merchant-signup")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"jsmith@example.com\",\n \"password\": \"<string>\",\n \"name\": \"<string>\",\n \"code\": \"<string>\",\n \"store_name\": \"<string>\",\n \"store_code\": \"<string>\",\n \"business_type\": \"<string>\",\n \"country\": \"<string>\",\n \"currency\": \"<string>\",\n \"phone\": \"<string>\",\n \"address\": \"<string>\",\n \"store_email\": \"jsmith@example.com\",\n \"plan\": \"<string>\",\n \"offer_code\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tybritelabs.com/v1/agency/merchant-signup")
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 \"email\": \"jsmith@example.com\",\n \"password\": \"<string>\",\n \"name\": \"<string>\",\n \"code\": \"<string>\",\n \"store_name\": \"<string>\",\n \"store_code\": \"<string>\",\n \"business_type\": \"<string>\",\n \"country\": \"<string>\",\n \"currency\": \"<string>\",\n \"phone\": \"<string>\",\n \"address\": \"<string>\",\n \"store_email\": \"jsmith@example.com\",\n \"plan\": \"<string>\",\n \"offer_code\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"ok": true,
"verified": true,
"store": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"store_name": "<string>",
"store_code": "<string>"
},
"checkout_intent": {
"plan": "<string>",
"period": "<string>",
"offer_code": "<string>"
},
"session": {}
}{
"error": {
"code": "invalid_request",
"message": "Missing required field",
"details": "The 'email' field is required",
"hint": "<string>",
"available_stock": 123,
"current_cart_quantity": 123,
"limit": 123,
"remaining": 123,
"reset": 123
}
}{
"error": {
"code": "invalid_request",
"message": "Missing required field",
"details": "The 'email' field is required",
"hint": "<string>",
"available_stock": 123,
"current_cart_quantity": 123,
"limit": 123,
"remaining": 123,
"reset": 123
}
}{
"error": {
"code": "invalid_request",
"message": "Missing required field",
"details": "The 'email' field is required",
"hint": "<string>",
"available_stock": 123,
"current_cart_quantity": 123,
"limit": 123,
"remaining": 123,
"reset": 123
}
}
