Customers
4 operations under customers. Examples read $API and $KEY from your shell.
GET /v1/customers
Parameters
kyc_statusstring optional in query, one of pending, approved, info_requested, rejectedexternal_idstring optional in querylimitinteger required in querystarting_afterstring optional in query
Responses
200 Default Response
object
dataarray requiredEach item:
objectstring required one ofcustomeridstring requiredtypestring required one ofindividual,businessnamestring requiredemailstring required (nullable)countrystring requiredexternal_idstring required (nullable)kyc_statusstring required one ofpending,approved,info_requested,rejectedkyc_reasonstring required (nullable)metadataobject requiredversioninteger requiredcreated_atstring requiredupdated_atstring required
has_moreboolean required
Errors are RFC 9457 problem documents (application/problem+json).
curl
curl -s \
"$API/v1/customers?limit=1" \
-H "authorization: Bearer $KEY"SDK
import { createScrClient } from "@scr/sdk";
// The client sends the API key for you.
const client = createScrClient({ baseUrl: process.env.API!, apiKey: process.env.KEY! });
const { data, error } = await client.GET("/v1/customers", {
params: { query: { limit: 1 } },
});POST /v1/customers
Send an Idempotency-Key header on every POST so a retry never repeats the request.
Request body
application/json, required
object
typestring required one ofindividual,businessnamestring requiredemailstring optionalcountrystring requiredexternal_idstring optionalmetadataobject optional
Responses
201 Default Response
object
objectstring required one ofcustomeridstring requiredtypestring required one ofindividual,businessnamestring requiredemailstring required (nullable)countrystring requiredexternal_idstring required (nullable)kyc_statusstring required one ofpending,approved,info_requested,rejectedkyc_reasonstring required (nullable)metadataobject requiredversioninteger requiredcreated_atstring requiredupdated_atstring required
Errors are RFC 9457 problem documents (application/problem+json).
curl
curl -s \
-X POST \
"$API/v1/customers" \
-H "authorization: Bearer $KEY" \
-H "idempotency-key: $(uuidgen)" \
-H "content-type: application/json" \
-d '{"type":"individual","name":"<name>","country":"<country>"}'SDK
import { createScrClient } from "@scr/sdk";
// The client sends the API key and an Idempotency-Key for you.
const client = createScrClient({ baseUrl: process.env.API!, apiKey: process.env.KEY! });
const { data, error } = await client.POST("/v1/customers", {
body: {
"type": "individual",
"name": "<name>",
"country": "<country>"
},
});GET /v1/customers/{id}
Parameters
idstring required in path
Responses
200 Default Response
object
objectstring required one ofcustomeridstring requiredtypestring required one ofindividual,businessnamestring requiredemailstring required (nullable)countrystring requiredexternal_idstring required (nullable)kyc_statusstring required one ofpending,approved,info_requested,rejectedkyc_reasonstring required (nullable)metadataobject requiredversioninteger requiredcreated_atstring requiredupdated_atstring required
Errors are RFC 9457 problem documents (application/problem+json).
curl
curl -s \
"$API/v1/customers/$ID" \
-H "authorization: Bearer $KEY"SDK
import { createScrClient } from "@scr/sdk";
// The client sends the API key for you.
const client = createScrClient({ baseUrl: process.env.API!, apiKey: process.env.KEY! });
const { data, error } = await client.GET("/v1/customers/{id}", {
params: { path: { id: "<id>" } },
});PATCH /v1/customers/{id}
Parameters
idstring required in path
Request body
application/json, required
object
namestring optionalemailstring optional (nullable)countrystring optionalexternal_idstring optional (nullable)metadataobject optional
Responses
200 Default Response
object
objectstring required one ofcustomeridstring requiredtypestring required one ofindividual,businessnamestring requiredemailstring required (nullable)countrystring requiredexternal_idstring required (nullable)kyc_statusstring required one ofpending,approved,info_requested,rejectedkyc_reasonstring required (nullable)metadataobject requiredversioninteger requiredcreated_atstring requiredupdated_atstring required
Errors are RFC 9457 problem documents (application/problem+json).
curl
curl -s \
-X PATCH \
"$API/v1/customers/$ID" \
-H "authorization: Bearer $KEY" \
-H "content-type: application/json" \
-d '{}'SDK
import { createScrClient } from "@scr/sdk";
// The client sends the API key for you.
const client = createScrClient({ baseUrl: process.env.API!, apiKey: process.env.KEY! });
const { data, error } = await client.PATCH("/v1/customers/{id}", {
params: { path: { id: "<id>" } },
body: {},
});