TypeScript
import { Autumn } from 'autumn-js' const autumn = new Autumn() const result = await autumn.referrals.createCode({ customerId: "cus_123", programId: "prog_123", });
{ "code": "<string>", "customer_id": "<string>", "created_at": 123 }
Create or fetch a referral code for a customer in a referral program.
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Bearer <token>
<token>
The unique identifier of the customer
ID of your referral program
OK
The referral code that can be shared with customers
Your unique identifier for the customer
The timestamp of when the referral code was created