Skip to main content
cURL
curl --request POST \
  --url https://api.grainfinance.co/v1/customers/{customerId}/update \
  --header 'Authorization: Basic <encoded-value>' \
  --header 'Content-Type: application/json' \
  --data @- <<EOF
{
  "contactEmail": "customer@company.com",
  "contactFullName": "Garrick Ollivander",
  "contactPhoneNumber": "+12125551234",
  "companyName": "Ollivander's Wand Shop",
  "companyAddress": "12 Diagon Alley",
  "companyCity": "London",
  "companyState": "London",
  "companyCountry": "GB",
  "companyTaxId": "123-45-6789",
  "externalCustomerId": "630231b3ae0d7e9e5097ad35",
  "extraFields": {
    "field_a": "value_a",
    "field_b": "value_b"
  }
}
EOF
{
  "message": "Can't perform this action",
  "reason": "Supplied object is in *Cancelled* state, which prevents performing this action"
}

Documentation Index

Fetch the complete documentation index at: https://docs.grainfinance.co/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

Authorization
string
header
required

Basic authentication using the partner API keys from https://console.grainfinance.co/api-keys

Path Parameters

customerId
string<uuid>
required

The id of the customer within the Grain platform. Stringified UUIDv4. See RFC 4112

Pattern: [0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-4[0-9A-Fa-f]{3}-[89ABab][0-9A-Fa-f]{3}-[0-9A-Fa-f]{12}

Body

application/json

The payload required in order to update a customer

The payload required in order to update a customer

contactEmail
string

The email for the company's primary contact

Example:

"customer@company.com"

contactFullName
string

The name of the company's primary contact

Example:

"Garrick Ollivander"

contactPhoneNumber
string

The phone number of the company's primary contact

Example:

"+12125551234"

companyName
string

The legal name of the customer's company

Example:

"Ollivander's Wand Shop"

companyAddress
string

The address of the company

Example:

"12 Diagon Alley"

companyCity
string

The city of the company

Example:

"London"

companyState
string

The state the company is in (US based)

Example:

"London"

companyCountry
string

The alpha-2 ISO 3166 country code of the entity's country.

Pattern: ^[A-Za-z]{2}$
Example:

"GB"

companyTaxId
string

The tax identification or registration number of the company

Example:

"123-45-6789"

externalCustomerId
string

The id used to identify the customer within your platform

Example:

"630231b3ae0d7e9e5097ad35"

extraFields
object

Additional fields that provide further details about the customer. These fields should be specified as a valid JSON object.

Example:
{
"field_a": "value_a",
"field_b": "value_b"
}

Response

Customer has been Updated