API ReferenceapipaymentsPOST /v1/subscriptions/{id}/cadence

POST /v1/subscriptions/\{id\}/cadence

Service: payments · operationId: (none)

Required scopes

(no scope declared — review service config)

Path parameters

  • id (string) required

Request body

{
  "type": "object",
  "properties": {
    "interval": {
      "type": "string",
      "enum": [
        "monthly",
        "quarterly",
        "annual"
      ]
    },
    "price_id": {
      "type": "string"
    }
  },
  "required": [
    "interval"
  ]
}

Responses

200 Subscription cadence updated

{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "customer_id": {
      "type": "string"
    },
    "stripe_subscription_id": {
      "type": "string"
    },
    "plan_id": {
      "type": "string"
    },
    "status": {
      "type": "string"
    },
    "current_period_start": {
      "type": "string"
    },
    "current_period_end": {
      "type": "string"
    },
    "cancelled_at": {
      "type": [
        "string",
        "null"
      ]
    },
    "created_at": {
      "type": "string"
    },
    "updated_at": {
      "type": "string"
    }
  },
  "required": [
    "id",
    "customer_id",
    "stripe_subscription_id",
    "plan_id",
    "status",
    "current_period_start",
    "current_period_end",
    "cancelled_at",
    "created_at",
    "updated_at"
  ]
}

404 Subscription not found

{
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    },
    "message": {
      "type": "string"
    }
  },
  "required": [
    "error",
    "message"
  ]
}

412 Unable to derive the requested cadence price

{
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    },
    "message": {
      "type": "string"
    }
  },
  "required": [
    "error",
    "message"
  ]
}

Example

curl -X POST https://payments.platform.loop.health/v1/subscriptions/{id}/cadence \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ ... }'