> ## Documentation Index
> Fetch the complete documentation index at: https://partner-help.letsdothis.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Cancel a membership policy

> Cancels immediately or at the end of the billing period. A member token acts as the primary member, under the scheme's cancellation rules and notice period. An organizer key acts as the organizer, with no notice period, and may cancel immediately. With an organizer key, invoices the membership still owes stay owed unless the request sends outstandingInvoices VOID; the cancellation quote says what is owed. A member's own cancellation voids an unpaid invoice in two cases: cancelling immediately inside a cooling-off window, and an unpaid member cancelling on a scheme with no notice period, whose membership ends at once. Organizer keys may also send an optional reason code and a private note of up to 2000 characters; this audit context does not change billing. Send an Idempotency-Key unique to each cancellation and reuse it when retrying. Additional cancelWhen values may be introduced.

> [!NOTE]
>
> This endpoint is in beta: its request and response contract can still change while it's being developed.


## OpenAPI

````yaml /openapi.json post /v0/membership-policies/{policyId}/cancel
openapi: 3.1.0
info:
  title: Let's Do This API
  version: 0.1.0
  description: >
    The full reference — getting started, pagination, error responses, rate
    limits and the changelog — lives at

    [partner-help.letsdothis.com/api-reference](https://partner-help.letsdothis.com/api-reference/overview).

    This page is the interactive OpenAPI view of the same specification.


    # Authentication


    Create an API key from **Settings** → **Credentials** in your Let's Do This
    account and send it as a bearer token:


    ```bash

    curl --request GET \
     --url "https://api.letsdothis.com/v0/participants" \
     --header "Authorization: Bearer YOUR-API-KEY"
    ```


    Keep the key secret: it identifies your organization, so do not ship it in a
    website or native app. If a key is exposed,

    revoke it from the same section and create a replacement.


    # OpenAPI schema


    Download the [OpenAPI schema](https://api.letsdothis.com/documentation/json)
    to use with Postman or an OpenAPI client

    generator.
servers:
  - url: https://api.letsdothis.com
    description: Production
  - url: https://api.staging.letsdothis.com
    description: Staging
security:
  - bearerAuth: []
tags:
  - name: Events
    x-group: Events
    description: Events that participants can register for.
  - name: EventOccurrences
    x-group: Event occurrences
    description: >-
      Event occurrences scoped to the organizer associated with your Public API
      credentials. Unlike the public Events catalog, results are limited to your
      own events.
  - name: Races
    x-group: Races
    description: >-
      Races within an event occurrence. An event occurrence may have one or more
      races, for example a 5K and a 10K within the same race day.
  - name: Tickets
    x-group: Tickets
    description: Tickets that are available for events.
  - name: BookingForms
    x-group: Booking forms
    description: >-
      Booking forms define the questions a booker answers when registering for a
      ticket. A ticket usually references a single booking form, so expect zero
      or one, while a booking form may be shared across multiple tickets.
  - name: BookingFormFields
    x-group: Booking form fields
    description: >-
      Booking form fields are the individual questions on a booking form — their
      type, label, options, and whether an answer is required. A field can be
      reused across multiple forms.
  - name: Bookings
    x-group: Bookings
    description: >-
      Bookings are the transaction record for a registration. A booking may
      contain one or more participants (entries).
  - name: Membership
    x-group: Memberships
    description: >-
      Membership schemes, purchased policies and the seats on them, owned by
      your organizer. Policies are billing contracts; a seat is one person's
      place on a policy.
  - name: Participant
    x-group: Participants
    description: Participants are users who successfully booked an event.
  - name: LineItem
    x-group: Line items
    description: Financial details related to individual items within transactions.
  - name: AddOns
    x-group: Add-ons
    description: >-
      Your add-on products, such as merchandise or extras, that participants buy
      with their entry. Imported products keep the ids you gave them.
  - name: DiscountCodes
    x-group: Discount codes
    description: >-
      Discount codes participants enter at checkout to reduce the price of a
      booking.
  - name: Credits
    x-group: Credits
    description: >-
      Credits are balances participants can spend at checkout, identified by
      their email address.
  - name: Referrals
    x-group: Referrals
    description: >-
      Referral programs, the referrers registered on them, and asynchronous
      imports of historical referrals.
  - name: Teams
    x-group: Teams
    description: >-
      Teams group participants of an event occurrence under a team program.
      Teams can be imported for participants whose bookings were imported.
  - name: Application
    x-group: Applications
    description: >-
      Applications are created when a user applies for tickets that are set up
      to require an application process, such as balloted or "Good For Age"
      entries.
  - name: Partner
    x-group: Partners
    description: >-
      Partners that were created by the organization who can have Reserved
      Entries assigned to them.
  - name: ReservedEntries
    x-group: Reserved entries
    description: >-
      Reserved Entries are entries that are reserved for a partner. After being
      assigned, the partner can then allocate these entries to participants.
  - name: Timing
    x-group: Timing
    description: >-
      Timing providers push bib numbers and bib-pack shipments back to Let's Do
      This for the startlist entries they received. Available to select timing
      partners only.
  - name: Identity
    x-group: API key
    description: >-
      What your API key can reach. Available to every key, including scoped
      ones.
paths:
  /v0/membership-policies/{policyId}/cancel:
    post:
      tags:
        - Membership
      summary: Cancel a membership policy
      description: >-
        Cancels immediately or at the end of the billing period. A member token
        acts as the primary member, under the scheme's cancellation rules and
        notice period. An organizer key acts as the organizer, with no notice
        period, and may cancel immediately. With an organizer key, invoices the
        membership still owes stay owed unless the request sends
        outstandingInvoices VOID; the cancellation quote says what is owed. A
        member's own cancellation voids an unpaid invoice in two cases:
        cancelling immediately inside a cooling-off window, and an unpaid member
        cancelling on a scheme with no notice period, whose membership ends at
        once. Organizer keys may also send an optional reason code and a private
        note of up to 2000 characters; this audit context does not change
        billing. Send an Idempotency-Key unique to each cancellation and reuse
        it when retrying. Additional cancelWhen values may be introduced.
      parameters:
        - schema:
            type: string
            pattern: ^[a-fA-F0-9]{24}$
          in: path
          name: policyId
          required: true
          description: >-
            The id of a membership policy: a member's purchased membership. Each
            seat names its policy in `policyId`.
        - schema:
            type: string
            minLength: 1
            maxLength: 100
          in: header
          name: idempotency-key
          required: true
          description: Unique per cancellation; send the same key on a retry.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MembershipCancellationRequest'
      responses:
        '200':
          description: >-
            The policy id, its pending cancellation if any, the cooling-off
            refund outcome when returned, and whether a requested void is still
            being finished.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MembershipCancellation'
        '400':
          description: A parameter or field is missing or malformed. `message` says which.
          content:
            application/json:
              schema:
                type: object
                required:
                  - code
                  - statusCode
                  - message
                properties:
                  code:
                    type: string
                    enum:
                      - MEMBERSHIP_INVALID_REQUEST
                  statusCode:
                    type: integer
                    enum:
                      - 400
                  message:
                    type: string
        '403':
          description: >-
            A member token sent outstandingInvoices or organizer cancellation
            details. Only an organizer key may supply those choices or details.
          content:
            application/json:
              schema:
                type: object
                required:
                  - code
                  - statusCode
                  - message
                properties:
                  code:
                    type: string
                    enum:
                      - MEMBERSHIP_CANCELLATION_INVOICE_CHOICE_NOT_PERMITTED
                      - MEMBERSHIP_CANCELLATION_DETAILS_NOT_PERMITTED
                  statusCode:
                    type: integer
                    enum:
                      - 403
                  message:
                    type: string
        '404':
          description: Your organization has no membership policy with this id.
          content:
            application/json:
              schema:
                type: object
                required:
                  - code
                  - statusCode
                  - message
                properties:
                  code:
                    type: string
                    enum:
                      - MEMBERSHIP_RESOURCE_NOT_FOUND
                  statusCode:
                    type: integer
                    enum:
                      - 404
                  message:
                    type: string
        '409':
          description: >-
            Cancellation is refused: another cancellation of the policy is in
            progress (retry shortly), immediate member cancellation outside
            cooling-off, or no billing period for a period-end cancellation.
          content:
            application/json:
              schema:
                type: object
                required:
                  - code
                  - statusCode
                  - message
                properties:
                  code:
                    type: string
                    enum:
                      - MEMBERSHIP_CANCELLATION_IN_PROGRESS
                      - MEMBERSHIP_CANCELLATION_OUTSIDE_COOLING_OFF
                      - MEMBERSHIP_CANCELLATION_NO_BILLING_PERIOD
                  statusCode:
                    type: integer
                    enum:
                      - 409
                  message:
                    type: string
        '422':
          description: This Idempotency-Key was used for a different change. Use a new key.
          content:
            application/json:
              schema:
                type: object
                required:
                  - code
                  - statusCode
                  - message
                properties:
                  code:
                    type: string
                    enum:
                      - MEMBERSHIP_IDEMPOTENCY_KEY_REUSED
                  statusCode:
                    type: integer
                    enum:
                      - 422
                  message:
                    type: string
components:
  schemas:
    MembershipCancellationRequest:
      title: MembershipCancellationRequest
      type: object
      properties:
        cancelWhen:
          type: string
          description: >-
            IMMEDIATELY ends it now when permitted; END_OF_BILLING_PERIOD
            applies the scheme's notice period for a member. More values may be
            added.
        outstandingInvoices:
          type: string
          enum:
            - KEEP
            - VOID
          description: >-
            Organizer keys only: what becomes of invoices the membership still
            owes. KEEP, the default, leaves them owed. VOID voids them, so the
            member owes nothing. A member token that sends this is refused; a
            member's own cancellation follows the scheme's rules.
        reason:
          type: string
          description: >-
            Organizer keys only. REQUESTED_BY_MEMBER, UNPAID_FEES,
            BREACH_OF_TERMS, DUPLICATE_MEMBERSHIP or OTHER. Audit context only;
            does not change billing or mark a system-triggered cancellation.
        note:
          type: string
          description: >-
            Organizer keys only. Private untrusted plain text, never returned to
            the member.
          maxLength: 2000
      required:
        - cancelWhen
      additionalProperties: false
    MembershipCancellation:
      title: MembershipCancellation
      type: object
      properties:
        policyId:
          type: string
        pendingChange:
          anyOf:
            - type: object
              properties:
                id:
                  type: string
                kind:
                  type: string
                  enum:
                    - OFFERING
                    - CANCELLATION
                  description: >-
                    OFFERING: a move to another offering. CANCELLATION: the
                    policy ends.
                timing:
                  type: string
                  enum:
                    - NOW
                    - AT_RENEWAL
                    - AT_DATE
                  description: >-
                    AT_DATE is a cancellation once its notice period has passed,
                    mid-cycle or not.
                effectiveAt:
                  type: string
                  format: date-time
                requestedAt:
                  type: string
                  format: date-time
                requestedByKind:
                  type:
                    - string
                    - 'null'
                  description: MEMBER, ORGANIZER, LDT or SYSTEM; null when not recorded.
                requestedVia:
                  type: string
                  description: DASHBOARD, SUPPORT_AGENT, PUBLIC_API, INTERNAL or BACKFILL.
                cancellationCause:
                  type:
                    - string
                    - 'null'
                  description: >-
                    For a cancellation, why it was made. NON_PAYMENT: a renewal
                    went unpaid; paying it calls the cancellation off.
                    BY_REQUEST: the member or the organizer asked for it. More
                    may be added. Null for an offering change.
                toOfferingId:
                  type:
                    - string
                    - 'null'
                  description: For an offering change; null for a cancellation.
                direction:
                  type:
                    - string
                    - 'null'
                  description: >-
                    UPGRADE, DOWNGRADE or SWAP for an offering change; null for
                    a cancellation.
                amountDueNow:
                  anyOf:
                    - $ref: '#/components/schemas/MembershipMoney'
                    - type: 'null'
                  description: >-
                    Still due before an offering change made now applies; null
                    once paid or when nothing is.
                payBy:
                  type:
                    - string
                    - 'null'
                  description: Unpaid by then, the offering change fails.
                  format: date-time
                releaseSeatIds:
                  type: array
                  items:
                    type: string
                  description: >-
                    Secondary seats that end when an offering change takes
                    effect.
              required:
                - id
                - kind
                - timing
                - effectiveAt
                - requestedAt
                - requestedByKind
                - requestedVia
                - cancellationCause
                - toOfferingId
                - direction
                - amountDueNow
                - payBy
                - releaseSeatIds
              additionalProperties: false
            - type: 'null'
        coolingOffRefund:
          $ref: '#/components/schemas/MembershipCoolingOffRefundOutcome'
        outstandingInvoicesVoidIncomplete:
          type: boolean
          description: >-
            True when the cancellation went through but some invoices an
            organizer key asked to void are not yet voided. They are retried for
            about an hour; read the cancellation quote to see what is still
            owed. Absent otherwise.
      required:
        - policyId
        - pendingChange
      additionalProperties: false
    MembershipMoney:
      title: MembershipMoney
      type: object
      properties:
        value:
          type: number
        currencyCode:
          type: string
      required:
        - value
        - currencyCode
      additionalProperties: false
      description: Money in minor units, e.g. DKK 150 is value 15000.
    MembershipCoolingOffRefundOutcome:
      title: MembershipCoolingOffRefundOutcome
      type: object
      properties:
        outcome:
          type: string
          description: >-
            REFUNDED, SUPPORT_REVIEWS or REFUND_FAILED. More values may be
            added.
        amount:
          $ref: '#/components/schemas/MembershipMoney'
      required:
        - outcome
      additionalProperties: false
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.