Change the delivery address
- Production and sandbox. The token decides the environment.
https://api.beautyrouter.com/v1/orders/{orderId}/delivery-address
using System.Net.Http.Headers;var client = new HttpClient();var request = new HttpRequestMessage{ Method = HttpMethod.Put, RequestUri = new Uri("https://api.beautyrouter.com/v1/orders/order-8Jd3kFs6Gh/delivery-address"), Headers = { { "Authorization", "Bearer <token>" }, }, Content = new StringContent("{ \"line1\": \"2210 Pearl St\", \"city\": \"Boulder\", \"state\": \"CO\", \"postalCode\": \"80302\", \"country\": \"US\", \"phone\": \"+13035550187\" }") { Headers = { ContentType = new MediaTypeHeaderValue("application/json") } }};using (var response = await client.SendAsync(request)){ response.EnsureSuccessStatusCode(); var body = await response.Content.ReadAsStringAsync(); Console.WriteLine(body);}package main
import ( "fmt" "strings" "net/http" "io")
func main() {
url := "https://api.beautyrouter.com/v1/orders/order-8Jd3kFs6Gh/delivery-address"
payload := strings.NewReader("{ \"line1\": \"2210 Pearl St\", \"city\": \"Boulder\", \"state\": \"CO\", \"postalCode\": \"80302\", \"country\": \"US\", \"phone\": \"+13035550187\" }")
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(res) fmt.Println(string(body))
}OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");RequestBody body = RequestBody.create(mediaType, "{ \"line1\": \"2210 Pearl St\", \"city\": \"Boulder\", \"state\": \"CO\", \"postalCode\": \"80302\", \"country\": \"US\", \"phone\": \"+13035550187\" }");Request request = new Request.Builder() .url("https://api.beautyrouter.com/v1/orders/order-8Jd3kFs6Gh/delivery-address") .put(body) .addHeader("Authorization", "Bearer <token>") .addHeader("Content-Type", "application/json") .build();
Response response = client.newCall(request).execute();import axios from 'axios';
const options = { method: 'PUT', url: 'https://api.beautyrouter.com/v1/orders/order-8Jd3kFs6Gh/delivery-address', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, data: { line1: '2210 Pearl St', city: 'Boulder', state: 'CO', postalCode: '80302', country: 'US', phone: '+13035550187' }};
try { const { data } = await axios.request(options); console.log(data);} catch (error) { console.error(error);}const url = 'https://api.beautyrouter.com/v1/orders/order-8Jd3kFs6Gh/delivery-address';const options = { method: 'PUT', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"line1":"2210 Pearl St","city":"Boulder","state":"CO","postalCode":"80302","country":"US","phone":"+13035550187"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")val body = RequestBody.create(mediaType, "{ \"line1\": \"2210 Pearl St\", \"city\": \"Boulder\", \"state\": \"CO\", \"postalCode\": \"80302\", \"country\": \"US\", \"phone\": \"+13035550187\" }")val request = Request.Builder() .url("https://api.beautyrouter.com/v1/orders/order-8Jd3kFs6Gh/delivery-address") .put(body) .addHeader("Authorization", "Bearer <token>") .addHeader("Content-Type", "application/json") .build()
val response = client.newCall(request).execute()<?php
$client = new \GuzzleHttp\Client();
$response = $client->request('PUT', 'https://api.beautyrouter.com/v1/orders/order-8Jd3kFs6Gh/delivery-address', [ 'body' => '{ "line1": "2210 Pearl St", "city": "Boulder", "state": "CO", "postalCode": "80302", "country": "US", "phone": "+13035550187" }', 'headers' => [ 'Authorization' => 'Bearer <token>', 'Content-Type' => 'application/json', ],]);
echo $response->getBody();import requests
url = "https://api.beautyrouter.com/v1/orders/order-8Jd3kFs6Gh/delivery-address"
payload = { "line1": "2210 Pearl St", "city": "Boulder", "state": "CO", "postalCode": "80302", "country": "US", "phone": "+13035550187"}headers = { "Authorization": "Bearer <token>", "Content-Type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.json())require 'uri'require 'net/http'
url = URI("https://api.beautyrouter.com/v1/orders/order-8Jd3kFs6Gh/delivery-address")
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 = "{ \"line1\": \"2210 Pearl St\", \"city\": \"Boulder\", \"state\": \"CO\", \"postalCode\": \"80302\", \"country\": \"US\", \"phone\": \"+13035550187\" }"
response = http.request(request)puts response.read_bodycurl --request PUT \ --url https://api.beautyrouter.com/v1/orders/order-8Jd3kFs6Gh/delivery-address \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "line1": "2210 Pearl St", "city": "Boulder", "state": "CO", "postalCode": "80302", "country": "US", "phone": "+13035550187" }'import Foundation
let headers = [ "Authorization": "Bearer <token>", "Content-Type": "application/json"]let parameters = [ "line1": "2210 Pearl St", "city": "Boulder", "state": "CO", "postalCode": "80302", "country": "US", "phone": "+13035550187"] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "https://api.beautyrouter.com/v1/orders/order-8Jd3kFs6Gh/delivery-address")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0)request.httpMethod = "PUT"request.allHTTPHeaderFields = headersrequest.httpBody = postData as Data
let session = URLSession.sharedlet dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) }})
dataTask.resume()Changes the delivery address of an order with the status draft or pending_verification. A placed order cannot
change its address, because the brand or distributor starts preparing it right away. Another status fails with
order_action_not_allowed. Send the full address. This changes the order only, not the company’s default address.
A carrier must be able to deliver to the address, and the company must have a license in that state. Every hazardous product in the order must be able to go there, and the brand or distributor must ship there.
Beauty Router recalculates the sales tax, so total can change. A pending_verification order keeps its shipping. A
draft’s shipping is worked out when it is placed.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The order ID.
Example
order-8Jd3kFs6GhRequest Bodyrequired
Section titled “Request Bodyrequired”object
Street address.
Suite, unit, or floor.
A two-letter US state code.
ZIP code.
Phone number for the delivery. Required on the company. Optional on an order, which then uses the company’s phone.
Examples
{ "line1": "2210 Pearl St", "city": "Boulder", "state": "CO", "postalCode": "80302", "country": "US", "phone": "+13035550187"}Responses
Section titled “Responses”The order with the new address.
object
The order ID.
The order number people see.
The company the order belongs to.
The user who placed the order.
draft: the order is saved for later. It holds no stock, and the supplier does not see it.
pending_verification: the company is prequalified, and the order waits until its verification ends, with no
charge yet.
payment_failed: the card charge failed, or a payment is waiting for 3-D Secure. Beauty Router tries once more
after 24 hours when the failure can be retried. If that fails too, or the failure cannot be retried, it cancels the
order at 24 hours. placed: the card was
charged, and the brand or distributor starts preparing the order right after. ready_to_ship, in_transit,
delivered, delivery_failed, and canceled follow the delivery. Only a placed order takes stock from the
supplier.
Why the order was canceled. Only on canceled orders.
The brand or distributor that fulfills the order.
object
object
The product ID.
The product name.
The wholesale price of one unit before the discount, in US dollars.
The discount on the whole line, in US dollars.
The line total, in US dollars.
The total of the lines, in US dollars.
The discount on the order, in US dollars.
The shipping charge, in US dollars: a flat amount or a carrier quote, free above the supplier’s threshold. It is
locked when the order is created. null on a draft with no address.
The sales tax, in US dollars. null on a draft with no address.
The amount the salon pays, in US dollars. It can change until the order is placed. null on a draft with no
address.
Always usd.
object
Street address.
Suite, unit, or floor.
A two-letter US state code.
ZIP code.
Phone number for the delivery. Required on the company. Optional on an order, which then uses the company’s phone.
object
The carrier’s tracking page. Left out when there is none.
The carrier. Left out when it is not known.
When the order was delivered, or null.
Example
{ "id": "order-8Jd3kFs6Gh", "number": "4821-7730", "companyId": "loc-7Hk2pQx9Lm", "userId": "user-3Vb8nWq1Rt", "status": "draft", "cancelReason": "salon", "supplier": { "id": "sup-1Ry6tUi3Op" }, "currency": "usd", "deliveryAddress": { "state": "CO", "country": "US" }}validation_failed: a field is missing or has a wrong value, or Beauty Router cannot deliver to this address.
address_state_without_license: the company has no license in this state. hazmat_destination: a hazardous
product in the order cannot go to this address. ship_to_restricted: the brand or distributor does not ship
to this address.
The body of every error response.
object
object
A stable error code.
A sentence for developers. It can change, so do not match on it.
The request field that caused the error. Only some errors have it.
Only on verification_data_missing and app_setup_incomplete. What still needs to be set.
Only on order_total_changed and order_has_problems. A fresh quote.
object
One group per supplier. Each group becomes one order.
object
object
An amount in dollars, with up to two decimal places.
The discount on the whole line, in US dollars.
An amount in dollars, with up to two decimal places.
The total of the lines, in US dollars.
The discount on the whole order, in US dollars.
object
The shipping charge in US dollars, or null when it cannot be worked out.
How much more to order for free shipping, or null when it does not apply.
The sales tax in US dollars, or null when it cannot be worked out.
object
The exemption certificate used, or null.
Why no certificate applies, or null when one does.
The amount the salon pays for this group in US dollars, or null when it cannot be worked out. Send it back as
expectedTotal. A group with problems has no expectedTotal.
now: Beauty Router charges the card when the order is created. after_verification: the company is
prequalified, so the charge waits until its verification ends.
object
What stops a group or the whole request. See Problems.
A sentence you can show. It can change, so do not match on it.
The product. Only on problems with one product.
The supplier. Only on problems with one supplier.
How many units can be ordered. Only on insufficient_stock.
The lines no supplier can take.
object
object
What stops a group or the whole request. See Problems.
A sentence you can show. It can change, so do not match on it.
The product. Only on problems with one product.
The supplier. Only on problems with one supplier.
How many units can be ordered. Only on insufficient_stock.
What stops every group.
object
What stops a group or the whole request. See Problems.
A sentence you can show. It can change, so do not match on it.
The product. Only on problems with one product.
The supplier. Only on problems with one supplier.
How many units can be ordered. Only on insufficient_stock.
The sum of all the groups in US dollars, or null when a group’s total is.
Always usd.
Examples
{ "error": { "code": "validation_failed", "message": "ein must have 9 digits.", "field": "ein" }}{ "error": { "code": "address_state_without_license", "message": "The delivery address is in a state where the company has no license." }}{ "error": { "code": "hazmat_destination", "message": "A hazardous product in this order cannot go to this address." }}{ "error": { "code": "ship_to_restricted", "message": "The brand or distributor does not ship to this address." }}invalid_user_token: the user token is missing or wrong. user_token_expired: the user token expired. Log the
user in again with POST /v1/login.
The body of every error response.
object
object
A stable error code.
A sentence for developers. It can change, so do not match on it.
The request field that caused the error. Only some errors have it.
Only on verification_data_missing and app_setup_incomplete. What still needs to be set.
Only on order_total_changed and order_has_problems. A fresh quote.
object
One group per supplier. Each group becomes one order.
object
object
An amount in dollars, with up to two decimal places.
The discount on the whole line, in US dollars.
An amount in dollars, with up to two decimal places.
The total of the lines, in US dollars.
The discount on the whole order, in US dollars.
object
The shipping charge in US dollars, or null when it cannot be worked out.
How much more to order for free shipping, or null when it does not apply.
The sales tax in US dollars, or null when it cannot be worked out.
object
The exemption certificate used, or null.
Why no certificate applies, or null when one does.
The amount the salon pays for this group in US dollars, or null when it cannot be worked out. Send it back as
expectedTotal. A group with problems has no expectedTotal.
now: Beauty Router charges the card when the order is created. after_verification: the company is
prequalified, so the charge waits until its verification ends.
object
What stops a group or the whole request. See Problems.
A sentence you can show. It can change, so do not match on it.
The product. Only on problems with one product.
The supplier. Only on problems with one supplier.
How many units can be ordered. Only on insufficient_stock.
The lines no supplier can take.
object
object
What stops a group or the whole request. See Problems.
A sentence you can show. It can change, so do not match on it.
The product. Only on problems with one product.
The supplier. Only on problems with one supplier.
How many units can be ordered. Only on insufficient_stock.
What stops every group.
object
What stops a group or the whole request. See Problems.
A sentence you can show. It can change, so do not match on it.
The product. Only on problems with one product.
The supplier. Only on problems with one supplier.
How many units can be ordered. Only on insufficient_stock.
The sum of all the groups in US dollars, or null when a group’s total is.
Always usd.
Examples
{ "error": { "code": "invalid_user_token", "message": "The user token is missing or not valid." }}{ "error": { "code": "user_token_expired", "message": "The user token expired. Log the user in again." }}user_cannot_order: the user was logged in with canOrder: false.
The body of every error response.
object
object
A stable error code.
A sentence for developers. It can change, so do not match on it.
The request field that caused the error. Only some errors have it.
Only on verification_data_missing and app_setup_incomplete. What still needs to be set.
Only on order_total_changed and order_has_problems. A fresh quote.
object
One group per supplier. Each group becomes one order.
object
object
An amount in dollars, with up to two decimal places.
The discount on the whole line, in US dollars.
An amount in dollars, with up to two decimal places.
The total of the lines, in US dollars.
The discount on the whole order, in US dollars.
object
The shipping charge in US dollars, or null when it cannot be worked out.
How much more to order for free shipping, or null when it does not apply.
The sales tax in US dollars, or null when it cannot be worked out.
object
The exemption certificate used, or null.
Why no certificate applies, or null when one does.
The amount the salon pays for this group in US dollars, or null when it cannot be worked out. Send it back as
expectedTotal. A group with problems has no expectedTotal.
now: Beauty Router charges the card when the order is created. after_verification: the company is
prequalified, so the charge waits until its verification ends.
object
What stops a group or the whole request. See Problems.
A sentence you can show. It can change, so do not match on it.
The product. Only on problems with one product.
The supplier. Only on problems with one supplier.
How many units can be ordered. Only on insufficient_stock.
The lines no supplier can take.
object
object
What stops a group or the whole request. See Problems.
A sentence you can show. It can change, so do not match on it.
The product. Only on problems with one product.
The supplier. Only on problems with one supplier.
How many units can be ordered. Only on insufficient_stock.
What stops every group.
object
What stops a group or the whole request. See Problems.
A sentence you can show. It can change, so do not match on it.
The product. Only on problems with one product.
The supplier. Only on problems with one supplier.
How many units can be ordered. Only on insufficient_stock.
The sum of all the groups in US dollars, or null when a group’s total is.
Always usd.
Examples
{ "error": { "code": "user_cannot_order", "message": "This user cannot place or change orders." }}not_found: the object does not exist, or the user has no access to it.
The body of every error response.
object
object
A stable error code.
A sentence for developers. It can change, so do not match on it.
The request field that caused the error. Only some errors have it.
Only on verification_data_missing and app_setup_incomplete. What still needs to be set.
Only on order_total_changed and order_has_problems. A fresh quote.
object
One group per supplier. Each group becomes one order.
object
object
An amount in dollars, with up to two decimal places.
The discount on the whole line, in US dollars.
An amount in dollars, with up to two decimal places.
The total of the lines, in US dollars.
The discount on the whole order, in US dollars.
object
The shipping charge in US dollars, or null when it cannot be worked out.
How much more to order for free shipping, or null when it does not apply.
The sales tax in US dollars, or null when it cannot be worked out.
object
The exemption certificate used, or null.
Why no certificate applies, or null when one does.
The amount the salon pays for this group in US dollars, or null when it cannot be worked out. Send it back as
expectedTotal. A group with problems has no expectedTotal.
now: Beauty Router charges the card when the order is created. after_verification: the company is
prequalified, so the charge waits until its verification ends.
object
What stops a group or the whole request. See Problems.
A sentence you can show. It can change, so do not match on it.
The product. Only on problems with one product.
The supplier. Only on problems with one supplier.
How many units can be ordered. Only on insufficient_stock.
The lines no supplier can take.
object
object
What stops a group or the whole request. See Problems.
A sentence you can show. It can change, so do not match on it.
The product. Only on problems with one product.
The supplier. Only on problems with one supplier.
How many units can be ordered. Only on insufficient_stock.
What stops every group.
object
What stops a group or the whole request. See Problems.
A sentence you can show. It can change, so do not match on it.
The product. Only on problems with one product.
The supplier. Only on problems with one supplier.
How many units can be ordered. Only on insufficient_stock.
The sum of all the groups in US dollars, or null when a group’s total is.
Always usd.
Examples
{ "error": { "code": "not_found", "message": "The object was not found." }}order_action_not_allowed: the order’s status does not allow this action.
The body of every error response.
object
object
A stable error code.
A sentence for developers. It can change, so do not match on it.
The request field that caused the error. Only some errors have it.
Only on verification_data_missing and app_setup_incomplete. What still needs to be set.
Only on order_total_changed and order_has_problems. A fresh quote.
object
One group per supplier. Each group becomes one order.
object
object
An amount in dollars, with up to two decimal places.
The discount on the whole line, in US dollars.
An amount in dollars, with up to two decimal places.
The total of the lines, in US dollars.
The discount on the whole order, in US dollars.
object
The shipping charge in US dollars, or null when it cannot be worked out.
How much more to order for free shipping, or null when it does not apply.
The sales tax in US dollars, or null when it cannot be worked out.
object
The exemption certificate used, or null.
Why no certificate applies, or null when one does.
The amount the salon pays for this group in US dollars, or null when it cannot be worked out. Send it back as
expectedTotal. A group with problems has no expectedTotal.
now: Beauty Router charges the card when the order is created. after_verification: the company is
prequalified, so the charge waits until its verification ends.
object
What stops a group or the whole request. See Problems.
A sentence you can show. It can change, so do not match on it.
The product. Only on problems with one product.
The supplier. Only on problems with one supplier.
How many units can be ordered. Only on insufficient_stock.
The lines no supplier can take.
object
object
What stops a group or the whole request. See Problems.
A sentence you can show. It can change, so do not match on it.
The product. Only on problems with one product.
The supplier. Only on problems with one supplier.
How many units can be ordered. Only on insufficient_stock.
What stops every group.
object
What stops a group or the whole request. See Problems.
A sentence you can show. It can change, so do not match on it.
The product. Only on problems with one product.
The supplier. Only on problems with one supplier.
How many units can be ordered. Only on insufficient_stock.
The sum of all the groups in US dollars, or null when a group’s total is.
Always usd.
Examples
{ "error": { "code": "order_action_not_allowed", "message": "This order can no longer be changed." }}internal_error: something failed on Beauty Router’s side. Try again later.
The body of every error response.
object
object
A stable error code.
A sentence for developers. It can change, so do not match on it.
The request field that caused the error. Only some errors have it.
Only on verification_data_missing and app_setup_incomplete. What still needs to be set.
Only on order_total_changed and order_has_problems. A fresh quote.
object
One group per supplier. Each group becomes one order.
object
object
An amount in dollars, with up to two decimal places.
The discount on the whole line, in US dollars.
An amount in dollars, with up to two decimal places.
The total of the lines, in US dollars.
The discount on the whole order, in US dollars.
object
The shipping charge in US dollars, or null when it cannot be worked out.
How much more to order for free shipping, or null when it does not apply.
The sales tax in US dollars, or null when it cannot be worked out.
object
The exemption certificate used, or null.
Why no certificate applies, or null when one does.
The amount the salon pays for this group in US dollars, or null when it cannot be worked out. Send it back as
expectedTotal. A group with problems has no expectedTotal.
now: Beauty Router charges the card when the order is created. after_verification: the company is
prequalified, so the charge waits until its verification ends.
object
What stops a group or the whole request. See Problems.
A sentence you can show. It can change, so do not match on it.
The product. Only on problems with one product.
The supplier. Only on problems with one supplier.
How many units can be ordered. Only on insufficient_stock.
The lines no supplier can take.
object
object
What stops a group or the whole request. See Problems.
A sentence you can show. It can change, so do not match on it.
The product. Only on problems with one product.
The supplier. Only on problems with one supplier.
How many units can be ordered. Only on insufficient_stock.
What stops every group.
object
What stops a group or the whole request. See Problems.
A sentence you can show. It can change, so do not match on it.
The product. Only on problems with one product.
The supplier. Only on problems with one supplier.
How many units can be ordered. Only on insufficient_stock.
The sum of all the groups in US dollars, or null when a group’s total is.
Always usd.
Examples
{ "error": { "code": "internal_error", "message": "Something went wrong. Try again later." }}