Skip to Content

create()

create( projectId, customerId, input ): Promise<{ api?: { links?: Record<string, { href: string; }>; redactions?: object[]; }; appStore: | { originalTransactionId: string; } | null; createdAt: string; customer: string; grantedBy: | { id: string; kind: "user" | "adminApiKey"; } | null; id: string; object: "product_grant"; payment?: { amountPaid: number | null; amountRefunded: number | null; amountUnrefunded: number | null; currency: string | null; refundHistoryAvailable: boolean; refunds: object[]; stripeChargeId: string | null; stripeCheckoutSessionId: string | null; stripeSubscriptionTerminal: boolean | null; }; period: | { end: string | null; start: string | null; } | null; product: { billingInterval: BillingInterval; displayName: string | null; id: string; isDefault: boolean; sku: string | null; }; source: "default" | "manual" | "stripe" | "appStore"; status: "active" | "completed" | "refunded"; stripe: | { checkoutSession: string | null; customer: string | null; invoice: string | null; paymentIntent: string | null; subscription: string | null; } | null; updatedAt: string; }>;

Grants a customer one of its project’s products by hand. The grant runs to endsAt, one billing interval from now when omitted; null is only valid for an infinite product. The project’s default product, and a product the customer already holds an active grant of, are refused.

Parameters

projectId

string

customerId

string

input

endsAt?

string | null = ...

Defaults to one billing interval from now; null is only valid for an infinite product.

product

string = ...

Last updated on