curl --request PATCH \
--url http://localhost:8080/api/v1/businesses/{id} \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"rotate_api_key": true
}
'import requests
url = "http://localhost:8080/api/v1/businesses/{id}"
payload = {
"name": "<string>",
"rotate_api_key": True
}
headers = {"Content-Type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>', rotate_api_key: true})
};
fetch('http://localhost:8080/api/v1/businesses/{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_PORT => "8080",
CURLOPT_URL => "http://localhost:8080/api/v1/businesses/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'rotate_api_key' => true
]),
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 := "http://localhost:8080/api/v1/businesses/{id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"rotate_api_key\": true\n}")
req, _ := http.NewRequest("PATCH", 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.patch("http://localhost:8080/api/v1/businesses/{id}")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"rotate_api_key\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8080/api/v1/businesses/{id}")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Patch.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"rotate_api_key\": true\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"status": "PENDING",
"updated_at": "2023-11-07T05:31:56Z",
"api_key": "<string>",
"api_key_prefix": "<string>"
}Update a Business (admin)
Update a business’s name or status, and optionally rotate its API key (returned once). Admin endpoint.
curl --request PATCH \
--url http://localhost:8080/api/v1/businesses/{id} \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"rotate_api_key": true
}
'import requests
url = "http://localhost:8080/api/v1/businesses/{id}"
payload = {
"name": "<string>",
"rotate_api_key": True
}
headers = {"Content-Type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({name: '<string>', rotate_api_key: true})
};
fetch('http://localhost:8080/api/v1/businesses/{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_PORT => "8080",
CURLOPT_URL => "http://localhost:8080/api/v1/businesses/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'rotate_api_key' => true
]),
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 := "http://localhost:8080/api/v1/businesses/{id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"rotate_api_key\": true\n}")
req, _ := http.NewRequest("PATCH", 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.patch("http://localhost:8080/api/v1/businesses/{id}")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"rotate_api_key\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8080/api/v1/businesses/{id}")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Patch.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"rotate_api_key\": true\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"status": "PENDING",
"updated_at": "2023-11-07T05:31:56Z",
"api_key": "<string>",
"api_key_prefix": "<string>"
}Path Parameters
Business UUID
Body
Partial update for a business. Omitted fields are left unchanged.
Response
Updated; rotated API key returned ONCE
Response to a business update. api_key is present only when rotated (ONCE).
Whether a business may authenticate and transact.
Pending is the state a self-onboarded business is created in and stays in
until an operator approves it. It exists so a half-finished application has
somewhere to live: the alternative — creating the business only on approval —
means an applicant who closes the tab has nothing to come back to.
Only Active authenticates. Pending and Rejected are both refused by
[AuthenticatedBusiness], and the distinction between them is for the
operator reading the list, not for the API.
PENDING, ACTIVE, DISABLED, REJECTED Prefix of the newest live key, or None if the business has none.