---
title: "Create a membership credit rule"
method: POST
path: "/customers/membership-credit-rules"
tags: ["MembershipCreditRules"]
---

# Create a membership credit rule

`POST /customers/membership-credit-rules`

This endpoint creates a new membership credit rule for a membership type.

## Request body

- object
  - `membership_type_id` string, uuid, required — Identifier of the membership tier whose members will receive this credit rule. Rules are scoped to a single tier; create separate rules per tier if benefits differ.
  - `coupon_id` string, required — Identifier of the coupon template used when issuing the credit. Each application of the rule issues a fresh coupon code derived from this template; the template defines the discount amount, validity, and offerings.
  - `coupon_name` string, required — Display name shown alongside the issued coupon in the customer's account (e.g. "August spa credit"). Not the redemption code; that's generated automatically. 1-120 characters.
  - `roll_over` boolean — If true, unused credits will roll over to the next month. Otherwise, any unused credits will be marked as expired on the next billing period.
  - `issue_on_signup` boolean — If true, the credit will be issued when new customers sign up for the given membership type. Otherwise, the credit will be issued only on the monthly billing schedule.
  - `multi_use` boolean — If true, the credit can be used an unlimited number of times until the expiry date.
  - `for_lead_booker_only` boolean — If true, the credit will only be issued for the lead booker of an order. If false, the credit will be issued for all guests on the order, including non-members.
  - `issuing_frequency` 'billing_cycle' | 'P0D' | 'P1M' | 'P3M' | 'P6M' | 'P1Y' — The frequency that this credit is issued. The duration is specified as an ISO8601 duration string. See https://en.wikipedia.org/wiki/ISO_8601#Durations
  - `include_upcoming` boolean — When true, apply the new rule to membership charges that are already scheduled but not yet billed — issuing the configured credit on the next cycle for members who joined before the rule existed. When false (default), the rule only takes effect for cycles scheduled after the rule was created; existing scheduled charges continue unchanged.

## Response `201`

The membership credit rule was successfully retrieved

- object
  - `data` MembershipCreditRule, required
    - `id` string, uuid, required — The ID of the credit rule
    - `membership_type_id` string, uuid, required — The ID of the membership type this rule relates to
    - `membership_type` SchemasMembershipTypeSummary
      - `id` string, uuid, required — The ID of the membership type this rule belongs to
      - `name` string, required — The name of the membership type this rule belongs to
    - `coupon_id` string, required — The ID of the coupon which will be issued
    - `coupon_name` string, required — The name of the coupon which will be issued
    - `coupon_description` string, required — The description of the coupon which will be issued
    - `roll_over` boolean, required — If true, unused credits will roll over to the next month. Otherwise, any unused credits will be marked as expired on the next billing period.
    - `issue_on_signup` boolean, required — If true, the credit will be issued when new customers sign up for the given membership type. Otherwise, the credit will be issued only on the monthly billing schedule.
    - `multi_use` boolean, required — If true, the credit can be used an unlimited number of times until the expiry date.
    - `for_lead_booker_only` boolean, required — If true, the credit will only be issued for the lead booker of an order. If false, the credit will be issued for all guests on the order, including non-members.
    - `issuing_frequency` 'billing_cycle' | 'P0D' | 'P1M' | 'P3M' | 'P6M' | 'P1Y', required — The frequency that this credit is issued. The duration is specified as an ISO8601 duration string. See https://en.wikipedia.org/wiki/ISO_8601#Durations
    - `created_at` string, date-time, required — The date and time which the credit rule was created
    - `updated_at` string, date-time, required — The date and time which the credit rule was last updated

## Other responses

- `401` — The user is unauthenticated
- `403` — The authenticated user does not have permission.
- `422` — The request didn't pass validation

---

[API](https://skmtc.dev/try/apis/trybe-api.md) · [All operations](https://skmtc.dev/try/apis/trybe-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/try/trybe-api/revisions/f37f92702da5/schema)
