Skip to content

Customers

Customer objects allow you to perform recurring charges and track multiple charges for the same customer. They are essential for any business model involving subscriptions or repeat purchases.

Creating a Customer

Create a customer to store their details and attach payment methods.

Request Example

bash
curl https://api.paylinker.com/v1/customers \
  -u sk_test_4eC39HqLyjWDarjtT1zdp7dc: \
  -d email="[email protected]" \
  -d name="Jenny Rosen" \
  -d description="Customer for Jenny Rosen"

Saving Payment Methods

To save a card for future use, you must attach a PaymentMethod to a Customer.

  1. Create a PaymentMethod (usually via the client-side SDK).
  2. Attach it to the Customer via the API.
bash
curl https://api.paylinker.com/v1/payment_methods/pm_1F7.../attach \
  -u sk_test_4eC39HqLyjWDarjtT1zdp7dc: \
  -d customer=cus_1F7...

Managing Customers

You can update customer information, delete customers, or list all customers.

  • Update: Change email, shipping address, or metadata.
  • Delete: Permanently remove a customer. This cannot be undone.

Metadata

You can attach key-value pairs to customers to store internal IDs (e.g., your database's user_id).

bash
curl https://api.paylinker.com/v1/customers/cus_1F7... \
  -u sk_test_4eC39HqLyjWDarjtT1zdp7dc: \
  -d "metadata[internal_id]"=42

Released under the MIT License.