Skip to main content
POST
/
v1
/
referrals.redeem_code
Typescript (SDK)
import { Autumn } from 'autumn-js'

const autumn = new Autumn()

const result = await autumn.referrals.redeemCode({
  code: "REF123",
  customerId: "cus_456",
});
{
  "id": "<string>",
  "customer_id": "<string>",
  "reward_id": "<string>"
}

Body Parameters

Response

{
  "id": "<string>",
  "customer_id": "<string>",
  "reward_id": "<string>"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

x-api-version
string
default:2.1
required

Body

application/json
code
string
required

The referral code to redeem

customer_id
string
required

The unique identifier of the customer redeeming the code

Response

200 - application/json

OK

id
string
required

The ID of the redemption event

customer_id
string
required

Your unique identifier for the customer

reward_id
string
required

The ID of the reward that will be granted