Create, update or delete a catalog subscription

Create or edit a subscription within a Plan, or remove it from the catalog. To change one reader’s subscription or renewal settings, use reader memberships.

TaskOperationEligible caller
Create a subscriptionPOST /api/v1/admin/subscriptionsadmin or partner, or root
Update a known subscriptionPUT /api/v1/admin/subscriptions/{id}support, admin or partner, or root
Delete a known subscriptionDELETE /api/v1/admin/subscriptions/{id}support, admin or partner, or root

Context and examples

Send the assigned Admin token and publication public key. Allowed roles are in the task table. readonly/manager cannot write. Service accounts cannot use these routes; Plan full_access is not mutation permission. Keep calls in trusted server code.

InputLocation / typeMeaning
resourceRequired header, publication public-key stringCurrent publication context. Initial PUT/DELETE lookup selects subscriptions whose existing Plan belongs to it.
tokenRequired header, existing eligible token stringADMIN_TOKEN in examples, with the operation-specific grant above.
idPUT/DELETE path, digit stringCatalog subscription ID, not a membership relationship ID, Plan ID or slug.
plan_idCreate/update JSON body, numeric Plan IDIntended parent Plan from the selected publication’s catalog.

The caller must be active; their current publication relationship, when present, must not be locked or suspended. Session checks can reject revoked, expired or compromised tokens.

Examples use fictional Plan 5001, subscription 3001 and illustrative responses. They are separate scenarios: create assumes a known Plan and unique slug; update assumes an existing record; delete assumes no blocking dependencies. Use intended same-publication references. Requests use cURL, Node.js 18+ fetch in an ES module (.mjs), and Python 3 urllib. Set WALLKIT_API_BASE to scheme and host only, plus RESOURCE_KEY and ADMIN_TOKEN. See shared errors.

Understand the write boundaries first

Confirm the intended Plan and its publication before sending plan_id. Choose an existing Plan from the selected publication’s catalog. An update or delete initially selects the existing subscription through its current Plan.

Use private for visibility. public:true makes private false on create but true on update. public overrides private when both are supplied. Returned public is always the inverse of stored private.

A supplied extra object replaces all properties. Countable country_vat on PUT replaces the country set: omitted countries are removed; [] or all-skipped country IDs can clear it. Omitted/null/noncountable country_vat leaves the set unchanged. The ordinary update omits VAT and transition fields.

Read current subscription/VAT state before repeating an uncertain write. Subscription save precedes VAT work; later errors or events can follow partial changes.

Catalog price, period, Plan and renewal settings are separate from reader membership dates/choices and provider billing. These writes do not confirm recalculation, migration, provisioning, cancellation or refunds.

Create a catalog subscription

POST /api/v1/admin/subscriptions

Create a subscription attached to the intended Plan.

Before you call

Use admin or partner token, or root, and the publication key. support alone cannot create. Choose the intended Plan from this publication’s catalog. Use private directly, and review write behavior, prices, transition and VAT rules before adding fields.

The example supplies material flags and integer-form price 500. VAT, transition and trial fields are omitted; their replacement and clearing rules still apply if added.

Request

Send a JSON object with required plan_id, price, currency, period and nonempty title. Other fields follow the table. Pagination, filter and sort inputs are ignored.

Response

HTTP 201 returns subscription fields with expanded Plan. Later events or response generation can fail after writes.

Example: Create an inactive private subscription

Assume Plan 5001 belongs to this publication, USD is configured, slug is unique and the new ID is 3001. The excerpt omits other general and conditional Admin fields. Immediate Plan and lightweight child are complete. Illustrative absent/null trial/downgrade fields do not establish defaults.

curl "${WALLKIT_API_BASE}/api/v1/admin/subscriptions" \
  -X POST \
  -H "resource: ${RESOURCE_KEY}" \
  -H "token: ${ADMIN_TOKEN}" \
  -H "Content-Type: application/json" \
  --data '{"plan_id":5001,"title":"Example subscription","slug":"example-subscription","type":"standard","price":500,"currency":"USD","period":"1 month","private":true,"active":false,"shared":false,"once":false,"is_allowed_autorenew":true,"is_applied_vat":false,"vat_percent":0,"extra":{"label":"example"}}'
const url = new URL(`${process.env.WALLKIT_API_BASE}/api/v1/admin/subscriptions`);
const response = await fetch(url, {
  method: "POST",
  headers: {"resource": process.env.RESOURCE_KEY, "token": process.env.ADMIN_TOKEN, "Content-Type": "application/json"},
  body: JSON.stringify({"plan_id": 5001, "title": "Example subscription", "slug": "example-subscription", "type": "standard", "price": 500, "currency": "USD", "period": "1 month", "private": true, "active": false, "shared": false, "once": false, "is_allowed_autorenew": true, "is_applied_vat": false, "vat_percent": 0, "extra": {"label": "example"}})
});
console.log(response.status, await response.json());
import os, json
from urllib.request import Request, urlopen
from urllib.error import HTTPError

url = os.environ["WALLKIT_API_BASE"] + "/api/v1/admin/subscriptions"
body = json.dumps({'plan_id': 5001, 'title': 'Example subscription', 'slug': 'example-subscription', 'type': 'standard', 'price': 500, 'currency': 'USD', 'period': '1 month', 'private': True, 'active': False, 'shared': False, 'once': False, 'is_allowed_autorenew': True, 'is_applied_vat': False, 'vat_percent': 0, 'extra': {'label': 'example'}}).encode("utf-8")
request = Request(
    url,
    data=body,
    headers={"resource": os.environ["RESOURCE_KEY"], "token": os.environ["ADMIN_TOKEN"], "Content-Type": "application/json"},
    method="POST"
)
try:
    with urlopen(request) as response:
        print(response.status, json.load(response))
except HTTPError as error:
    print(error.code, json.load(error))

HTTP 201 response excerpt:

{
  "id": 3001,
  "slug": "example-subscription",
  "type": "standard",
  "title": "Example subscription",
  "plan_id": 5001,
  "price": 500,
  "currency": "USD",
  "period": "1 month",
  "active": false,
  "once": false,
  "private": true,
  "public": false,
  "is_allowed_autorenew": true,
  "is_applied_vat": false,
  "vat_percent": 0,
  "extra": {
    "label": "example"
  },
  "next_subscription": null,
  "downgrade_subscription": null,
  "plan": {
    "id": 5001,
    "title": "Example Plan",
    "slug": "example-plan",
    "description": "Illustrative configuration.",
    "full_access": false,
    "predictive_paywall": false,
    "predictive_percents": 0,
    "can_own_teams": false,
    "priority": 1,
    "private": true,
    "active": false,
    "extra": {},
    "public": false,
    "subscriptions": [
      {
        "id": 3001,
        "title": "Example subscription",
        "price": 500,
        "currency": "USD",
        "period": "1 month"
      }
    ]
  }
}

Alternative: Normalized slug already used

HTTP 409 response:

{
  "error": "subscription_slug_not_unique",
  "error_description": "Subscription slug already used",
  "req_guid": "synthetic-request-reference"
}

This validation precedes writing. Other failures can leave changes in place.

Recovery

HTTP statusAPI code / shapeCauseNext action
409incorrect_data / Body must be json format or Wrong http methodFalsy parsed body or wrong method if action reached.Use the registered POST route and intended JSON object.
409invalid_plan_id / Incorrect Plan ID; invalid_title / Title field is required; invalid_{field}Required/configured field validation.Correct the reported field; independently confirm the intended Plan's publication.
409subscription_slug or subscription_slug_not_uniqueNormalized slug too long or already used in selected publication context.Use the intended valid unique slug.
409next_subscription / message; trial_validation_error / messageChoice/autorenew conflict or trial pair/type error.Apply the field-specific order and type rules; do not assume a reader transition happened.
409validator_error / Validation has been failedOther caught validation Exception.Keep request reference and ask the integration operator to inspect the input.
412 / varieserror / Unknown error, or uncaught/runtime/transport failureWrite/VAT/event/response failure, possibly after earlier persistence.Inspect stored subscription/VAT state before retrying; no atomic rollback or unchanged-state guarantee.

See shared errors. Read subscription detail to inspect saved configuration.

Update a catalog subscription

PUT /api/v1/admin/subscriptions/{id}

Change a known subscription whose existing Plan belongs to the selected publication.

Before you call

Use support, admin or partner token, or root, and the intended subscription ID. Choose any replacement plan_id from this publication’s catalog. Use private directly: PUT public does not behave like POST.

Read write behavior: extra replaces the object; country_vat replaces the set; next/autorenew/null inputs have ordered effects. An error does not guarantee rollback. The example changes title and extra, omitting VAT and transitions.

Request

Send a JSON object. A present title has its validation and legacy fallback rules; PUT ignores type. Do not send taxonomies: values the API treats as true are rejected with invalid_taxonomies. Plan rules are separate. Pagination, filter and sort are ignored. Digit ID 0 reaches lookup and can return not found, without a separate invalid_id response.

Response

HTTP 200 returns subscription fields with expanded Plan.

Example: Change title and replace extra

Assume the record has the create example’s values. extra becomes {label:revised}, without merging old keys. Other general/conditional fields are omitted from the excerpt; immediate Plan and its lightweight child are complete.

curl "${WALLKIT_API_BASE}/api/v1/admin/subscriptions/3001" \
  -X PUT \
  -H "resource: ${RESOURCE_KEY}" \
  -H "token: ${ADMIN_TOKEN}" \
  -H "Content-Type: application/json" \
  --data '{"title":"Example revised subscription","extra":{"label":"revised"}}'
const url = new URL(`${process.env.WALLKIT_API_BASE}/api/v1/admin/subscriptions/3001`);
const response = await fetch(url, {
  method: "PUT",
  headers: {"resource": process.env.RESOURCE_KEY, "token": process.env.ADMIN_TOKEN, "Content-Type": "application/json"},
  body: JSON.stringify({"title": "Example revised subscription", "extra": {"label": "revised"}})
});
console.log(response.status, await response.json());
import os, json
from urllib.request import Request, urlopen
from urllib.error import HTTPError

url = os.environ["WALLKIT_API_BASE"] + "/api/v1/admin/subscriptions/3001"
body = json.dumps({'title': 'Example revised subscription', 'extra': {'label': 'revised'}}).encode("utf-8")
request = Request(
    url,
    data=body,
    headers={"resource": os.environ["RESOURCE_KEY"], "token": os.environ["ADMIN_TOKEN"], "Content-Type": "application/json"},
    method="PUT"
)
try:
    with urlopen(request) as response:
        print(response.status, json.load(response))
except HTTPError as error:
    print(error.code, json.load(error))

HTTP 200 response excerpt:

{
  "id": 3001,
  "slug": "example-subscription",
  "type": "standard",
  "title": "Example revised subscription",
  "plan_id": 5001,
  "price": 500,
  "currency": "USD",
  "period": "1 month",
  "active": false,
  "once": false,
  "private": true,
  "public": false,
  "is_allowed_autorenew": true,
  "is_applied_vat": false,
  "vat_percent": 0,
  "extra": {
    "label": "revised"
  },
  "next_subscription": null,
  "downgrade_subscription": null,
  "plan": {
    "id": 5001,
    "title": "Example Plan",
    "slug": "example-plan",
    "description": "Illustrative configuration.",
    "full_access": false,
    "predictive_paywall": false,
    "predictive_percents": 0,
    "can_own_teams": false,
    "priority": 1,
    "private": true,
    "active": false,
    "extra": {},
    "public": false,
    "subscriptions": [
      {
        "id": 3001,
        "title": "Example revised subscription",
        "price": 500,
        "currency": "USD",
        "period": "1 month"
      }
    ]
  }
}

Alternative: Subscription not found

HTTP 404 response:

{
  "error": "subscription_not_found",
  "error_description": "Subscription not found",
  "req_guid": "synthetic-request-reference"
}

No subscription matched through a Plan in this publication. This does not establish global absence.

Recovery

HTTP statusAPI code / shapeCauseNext action
404subscription_not_found / Subscription not foundNo selected-publication subscription matches ID.Check the known ID and publication, including its current parent Plan.
409incorrect_data, invalid_{field}, subscription_slug, subscription_slug_not_unique or validator_errorMethod/body/scalar/slug/other caught validation failure.Correct the reported constraint; do not infer a complete generic patch schema.
409next_subscription / message; trial_validation_error / messageChoice/autorenew/trial validation, including request ordering/type.Apply the exact transition/trial rules before resubmitting intended configuration.
409invalid_taxonomies / Subscription not support taxonomiesTruthy taxonomies supplied.Remove that field from this catalog request; it is not a Plan-rule update.
500 / varieserror / Unknown error, or uncaught/runtime/transport failureWrite/VAT/event/refresh/response-format failure after possible earlier writes.Inspect persisted subscription and complete VAT set before retrying. Do not assume rollback or unchanged state.

See shared errors. Read the subscription and compare intended fields and VAT/choice settings.

Delete a catalog subscription

DELETE /api/v1/admin/subscriptions/{id}

Delete a catalog record if its dependency checks allow it. This does not remove a reader’s membership or refund/migrate provider billing.

Before you call

Use support, admin or partner token, or root, with the publication key and numeric ID. Any membership/history can block deletion, including inactive or expired ones. Invitations, promos, sponsorships and default user/guest/downgrade references also block it. Review the blocking dependencies with your operator before retrying.

Initial lookup uses the parent Plan’s publication. Earlier deletion or later event/response failures can leave uncertain state. Inspect before repeating; another call may return not found. No exhaustive cascade or atomicity guarantee applies.

Request

Send the headers and intended numeric catalog ID in the path, without a body. No filter, pagination or sort options are supported. ID 0 can return not found; nondigit paths do not guarantee this JSON error shape.

Response

HTTP 200 returns this field, apart from shared response metadata:

FieldType / presenceMeaning
resultBoolean; addedCatalog subscription delete result, not a complete cascade report, payment/refund status or reader cancellation result. False is possible without an exception.

Example: Delete an intentionally disposable record

Assume fictional subscription 3001 belongs to this publication, has no blocking dependencies and permits the illustrated result.

curl "${WALLKIT_API_BASE}/api/v1/admin/subscriptions/3001" \
  -X DELETE \
  -H "resource: ${RESOURCE_KEY}" \
  -H "token: ${ADMIN_TOKEN}"
const url = new URL(`${process.env.WALLKIT_API_BASE}/api/v1/admin/subscriptions/3001`);
const response = await fetch(url, {
  method: "DELETE",
  headers: {"resource": process.env.RESOURCE_KEY, "token": process.env.ADMIN_TOKEN}
});
console.log(response.status, await response.json());
import os, json
from urllib.request import Request, urlopen
from urllib.error import HTTPError

url = os.environ["WALLKIT_API_BASE"] + "/api/v1/admin/subscriptions/3001"
request = Request(
    url,
    headers={"resource": os.environ["RESOURCE_KEY"], "token": os.environ["ADMIN_TOKEN"]},
    method="DELETE"
)
try:
    with urlopen(request) as response:
        print(response.status, json.load(response))
except HTTPError as error:
    print(error.code, json.load(error))

HTTP 200 response:

{
  "result": true
}

Alternative: History blocks deletion

HTTP 409 response:

{
  "error": "subscribers_subscription_used",
  "error_description": "The subscription cannot be deleted because users have a subscription history associated with it.",
  "req_guid": "synthetic-request-reference"
}

This route retains its 409 guard codes, unlike Plan delete’s exception/500 wrapper.

Recovery

HTTP statusAPI code / shapeCauseNext action
404subscription_not_found / Subscription not foundNo matching ID through a Plan in the selected publication, including an already removed record.Inspect the known configuration; do not repeat deletion blindly.
409subscribers_subscription_used / messageAny membership/history or sponsored subscription blocks deletion.Inspect the reported dependency with the integration operator; no automatic cancellation/history removal.
409invite_subscription_used / Cannot be deleted while it is being used in invitations.Invitation reference exists.Review the intended catalog/dependency state; do not infer a forced-delete option.
409promo_subscription_used / Cannot be deleted while it is being used in promo.Promo subscription link exists.Inspect the configured reference before deciding another action.
409resource_subscription_used / default-setting messageRecord is the configured default user, guest or downgrade subscription.Ask the integration operator to inspect the intended configuration; this request does not change those settings.
409delete_subscription_failed / messageOther caught failure, including possible snapshot/event/response failure.Retain request reference and inspect whether deletion already occurred before retrying.
200result:falseModel delete result was false.Inspect persisted configuration before another action.
Varies / no guaranteed JSONUncaught runtime/routing/transport failureNot every failure reaches the handler's Exception catches.Keep diagnostics and ask the integration operator to inspect state.

See shared errors. Browse subscriptions to inspect remaining configuration.

Price normalization

Price is filtered to float, then converted to text. If the filtered text contains a decimal point, the value is multiplied by 100, rounded and converted to integer. Otherwise it is rounded to integer without multiplication. The filtered representation matters, not just the original JSON spelling or trailing zeros.

Do not assume one major/minor input unit or universal multiplication by 100. The example uses integer-form 500 and stored price 500, without currency conversion. trial_price uses integer filtering instead. Confirm intended nonnegative amounts before sending; these fields do not compute final payable totals.

Request fields and operation differences

Send a JSON object. Field-specific behavior below takes precedence over a generic patch/replace assumption.

FieldInput / validationCreate and update behavior
plan_idRequired on create; existing Plan validation; integer assignmentA supplied nonnull value replaces the parent Plan ID. Omission/null preserves the existing update value. Choose a known intended existing Plan from the selected publication’s catalog.
titleRequired nonempty trimmed text on create; use the intended catalog titleUpdate rejects an explicitly present empty/trimmed-empty title; explicit null is not a preserve guarantee. Omission normally avoids assignment, but an existing empty title can trigger a legacy period-label fallback.
slugText normalized by transliteration/lowercase/hyphens; nonempty normalized value checked for publication uniqueness, maximum 128 charactersCreate omitted/normalized-empty stores null. Update property present assigns normalized value or null; omitted preserves. No Plan-style generated title-ID fallback. Exact null coercion is not guaranteed across runtimes.
typePOST enum: standard, gift, multi-seat when property presentCreate saves trimmed/lower text after validation; PUT ignores this field. Do not assume it changes a stored type. Omitted deployed default is not guaranteed here.
priceRequired on create; presence check, then amount filterUse an intended nonnegative amount using the price normalization described above. Update nonnull assigns; omitted/null preserves. See price normalization above.
currencyRequired on create; must be in configured currency listValidation precedes uppercase assignment; do not assume every lowercase input is accepted. Update validates/assigns when nonnull.
periodRequired on create; optional nonnull update textMatches /^[\d]{1,4}\s(day|month|year|week|hours|minute)$/i: one to four digits, one whitespace character, one listed word; then lowercased. No fixed seconds conversion or positive-count promise.
active, shared, once, privateBoolean inputs; assigned when nonnullOrdinary omitted/null values preserve existing update values. shared is accepted for storage but omitted from the selected response. No membership or eligibility grant.
publicBoolean input; assigned after privatePOST sets private=!filtered public; PUT sets private=filtered public. Use private when expressing the intended visibility in focused examples.
description, subscriber_typeStored value / filtered text respectively; nonnull assignmentOmitted/null preserves update values; no closed subscriber-type enum here.
is_applied_vat, vat_percentBoolean filtering / float filtering; nonnull assignmentStored settings, rather than a tax calculation. Choose the intended VAT percentage with your operator.
extraJSON objectWhole-object replacement. Null, array and scalar are ignored by this assignment.
limit_sponsored_slotsNumericality validation if property present; assigned only for a native JSON integer greater than 0Numeric strings, 0 or negative values are not an assignment/clear guarantee even if a value passes numeric validation. No sponsor availability calculation.
external_source_idsFiltered trimmed stringPOST assigns when nonnull; PUT processes when property present, including explicit null. Mapping data, not a provider API call or guaranteed parsed object.
is_allowed_upgrade_priceBoolean filteringPOST assigns when nonnull; PUT processes when property present. No immediate price-upgrade action or output-type conversion promise beyond the linked response definition.
is_allowed_autorenew, next_subscription, downgrade_subscriptionBoolean/reference inputsField-specific validation and assignment order below; no actual reader transition.
trial_period, trial_price, trial_iterationsTrial settingsField-specific validation/clearing below; no validated full stored-state or free-trial eligibility result.
country_vat[]Countable collection of country_id and vat_percent entriesCreate adds rows after saving the subscription. PUT upserts handled countries and deletes all other rows; [] or all-skipped IDs clears. Null/noncountable is not a clear instruction.

Use JSON booleans. After string/lowercase/trim filtering, empty values and literal false become false; nonempty off does not. The create example supplies material flags explicitly rather than assuming schema defaults.

country_id is integer-filtered; empty/zero IDs are skipped. vat_percent is float-filtered, with empty/zero results stored as 0. Supply existing intended countries once each with the appropriate VAT percentage. Earlier rows can remain after failure. Returned country fields follow the general subscription definition.

Next, downgrade and autorenew ordering

Nonempty next/downgrade choices must exist and their Plans must belong to the current publication. Confirm their activity, visibility, price and intended transition configuration with your operator. Select the parent plan_id from the same intended publication catalog.

SelectionBehavior
Next targetMust allow autorenew. During update validation the current subscription must disallow autorenew; a supplied is_allowed_autorenew is applied in memory before this check. An existing true flag with a new nonempty next target and no explicit false can fail before later assignment would disable it.
Downgrade targetExisting target and current-publication Plan required; no target-autorenew requirement.
Conflict checksReject self/direct opposite-link conflicts, direct reverse references, and equal nonempty next/downgrade IDs when both supplied. No full graph or longer-cycle guarantee.
Create autorenew/nextis_allowed_autorenew defaults explicitly to true when absent. A validated next ID is stored only when final autorenew is false; otherwise next is cleared. Supplying next alone does not override that create default.
Update next propertyPresent nonempty value assigns its integer reference; empty/null attempts clear. Presence also forces autorenew false before the final explicit autorenew override. Thus clearing next can disable autorenew unless the request explicitly overrides it.
Update autorenew trueFinal true clears next, including an existing next when the next property is omitted. Validation has already happened, so assignment order matters.
Downgrade clearingPUT property present with sanitized-empty value clears to null; omission preserves. POST nonnull assignment follows validation.

All next/downgrade validation failures use next_subscription, including downgrade errors. This configures choices rather than performing renewal or transition.

Trial settings

Omitted/null trial_period does not require a pair. When nonnull, it must be nonempty and trial_iterations must be a native JSON integer at least 1. Supply an intended trial period and price; ordinary period validation is separate, so confirm the complete trial configuration before use.

Create lowercases nonnull trial_period and integer-filters price/iterations. Update processes a present trial_period: null can follow its clearing path, while an empty string fails earlier validation. Omission preserves it. Clearing period does not clear stored trial_price/iterations; those assign only when nonnull. Iterations alone does not validate the full configuration.

Create/update response fields

Create returns HTTP 201; update returns HTTP 200. Both return the subscription at the top level, without items/paginator. Use general subscription fields with this immediate-Plan difference:

Returned objectType / presenceMeaning
SubscriptionGeneral subscription objectCatalog price, period, type, flags and extra; next/downgrade objects with their defined nesting limits; conditional Admin timestamps/country_vat. No reader membership dates or renewal choice. shared is not returned.
planExpanded immediate PlanThe linked 14 Plan fields: id,title,slug,description,full_access,predictive_paywall,predictive_percents,can_own_teams,priority,private,active,extra,public,subscriptions. No Plan timestamps, resource_id, settings, rules or list counts.
plan.subscriptions[]Array; presentOnly id,title,price,currency,period. These are lightweight choices without an active/private restriction.
next_subscription / downgrade_subscriptionGeneral/public subscription or null under defined conditionsCompact Plans and nesting limits follow the general definition, not the immediate-Plan expansion.
country_vat[]Array; Admin context onlyCountry VAT row/country fields from the linked definition, not a calculated tax result.

Related records can extend beyond the initial publication lookup. Missing Plan/link data can fail response generation instead of returning a compact fallback. extra and external mappings use application-defined data and are not guaranteed safe for public sharing. No new authentication credential is generated.

Full diagram

Use the arrow keys to scroll. Escape closes this view.

Search documentation

Enter at least 2 characters.

    ↑ ↓ move through results · Enter opens · Escape closes