Customers

Create and manage customers with the Shika Creators API.

Customers API

Customers allow you to save payment information for repeat purchases, track payment history, and manage subscriptions.

The Customer Object

{
  "id": "cus_abc123def456",
  "object": "customer",
  "email": "customer@example.com",
  "name": "John Doe",
  "phone": "0241234567",
  "description": "VIP customer",
  "metadata": {
    "user_id": "123"
  },
  "created_at": "2024-01-15T10:00:00Z"
}

Attributes

AttributeTypeDescription
idstringUnique identifier for the customer
objectstringAlways "customer"
emailstringCustomer's email address
namestringCustomer's full name
phonestringCustomer's phone number
descriptionstringDescription of the customer
metadataobjectCustom key-value pairs
created_atstringISO 8601 timestamp

Create a Customer

Creates a new customer.

POST /v1/customers

Request Body

ParameterTypeRequiredDescription
emailstringNoCustomer's email address
namestringNoCustomer's full name
phonestringNoCustomer's phone number
descriptionstringNoDescription of the customer
metadataobjectNoCustom metadata
curl -X POST https://api.shikacreators.com/v1/customers \
  -H "Authorization: Bearer sk_test_..." \
  -H "Content-Type: application/json" \
  -d '{
    "email": "customer@example.com",
    "name": "John Doe",
    "phone": "0241234567",
    "description": "VIP customer",
    "metadata": {
      "user_id": "123"
    }
  }'
const customer = await shikacreators.customers.create({
  email: 'customer@example.com',
  name: 'John Doe',
  phone: '0241234567',
  description: 'VIP customer',
  metadata: {
    user_id: '123'
  }
})
customer = client.customers.create(
    email='customer@example.com',
    name='John Doe',
    phone='0241234567',
    description='VIP customer',
    metadata={'user_id': '123'}
)
$customer = $shikacreators->customers->create([
    'email' => 'customer@example.com',
    'name' => 'John Doe',
    'phone' => '0241234567',
    'description' => 'VIP customer',
    'metadata' => ['user_id' => '123']
]);

Response

{
  "id": "cus_abc123def456",
  "object": "customer",
  "email": "customer@example.com",
  "name": "John Doe",
  "phone": "0241234567",
  "description": "VIP customer",
  "metadata": {
    "user_id": "123"
  },
  "created_at": "2024-01-15T10:00:00Z"
}

Retrieve a Customer

Retrieves a customer by ID.

GET /v1/customers/:id
curl https://api.shikacreators.com/v1/customers/cus_abc123def456 \
  -H "Authorization: Bearer sk_test_..."
const customer = await shikacreators.customers.retrieve('cus_abc123def456')
customer = client.customers.retrieve('cus_abc123def456')

Update a Customer

Updates a customer's information.

PATCH /v1/customers/:id

Request Body

ParameterTypeDescription
emailstringCustomer's email address
namestringCustomer's full name
phonestringCustomer's phone number
descriptionstringDescription of the customer
metadataobjectCustom metadata
curl -X PATCH https://api.shikacreators.com/v1/customers/cus_abc123def456 \
  -H "Authorization: Bearer sk_test_..." \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Jane Doe",
    "description": "Updated description",
    "metadata": {
      "vip": "true"
    }
  }'
const customer = await shikacreators.customers.update('cus_abc123def456', {
  name: 'Jane Doe',
  description: 'Updated description',
  metadata: { vip: 'true' }
})
customer = client.customers.update('cus_abc123def456',
    name='Jane Doe',
    description='Updated description',
    metadata={'vip': 'true'}
)

Delete a Customer

Deletes a customer.

DELETE /v1/customers/:id

Deleting a customer will cancel all active subscriptions and remove payment history association.

curl -X DELETE https://api.shikacreators.com/v1/customers/cus_abc123def456 \
  -H "Authorization: Bearer sk_test_..."
const deleted = await shikacreators.customers.delete('cus_abc123def456')
deleted = client.customers.delete('cus_abc123def456')

Response

{
  "id": "cus_abc123def456",
  "object": "customer",
  "deleted": true
}

List Customers

Returns a list of customers.

GET /v1/customers

Query Parameters

ParameterTypeDescription
limitintegerNumber of results (1-100, default 10)
starting_afterstringCursor for pagination
ending_beforestringCursor for pagination
emailstringFilter by email
created[gte]stringFilter by creation date
created[lte]stringFilter by creation date
curl "https://api.shikacreators.com/v1/customers?limit=10" \
  -H "Authorization: Bearer sk_test_..."
const customers = await shikacreators.customers.list({
  limit: 10
})

// Iterate through all customers
for await (const customer of shikacreators.customers.list()) {
  console.log(customer.id)
}
customers = client.customers.list(limit=10)

# Iterate through all customers
for customer in client.customers.list():
    print(customer.id)

Response

{
  "object": "list",
  "data": [
    {
      "id": "cus_abc123def456",
      "object": "customer",
      "email": "customer@example.com",
      "name": "John Doe",
      ...
    }
  ],
  "has_more": true,
  "url": "/v1/customers"
}

List Customer Payments

Returns all payments for a customer by filtering the payments list.

GET /v1/payments?customer=cus_abc123def456
curl "https://api.shikacreators.com/v1/payments?customer=cus_abc123def456" \
  -H "Authorization: Bearer sk_test_..."
const payments = await shikacreators.payments.list({
  customer: 'cus_abc123def456'
})
payments = client.payments.list(customer='cus_abc123def456')

List Customer Subscriptions

Returns all subscriptions for a customer by filtering the subscriptions list.

GET /v1/subscriptions?customer=cus_abc123def456
curl "https://api.shikacreators.com/v1/subscriptions?customer=cus_abc123def456" \
  -H "Authorization: Bearer sk_test_..."
const subscriptions = await shikacreators.subscriptions.list({
  customer: 'cus_abc123def456'
})
subscriptions = client.subscriptions.list(customer='cus_abc123def456')