Skip to main content
PUT
/
buyers
/
{buyer_id}
Update buyer
using RestSharp;


var options = new RestClientOptions("https://api.sandbox.{id}.gr4vy.app/buyers/{buyer_id}");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("Authorization", "Bearer <token>");
request.AddJsonBody("{}", false);
var response = await client.PutAsync(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}"

payload := strings.NewReader("{}")

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(string(body))

}
HttpResponse<String> response = Unirest.put("https://api.sandbox.{id}.gr4vy.app/buyers/{buyer_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{}")
.asString();
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sandbox.{id}.gr4vy.app/buyers/{buyer_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([

]),
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}"

payload = {}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

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

print(response.text)
const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({})
};

fetch('https://api.sandbox.{id}.gr4vy.app/buyers/{buyer_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
curl --request PUT \
--url https://api.sandbox.{id}.gr4vy.app/buyers/{buyer_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{}'
{
  "type": "buyer",
  "id": "fe26475d-ec3e-4884-9553-f7356683f7f9",
  "billing_details": {
    "type": "billing-details",
    "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"
    },
    "tax_id": {
      "value": "12345678931",
      "kind": "gb.vat"
    }
  },
  "created_at": "2013-07-16T19:23:00.000+00:00",
  "display_name": "John L.",
  "external_identifier": "user-789123",
  "merchant_account_id": "default",
  "updated_at": "2013-07-16T19:23:00.000+00:00",
  "account_number": "1234567"
}
{
"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": []
}
{
"type": "error",
"code": "not_found",
"status": 404,
"message": "The resource could not be found",
"details": []
}
{
"type": "error",
"code": "duplicate_record",
"status": 409,
"message": "A duplicate record exists with this external_identifier value",
"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

A request to update a buyer.

external_identifier
string | null

An external identifier that can be used to match the buyer against your own records. This value needs to be unique for all buyers.

Required string length: 1 - 200
Example:

"user-789123"

display_name
string | null

A unique name for this buyer which is used in the Gr4vy admin panel to give a buyer a human readable name.

Required string length: 1 - 200
Example:

"John L."

billing_details
Billing Details (Update) · object | null

The billing details of the buyer.

Response

Returns the updated buyer record.

type
enum<string>

The type of this resource. Is always buyer.

Available options:
buyer
Example:

"buyer"

id
string<uuid>

The unique Gr4vy ID for this buyer.

Example:

"fe26475d-ec3e-4884-9553-f7356683f7f9"

billing_details
Billing details · object | null

The billing details associated with a buyer.

created_at
string<date-time>

The date and time when this buyer was created in our system.

Example:

"2013-07-16T19:23:00.000+00:00"

display_name
string | null

A unique name for this buyer which is used in the Gr4vy admin panel to give a buyer a human readable name.

Required string length: 1 - 200
Example:

"John L."

external_identifier
string | null

An external identifier that can be used to match the buyer against your own records.

Required string length: 1 - 200
Example:

"user-789123"

merchant_account_id
string

The unique ID for a merchant account.

Example:

"default"

updated_at
string<date-time>

The date and time when this buyer was last updated in our system.

Example:

"2013-07-16T19:23:00.000+00:00"

account_number
string | null

The source account number to perform an account funding transaction.

Required string length: 1 - 255
Example:

"1234567"