Skip to main content
POST
/
buyers
/
{buyer_id}
/
shipping-details
New buyer shipping detail
using RestSharp;


var options = new RestClientOptions("https://api.sandbox.{id}.gr4vy.app/buyers/{buyer_id}/shipping-details");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "Bearer <token>");
request.AddJsonBody("{\n  \"first_name\": \"John\",\n  \"last_name\": \"Lunn\",\n  \"email_address\": \"john@example.com\",\n  \"phone_number\": \"+1234567890\",\n  \"address\": {\n    \"city\": \"London\",\n    \"country\": \"GB\",\n    \"postal_code\": \"789123\",\n    \"state\": \"Greater London\",\n    \"state_code\": \"GB-LND\",\n    \"house_number_or_name\": \"10\",\n    \"line1\": \"10 Oxford Street\",\n    \"line2\": \"New Oxford Court\",\n    \"organization\": \"Gr4vy\"\n  }\n}", false);
var response = await client.PostAsync(request);

Console.WriteLine("{0}", response.Content);
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://api.sandbox.{id}.gr4vy.app/buyers/{buyer_id}/shipping-details"

payload := strings.NewReader("{\n \"first_name\": \"John\",\n \"last_name\": \"Lunn\",\n \"email_address\": \"john@example.com\",\n \"phone_number\": \"+1234567890\",\n \"address\": {\n \"city\": \"London\",\n \"country\": \"GB\",\n \"postal_code\": \"789123\",\n \"state\": \"Greater London\",\n \"state_code\": \"GB-LND\",\n \"house_number_or_name\": \"10\",\n \"line1\": \"10 Oxford Street\",\n \"line2\": \"New Oxford Court\",\n \"organization\": \"Gr4vy\"\n }\n}")

req, _ := http.NewRequest("POST", 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(string(body))

}
HttpResponse<String> response = Unirest.post("https://api.sandbox.{id}.gr4vy.app/buyers/{buyer_id}/shipping-details")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"first_name\": \"John\",\n \"last_name\": \"Lunn\",\n \"email_address\": \"john@example.com\",\n \"phone_number\": \"+1234567890\",\n \"address\": {\n \"city\": \"London\",\n \"country\": \"GB\",\n \"postal_code\": \"789123\",\n \"state\": \"Greater London\",\n \"state_code\": \"GB-LND\",\n \"house_number_or_name\": \"10\",\n \"line1\": \"10 Oxford Street\",\n \"line2\": \"New Oxford Court\",\n \"organization\": \"Gr4vy\"\n }\n}")
.asString();
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sandbox.{id}.gr4vy.app/buyers/{buyer_id}/shipping-details",
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([
'first_name' => 'John',
'last_name' => 'Lunn',
'email_address' => 'john@example.com',
'phone_number' => '+1234567890',
'address' => [
'city' => 'London',
'country' => 'GB',
'postal_code' => '789123',
'state' => 'Greater London',
'state_code' => 'GB-LND',
'house_number_or_name' => '10',
'line1' => '10 Oxford Street',
'line2' => 'New Oxford Court',
'organization' => 'Gr4vy'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
import requests

url = "https://api.sandbox.{id}.gr4vy.app/buyers/{buyer_id}/shipping-details"

payload = {
"first_name": "John",
"last_name": "Lunn",
"email_address": "john@example.com",
"phone_number": "+1234567890",
"address": {
"city": "London",
"country": "GB",
"postal_code": "789123",
"state": "Greater London",
"state_code": "GB-LND",
"house_number_or_name": "10",
"line1": "10 Oxford Street",
"line2": "New Oxford Court",
"organization": "Gr4vy"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
first_name: 'John',
last_name: 'Lunn',
email_address: 'john@example.com',
phone_number: '+1234567890',
address: {
city: 'London',
country: 'GB',
postal_code: '789123',
state: 'Greater London',
state_code: 'GB-LND',
house_number_or_name: '10',
line1: '10 Oxford Street',
line2: 'New Oxford Court',
organization: 'Gr4vy'
}
})
};

fetch('https://api.sandbox.{id}.gr4vy.app/buyers/{buyer_id}/shipping-details', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
curl --request POST \
--url https://api.sandbox.{id}.gr4vy.app/buyers/{buyer_id}/shipping-details \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"first_name": "John",
"last_name": "Lunn",
"email_address": "john@example.com",
"phone_number": "+1234567890",
"address": {
"city": "London",
"country": "GB",
"postal_code": "789123",
"state": "Greater London",
"state_code": "GB-LND",
"house_number_or_name": "10",
"line1": "10 Oxford Street",
"line2": "New Oxford Court",
"organization": "Gr4vy"
}
}
'
{
  "type": "shipping-details",
  "id": "8724fd24-5489-4a5d-90fd-0604df7d3b83",
  "buyer_id": "8724fd24-5489-4a5d-90fd-0604df7d3b83",
  "first_name": "John",
  "last_name": "Lunn",
  "email_address": "john@example.com",
  "phone_number": "+1234567890",
  "address": {
    "city": "London",
    "country": "GB",
    "postal_code": "789123",
    "state": "Greater London",
    "state_code": "GB-LND",
    "house_number_or_name": "10",
    "line1": "10 Oxford Street",
    "line2": "New Oxford Court",
    "organization": "Gr4vy"
  }
}
{
"type": "error",
"code": "bad_request",
"status": 400,
"message": "Missing '****' field",
"details": [
{
"location": "body",
"type": "value_error.missing",
"pointer": "/payment_method/number",
"message": "field required"
}
]
}
{
"type": "error",
"code": "unauthorized",
"status": 401,
"message": "No valid API authentication found",
"details": []
}
This endpoint requires the buyers.write scope.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

buyer_id
string<uuid>
required

The unique ID for a buyer.

Example:

"8724fd24-5489-4a5d-90fd-0604df7d3b83"

Body

application/json

Shipping detail associated to a buyer.

first_name
string | null

The first name(s) or given name for the buyer.

Required string length: 1 - 255
Example:

"John"

last_name
string | null

The last name, or family name, of the buyer.

Required string length: 1 - 255
Example:

"Lunn"

email_address
string | null

The email address for the buyer.

Required string length: 1 - 320
Example:

"john@example.com"

phone_number
string | null

The phone number for the buyer which should be formatted according to the E164 number standard.

Required string length: 1 - 50
Pattern: ^\+[1-9]\d{1,14}$
Example:

"+1234567890"

address
Address · object | null

The physical shipping address associated to this buyer.

Response

Returns the shipping detail that was added.

Shipping detail for a buyer.

type
enum<string>

The type of this resource. Is always shipping-details.

Available options:
shipping-details
Example:

"shipping-details"

id
string<uuid>

The unique ID for a buyer's shipping detail.

Example:

"8724fd24-5489-4a5d-90fd-0604df7d3b83"

buyer_id
string<uuid>

The unique ID for a buyer.

Example:

"8724fd24-5489-4a5d-90fd-0604df7d3b83"

first_name
string | null

The first name(s) or given name of the buyer.

Required string length: 1 - 255
Example:

"John"

last_name
string | null

The last name, or family name, of the buyer.

Required string length: 1 - 255
Example:

"Lunn"

email_address
string | null

The email address of the buyer.

Required string length: 1 - 320
Example:

"john@example.com"

phone_number
string | null

The phone number of the buyer. This number is formatted according to the E164 number standard.

Required string length: 1 - 50
Pattern: ^\+[1-9]\d{1,14}$
Example:

"+1234567890"

address
Address · object | null

The physical shipping address associated to this buyer.