WhiteLabel API
Billing Plans
Create Billing Plan
this api endpoint (post) (post) creates a whitelabel billing plan product if the request succeeds it returns a billing plan object docid\ zua8112ru urunnvc2ul4 ; otherwise, it will return an error permissions agency billing plans create webhook event product events docid\ bfktivl3xva6ucdtrt5bz body parameters pricing model array of objects the pricing configuration of the billing plan in all supported currencies exampe "pricing model" \[ { "currency" "eur", "price" 1000, "billing cycle" "month", "interval" 3, "transaction fees" 3 5, "transaction fees cents" 0 } ] currency string appendix docid\ kfbmx4q3dxjtduqf75yx1 price integer interval integer transaction fees decimal the percentage to charge as a fee on every client's transaction the default value is 0 transaction fees cents integer the number of cents to charge as a fee on every client's transaction the default value is 0 billing cycle string the billing cycle of this pricing model the available values are day , month , week and year languages object the titles, subtitles, seo descriptions, seo titles and long descriptions of the product in all supported languages the minimum information required is a title in at least one language the keys of the object are a appendix docid\ kfbmx4q3dxjtduqf75yx1 while the values are also objects with the content of the product note a language has to be activated on your account before it can be used exampe "languages" { "en" { "title" "blue t shirt", "description" "exclusive blue t shirt, just 100 pieces available", "seo title" "my super awesome blue t shirt", "seo description" "exclusive blue t shirt, just 100 pieces available", "slug" "blue shirt" }, "de" { // german content }, "sv" { // swedish content } } permissions object appendix docid\ kfbmx4q3dxjtduqf75yx1 an object containing the permissions of the product any clients that join this billing plan will receive matching permission to your whitelabel platform trial period integer the trial period of the billing plan in days the default value is 0 unlimited stock boolean the default value is true if set to false , then the stock parameter is required stock integer the available stock for this product you can ignore this parameter if unlimited stock is set to true retries integer the number of retries that are allowed when the customer fails to pay for their billing plan cancel action string determines what action is taken when all available retries for a recurring payment have failed the possible values are pause and cancel cancel behaviour string determines how cancelations are handled the possible values are immediate and end of period descriptor string the statement descriptor of the billing plan the maximum number of characters is 20 stock limit warning integer if the product stock falls below this value, an email notification will be sent to you will be ignored if unlimited stock is set to true max units integer the maximum amount of stock that can be purchased in a single order price min units integer the minimum amount of stock that can be purchased in a single order buyable boolean determines if the product is available for sale and can be purchased via external sites and tamio checkout flows the default value is true price discount allowed boolean determines if the product can have any discounts applied to it the default value is true price shown boolean determines if the product is currently visible in external assets the default value is true client id string a client id for assigning the billing plan once specified, only the designated client can purchase this billing plan price exclude from feed boolean determines if the product will be included in third party feeds and product search engines price new from appendix docid\ kfbmx4q3dxjtduqf75yx1 the date the product was launched for sale as a brand new item price new to appendix docid\ kfbmx4q3dxjtduqf75yx1 after this date, the product will not be considered a brand new item price expiry date appendix docid\ kfbmx4q3dxjtduqf75yx1 after this date, the product will not be available for sale price release date appendix docid\ kfbmx4q3dxjtduqf75yx1 the date that the product will be released for sale gallery array of strings each string in the array must be an asset id quotas object an object containing any custom quotas associated with the billing plan when users purchase this plan, their quotas will be updated according to these values example "quotas" { "automations quota" 100, "transaction quota" 100, "datatransfer quota" 100, "storage quota" 3, "languages quota" 1, "products quota" 100, "domains quota" 100, "currencies quota" 2, "teammates quota" 100, "api quota" 100, "newsletters quota" 100 } custom attributes array of objects you can create custom attributes for a product and save them for later use they can be incorporated into your custom flows when retrieving a product or via webhooks you can also use them to trigger actions such as registering information in a crm or an erp system the custom attributes option is an array that contains objects each corresponding to a custom attribute example "custom attributes" \[ { "language" "en", "name" "name", "value" "some value" } ] language string name string value string custom fields array of objects you can create custom fields for a product and save them for later use they are used on tamio sites for filtering results and on custom flows the custom fields option is an array that contains objects each corresponding to a custom attribute the possible configurations can be seen below example "custom fields" \[ { "language" "en", "name" "name", "values" \["some value"], "type" "checkboxes" }, { "language" "en", "name" "name", "values" \["some value"], "type" "date picker", "range from" "2024 03 06", "range to" "2024 03 31" }, { "language" "en", "name" "name", "type" "size" } ] language string name string values array of strings available for custom fields with type checkboxes range from appendix docid\ kfbmx4q3dxjtduqf75yx1 available for custom fields with type date picker range to appendix docid\ kfbmx4q3dxjtduqf75yx1 available for custom fields with type date picker type string the possible values are size , checkboxes , textfield , textarea and date picker controlls how the they will be displayed on tamio sites require "uri" require "json" require "net/http" url = uri("https //api tamio com/v2/whitelabel/plans/create") https = net http new(url host, url port) https use ssl = true request = net http post new(url) request\["accept"] = "application/json" \# replace your token here with your developer key request\["authorization"] = "bearer your token here" data = { unlimited stock true, pricing model \[ { currency "eur", price 1000, billing cycle "month", interval 3, transaction fees 3 5, transaction fees cents 0 } ], languages { en { title "billing plan 10" } }, trial period 0, descriptor "sub10 m1" } request body = data to json response = https request(request) puts response read bodycurl location request post 'https //api tamio com/v2/whitelabel/plans/create' \\ \ header 'accept application/json' \\ \ header 'authorization bearer your token here' \\ \ data raw '{"unlimited stock" true, "tax category" "other", "pricing model" \[{"currency" "eur", "price" 10, "billing cycle" "month", "interval" 3}],"languages" {"en" {"title" "my awesome product"}}, "descriptor" "sub10 m3", "trial period" 10}'var myheaders = new headers(); myheaders append("accept", "application/json"); // replace your token here with your developer key myheaders append("authorization", "bearer your token here"); var data = { unlimited stock true, pricing model \[ { currency "eur", price 1000, billing cycle "month", interval 3, transaction fees 3 5, transaction fees cents 0 } ], languages { en { title "billing plan 10" } }, trial period 0, descriptor "sub10 m1" }; var body = json stringify(data); var requestoptions = { method 'post', headers myheaders, body body }; fetch("https //api tamio com/v2/whitelabel/plans/create", requestoptions) then(response => response text()) then(result => console log(result)) catch(error => console log('error', error));{ "product" { "id" "c8e96c47 0dcd 494e 8b84 5892c5d119e5", "object" "product", "name" "billing plan 10", "classification" "agency billing plan", "created" "2022 12 16 15 49 57 +0000", "created unix" 1671205797, "currency" "eur", "gallery" \[], "in stock" true, "type" "billing plan", "updated" "2022 12 16 15 49 58 +0000", "updated unix" 1671205798, "on sale" true, "discount allowed" true, "hide if no stock" true, "shown" true, "description" null, "long description" null, "seo description" null, "seo title" null, "stock" null, "tax calculation" "exclusive", "has variations" false, "unlimited stock" true, "pricing model" \[ { "id" "9ad644a4 3634 458c b9f7 d26d2a085db5", "object" "pricing model", "currency" "eur", "price" 1000, "recommended seller price" null, "acquisition price" null, "billing cycle" "month", "interval" 3, "stripe price id" "price 1mfgaceje1uz2ukgpf1mqmbw", "transaction fees cents" 0, "transaction fees" 3 5, "is metered" true } ], "custom attributes" null, "permissions" { "account" { "view" true, "edit" true, "remove" true }, "billing" { "view" true, "edit" true }, "keys" { "view" true, "edit" true, "remove" true, "create" true }, "webhooks" { "view" true, "edit" true, "remove" true, "create" true }, "logs" { "view" true }, "audit trail" { "view" true }, "revenue analytics" { "view" true }, "source analytics" { "view" true }, "visitor analytics" { "view" true }, "domains" { "edit" true, "view" true, "create" true, "remove" true }, "taxes" { "edit" true, "view" true, "create" true, "remove" true }, "teammates" { "edit" true, "view" true, "create" true, "remove" true }, "reports" { "view" true, "edit" true }, "sites" { "edit" true, "view" true, "create" true, "remove" true, "publish" true }, "pages" { "edit" true, "view" true, "create" true, "remove" true }, "affiliate programs" { "edit" true, "view" true, "create" true, "remove" true }, "affiliates" { "edit" true, "view" true, "remove" true }, "payouts" { "edit" true, "view" true, "create" true, "remove" true }, "affiliate network" { "edit" true, "view" true }, "payments" { "edit" true, "view" true, "remove" true }, "integrations" { "edit" true, "create" true, "publish" true, "view" true, "remove" true }, "invoices" { "view" true, "edit" true, "remove" true, "create" true }, "subscriptions" { "view" true, "edit" true, "remove" true }, "instalment plans" { "view" true, "edit" true, "remove" true }, "customers" { "view" true, "edit" true, "create" true, "remove" true }, "subscribers" { "view" true, "edit" true, "create" true, "remove" true }, "mailing lists" { "view" true, "edit" true, "create" true, "remove" true }, "automations" { "view" true, "edit" true, "create" true, "remove" true }, "discounts" { "view" true, "edit" true, "create" true, "remove" true }, "email templates" { "view" true, "edit" true, "create" true, "remove" true }, "reviews" { "view" true, "edit" true, "remove" true }, "assets" { "view" true, "edit" true, "create" true, "remove" true }, "products" { "view" true, "edit" true, "create" true, "remove" true }, "shippings" { "view" true, "edit" true, "create" true, "remove" true }, "warehouses" { "view" true, "edit" true, "create" true, "remove" true }, "support" { "view" true, "edit" true, "create" true, "remove" true } }, "min units" null, "max units" null, "stock limit warning" null, "allow negative stock" false, "additional information" { "sample" false, "release date unix" null, "release date" null, "expiry date unix" null, "expiry date" null, "new from unix" null, "new from" null, "new to unix" null, "new to" null, "exclude from feed" false }, "price" 1000, "languages" { "en" { "title" "billing plan 10" } }, "billing cycle" "month", "interval" 3, "trial period" 0, "descriptor" "sub10 m1", "retries" 3, "cancel action" "cancel", "cancel behaviour" "end of period", "is moss product" true }, "status" 200 }