Typescript (SDK)
import { Autumn } from 'autumn-js'
const autumn = new Autumn()
const result = await autumn.rewards.update({
rewardId: "<id>",
});from autumn_sdk import Autumn
autumn = Autumn(secret_key="am_sk_test...")
res = autumn.rewards.update(reward_id="<id>")curl --request POST \
--url https://api.useautumn.com/v1/rewards.update \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-api-version: <x-api-version>' \
--data '
{
"reward_id": "<string>",
"coupon": {
"name": "<string>",
"plan_ids": [
"<string>"
],
"promo_codes": [
{
"code": "<string>",
"global_max_redemption": 4503599627370495,
"first_time_transaction": true
}
]
},
"feature_grant": {
"name": "<string>",
"grants": [
{
"feature_id": "<string>",
"included": 1,
"expiry": {
"length": 0
}
}
],
"promo_codes": [
{
"code": "<string>",
"max_uses": 4503599627370495
}
]
}
}
'{
"feature_grant": {
"id": "beta_credits_grant",
"name": "Beta Tester Credits",
"promo_codes": [
{
"code": "BETA2024",
"max_uses": 500
}
],
"grants": [
{
"feature_id": "credits",
"included": 1000,
"expiry": {
"type": "month",
"length": 1
}
}
],
"created_at": 1718000000000
}
}
Rewards & Referrals
Update Reward
Update a coupon or feature grant. Omitted fields keep their current value.
POST
/
v1
/
rewards.update
Typescript (SDK)
import { Autumn } from 'autumn-js'
const autumn = new Autumn()
const result = await autumn.rewards.update({
rewardId: "<id>",
});from autumn_sdk import Autumn
autumn = Autumn(secret_key="am_sk_test...")
res = autumn.rewards.update(reward_id="<id>")curl --request POST \
--url https://api.useautumn.com/v1/rewards.update \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-api-version: <x-api-version>' \
--data '
{
"reward_id": "<string>",
"coupon": {
"name": "<string>",
"plan_ids": [
"<string>"
],
"promo_codes": [
{
"code": "<string>",
"global_max_redemption": 4503599627370495,
"first_time_transaction": true
}
]
},
"feature_grant": {
"name": "<string>",
"grants": [
{
"feature_id": "<string>",
"included": 1,
"expiry": {
"length": 0
}
}
],
"promo_codes": [
{
"code": "<string>",
"max_uses": 4503599627370495
}
]
}
}
'{
"feature_grant": {
"id": "beta_credits_grant",
"name": "Beta Tester Credits",
"promo_codes": [
{
"code": "BETA2024",
"max_uses": 500
}
],
"grants": [
{
"feature_id": "credits",
"included": 1000,
"expiry": {
"type": "month",
"length": 1
}
}
],
"created_at": 1718000000000
}
}
Body Parameters
Response
{
"feature_grant": {
"id": "beta_credits_grant",
"name": "Beta Tester Credits",
"promo_codes": [
{
"code": "BETA2024",
"max_uses": 500
}
],
"grants": [
{
"feature_id": "credits",
"included": 1000,
"expiry": {
"type": "month",
"length": 1
}
}
],
"created_at": 1718000000000
}
}
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Body
application/json