Skip to main content
Glama

subscriptions.create

Create recurring payment subscriptions for customers using the Ryft API. Specify billing cycles, amounts, and intervals to automate revenue collection.

Instructions

Create a Ryft subscription.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
customerIdYes
paymentMethodIdNo
descriptionNo
billingCycleTimestampNo
amountYes
currencyYes
intervalYes
metadataNo

Implementation Reference

  • The handler implementation for the 'subscriptions.create' tool, which validates input using subscriptionCreateSchema and makes a POST request to the Ryft API.
    registerTool(
      'subscriptions.create',
      'Create a Ryft subscription.',
      subscriptionCreateSchema.shape,
      async (args) => {
        const parsed = subscriptionCreateSchema.parse(args);
        return client.post('/subscriptions', {
          customer: { id: parsed.customerId },
          ...(parsed.paymentMethodId ? { paymentMethod: { id: parsed.paymentMethodId } } : {}),
          description: parsed.description,
          billingCycleTimestamp: parsed.billingCycleTimestamp,
          price: {
            amount: parsed.amount,
            currency: parsed.currency,
            interval: parsed.interval,
          },
          metadata: parsed.metadata,
        });
      },
    );
  • Input schema definition for the 'subscriptions.create' tool.
    const subscriptionCreateSchema = z.object({
      customerId: z.string().min(1),
      paymentMethodId: z.string().min(1).optional(),
      description: z.string().min(1).optional(),
      billingCycleTimestamp: z.number().int().optional(),
      amount: z.number().int().positive(),
      currency: z.string().length(3),
      interval: intervalSchema,
      metadata: z.record(z.string(), z.string()).optional(),
    });
  • Registration function that ties tool handlers to the tool registrar.
    export function registerSubscriptionTools(registerTool: ToolRegistrar, client: RyftHttpClient) {

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/bkawk/ryft-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server