Skip to main content
POST
/
buyers
C#
using Gr4vy;
using Gr4vy.Models.Components;

var sdk = new Gr4vySDK(
    id: "example",
    server: SDKConfig.Server.Sandbox,
    bearerAuthSource: Auth.WithToken(privateKey),
    merchantAccountId: "default"
);

var res = await sdk.Buyers.CreateAsync(buyerCreate: new BuyerCreate() {});

// handle response
{
  "type": "buyer",
  "id": "fe26475d-ec3e-4884-9553-f7356683f7f9",
  "merchant_account_id": "default",
  "display_name": "John Doe",
  "external_identifier": "buyer-12345",
  "billing_details": {
    "first_name": "John",
    "last_name": "Doe",
    "email_address": "[email protected]",
    "phone_number": "+1234567890",
    "address": {
      "city": "San Jose",
      "country": "US",
      "postal_code": "94560",
      "state": "California",
      "state_code": "US-CA",
      "house_number_or_name": "10",
      "line1": "Stafford Appartments",
      "line2": "29th Street",
      "organization": "Gr4vy"
    },
    "tax_id": {
      "value": "12345678931",
      "kind": "us.ein"
    }
  },
  "account_number": "<string>",
  "created_at": "2013-07-16T19:23:00.000+00:00",
  "updated_at": "2013-07-16T19:23:00.000+00:00"
}
This endpoint requires the buyers.write scope.

Authorizations

Authorization
string
header
required

Headers

x-gr4vy-merchant-account-id
string | null
Examples:

Body

application/json
display_name
string | null
Required string length: 1 - 200
Examples:
external_identifier
string | null
Required string length: 1 - 200
Examples:
billing_details
object | null
account_number
string | null
Required string length: 1 - 200

Response

merchant_account_id
string
required
Examples:
created_at
string<date-time>
required
Examples:
updated_at
string<date-time>
required
Examples:
type
string
default:buyer
Allowed value: "buyer"
Examples:
id
string<uuid> | null
Examples:
display_name
string | null
Required string length: 1 - 200
Examples:
external_identifier
string | null
Required string length: 1 - 200
Examples:
billing_details
object | null
account_number
string | null
Required string length: 1 - 200