Skip to content

Change the plan's tier, mode or cancellation

PUT
https://billing.ezghcloud.com/v1/organizations/{orgId}/plan

Authorization

  • apiKeyoptionalHTTP
  • oauthoptionalHTTP
  • sessionCookieoptionalAPI key in cookie

Path parameters

  • orgIdstringrequired

    The organization's UUID or prefixed ID (org_…).

Header parameters

  • If-Matchoptionalstring

Request bodyJSONrequired

  • tierp8orp20orp100required

    A higher tier upgrades now (charging the prorated difference); a lower one takes effect next month.

  • modecaporoveragerequired
  • cancelAtPeriodEndbooleanrequired

    true cancels the plan at the end of the month.

Returns

200

OK

JSON
  • planPlanornullrequired

    Null when the organization never subscribed.

    2 variants

    One of the following:

    • Plan
      11 properties
      • tierp8orp20orp100required
      • modecaporoveragerequired

        cap: never pay more than the plan price; overage: usage past the credit is charged to the card.

      • statusscheduledoractiveorpast_dueorlapsedorcancelledrequired
      • currentPeriodstringrequired

        The calendar month (UTC) the plan is in.

        pattern: ^[0-9]{4}-[0-9]{2}$
      • startsPeriodstringrequired

        The month the plan started, or starts when scheduled.

        pattern: ^[0-9]{4}-[0-9]{2}$
      • pendingTierstringornullrequired

        A lower tier taking effect next month.

        2 variants

        One of the following:

        • string
        • null
      • cancelAtPeriodEndbooleanrequired
      • capSincestringornullrequired

        The hour the cap began counting this month; null in overage mode.

        2 variants

        One of the following:

        • string
        • null
      • creditobjectrequired
        3 properties
        • amountstringrequired

          Credit usable this month.

          pattern: ^[0-9]+\.[0-9]{2}$
        • usedstringrequired

          Usage this month counted against it.

          pattern: ^[0-9]+\.[0-9]{2}$
        • remainingstringrequired
          pattern: ^[0-9]+\.[0-9]{2}$
      • controlsobjectrequired
        2 properties
        • blockedbooleanrequired

          New billable resources are refused.

        • stoppedbooleanrequired

          Running instances were stopped.

      • updatedAtstringrequired
        format: date-time
    • null
  • tiersarray ofobjectrequired
    4 properties
    • tierp8orp20orp100required
    • pricestringrequired

      Price per month, in dollars.

      pattern: ^[0-9]+\.[0-9]{2}$
    • creditstringrequired

      Credit per month, in dollars.

      pattern: ^[0-9]+\.[0-9]{2}$
    • currencystringrequired

400

invalid_request: the request is malformed (with issues), or invalid_cursor.

JSON
  • errorobjectrequired
    3 properties
    • codestringrequired

      What went wrong, for programs: branch on this, never on message.

    • messagestringrequired

      What went wrong, for people.

    • issuesoptionalarray ofobject

      With invalid_request: each invalid field.

      2 properties
      • pathstringrequired
      • messagestringrequired

401

unauthenticated: no valid credential.

JSON
  • errorobjectrequired
    3 properties
    • codestringrequired

      What went wrong, for programs: branch on this, never on message.

    • messagestringrequired

      What went wrong, for people.

    • issuesoptionalarray ofobject

      With invalid_request: each invalid field.

      2 properties
      • pathstringrequired
      • messagestringrequired

402

payment_failed: an upgrade's charge was declined.

JSON
  • errorobjectrequired
    3 properties
    • codestringrequired

      What went wrong, for programs: branch on this, never on message.

    • messagestringrequired

      What went wrong, for people.

    • issuesoptionalarray ofobject

      With invalid_request: each invalid field.

      2 properties
      • pathstringrequired
      • messagestringrequired

403

access_denied: the caller isn't allowed to (the message names the action); forbidden_origin: a cookie-authenticated write from another site.

JSON
  • errorobjectrequired
    3 properties
    • codestringrequired

      What went wrong, for programs: branch on this, never on message.

    • messagestringrequired

      What went wrong, for people.

    • issuesoptionalarray ofobject

      With invalid_request: each invalid field.

      2 properties
      • pathstringrequired
      • messagestringrequired

404

not_found: the organization (or one the caller doesn't belong to), or the resource, doesn't exist.

JSON
  • errorobjectrequired
    3 properties
    • codestringrequired

      What went wrong, for programs: branch on this, never on message.

    • messagestringrequired

      What went wrong, for people.

    • issuesoptionalarray ofobject

      With invalid_request: each invalid field.

      2 properties
      • pathstringrequired
      • messagestringrequired

409

plan_lapsed: subscribe again to choose a plan.

JSON
  • errorobjectrequired
    3 properties
    • codestringrequired

      What went wrong, for programs: branch on this, never on message.

    • messagestringrequired

      What went wrong, for people.

    • issuesoptionalarray ofobject

      With invalid_request: each invalid field.

      2 properties
      • pathstringrequired
      • messagestringrequired

412

precondition_failed: the plan changed since it was read.

JSON
  • errorobjectrequired
    3 properties
    • codestringrequired

      What went wrong, for programs: branch on this, never on message.

    • messagestringrequired

      What went wrong, for people.

    • issuesoptionalarray ofobject

      With invalid_request: each invalid field.

      2 properties
      • pathstringrequired
      • messagestringrequired

429

too_many_requests: slow down.

JSON
  • errorobjectrequired
    3 properties
    • codestringrequired

      What went wrong, for programs: branch on this, never on message.

    • messagestringrequired

      What went wrong, for people.

    • issuesoptionalarray ofobject

      With invalid_request: each invalid field.

      2 properties
      • pathstringrequired
      • messagestringrequired

500

internal_error: a bug; the details are in the logs, under the request ID.

JSON
  • errorobjectrequired
    3 properties
    • codestringrequired

      What went wrong, for programs: branch on this, never on message.

    • messagestringrequired

      What went wrong, for people.

    • issuesoptionalarray ofobject

      With invalid_request: each invalid field.

      2 properties
      • pathstringrequired
      • messagestringrequired

503

billing_busy, or a dependency is unavailable.

JSON
  • errorobjectrequired
    3 properties
    • codestringrequired

      What went wrong, for programs: branch on this, never on message.

    • messagestringrequired

      What went wrong, for people.

    • issuesoptionalarray ofobject

      With invalid_request: each invalid field.

      2 properties
      • pathstringrequired
      • messagestringrequired
Navigation

Type to search…

↑↓ navigate↵ selectEsc close