Skip to content
Navigation

Cancels a subscription now or at the end of its period.

POST
https://api.sherpo.io/merchant/v1/stores/{store}/subscriptions/{subscription}/cancel

Authorization

  • bearer
    HTTP
    required

Path parameters

  • store
    string
    required

    The store's id.

  • subscription
    string
    required
    minLength: 1

Header parameters

  • Idempotency-Key
    optional
    string

    Repeats within 24 hours answer the first result; the same key with other arguments is a conflict.

    maxLength: 255 · minLength: 1 · pattern: ^[\x21-\x7E]+$

Request body JSON required

  • when
    now
    or
    period_end
    required
  • reason
    optional

    Why, in your own words; one of the codes the store writes itself as a reason (refund, dispute, upgraded, account_erased, Ended by the seller. and the like) is refused.

    One of the following:

    • string
    • null

Returns

200

Cancels a subscription now or at the end of its period.

JSON
  • display_status
    string
    required

    Its status as people read it: cancelling while it bills and is set to stop.

  • next_event
    required

    What happens at the end of its latest paid period, as of the answer; null when nothing is ahead.

    One of the following:

    • object
    • null
  • actions
    object
    required

    The moves the store offers on it as of the answer; a write still decides again.

    • cancel
      object
      required
      • period_end
        boolean
        required

        Stopping at the period's end: it bills, is not set to stop, and its period has not ended or is not known yet.

      • now
        boolean
        required

        Ending it now, revoking what it paid for.

    • resume
      boolean
      required

      Taking a stop back: it still bills and is set to stop.

  • period_end
    required

    When its period ends, as a cancel reads it; null for none, or once a period was refunded and none is paid.

    One of the following:

    • string
    • null
  • customer
    required

    One of the following:

    • object
    • null
  • product
    required

    One of the following:

    • object
    • null
  • plan
    required

    One of the following:

    • object
    • null
  • periods
    object
    required
    • items
      array of
      object
      required
      • id
        string
        required
      • subscription_id
        string
        required
      • starts_at
        required

        One of the following:

        • string
        • null
      • ends_at
        required

        One of the following:

        • string
        • null
      • status
        string
        required
      • lead_in
        boolean
        required

        A first period the customer's own grant covered, charged nothing; the plan's first charge pays the next.

      • settlement_id
        required

        One of the following:

        • string
        • null
      • grant_id
        required

        One of the following:

        • string
        • null
      • currency
        required

        One of the following:

        • string
        • null
      • exponent
        required

        One of the following:

        • number
        • null
      • amount
        required

        One of the following:

        • number
        • null
      • order
        required

        One of the following:

        • object
        • null
    • total
      number
      required
  • scheduled_change
    required

    The plan it renews on from effective_at, the end of its paid run, as the customer scheduled; null for none.

    One of the following:

    • object
    • null
  • id
    string
    required
  • customer_id
    string
    required
  • product_id
    string
    required
  • plan_id
    string
    required
  • processor
    required

    One of the following:

    • string
    • null
  • external_ref
    required

    One of the following:

    • string
    • null
  • account_ref
    required

    One of the following:

    • string
    • null
  • status
    string
    required
  • cancel_at_period_end
    boolean
    required
  • instrument_ref
    required

    One of the following:

    • string
    • null
  • cancel_reason
    required

    One of the following:

    • string
    • null
  • created_at
    required

    One of the following:

    • string
    • null
  • ended_at
    required

    One of the following:

    • string
    • null
JSON
  • type
    string
    required
    format: uri
  • title
    string
    required
  • status
    integer
    required
  • detail
    string
    required
  • code
    optional
    string
  • context
    optional
    object
  • reached_core
    optional
    boolean
  • core_answer
    optional
    string

Type to search…

↑↓ navigate↵ selectEsc close