Calls
Product
create
10min
this call creates a product the arguments that would be included in the doc are described below basic parameters name type required description action string true create group id integer true this designates which project the action should be applied towards doc array true see doc parameters below general doc parameters note that the descriptions are of the true statement so for instance, only one means that "\[if the variable is passed as true ] only a single unit can be added per user " the boolean defaults are false unless otherwise noted name type required description base product type integer true 1 event 2 discount 3 session holder 4 session 5 days within a session (these are created automatically, not via the api) 6 subscription 7 merchandise product name string true the name for the product visible to users product price float true the price, which can be zero for any products which are not discounts limited to two decimals cat id string true the category the product appears in product type integer false this determines whether a product can be added to a cart at either the parent level, the child level, or both 0 both a parent and child level product, this is the default 1 parent level only 2 child level only product start date string false the date the product becomes available to users for selection unavailable products cannot be triggered or added manually to a user this is an option for all product types except merchandise product end date string false the date the product becomes unavailable to users for selection this is an option for all product types except merchandise product short remarks string false the text description presented to users location string false a text description of location internalid string false a text field intended for including external codes misc1 string false text field for miscallaneous use misc2 string false a second text field for miscallaneous use lock once funds allocated boolean false locks product if any funds are allocated, useful for partial payments in the context of autobill lock after paid boolean false locks product after the product is paid in full true is the default lock in cart boolean false locks once added to the cart, irrespective of payment status typically used for mandatory products which are added automatically only one boolean false only a single unit can be added per user true is the default visible to users boolean false if the product should appear to users for selection if false , it is set as an admin only product note that products not visible to users can still be added to users either via triggers or manually true is the default force paid first boolean false payments will be applied towards this product before others if multiple prodcuts are marked this way, it respects the order in which they appear on the products page quota cart integer false how many of a product can be ordered before it becomes unavialble to users for selection when a quota is reached, if allow waitlist is true a waitlist option will present allow waitlist boolean false a waitlist option will appear once the quota is met waitlist presentation boolean false presents the default text "waitlist" waitlist present text value string false include if waitlist presentation is false this is the text presented to the user when the waitlist option is presented to them zero product presentation boolean false allows you to provide a value to zero product presentation only works if the product price is zero zero product presentation string false text presented to users when a product has a zero price defaults to $0 product assigned admins array of strings false provide an array of admin id's for the admin's you would like assigned to the product these are visible on the admin management page product specific parameters there are some product types that have unique parameters make sure to only pass them when you are creating the appropriate product type subscription parameters name type required description recurring by user boolean false the user can choose whether to make this a recurring charge recurring by user auto on boolean false this is an opt out version, where the user has the option to opt out of a recurring charge recurring allow user disable boolean false the user can choose to unsubscribe recurring enable autocharge boolean false the system will automatically try to charge the user for the subscription, the user initiates each payment manually for this subscription if false recurring allow upgrade boolean false allows the user to upgrade to different subscription level recurring allow auto upgrade boolean false allows the product to be automatically upgraded to a higher level after a certain number of instances recurring upgrade prorate boolean false enable prorating for incomplete subscription periods recurring allow autorenew boolean false the subscription will automatically renew at each renewal period recurring limit autorenew boolean false limits the number of times a subscription will renew recurring limit autorenew num field boolean false if recurring limit autorenew is true , then this is number of times it should renew automatically session parameters name type required description session start date string true the start time of the session in the form "yyyy mm dd" session end date string true the end time of the session in the form "yyyy mm dd" must be greater than or equal to product activity start date disable time conflict boolean false users will be able to select this product despite time conflicts min session num integer false the minimum amount of sessions a user must select max session num integer false the maximum amount of sessions a user can select allow partial enrollment boolean false allows a user to select days within a session min partial selection integer if allow partial enrollment is true , the minimum number of days a user can select max partial selection if allow partial enrollment is true , the maximum number of days a user can select event parameters name type required description product activity start date string true the start time of the event in the form "yyyy mm dd" product activity end date string true the end time of the event in the form "yyyy mm dd" must be greater than or equal to product activity start date disable time conflict boolean false users will be able to select this product despite time conflicts discount parameters name type required description percent product boolean true allows you to provide a percentage value as a string to product price , for example "33 33" note that all values passed to product price , regardless if it's a fixed value or a percentage, will be interpreted as negative (ie 1 | product price |) selected products array false allows you to provide a list with two optional nested lists of either product id's ( product ), category id's ( category ), or both the id's you include indicate towards which product or category a discount applies id's can be found in the back end of the system by editing either the product or category and looking in the top right of the window products array false this is a list of product id's nested within selected products including product id's ensures the discount applies towards the product's specified the only exception is if the product belongs to a category whose id is included in category in this case, including a product id will exclude that product, while ensuring the discount will apply to the remaining products within that category for example "selected products" { "products" { "3625251" true} } categories array false this is a list of category id's nested within selected products including category id's ensures that the the discount will apply towards all products within those categories, unless you choose to exclude a product by providing it's id in product for example "selected products" { "categories" {"25141"\ true } } example create a new product this is an example which would create a new product call curl x post "https //www regpack com/reg/api2/products/" \\ h "content type application/json" \\ h "accept application/json" \\ h "api id 15263" \\ h "api user api admin\@regpacks com" \\ h "api token cd2e514f 7gab 3cde 62fg 51abcd4e7362" \\ d '{ "action" "create", "group id" 100909072, "doc" { "base product type" 1, "product name" "the village vanguard presents bill evans trio", "product price" "10", "product activity start date" "1961 06 21", "product activity end date" "1961 06 21", "product short remarks" "this event will be recorded for later release" } }import requests import json status endpoint = https //www regpack com/reg/api2/products/ headers = { "content type" "application/json", "accept" "application/json", "api id" "15263", "api user" "api admin\@regpacks com", "api token" "cd2e514f 7gab 3cde 62fg 51abcd4e7362", } payload = { "action" "create", "group id" 100909072, "doc" { "base product type" 1, "product name" "the village vanguard presents bill evans trio", "product price" "10", "product activity start date" "1961 06 21", "product activity end date" "1961 06 21", "product short remarks" "this event will be recorded for later release" } } create product json = json dumps(payload) create product response = requests post(url=product endpoint, data=create product json, headers=headers, timeout=10) response { "msg" "product created successfully ", "msg type" "info", "success" true }