Zum Hauptinhalt springen
GET
/
api
/
customer
/
subscriptions
/
{id}
/
plan-options
Get plan switch options
curl --request GET \
  --url https://coreapi.io/api/customer/subscriptions/{id}/plan-options \
  --header 'Authorization: Bearer <token>'
{
  "currentTier": {
    "id": "<string>",
    "planId": "<string>",
    "planCode": "pro-plan",
    "position": 123,
    "name": "Pro",
    "currency": "EUR",
    "items": [
      {
        "id": "<string>",
        "productId": "<string>",
        "productName": "Pro Plan",
        "defaultQuantity": 123,
        "minQuantity": 123,
        "maxQuantity": 123,
        "quantityEditable": true,
        "pricePlan": {}
      }
    ],
    "recurringTotal": {
      "netAmount": "49.00",
      "taxAmount": "9.31",
      "grossAmount": "58.31",
      "currency": "EUR"
    }
  },
  "options": [
    {
      "tier": {
        "id": "<string>",
        "planId": "<string>",
        "planCode": "pro-plan",
        "position": 123,
        "name": "Pro",
        "currency": "EUR",
        "items": [
          {
            "id": "<string>",
            "productId": "<string>",
            "productName": "Pro Plan",
            "defaultQuantity": 123,
            "minQuantity": 123,
            "maxQuantity": 123,
            "quantityEditable": true,
            "pricePlan": {}
          }
        ],
        "recurringTotal": {
          "netAmount": "49.00",
          "taxAmount": "9.31",
          "grossAmount": "58.31",
          "currency": "EUR"
        }
      },
      "preview": {
        "creditAmount": "14.50",
        "chargeAmount": "24.50",
        "currency": "EUR",
        "effectiveAt": "2023-11-07T05:31:56Z",
        "recurringTotal": {
          "netAmount": "49.00",
          "taxAmount": "9.31",
          "grossAmount": "58.31",
          "currency": "EUR"
        },
        "warnings": [
          "active_discount_will_be_lost"
        ]
      }
    }
  ]
}

Autorisierungen

Authorization
string
header
erforderlich

Customer access token. Send it as Authorization: Bearer . Obtain it server side via POST /customers/{id}/authenticate (use the response accessToken), or from a customer portal session. The token must carry the customer:plan:switch permission.

Pfadparameter

id
string<uuid>
erforderlich

The subscription UUID.

Beispiel:

"1280792f-4e23-793d-8e9c-3a1bf36630bd"

Antwort

Current tier and reachable options.

currentTier
object
options
object[]

All tiers the subscription can reach from its current tier, each with a financial preview.