members.dev
Benefit schedules

Create Benefit Schedule

Creates a schedule with server-set **starts_at** (UTC now) and **status** `active`. If **expiry** is omitted, the schedule never ends overall (`expiry_type: never`). If a **benefit_grants** entry omits **expiry**, it defaults to never when **recurring** is never, else one billing **occurence** (`interval_count: 1`).

POST
/v1/schedules

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

curl -X POST "https://api.members.dev/v1/schedules" \  -H "Content-Type: application/json" \  -d '{    "user_id": "string",    "recurring": {      "recurring_type": "never"    },    "benefit_grants": [      {        "benefit_id": "string",        "value_initial": 0      }    ]  }'
{
  "id": "string",
  "user_id": "string",
  "status": "scheduled",
  "starts_at": null,
  "recurring": {
    "recurring_type": "never"
  },
  "expiry": {
    "expiry_type": "never"
  },
  "benefit_grants": [
    {
      "benefit_id": "string",
      "value_initial": 0,
      "expiry": {
        "expiry_type": "never"
      }
    }
  ],
  "parent": {
    "subscription_id": "string",
    "product_id": "string"
  },
  "state_transitions": {
    "started_at": {},
    "past_due_at": {},
    "canceled_at": {},
    "expired_at": {},
    "revoked_at": {}
  },
  "next_update": {
    "updates_at": null,
    "update_type": "activates"
  },
  "created_at": null,
  "updated_at": null
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}