Skip to content
Back to skills

012 Javascript A135d189

ASecurity

```javascript // POST /v1/checkout/sessions const session = await creem.checkout.sessions.create({ product_id: 'prod_xxx', success_url: 'https://example.com/success', cancel_url: 'https://example.com/cancel', customer_email: 'user@example.com', // Optional metadata: { order_id: '123' } // Optional }); // Returns: { url: 'https://checkout.creem.io/xxx', id: 'cs_xxx' } ```

  • 9 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added October 11, 2026
developmentjavascriptjavaapi

Works with

  • cursor
  • api

Security analysis

A100/100

Scanned October 11, 2026

npx -y skills add tools-only/X-Skills --skill 012-javascript_a135d189 --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of 012 Javascript A135d189?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for 012 Javascript A135d189
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/tools-only-012-javascript-a135d189/badge)](https://www.skillsdirectory.com/skills/tools-only-012-javascript-a135d189)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

SKILL.md
# Creem.io API Reference

## Checkout Sessions

### Create Checkout Session

```javascript
// POST /v1/checkout/sessions
const session = await creem.checkout.sessions.create({
  product_id: 'prod_xxx',
  success_url: 'https://example.com/success',
  cancel_url: 'https://example.com/cancel',
  customer_email: 'user@example.com', // Optional
  metadata: { order_id: '123' }       // Optional
});
// Returns: { url: 'https://checkout.creem.io/xxx', id: 'cs_xxx' }
```

## Products

### Create Product

```javascript
// POST /v1/products
const product = await creem.products.create({
  name: 'Pro Plan',
  description: 'Full access to all features',
  price: 2900,           // Amount in cents
  currency: 'usd',
  recurring: {           // Optional - for subscriptions
    interval: 'month',
    interval_count: 1
  }
});
```

### Retrieve Product

```javascript
// GET /v1/products/:id
const product = await creem.products.retrieve('prod_xxx');
```

## Transactions

### Retrieve Transaction

```javascript
// GET /v1/transactions/:id
const transaction = await creem.transactions.retrieve('txn_xxx');
```

### List Transactions

```javascript
// GET /v1/transactions
const transactions = await creem.transactions.list({
  customer_id: 'cus_xxx',      // Optional filter
  product_id: 'prod_xxx',      // Optional filter
  status: 'completed',         // Optional filter
  limit: 25,
  starting_after: 'txn_xxx'    // Pagination cursor
});
```

## Customers

### Retrieve Customer

```javascript
// GET /v1/customers/:id
const customer = await creem.customers.retrieve('cus_xxx');

// GET /v1/customers/email/:email
const customer = await creem.customers.retrieveByEmail('user@example.com');
```

### List Customers

```javascript
// GET /v1/customers
const customers = await creem.customers.list({
  limit: 25,
  starting_after: 'cus_xxx'
});
```

### Generate Portal Link

```javascript
// POST /v1/customers/:id/portal
const portal = await creem.customers.createPortalSession('cus_xxx');
// Returns: { url: 'https://portal.creem.io/xxx' }
```

## Discount Codes

### Create Discount

```javascript
// POST /v1/discounts
const discount = await creem.discounts.create({
  code: 'LAUNCH20',
  type: 'percentage',    // or 'fixed'
  value: 20,             // 20% or 20 cents
  expires_at: '2024-12-31T23:59:59Z',
  max_redemptions: 100   // Optional
});
```

### Retrieve Discount

```javascript
// GET /v1/discounts/:code
const discount = await creem.discounts.retrieve('LAUNCH20');
```

### Delete Discount

```javascript
// DELETE /v1/discounts/:code
await creem.discounts.delete('LAUNCH20');
```

## Error Handling

```javascript
try {
  const session = await creem.checkout.sessions.create({...});
} catch (error) {
  if (error.type === 'invalid_request_error') {
    console.error('Invalid parameters:', error.message);
  } else if (error.type === 'authentication_error') {
    console.error('Invalid API key');
  } else if (error.type === 'rate_limit_error') {
    console.error('Rate limited, retry after:', error.retry_after);
  }
}
```

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.