Subscription Plan
Endpoints for Subscription Plan
Endpoints for Subscription Plan
GET/api/v1/subscription-plans
Authentication: Bearer token (JWT)
pagenumberOptional1minimum: 1takenumberOptional10minimum: 1maximum: 50orderDirectionstringOptional"desc"Allowed values: "asc", "desc"orderBystringOptional"createdAt"Allowed values: "createdAt", "id", "updatedAt", "name"statusstringOptional"draft", "published", "archived"allowSameSubscriptionChangebooleanOptionalallowDifferentSubscriptionSwitchbooleanOptionalshowAsOptionOnSubscriptionSwitchbooleanOptionalshowAsOptionOnAdminSubscriptionSwitchbooleanOptionalnamestringOptionalitemsarray of SubscriptionPlanResponseRequired33 fieldsitemspaymentProvidersarray of PAYMENT_PROVIDERRequired when parent is presentField path: items[].paymentProviders"stripe", "vipps", "external", "nets", "efaktura-avtalegiro-ehf", "swedbankpay"namestringRequired when parent is presentField path: items[].nameuuidstringRequired when parent is presentField path: items[].uuidbillingPeriodstringRequired when parent is presentField path: items[].billingPeriod"monthly", "thirty_days", "quarterly", "half_yearly", "yearly", "custom"billingPeriodUnitstringRequired when parent is presentField path: items[].billingPeriodUnit"day", "week", "month", "year"billingPeriodFrequencynumberRequired when parent is presentField path: items[].billingPeriodFrequencyautoRenewbooleanRequired when parent is presentField path: items[].autoRenewstatusstringRequired when parent is presentField path: items[].status"draft", "published", "archived"tenantIdnumberRequired when parent is presentField path: items[].tenantIdallowSameSubscriptionChangebooleanRequired when parent is presentField path: items[].allowSameSubscriptionChangeallowDifferentSubscriptionSwitchbooleanRequired when parent is presentField path: items[].allowDifferentSubscriptionSwitchallowAdminSameSubscriptionChangebooleanRequired when parent is presentField path: items[].allowAdminSameSubscriptionChangeallowAdminDifferentSubscriptionSwitchbooleanRequired when parent is presentField path: items[].allowAdminDifferentSubscriptionSwitchenableGiftSubscriptionbooleanRequired when parent is presentField path: items[].enableGiftSubscriptionallowFutureStartDatebooleanRequired when parent is presentField path: items[].allowFutureStartDateshowAsOptionOnSubscriptionSwitchbooleanRequired when parent is presentField path: items[].showAsOptionOnSubscriptionSwitchshowAsOptionOnAdminSubscriptionSwitchbooleanRequired when parent is presentField path: items[].showAsOptionOnAdminSubscriptionSwitchofferSwitchOnCheckoutbooleanRequired when parent is presentField path: items[].offerSwitchOnCheckouttenantTenantRequired when parent is presentField path: items[].tenantNested fields omitted: field limit.entityTagsarray of EntityTagRequired when parent is presentField path: items[].entityTags13 fieldsitems[].entityTagsproductIdnumberRequired when parent is presentField path: items[].entityTags[].productIdtagIdnumberRequired when parent is presentField path: items[].entityTags[].tagIdsubscriptionPlanIdnumberRequired when parent is presentField path: items[].entityTags[].subscriptionPlanIdtagTagRequired when parent is presentField path: items[].entityTags[].tagNested fields omitted: depth limit.productProductRequired when parent is presentField path: items[].entityTags[].productNested fields omitted: depth limit.subscriptionPlanSubscriptionPlanRequired when parent is presentField path: items[].entityTags[].subscriptionPlanNested fields omitted: depth limit.visualWorkflowIdnumberRequired when parent is presentField path: items[].entityTags[].visualWorkflowIdvisualWorkflowVisualWorkflowRequired when parent is presentField path: items[].entityTags[].visualWorkflowNested fields omitted: depth limit.idnumberRequired when parent is presentField path: items[].entityTags[].idcreatedAtstring (date-time)Required when parent is presentField path: items[].entityTags[].createdAtupdatedAtstring (date-time)Required when parent is presentField path: items[].entityTags[].updatedAtdeletedAtstring (date-time)Required when parent is presentField path: items[].entityTags[].deletedAtmetaDataobjectRequired when parent is presentField path: items[].entityTags[].metaDatasubscriptionPlanProductsarray of SubscriptionPlanProductRequired when parent is presentField path: items[].subscriptionPlanProducts13 fieldsitems[].subscriptionPlanProductssubscriptionPlanIdnumberRequired when parent is presentField path: items[].subscriptionPlanProducts[].subscriptionPlanIdproductIdnumberRequired when parent is presentField path: items[].subscriptionPlanProducts[].productIdpricenumberRequired when parent is presentField path: items[].subscriptionPlanProducts[].pricepropertiesOptionalProductPropertiesRequired when parent is presentField path: items[].subscriptionPlanProducts[].propertiesNested fields omitted: depth limit.subscriptionPlanSubscriptionPlanRequired when parent is presentField path: items[].subscriptionPlanProducts[].subscriptionPlanNested fields omitted: depth limit.productProductRequired when parent is presentField path: items[].subscriptionPlanProducts[].productNested fields omitted: depth limit.tenantIdnumberRequired when parent is presentField path: items[].subscriptionPlanProducts[].tenantIdtenantTenantRequired when parent is presentField path: items[].subscriptionPlanProducts[].tenantNested fields omitted: depth limit.idnumberRequired when parent is presentField path: items[].subscriptionPlanProducts[].idcreatedAtstring (date-time)Required when parent is presentField path: items[].subscriptionPlanProducts[].createdAtupdatedAtstring (date-time)Required when parent is presentField path: items[].subscriptionPlanProducts[].updatedAtdeletedAtstring (date-time)Required when parent is presentField path: items[].subscriptionPlanProducts[].deletedAtmetaDataobjectRequired when parent is presentField path: items[].subscriptionPlanProducts[].metaDatapackagesarray of PackageRequired when parent is presentField path: items[].packagesNested fields omitted: field limit.memberPackagesarray of MemberPackageRequired when parent is presentField path: items[].memberPackagesNested fields omitted: field limit.idnumberRequired when parent is presentField path: items[].idcreatedAtstring (date-time)Required when parent is presentField path: items[].createdAtupdatedAtstring (date-time)Required when parent is presentField path: items[].updatedAtdeletedAtstring (date-time)Required when parent is presentField path: items[].deletedAtmetaDataobjectRequired when parent is presentField path: items[].metaDatasubscriptionCountnumberRequired when parent is presentField path: items[].subscriptionCountproductsarray of SubscriptionProductRequired when parent is presentField path: items[].products13 fieldsitems[].productscirculationTypeCIRCULATION_TYPEField path: items[].products[].circulationType"subscription", "single_copy"productIdnumberRequired when parent is presentField path: items[].products[].productIdnamestringRequired when parent is presentField path: items[].products[].namepricenumberRequired when parent is presentField path: items[].products[].pricecurrencystringRequired when parent is presentField path: items[].products[].currencyisOptionalbooleanRequired when parent is presentField path: items[].products[].isOptionalbasePricenumberRequired when parent is presentField path: items[].products[].basePricepropertiesOptionalProductPropertiesRequired when parent is presentField path: items[].products[].propertiesNested fields omitted: depth limit.shippingChargesarray of ShippingChargeRequired when parent is presentField path: items[].products[].shippingChargesNested fields omitted: depth limit.productCategorystringRequired when parent is presentField path: items[].products[].productCategory"digital_subscription", "physical_subscription", "physical", "event_ticket", "PHYSICAL_PRODUCT"taxnumberRequired when parent is presentField path: items[].products[].taxdescriptionstringRequired when parent is presentField path: items[].products[].descriptionmaxQuantityPerOrdernumberRequired when parent is presentField path: items[].products[].maxQuantityPerOrdertagsarray of stringField path: items[].tagspricenumberRequired when parent is presentField path: items[].pricehasOptionalProductsbooleanRequired when parent is presentField path: items[].hasOptionalProductsmetaPageMetaRequired6 fieldsmetapagenumberRequiredField path: meta.pagetakenumberRequiredField path: meta.takecountnumberRequiredField path: meta.countpageCountnumberRequiredField path: meta.pageCounthasPreviousPagebooleanRequiredField path: meta.hasPreviousPagehasNextPagebooleanRequiredField path: meta.hasNextPage{
"items": [
{
"paymentProviders": [],
"entityTags": [],
"subscriptionPlanProducts": [],
"packages": [],
"memberPackages": [],
"metaData": {},
"products": [],
"tags": []
}
],
"meta": {
"page": 0,
"take": 0,
"count": 0,
"pageCount": 0,
"hasPreviousPage": true,
"hasNextPage": true
}
}Query validation failed; field codes in errors[]
messageCodestringRequired"badRequest", "internalServerError"messagestringerrorsarray of FieldErrorRequired7 fieldserrorsfieldstringRequired when parent is presentField path: errors[].fieldfieldValuestringRequired when parent is presentField path: errors[].fieldValueidentifierstringRequired when parent is presentField path: errors[].identifieridentifierValuestringRequired when parent is presentField path: errors[].identifierValuemessageCodestringRequired when parent is presentField path: errors[].messageCodemessagestringField path: errors[].messageerrorTypestringRequired when parent is presentField path: errors[].errorType{
"messageCode": "badRequest",
"message": "string",
"errors": [
{}
]
}unauthorized
This response has no body.
forbiddenResource
messageCodestringRequiredmessagestringerrorsarray of FieldErrorRequired7 fieldserrorsfieldstringRequired when parent is presentField path: errors[].fieldfieldValuestringRequired when parent is presentField path: errors[].fieldValueidentifierstringRequired when parent is presentField path: errors[].identifieridentifierValuestringRequired when parent is presentField path: errors[].identifierValuemessageCodestringRequired when parent is presentField path: errors[].messageCodemessagestringField path: errors[].messageerrorTypestringRequired when parent is presentField path: errors[].errorType{
"messageCode": "string",
"message": "string",
"errors": [
{}
]
}curlcurl https://api.subrite.no/api/v1/subscription-plans \
--header 'Authorization: Bearer <token>'POST/api/v1/subscription-plans
Authentication: Bearer token (JWT)
application/jsonproductsarray of SubscriptionPlanProductDtoRequired3 required when the containing object is present3 fieldsproductsuniqueItems: trueproductIdnumberRequired when parent is presentField path: products[].productIdminimum: 1pricenumberRequired when parent is presentField path: products[].priceminimum: 0propertiesOptionalProductPropertiesRequired when parent is presentField path: products[].properties2 required when the containing object is present2 fieldsproducts[].propertiesisRequiredbooleanRequired when parent is presentField path: products[].properties.isRequiredquantityRangenumberRequired when parent is presentField path: products[].properties.quantityRangepaymentProvidersarray of PAYMENT_PROVIDERRequired"stripe", "vipps", "external", "nets", "efaktura-avtalegiro-ehf", "swedbankpay"minItems: 1allowSameSubscriptionChangebooleanOptionalallowDifferentSubscriptionSwitchbooleanOptionalallowAdminSameSubscriptionChangebooleanOptionalallowAdminDifferentSubscriptionSwitchbooleanOptionalenableGiftSubscriptionbooleanOptionalallowFutureStartDatebooleanOptionalshowAsOptionOnSubscriptionSwitchbooleanOptionalshowAsOptionOnAdminSubscriptionSwitchbooleanOptionalofferSwitchOnCheckoutbooleanOptionalnamestringRequiredbillingPeriodstringRequired"monthly", "thirty_days", "quarterly", "half_yearly", "yearly", "custom"billingPeriodUnitstringRequiredbillingPeriodFrequencynumberRequiredminimum: 1statusstringRequired"draft", "published", "archived"autoRenewbooleanRequiredtagsarray of stringRequiredpaymentProvidersarray of PAYMENT_PROVIDERRequired"stripe", "vipps", "external", "nets", "efaktura-avtalegiro-ehf", "swedbankpay"namestringRequireduuidstringRequiredbillingPeriodstringRequired"monthly", "thirty_days", "quarterly", "half_yearly", "yearly", "custom"billingPeriodUnitstringRequired"day", "week", "month", "year"billingPeriodFrequencynumberRequiredautoRenewbooleanRequiredstatusstringRequired"draft", "published", "archived"tenantIdnumberRequiredallowSameSubscriptionChangebooleanRequiredallowDifferentSubscriptionSwitchbooleanRequiredallowAdminSameSubscriptionChangebooleanRequiredallowAdminDifferentSubscriptionSwitchbooleanRequiredenableGiftSubscriptionbooleanRequiredallowFutureStartDatebooleanRequiredshowAsOptionOnSubscriptionSwitchbooleanRequiredshowAsOptionOnAdminSubscriptionSwitchbooleanRequiredofferSwitchOnCheckoutbooleanRequiredtenantTenantRequiredNested fields omitted: field limit.entityTagsarray of EntityTagRequired13 fieldsentityTagsproductIdnumberRequired when parent is presentField path: entityTags[].productIdtagIdnumberRequired when parent is presentField path: entityTags[].tagIdsubscriptionPlanIdnumberRequired when parent is presentField path: entityTags[].subscriptionPlanIdtagTagRequired when parent is presentField path: entityTags[].tagNested fields omitted: field limit.productProductRequired when parent is presentField path: entityTags[].productNested fields omitted: field limit.subscriptionPlanSubscriptionPlanRequired when parent is presentField path: entityTags[].subscriptionPlanNested fields omitted: field limit.visualWorkflowIdnumberRequired when parent is presentField path: entityTags[].visualWorkflowIdvisualWorkflowVisualWorkflowRequired when parent is presentField path: entityTags[].visualWorkflowNested fields omitted: field limit.idnumberRequired when parent is presentField path: entityTags[].idcreatedAtstring (date-time)Required when parent is presentField path: entityTags[].createdAtupdatedAtstring (date-time)Required when parent is presentField path: entityTags[].updatedAtdeletedAtstring (date-time)Required when parent is presentField path: entityTags[].deletedAtmetaDataobjectRequired when parent is presentField path: entityTags[].metaDatasubscriptionPlanProductsarray of SubscriptionPlanProductRequired13 fieldssubscriptionPlanProductssubscriptionPlanIdnumberRequired when parent is presentField path: subscriptionPlanProducts[].subscriptionPlanIdproductIdnumberRequired when parent is presentField path: subscriptionPlanProducts[].productIdpricenumberRequired when parent is presentField path: subscriptionPlanProducts[].pricepropertiesOptionalProductPropertiesRequired when parent is presentField path: subscriptionPlanProducts[].properties2 fieldssubscriptionPlanProducts[].propertiesisRequiredbooleanRequired when parent is presentField path: subscriptionPlanProducts[].properties.isRequiredquantityRangenumberRequired when parent is presentField path: subscriptionPlanProducts[].properties.quantityRangesubscriptionPlanSubscriptionPlanRequired when parent is presentField path: subscriptionPlanProducts[].subscriptionPlanNested fields omitted: field limit.productProductRequired when parent is presentField path: subscriptionPlanProducts[].productNested fields omitted: field limit.tenantIdnumberRequired when parent is presentField path: subscriptionPlanProducts[].tenantIdtenantTenantRequired when parent is presentField path: subscriptionPlanProducts[].tenantNested fields omitted: field limit.idnumberRequired when parent is presentField path: subscriptionPlanProducts[].idcreatedAtstring (date-time)Required when parent is presentField path: subscriptionPlanProducts[].createdAtupdatedAtstring (date-time)Required when parent is presentField path: subscriptionPlanProducts[].updatedAtdeletedAtstring (date-time)Required when parent is presentField path: subscriptionPlanProducts[].deletedAtmetaDataobjectRequired when parent is presentField path: subscriptionPlanProducts[].metaDatapackagesarray of PackageRequiredNested fields omitted: field limit.memberPackagesarray of MemberPackageRequiredNested fields omitted: field limit.idnumberRequiredcreatedAtstring (date-time)RequiredupdatedAtstring (date-time)RequireddeletedAtstring (date-time)RequiredmetaDataobjectRequiredsubscriptionCountnumberRequiredproductsarray of SubscriptionProductRequired13 fieldsproductscirculationTypeCIRCULATION_TYPEField path: products[].circulationType"subscription", "single_copy"productIdnumberRequired when parent is presentField path: products[].productIdnamestringRequired when parent is presentField path: products[].namepricenumberRequired when parent is presentField path: products[].pricecurrencystringRequired when parent is presentField path: products[].currencyisOptionalbooleanRequired when parent is presentField path: products[].isOptionalbasePricenumberRequired when parent is presentField path: products[].basePricepropertiesOptionalProductPropertiesRequired when parent is presentField path: products[].properties2 fieldsproducts[].propertiesisRequiredbooleanRequired when parent is presentField path: products[].properties.isRequiredquantityRangenumberRequired when parent is presentField path: products[].properties.quantityRangeshippingChargesarray of ShippingChargeRequired when parent is presentField path: products[].shippingCharges2 fieldsproducts[].shippingChargescountrystringRequired when parent is presentField path: products[].shippingCharges[].countrychargenumberRequired when parent is presentField path: products[].shippingCharges[].chargeproductCategorystringRequired when parent is presentField path: products[].productCategory"digital_subscription", "physical_subscription", "physical", "event_ticket", "PHYSICAL_PRODUCT"taxnumberRequired when parent is presentField path: products[].taxdescriptionstringRequired when parent is presentField path: products[].descriptionmaxQuantityPerOrdernumberRequired when parent is presentField path: products[].maxQuantityPerOrdertagsarray of stringpricenumberRequiredhasOptionalProductsbooleanRequired{
"paymentProviders": [
"stripe"
],
"name": "string",
"uuid": "string",
"billingPeriod": "monthly",
"billingPeriodUnit": "day",
"billingPeriodFrequency": 0,
"autoRenew": true,
"status": "draft",
"tenantId": 0,
"allowSameSubscriptionChange": true,
"allowDifferentSubscriptionSwitch": true,
"allowAdminSameSubscriptionChange": true,
"allowAdminDifferentSubscriptionSwitch": true,
"enableGiftSubscription": true,
"allowFutureStartDate": true,
"showAsOptionOnSubscriptionSwitch": true,
"showAsOptionOnAdminSubscriptionSwitch": true,
"offerSwitchOnCheckout": true,
"tenant": {
"market": "NO",
"productName": "enterprise",
"additionalFeatures": [],
"disabledFeatures": [],
"name": "string",
"isActive": true,
"defaultLanguage": "en",
"hostName": "string",
"logo": "string",
"favicon": "string",
"authLogo": "string",
"authLogoHeight": 0,
"siteUrl": "string",
"termsUrl": "string",
"privacyUrl": "string",
"gtm": "string",
"taxRates": [],
"smsOtp": true,
"emailProvider": "brevo",
"tenantContact": "string",
"registeredBusinessNo": "string",
"bankAccountNo": "string",
"swiftCode": "string",
"iban": "<iban>",
"defaultLogoutURL": "string",
"postalAddress": "<postalAddress>",
"otpTemplateId": {},
"smsSenderId": 0,
"emailSenderId": 0,
"smsSender": {
"metaData": {}
},
"emailSender": {
"metaData": {}
},
"products": [],
"users": [],
"members": [],
"roles": [],
"subscriptionPlans": [],
"packages": [],
"invoices": [],
"orders": [],
"paymentProviders": [],
"newslettersProviderConfig": [],
"paymentProviderConfigs": [],
"oidcClients": [],
"oauthProviders": [],
"activityLogs": [],
"m2m_api_clients": [],
"customProperties": [],
"consents": [],
"preference": {
"inputFieldConfig": [],
"customFieldsOnMemberCard": [],
"customFieldsOnInvoice": [],
"visibleAdditionalFieldsOnMypage": [],
"metaData": {}
},
"settings": {
"aiResidency": {},
"metaData": {}
},
"communicationTemplates": [],
"additionalHostnames": [],
"exportHistory": [],
"arReportHistory": [],
"mypageCardsSettings": [],
"webhooks": [],
"customOrders": [],
"customOrderSources": [],
"brandKits": [],
"communicationReceivers": [],
"id": 0,
"createdAt": "2019-08-24T14:15:22Z",
"updatedAt": "2019-08-24T14:15:22Z",
"deletedAt": "2019-08-24T14:15:22Z",
"metaData": {}
},
"entityTags": [
{
"metaData": {}
}
],
"subscriptionPlanProducts": [
{
"metaData": {}
}
],
"packages": [
{
"paymentProviders": [],
"description": {},
"packageProducts": [],
"payments": [],
"memberPackages": [],
"metaData": {}
}
],
"memberPackages": [
{
"memberPackageProducts": [],
"orders": [],
"changes": [],
"histories": [],
"metaData": {}
}
],
"id": 0,
"createdAt": "2019-08-24T14:15:22Z",
"updatedAt": "2019-08-24T14:15:22Z",
"deletedAt": "2019-08-24T14:15:22Z",
"metaData": {},
"subscriptionCount": 0,
"products": [
{
"shippingCharges": []
}
],
"tags": [
"string"
],
"price": 0,
"hasOptionalProducts": true
}Body validation failed, or a product id does not exist in this tenant; field codes in errors[]
messageCodestringRequired"badRequest", "internalServerError", "invalidProducts"messagestringerrorsarray of FieldErrorRequired7 fieldserrorsfieldstringRequired when parent is presentField path: errors[].fieldfieldValuestringRequired when parent is presentField path: errors[].fieldValueidentifierstringRequired when parent is presentField path: errors[].identifieridentifierValuestringRequired when parent is presentField path: errors[].identifierValuemessageCodestringRequired when parent is presentField path: errors[].messageCodemessagestringField path: errors[].messageerrorTypestringRequired when parent is presentField path: errors[].errorType{
"messageCode": "badRequest",
"message": "string",
"errors": [
{}
]
}unauthorized
This response has no body.
forbiddenResource
Same fields as Get all subscription plans of the tenant (403).
{
"messageCode": "string",
"message": "string",
"errors": [
{}
]
}curlcurl https://api.subrite.no/api/v1/subscription-plans \
--request POST \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"products": [
{}
],
"paymentProviders": [
"stripe"
],
"allowSameSubscriptionChange": true,
"allowDifferentSubscriptionSwitch": true,
"allowAdminSameSubscriptionChange": true,
"allowAdminDifferentSubscriptionSwitch": true,
"enableGiftSubscription": true,
"allowFutureStartDate": true,
"showAsOptionOnSubscriptionSwitch": true,
"showAsOptionOnAdminSubscriptionSwitch": true,
"offerSwitchOnCheckout": true,
"name": "string",
"billingPeriod": "monthly",
"billingPeriodUnit": "string",
"billingPeriodFrequency": 1,
"status": "draft",
"autoRenew": true,
"tags": [
"string"
]
}'GET/api/v1/subscription-plans/statistic
Authentication: Bearer token (JWT)
activeMembersnumberRequiredsoldTodaynumberRequiredsoldYesterdaynumberRequiredsoldLast7DaysnumberRequired{
"activeMembers": 0,
"soldToday": 0,
"soldYesterday": 0,
"soldLast7Days": 0
}unauthorized
This response has no body.
forbiddenResource
Same fields as Get all subscription plans of the tenant (403).
{
"messageCode": "string",
"message": "string",
"errors": [
{}
]
}curlcurl https://api.subrite.no/api/v1/subscription-plans/statistic \
--header 'Authorization: Bearer <token>'GET/api/v1/subscription-plans/all
Authentication: Bearer token (JWT)
statusstringOptional"draft", "published", "archived"allowSameSubscriptionChangebooleanOptionalallowDifferentSubscriptionSwitchbooleanOptionalshowAsOptionOnSubscriptionSwitchbooleanOptionalshowAsOptionOnAdminSubscriptionSwitchbooleanOptionalnamestringOptionalpaymentProvidersarray of PAYMENT_PROVIDERRequired when parent is present"stripe", "vipps", "external", "nets", "efaktura-avtalegiro-ehf", "swedbankpay"namestringRequired when parent is presentuuidstringRequired when parent is presentbillingPeriodstringRequired when parent is present"monthly", "thirty_days", "quarterly", "half_yearly", "yearly", "custom"billingPeriodUnitstringRequired when parent is present"day", "week", "month", "year"billingPeriodFrequencynumberRequired when parent is presentautoRenewbooleanRequired when parent is presentstatusstringRequired when parent is present"draft", "published", "archived"tenantIdnumberRequired when parent is presentallowSameSubscriptionChangebooleanRequired when parent is presentallowDifferentSubscriptionSwitchbooleanRequired when parent is presentallowAdminSameSubscriptionChangebooleanRequired when parent is presentallowAdminDifferentSubscriptionSwitchbooleanRequired when parent is presentenableGiftSubscriptionbooleanRequired when parent is presentallowFutureStartDatebooleanRequired when parent is presentshowAsOptionOnSubscriptionSwitchbooleanRequired when parent is presentshowAsOptionOnAdminSubscriptionSwitchbooleanRequired when parent is presentofferSwitchOnCheckoutbooleanRequired when parent is presenttenantTenantRequired when parent is presentNested fields omitted: field limit.entityTagsarray of EntityTagRequired when parent is present13 fields[].entityTagsproductIdnumberRequired when parent is presentField path: [].entityTags[].productIdtagIdnumberRequired when parent is presentField path: [].entityTags[].tagIdsubscriptionPlanIdnumberRequired when parent is presentField path: [].entityTags[].subscriptionPlanIdtagTagRequired when parent is presentField path: [].entityTags[].tagNested fields omitted: field limit.productProductRequired when parent is presentField path: [].entityTags[].productNested fields omitted: field limit.subscriptionPlanSubscriptionPlanRequired when parent is presentField path: [].entityTags[].subscriptionPlanNested fields omitted: field limit.visualWorkflowIdnumberRequired when parent is presentField path: [].entityTags[].visualWorkflowIdvisualWorkflowVisualWorkflowRequired when parent is presentField path: [].entityTags[].visualWorkflowNested fields omitted: field limit.idnumberRequired when parent is presentField path: [].entityTags[].idcreatedAtstring (date-time)Required when parent is presentField path: [].entityTags[].createdAtupdatedAtstring (date-time)Required when parent is presentField path: [].entityTags[].updatedAtdeletedAtstring (date-time)Required when parent is presentField path: [].entityTags[].deletedAtmetaDataobjectRequired when parent is presentField path: [].entityTags[].metaDatasubscriptionPlanProductsarray of SubscriptionPlanProductRequired when parent is present13 fields[].subscriptionPlanProductssubscriptionPlanIdnumberRequired when parent is presentField path: [].subscriptionPlanProducts[].subscriptionPlanIdproductIdnumberRequired when parent is presentField path: [].subscriptionPlanProducts[].productIdpricenumberRequired when parent is presentField path: [].subscriptionPlanProducts[].pricepropertiesOptionalProductPropertiesRequired when parent is presentField path: [].subscriptionPlanProducts[].properties2 fields[].subscriptionPlanProducts[].propertiesisRequiredbooleanRequired when parent is presentField path: [].subscriptionPlanProducts[].properties.isRequiredquantityRangenumberRequired when parent is presentField path: [].subscriptionPlanProducts[].properties.quantityRangesubscriptionPlanSubscriptionPlanRequired when parent is presentField path: [].subscriptionPlanProducts[].subscriptionPlanNested fields omitted: field limit.productProductRequired when parent is presentField path: [].subscriptionPlanProducts[].productNested fields omitted: field limit.tenantIdnumberRequired when parent is presentField path: [].subscriptionPlanProducts[].tenantIdtenantTenantRequired when parent is presentField path: [].subscriptionPlanProducts[].tenantNested fields omitted: field limit.idnumberRequired when parent is presentField path: [].subscriptionPlanProducts[].idcreatedAtstring (date-time)Required when parent is presentField path: [].subscriptionPlanProducts[].createdAtupdatedAtstring (date-time)Required when parent is presentField path: [].subscriptionPlanProducts[].updatedAtdeletedAtstring (date-time)Required when parent is presentField path: [].subscriptionPlanProducts[].deletedAtmetaDataobjectRequired when parent is presentField path: [].subscriptionPlanProducts[].metaDatapackagesarray of PackageRequired when parent is presentNested fields omitted: field limit.memberPackagesarray of MemberPackageRequired when parent is presentNested fields omitted: field limit.idnumberRequired when parent is presentcreatedAtstring (date-time)Required when parent is presentupdatedAtstring (date-time)Required when parent is presentdeletedAtstring (date-time)Required when parent is presentmetaDataobjectRequired when parent is presentsubscriptionCountnumberRequired when parent is presentproductsarray of SubscriptionProductRequired when parent is present13 fields[].productscirculationTypeCIRCULATION_TYPEField path: [].products[].circulationType"subscription", "single_copy"productIdnumberRequired when parent is presentField path: [].products[].productIdnamestringRequired when parent is presentField path: [].products[].namepricenumberRequired when parent is presentField path: [].products[].pricecurrencystringRequired when parent is presentField path: [].products[].currencyisOptionalbooleanRequired when parent is presentField path: [].products[].isOptionalbasePricenumberRequired when parent is presentField path: [].products[].basePricepropertiesOptionalProductPropertiesRequired when parent is presentField path: [].products[].properties2 fields[].products[].propertiesisRequiredbooleanRequired when parent is presentField path: [].products[].properties.isRequiredquantityRangenumberRequired when parent is presentField path: [].products[].properties.quantityRangeshippingChargesarray of ShippingChargeRequired when parent is presentField path: [].products[].shippingCharges2 fields[].products[].shippingChargescountrystringRequired when parent is presentField path: [].products[].shippingCharges[].countrychargenumberRequired when parent is presentField path: [].products[].shippingCharges[].chargeproductCategorystringRequired when parent is presentField path: [].products[].productCategory"digital_subscription", "physical_subscription", "physical", "event_ticket", "PHYSICAL_PRODUCT"taxnumberRequired when parent is presentField path: [].products[].taxdescriptionstringRequired when parent is presentField path: [].products[].descriptionmaxQuantityPerOrdernumberRequired when parent is presentField path: [].products[].maxQuantityPerOrdertagsarray of stringpricenumberRequired when parent is presenthasOptionalProductsbooleanRequired when parent is present[
{
"paymentProviders": [],
"name": "string",
"uuid": "string",
"billingPeriod": "monthly",
"billingPeriodUnit": "day",
"billingPeriodFrequency": 0,
"autoRenew": true,
"status": "draft",
"tenantId": 0,
"allowSameSubscriptionChange": true,
"allowDifferentSubscriptionSwitch": true,
"allowAdminSameSubscriptionChange": true,
"allowAdminDifferentSubscriptionSwitch": true,
"enableGiftSubscription": true,
"allowFutureStartDate": true,
"showAsOptionOnSubscriptionSwitch": true,
"showAsOptionOnAdminSubscriptionSwitch": true,
"offerSwitchOnCheckout": true,
"tenant": {
"additionalFeatures": [],
"disabledFeatures": [],
"taxRates": [],
"products": [],
"users": [],
"members": [],
"roles": [],
"subscriptionPlans": [],
"packages": [],
"invoices": [],
"orders": [],
"paymentProviders": [],
"newslettersProviderConfig": [],
"paymentProviderConfigs": [],
"oidcClients": [],
"oauthProviders": [],
"activityLogs": [],
"m2m_api_clients": [],
"customProperties": [],
"consents": [],
"communicationTemplates": [],
"additionalHostnames": [],
"exportHistory": [],
"arReportHistory": [],
"mypageCardsSettings": [],
"webhooks": [],
"customOrders": [],
"customOrderSources": [],
"brandKits": [],
"communicationReceivers": [],
"metaData": {}
},
"entityTags": [],
"subscriptionPlanProducts": [],
"packages": [],
"memberPackages": [],
"id": 0,
"createdAt": "2019-08-24T14:15:22Z",
"updatedAt": "2019-08-24T14:15:22Z",
"deletedAt": "2019-08-24T14:15:22Z",
"metaData": {},
"subscriptionCount": 0,
"products": [],
"tags": [],
"price": 0,
"hasOptionalProducts": true
}
]Query validation failed; field codes in errors[]
Same fields as Get all subscription plans of the tenant (400).
{
"messageCode": "badRequest",
"message": "string",
"errors": [
{}
]
}unauthorized
This response has no body.
forbiddenResource
Same fields as Get all subscription plans of the tenant (403).
{
"messageCode": "string",
"message": "string",
"errors": [
{}
]
}curlcurl https://api.subrite.no/api/v1/subscription-plans/all \
--header 'Authorization: Bearer <token>'GET/api/v1/subscription-plans/enqueue-cleanup-invited-members-not-accepted-expired
Authentication: Bearer token (JWT)
This response has no body.
unauthorized
This response has no body.
forbiddenResource
Same fields as Get all subscription plans of the tenant (403).
{
"messageCode": "string",
"message": "string",
"errors": [
{}
]
}curlcurl https://api.subrite.no/api/v1/subscription-plans/enqueue-cleanup-invited-members-not-accepted-expired \
--header 'Authorization: Bearer <token>'GET/api/v1/subscription-plans/{id}
Authentication: Bearer token (JWT)
idnumberRequiredSame fields as Create a new subscription plan (201).
{
"paymentProviders": [
"stripe"
],
"name": "string",
"uuid": "string",
"billingPeriod": "monthly",
"billingPeriodUnit": "day",
"billingPeriodFrequency": 0,
"autoRenew": true,
"status": "draft",
"tenantId": 0,
"allowSameSubscriptionChange": true,
"allowDifferentSubscriptionSwitch": true,
"allowAdminSameSubscriptionChange": true,
"allowAdminDifferentSubscriptionSwitch": true,
"enableGiftSubscription": true,
"allowFutureStartDate": true,
"showAsOptionOnSubscriptionSwitch": true,
"showAsOptionOnAdminSubscriptionSwitch": true,
"offerSwitchOnCheckout": true,
"tenant": {
"market": "NO",
"productName": "enterprise",
"additionalFeatures": [],
"disabledFeatures": [],
"name": "string",
"isActive": true,
"defaultLanguage": "en",
"hostName": "string",
"logo": "string",
"favicon": "string",
"authLogo": "string",
"authLogoHeight": 0,
"siteUrl": "string",
"termsUrl": "string",
"privacyUrl": "string",
"gtm": "string",
"taxRates": [],
"smsOtp": true,
"emailProvider": "brevo",
"tenantContact": "string",
"registeredBusinessNo": "string",
"bankAccountNo": "string",
"swiftCode": "string",
"iban": "<iban>",
"defaultLogoutURL": "string",
"postalAddress": "<postalAddress>",
"otpTemplateId": {},
"smsSenderId": 0,
"emailSenderId": 0,
"smsSender": {
"metaData": {}
},
"emailSender": {
"metaData": {}
},
"products": [],
"users": [],
"members": [],
"roles": [],
"subscriptionPlans": [],
"packages": [],
"invoices": [],
"orders": [],
"paymentProviders": [],
"newslettersProviderConfig": [],
"paymentProviderConfigs": [],
"oidcClients": [],
"oauthProviders": [],
"activityLogs": [],
"m2m_api_clients": [],
"customProperties": [],
"consents": [],
"preference": {
"inputFieldConfig": [],
"customFieldsOnMemberCard": [],
"customFieldsOnInvoice": [],
"visibleAdditionalFieldsOnMypage": [],
"metaData": {}
},
"settings": {
"aiResidency": {},
"metaData": {}
},
"communicationTemplates": [],
"additionalHostnames": [],
"exportHistory": [],
"arReportHistory": [],
"mypageCardsSettings": [],
"webhooks": [],
"customOrders": [],
"customOrderSources": [],
"brandKits": [],
"communicationReceivers": [],
"id": 0,
"createdAt": "2019-08-24T14:15:22Z",
"updatedAt": "2019-08-24T14:15:22Z",
"deletedAt": "2019-08-24T14:15:22Z",
"metaData": {}
},
"entityTags": [
{
"metaData": {}
}
],
"subscriptionPlanProducts": [
{
"metaData": {}
}
],
"packages": [
{
"paymentProviders": [],
"description": {},
"packageProducts": [],
"payments": [],
"memberPackages": [],
"metaData": {}
}
],
"memberPackages": [
{
"memberPackageProducts": [],
"orders": [],
"changes": [],
"histories": [],
"metaData": {}
}
],
"id": 0,
"createdAt": "2019-08-24T14:15:22Z",
"updatedAt": "2019-08-24T14:15:22Z",
"deletedAt": "2019-08-24T14:15:22Z",
"metaData": {},
"subscriptionCount": 0,
"products": [
{
"shippingCharges": []
}
],
"tags": [
"string"
],
"price": 0,
"hasOptionalProducts": true
}The id is not an integer
messageCodestringRequired"badRequest"messagestringerrorsarray of FieldErrorRequired7 fieldserrorsfieldstringRequired when parent is presentField path: errors[].fieldfieldValuestringRequired when parent is presentField path: errors[].fieldValueidentifierstringRequired when parent is presentField path: errors[].identifieridentifierValuestringRequired when parent is presentField path: errors[].identifierValuemessageCodestringRequired when parent is presentField path: errors[].messageCodemessagestringField path: errors[].messageerrorTypestringRequired when parent is presentField path: errors[].errorType{
"messageCode": "badRequest",
"message": "string",
"errors": [
{}
]
}unauthorized
This response has no body.
forbiddenResource
Same fields as Get all subscription plans of the tenant (403).
{
"messageCode": "string",
"message": "string",
"errors": [
{}
]
}subscriptionPlanNotFound
messageCodestringRequired"subscriptionPlanNotFound"messagestringerrorsarray of FieldErrorRequired7 fieldserrorsfieldstringRequired when parent is presentField path: errors[].fieldfieldValuestringRequired when parent is presentField path: errors[].fieldValueidentifierstringRequired when parent is presentField path: errors[].identifieridentifierValuestringRequired when parent is presentField path: errors[].identifierValuemessageCodestringRequired when parent is presentField path: errors[].messageCodemessagestringField path: errors[].messageerrorTypestringRequired when parent is presentField path: errors[].errorType{
"messageCode": "subscriptionPlanNotFound",
"message": "string",
"errors": [
{}
]
}curlcurl 'https://api.subrite.no/api/v1/subscription-plans/{id}' \
--header 'Authorization: Bearer <token>'DELETE/api/v1/subscription-plans/{id}
Authentication: Bearer token (JWT)
idnumberRequiredThis response has no body.
The id is not an integer, or a package still uses the plan
messageCodestringRequired"badRequest", "subscriptionPlanUsedInPackages"messagestringerrorsarray of FieldErrorRequired7 fieldserrorsfieldstringRequired when parent is presentField path: errors[].fieldfieldValuestringRequired when parent is presentField path: errors[].fieldValueidentifierstringRequired when parent is presentField path: errors[].identifieridentifierValuestringRequired when parent is presentField path: errors[].identifierValuemessageCodestringRequired when parent is presentField path: errors[].messageCodemessagestringField path: errors[].messageerrorTypestringRequired when parent is presentField path: errors[].errorType{
"messageCode": "badRequest",
"message": "string",
"errors": [
{}
]
}unauthorized
This response has no body.
forbiddenResource
Same fields as Get all subscription plans of the tenant (403).
{
"messageCode": "string",
"message": "string",
"errors": [
{}
]
}subscriptionPlanNotFound
Same fields as Get a subscription plan by id (404).
{
"messageCode": "subscriptionPlanNotFound",
"message": "string",
"errors": [
{}
]
}curlcurl 'https://api.subrite.no/api/v1/subscription-plans/{id}' \
--request DELETE \
--header 'Authorization: Bearer <token>'PATCH/api/v1/subscription-plans/{id}
Authentication: Bearer token (JWT)
idnumberRequiredapplication/jsonproductsarray of SubscriptionPlanProductDtoOptional3 required when the containing object is present3 fieldsproductsuniqueItems: trueproductIdnumberRequired when parent is presentField path: products[].productIdminimum: 1pricenumberRequired when parent is presentField path: products[].priceminimum: 0propertiesOptionalProductPropertiesRequired when parent is presentField path: products[].properties2 required when the containing object is present2 fieldsproducts[].propertiesisRequiredbooleanRequired when parent is presentField path: products[].properties.isRequiredquantityRangenumberRequired when parent is presentField path: products[].properties.quantityRangepaymentProvidersarray of PAYMENT_PROVIDEROptional"stripe", "vipps", "external", "nets", "efaktura-avtalegiro-ehf", "swedbankpay"minItems: 1allowSameSubscriptionChangebooleanOptionalallowDifferentSubscriptionSwitchbooleanOptionalallowAdminSameSubscriptionChangebooleanOptionalallowAdminDifferentSubscriptionSwitchbooleanOptionalenableGiftSubscriptionbooleanOptionalallowFutureStartDatebooleanOptionalshowAsOptionOnSubscriptionSwitchbooleanOptionalshowAsOptionOnAdminSubscriptionSwitchbooleanOptionalofferSwitchOnCheckoutbooleanOptionalnamestringOptionalbillingPeriodstringOptional"monthly", "thirty_days", "quarterly", "half_yearly", "yearly", "custom"billingPeriodUnitstringOptionalbillingPeriodFrequencynumberOptionalminimum: 1statusstringOptional"draft", "published", "archived"autoRenewbooleanOptionaltagsarray of stringOptional{
"paymentProviders": [
"stripe"
],
"allowSameSubscriptionChange": true,
"allowDifferentSubscriptionSwitch": true,
"allowAdminSameSubscriptionChange": true,
"allowAdminDifferentSubscriptionSwitch": true,
"enableGiftSubscription": true,
"allowFutureStartDate": true,
"showAsOptionOnSubscriptionSwitch": true,
"showAsOptionOnAdminSubscriptionSwitch": true,
"offerSwitchOnCheckout": true,
"name": "string",
"billingPeriod": "monthly",
"billingPeriodUnit": "string",
"billingPeriodFrequency": 1,
"status": "draft",
"autoRenew": true,
"tags": [
"string"
]
}Same fields as Create a new subscription plan (201).
{
"paymentProviders": [
"stripe"
],
"name": "string",
"uuid": "string",
"billingPeriod": "monthly",
"billingPeriodUnit": "day",
"billingPeriodFrequency": 0,
"autoRenew": true,
"status": "draft",
"tenantId": 0,
"allowSameSubscriptionChange": true,
"allowDifferentSubscriptionSwitch": true,
"allowAdminSameSubscriptionChange": true,
"allowAdminDifferentSubscriptionSwitch": true,
"enableGiftSubscription": true,
"allowFutureStartDate": true,
"showAsOptionOnSubscriptionSwitch": true,
"showAsOptionOnAdminSubscriptionSwitch": true,
"offerSwitchOnCheckout": true,
"tenant": {
"market": "NO",
"productName": "enterprise",
"additionalFeatures": [],
"disabledFeatures": [],
"name": "string",
"isActive": true,
"defaultLanguage": "en",
"hostName": "string",
"logo": "string",
"favicon": "string",
"authLogo": "string",
"authLogoHeight": 0,
"siteUrl": "string",
"termsUrl": "string",
"privacyUrl": "string",
"gtm": "string",
"taxRates": [],
"smsOtp": true,
"emailProvider": "brevo",
"tenantContact": "string",
"registeredBusinessNo": "string",
"bankAccountNo": "string",
"swiftCode": "string",
"iban": "<iban>",
"defaultLogoutURL": "string",
"postalAddress": "<postalAddress>",
"otpTemplateId": {},
"smsSenderId": 0,
"emailSenderId": 0,
"smsSender": {
"metaData": {}
},
"emailSender": {
"metaData": {}
},
"products": [],
"users": [],
"members": [],
"roles": [],
"subscriptionPlans": [],
"packages": [],
"invoices": [],
"orders": [],
"paymentProviders": [],
"newslettersProviderConfig": [],
"paymentProviderConfigs": [],
"oidcClients": [],
"oauthProviders": [],
"activityLogs": [],
"m2m_api_clients": [],
"customProperties": [],
"consents": [],
"preference": {
"inputFieldConfig": [],
"customFieldsOnMemberCard": [],
"customFieldsOnInvoice": [],
"visibleAdditionalFieldsOnMypage": [],
"metaData": {}
},
"settings": {
"aiResidency": {},
"metaData": {}
},
"communicationTemplates": [],
"additionalHostnames": [],
"exportHistory": [],
"arReportHistory": [],
"mypageCardsSettings": [],
"webhooks": [],
"customOrders": [],
"customOrderSources": [],
"brandKits": [],
"communicationReceivers": [],
"id": 0,
"createdAt": "2019-08-24T14:15:22Z",
"updatedAt": "2019-08-24T14:15:22Z",
"deletedAt": "2019-08-24T14:15:22Z",
"metaData": {}
},
"entityTags": [
{
"metaData": {}
}
],
"subscriptionPlanProducts": [
{
"metaData": {}
}
],
"packages": [
{
"paymentProviders": [],
"description": {},
"packageProducts": [],
"payments": [],
"memberPackages": [],
"metaData": {}
}
],
"memberPackages": [
{
"memberPackageProducts": [],
"orders": [],
"changes": [],
"histories": [],
"metaData": {}
}
],
"id": 0,
"createdAt": "2019-08-24T14:15:22Z",
"updatedAt": "2019-08-24T14:15:22Z",
"deletedAt": "2019-08-24T14:15:22Z",
"metaData": {},
"subscriptionCount": 0,
"products": [
{
"shippingCharges": []
}
],
"tags": [
"string"
],
"price": 0,
"hasOptionalProducts": true
}Body validation failed, the id is not an integer, a product id is unknown, or the product change is not allowed while members are subscribed to the plan
messageCodestringRequired"badRequest", "internalServerError", "invalidProducts", "planProductRemovalBlockedByActiveSubscriptions", "planRequiredProductAdditionBlockedByActiveSubscriptions"messagestringerrorsarray of FieldErrorRequired7 fieldserrorsfieldstringRequired when parent is presentField path: errors[].fieldfieldValuestringRequired when parent is presentField path: errors[].fieldValueidentifierstringRequired when parent is presentField path: errors[].identifieridentifierValuestringRequired when parent is presentField path: errors[].identifierValuemessageCodestringRequired when parent is presentField path: errors[].messageCodemessagestringField path: errors[].messageerrorTypestringRequired when parent is presentField path: errors[].errorType{
"messageCode": "badRequest",
"message": "string",
"errors": [
{}
]
}unauthorized
This response has no body.
forbiddenResource
Same fields as Get all subscription plans of the tenant (403).
{
"messageCode": "string",
"message": "string",
"errors": [
{}
]
}subscriptionPlanNotFound
Same fields as Get a subscription plan by id (404).
{
"messageCode": "subscriptionPlanNotFound",
"message": "string",
"errors": [
{}
]
}A price change was carried in the body while another is already scheduled for a future date
messageCodestringRequired"planPriceVersionAlreadyScheduled"messagestringerrorsarray of FieldErrorRequired7 fieldserrorsfieldstringRequired when parent is presentField path: errors[].fieldfieldValuestringRequired when parent is presentField path: errors[].fieldValueidentifierstringRequired when parent is presentField path: errors[].identifieridentifierValuestringRequired when parent is presentField path: errors[].identifierValuemessageCodestringRequired when parent is presentField path: errors[].messageCodemessagestringField path: errors[].messageerrorTypestringRequired when parent is presentField path: errors[].errorType{
"messageCode": "planPriceVersionAlreadyScheduled",
"message": "string",
"errors": [
{}
]
}curlcurl 'https://api.subrite.no/api/v1/subscription-plans/{id}' \
--request PATCH \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"products": [
{}
],
"paymentProviders": [
"stripe"
],
"allowSameSubscriptionChange": true,
"allowDifferentSubscriptionSwitch": true,
"allowAdminSameSubscriptionChange": true,
"allowAdminDifferentSubscriptionSwitch": true,
"enableGiftSubscription": true,
"allowFutureStartDate": true,
"showAsOptionOnSubscriptionSwitch": true,
"showAsOptionOnAdminSubscriptionSwitch": true,
"offerSwitchOnCheckout": true,
"name": "string",
"billingPeriod": "monthly",
"billingPeriodUnit": "string",
"billingPeriodFrequency": 1,
"status": "draft",
"autoRenew": true,
"tags": [
"string"
]
}'GET/api/v1/subscription-plans/{id}/price-versions
Authentication: Bearer token (JWT)
idnumberRequiredversionsarray of PlanPriceVersionResponseRequired15 fieldsversionsstatusPLAN_PRICE_VERSION_STATUSRequired when parent is presentField path: versions[].status"scheduled", "active", "superseded", "cancelled"productsarray of PlanPriceVersionProductResponseRequired when parent is presentField path: versions[].products4 fieldsversions[].productsproductIdnumberRequired when parent is presentField path: versions[].products[].productIdpricenumberRequired when parent is presentField path: versions[].products[].pricenamestringField path: versions[].products[].nameisOptionalbooleanField path: versions[].products[].isOptionalidstringRequired when parent is presentField path: versions[].idsubscriptionPlanIdnumberRequired when parent is presentField path: versions[].subscriptionPlanIdvalidFromstring (date-time)Required when parent is presentField path: versions[].validFromnotestringRequired when parent is presentField path: versions[].noteaffectedCountAtSchedulenumberRequired when parent is presentField path: versions[].affectedCountAtSchedulecreatedByUserIdnumberRequired when parent is presentField path: versions[].createdByUserIdcreatedByNamestringRequired when parent is presentField path: versions[].createdByNamecreatedAtstring (date-time)Required when parent is presentField path: versions[].createdAtactivatedAtstring (date-time)Required when parent is presentField path: versions[].activatedAtcancelledByUserIdnumberRequired when parent is presentField path: versions[].cancelledByUserIdcancelledByNamestringRequired when parent is presentField path: versions[].cancelledByNamecancelledAtstring (date-time)Required when parent is presentField path: versions[].cancelledAtcancellablebooleanRequired when parent is presentField path: versions[].cancellable{
"versions": [
{
"products": []
}
]
}The id is not an integer
Same fields as Get a subscription plan by id (400).
{
"messageCode": "badRequest",
"message": "string",
"errors": [
{}
]
}unauthorized
This response has no body.
forbiddenResource
Same fields as Get all subscription plans of the tenant (403).
{
"messageCode": "string",
"message": "string",
"errors": [
{}
]
}subscriptionPlanNotFound
Same fields as Get a subscription plan by id (404).
{
"messageCode": "subscriptionPlanNotFound",
"message": "string",
"errors": [
{}
]
}curlcurl 'https://api.subrite.no/api/v1/subscription-plans/{id}/price-versions' \
--header 'Authorization: Bearer <token>'POST/api/v1/subscription-plans/{id}/price-versions
Authentication: Bearer token (JWT)
idnumberRequiredapplication/jsonproductsarray of PlanPriceVersionProductDtoRequired2 required when the containing object is present2 fieldsproductsminItems: 1uniqueItems: trueproductIdnumberRequired when parent is presentField path: products[].productIdminimum: 1pricenumberRequired when parent is presentField path: products[].priceminimum: 0validFromstringOptionalpattern: /^\d{4}-\d{2}-\d{2}$/notestringOptionalmaxLength: 255statusPLAN_PRICE_VERSION_STATUSRequired"scheduled", "active", "superseded", "cancelled"productsarray of PlanPriceVersionProductResponseRequired4 fieldsproductsproductIdnumberRequired when parent is presentField path: products[].productIdpricenumberRequired when parent is presentField path: products[].pricenamestringField path: products[].nameisOptionalbooleanField path: products[].isOptionalidstringRequiredsubscriptionPlanIdnumberRequiredvalidFromstring (date-time)RequirednotestringRequiredaffectedCountAtSchedulenumberRequiredcreatedByUserIdnumberRequiredcreatedByNamestringRequiredcreatedAtstring (date-time)RequiredactivatedAtstring (date-time)RequiredcancelledByUserIdnumberRequiredcancelledByNamestringRequiredcancelledAtstring (date-time)RequiredcancellablebooleanRequired{
"status": "scheduled",
"products": [
{}
],
"id": "string",
"subscriptionPlanId": 0,
"validFrom": "2019-08-24T14:15:22Z",
"note": "string",
"affectedCountAtSchedule": 0,
"createdByUserId": 0,
"createdByName": "string",
"createdAt": "2019-08-24T14:15:22Z",
"activatedAt": "2019-08-24T14:15:22Z",
"cancelledByUserId": 0,
"cancelledByName": "string",
"cancelledAt": "2019-08-24T14:15:22Z",
"cancellable": true
}Body validation failed, the effective date is in the past, the prices do not cover exactly the products on the plan, or they change no price
messageCodestringRequired"badRequest", "internalServerError", "planPriceVersionTooSoon", "planPriceVersionProductsMismatch", "planPriceVersionUnchanged"messagestringerrorsarray of FieldErrorRequired7 fieldserrorsfieldstringRequired when parent is presentField path: errors[].fieldfieldValuestringRequired when parent is presentField path: errors[].fieldValueidentifierstringRequired when parent is presentField path: errors[].identifieridentifierValuestringRequired when parent is presentField path: errors[].identifierValuemessageCodestringRequired when parent is presentField path: errors[].messageCodemessagestringField path: errors[].messageerrorTypestringRequired when parent is presentField path: errors[].errorType{
"messageCode": "badRequest",
"message": "string",
"errors": [
{}
]
}unauthorized
This response has no body.
forbiddenResource
Same fields as Get all subscription plans of the tenant (403).
{
"messageCode": "string",
"message": "string",
"errors": [
{}
]
}subscriptionPlanNotFound
Same fields as Get a subscription plan by id (404).
{
"messageCode": "subscriptionPlanNotFound",
"message": "string",
"errors": [
{}
]
}planPriceVersionAlreadyScheduled
Same fields as Update a subscription plan (409).
{
"messageCode": "planPriceVersionAlreadyScheduled",
"message": "string",
"errors": [
{}
]
}curlcurl 'https://api.subrite.no/api/v1/subscription-plans/{id}/price-versions' \
--request POST \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"products": [
{}
],
"validFrom": "string",
"note": "string"
}'POST/api/v1/subscription-plans/{id}/price-versions/preview
Authentication: Bearer token (JWT)
idnumberRequiredapplication/jsonbyPaymentProviderarray of PaymentProviderCountRequired2 fieldsbyPaymentProviderpaymentProviderstringRequired when parent is presentField path: byPaymentProvider[].paymentProvidercountnumberRequired when parent is presentField path: byPaymentProvider[].countaffectedActivenumberRequiredaffectedEndednumberRequiredskippedCustomPricenumberRequiredmovesOnePeriodLaternumberRequiredmrrDeltanumberRequiredcurrentPlanPricenumberRequirednewPlanPricenumberRequiredvalidFromstring (date-time)RequiredimmediatebooleanRequired{
"byPaymentProvider": [
{}
],
"affectedActive": 0,
"affectedEnded": 0,
"skippedCustomPrice": 0,
"movesOnePeriodLater": 0,
"mrrDelta": 0,
"currentPlanPrice": 0,
"newPlanPrice": 0,
"validFrom": "2019-08-24T14:15:22Z",
"immediate": true
}Body validation failed, the effective date is in the past, or the prices do not cover exactly the products on the plan
messageCodestringRequired"badRequest", "internalServerError", "planPriceVersionTooSoon", "planPriceVersionProductsMismatch"messagestringerrorsarray of FieldErrorRequired7 fieldserrorsfieldstringRequired when parent is presentField path: errors[].fieldfieldValuestringRequired when parent is presentField path: errors[].fieldValueidentifierstringRequired when parent is presentField path: errors[].identifieridentifierValuestringRequired when parent is presentField path: errors[].identifierValuemessageCodestringRequired when parent is presentField path: errors[].messageCodemessagestringField path: errors[].messageerrorTypestringRequired when parent is presentField path: errors[].errorType{
"messageCode": "badRequest",
"message": "string",
"errors": [
{}
]
}unauthorized
This response has no body.
forbiddenResource
Same fields as Get all subscription plans of the tenant (403).
{
"messageCode": "string",
"message": "string",
"errors": [
{}
]
}subscriptionPlanNotFound
Same fields as Get a subscription plan by id (404).
{
"messageCode": "subscriptionPlanNotFound",
"message": "string",
"errors": [
{}
]
}curlcurl 'https://api.subrite.no/api/v1/subscription-plans/{id}/price-versions/preview' \
--request POST \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"products": [
{}
],
"validFrom": "string",
"note": "string"
}'DELETE/api/v1/subscription-plans/{id}/price-versions/{versionId}
Authentication: Bearer token (JWT)
idnumberRequiredversionIdstringRequiredSame fields as Schedule a plan price change. An effective date of today (or none) applies it right away (201).
{
"status": "scheduled",
"products": [
{}
],
"id": "string",
"subscriptionPlanId": 0,
"validFrom": "2019-08-24T14:15:22Z",
"note": "string",
"affectedCountAtSchedule": 0,
"createdByUserId": 0,
"createdByName": "string",
"createdAt": "2019-08-24T14:15:22Z",
"activatedAt": "2019-08-24T14:15:22Z",
"cancelledByUserId": 0,
"cancelledByName": "string",
"cancelledAt": "2019-08-24T14:15:22Z",
"cancellable": true
}The plan id is not an integer, or the version id is not a uuid
Same fields as Get a subscription plan by id (400).
{
"messageCode": "badRequest",
"message": "string",
"errors": [
{}
]
}unauthorized
This response has no body.
forbiddenResource
Same fields as Get all subscription plans of the tenant (403).
{
"messageCode": "string",
"message": "string",
"errors": [
{}
]
}planPriceVersionNotFound
messageCodestringRequired"planPriceVersionNotFound"messagestringerrorsarray of FieldErrorRequired7 fieldserrorsfieldstringRequired when parent is presentField path: errors[].fieldfieldValuestringRequired when parent is presentField path: errors[].fieldValueidentifierstringRequired when parent is presentField path: errors[].identifieridentifierValuestringRequired when parent is presentField path: errors[].identifierValuemessageCodestringRequired when parent is presentField path: errors[].messageCodemessagestringField path: errors[].messageerrorTypestringRequired when parent is presentField path: errors[].errorType{
"messageCode": "planPriceVersionNotFound",
"message": "string",
"errors": [
{}
]
}The change is not scheduled, or subscriptions were already invoiced or charged at its prices
messageCodestringRequired"planPriceVersionNotCancellable", "planPriceVersionAlreadyBilled"messagestringerrorsarray of FieldErrorRequired7 fieldserrorsfieldstringRequired when parent is presentField path: errors[].fieldfieldValuestringRequired when parent is presentField path: errors[].fieldValueidentifierstringRequired when parent is presentField path: errors[].identifieridentifierValuestringRequired when parent is presentField path: errors[].identifierValuemessageCodestringRequired when parent is presentField path: errors[].messageCodemessagestringField path: errors[].messageerrorTypestringRequired when parent is presentField path: errors[].errorType{
"messageCode": "planPriceVersionNotCancellable",
"message": "string",
"errors": [
{}
]
}curlcurl 'https://api.subrite.no/api/v1/subscription-plans/{id}/price-versions/{versionId}' \
--request DELETE \
--header 'Authorization: Bearer <token>'