Skip to content
Get started

Lookup a customer

client.Customers.Get(ctx, id, query) (*CustomerV1, error)
GET/v1/customers/{id}

Retrieves the details of an existing customer. Supply the unique customer ID that was returned from your 'create customer' request, and Straddle will return the corresponding customer information.

ParametersExpand Collapse
id string
query CustomerGetParams
CorrelationID param.Field[string]optional

Optional client generated identifier to trace and debug a series of requests.

RequestID param.Field[string]optional

Optional client generated identifier to trace and debug a request.

StraddleAccountID param.Field[string]optional

For use by platforms to specify an account id and set scope of a request.

formatuuid
ReturnsExpand Collapse
type CustomerV1 struct{…}
Data CustomerV1Data
ID string

Unique identifier for the customer.

formatuuid
CreatedAt Time

Timestamp of when the customer record was created.

formatdate-time
Email string

The customer's email address.

formatemail
Name string

Full name of the individual or business name.

Phone string

The customer's phone number in E.164 format.

Status string
One of the following:
const CustomerV1DataStatusPending CustomerV1DataStatus = "pending"
const CustomerV1DataStatusReview CustomerV1DataStatus = "review"
const CustomerV1DataStatusVerified CustomerV1DataStatus = "verified"
const CustomerV1DataStatusInactive CustomerV1DataStatus = "inactive"
const CustomerV1DataStatusRejected CustomerV1DataStatus = "rejected"
Type string
One of the following:
const CustomerV1DataTypeIndividual CustomerV1DataType = "individual"
const CustomerV1DataTypeBusiness CustomerV1DataType = "business"
UpdatedAt Time

Timestamp of the most recent update to the customer record.

formatdate-time
Address CustomerAddressV1optional

An object containing the customer's address. This is optional, but if provided, all required fields must be present.

Address1 string

Primary address line (e.g., street, PO Box).

maxLength100
City string

City, district, suburb, town, or village.

maxLength100
State string

Two-letter state code.

Zip string

Zip or postal code.

Address2 stringoptional

Secondary address line (e.g., apartment, suite, unit, or building).

maxLength100
ComplianceProfile CustomerV1DataComplianceProfileUnionoptional

PII required to trigger Patriot Act compliant KYC verification.

One of the following:
type CustomerV1DataComplianceProfileIndividualComplianceProfile struct{…}

PII required to trigger Patriot Act compliant KYC verification.

Dob Time

Masked date of birth in ****-- format.

formatdate
Ssn string

Masked Social Security Number in the format --***.

type CustomerV1DataComplianceProfileBusinessComplianceProfile struct{…}

Business registration data required to trigger Patriot Act compliant KYB verification.

Ein string

Masked Employer Identification Number in the format -*****

The official registered name of the business. This name should be correlated with the ein value.

Representatives []CustomerV1DataComplianceProfileBusinessComplianceProfileRepresentativeoptional

A list of people related to the company. Only valid where customer type is 'business'.

Name string
Email stringoptional
Phone stringoptional
Website stringoptional

Official business website URL. Optional but recommended for enhanced KYB.

formaturi
Config CustomerV1DataConfigoptional
ProcessingMethod stringoptional
One of the following:
const CustomerV1DataConfigProcessingMethodInline CustomerV1DataConfigProcessingMethod = "inline"
const CustomerV1DataConfigProcessingMethodBackground CustomerV1DataConfigProcessingMethod = "background"
const CustomerV1DataConfigProcessingMethodSkip CustomerV1DataConfigProcessingMethod = "skip"
SandboxOutcome stringoptional
One of the following:
const CustomerV1DataConfigSandboxOutcomeStandard CustomerV1DataConfigSandboxOutcome = "standard"
const CustomerV1DataConfigSandboxOutcomeVerified CustomerV1DataConfigSandboxOutcome = "verified"
const CustomerV1DataConfigSandboxOutcomeRejected CustomerV1DataConfigSandboxOutcome = "rejected"
const CustomerV1DataConfigSandboxOutcomeReview CustomerV1DataConfigSandboxOutcome = "review"
Device CustomerV1DataDeviceoptional
IPAddress string

The customer's IP address at the time of profile creation. Use 0.0.0.0 to represent an offline customer registration.

minLength1
formatipv4
ExternalID stringoptional

Unique identifier for the customer in your database, used for cross-referencing between Straddle and your systems.

Metadata map[string, string]optional

Up to 20 additional user-defined key-value pairs. Useful for storing additional information about the customer in a structured format.

Metadata about the API request, including an identifier and timestamp.

APIRequestID string

Unique identifier for this API request, useful for troubleshooting.

formatuuid
APIRequestTimestamp Time

Timestamp for this API request, useful for troubleshooting.

formatdate-time
ResponseType CustomerV1ResponseType

Indicates the structure of the returned content.

  • "object" means the data field contains a single JSON object.
  • "array" means the data field contains an array of objects.
  • "error" means the data field contains an error object with details of the issue.
  • "none" means no data is returned.
One of the following:
const CustomerV1ResponseTypeObject CustomerV1ResponseType = "object"
const CustomerV1ResponseTypeArray CustomerV1ResponseType = "array"
const CustomerV1ResponseTypeError CustomerV1ResponseType = "error"
const CustomerV1ResponseTypeNone CustomerV1ResponseType = "none"

Lookup a customer

package main

import (
  "context"
  "fmt"

  "github.com/straddleio/straddle-go"
  "github.com/straddleio/straddle-go/option"
)

func main() {
  client := straddle.NewClient(
    option.WithAPIKey("My API Key"),
  )
  customerV1, err := client.Customers.Get(
    context.TODO(),
    "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
    straddle.CustomerGetParams{

    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", customerV1.Data)
}
{
  "data": {
    "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
    "created_at": "2019-12-27T18:11:19.117Z",
    "email": "ron.swanson@pawnee.com",
    "name": "Ron Swanson",
    "phone": "+12128675309",
    "status": "pending",
    "type": "individual",
    "updated_at": "2019-12-27T18:11:19.117Z",
    "address": {
      "address1": "123 Main St",
      "city": "Anytown",
      "state": "CA",
      "zip": "12345",
      "address2": "Apt 1"
    },
    "compliance_profile": {
      "dob": "2019-12-27",
      "ssn": "***-**-****"
    },
    "config": {
      "processing_method": "inline",
      "sandbox_outcome": "standard"
    },
    "device": {
      "ip_address": "192.168.1.1"
    },
    "external_id": "external_id",
    "metadata": {
      "foo": "string"
    }
  },
  "meta": {
    "api_request_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
    "api_request_timestamp": "2019-12-27T18:11:19.117Z"
  },
  "response_type": "object"
}
Returns Examples
{
  "data": {
    "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
    "created_at": "2019-12-27T18:11:19.117Z",
    "email": "ron.swanson@pawnee.com",
    "name": "Ron Swanson",
    "phone": "+12128675309",
    "status": "pending",
    "type": "individual",
    "updated_at": "2019-12-27T18:11:19.117Z",
    "address": {
      "address1": "123 Main St",
      "city": "Anytown",
      "state": "CA",
      "zip": "12345",
      "address2": "Apt 1"
    },
    "compliance_profile": {
      "dob": "2019-12-27",
      "ssn": "***-**-****"
    },
    "config": {
      "processing_method": "inline",
      "sandbox_outcome": "standard"
    },
    "device": {
      "ip_address": "192.168.1.1"
    },
    "external_id": "external_id",
    "metadata": {
      "foo": "string"
    }
  },
  "meta": {
    "api_request_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
    "api_request_timestamp": "2019-12-27T18:11:19.117Z"
  },
  "response_type": "object"
}