Calls
Product
create_category
5 min
this call creates a product category the arguments that would be included in the doc are described below basic parameters name type required description action string true create category group id integer true this designates which project the action should be applied towards doc array true see doc parameters below general doc parameters name type required description category name string true the name for the category visible to users category top remark string false a brief description at the top of the category visible to users category bottom remark string false a brief description at the bottom of the category visible to users category quota ordered integer false the amount of products within a category that a user can order the default has no limit interchange category boolean false true if only a single product in the category should be able to be orderered default is false mandatory category boolean false true if a product needs to be ordered from that category in order for the form to be marked complete default is false example create a new category this is an example which would create a new category 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 category", "group id" 100909072, "doc" { "category name" "fall performances", "category top remark" "fall performances are below", "category bottom remark" "please note that if you must miss an event, tickets are only transferable to future performances", "category quota ordered" 12, "interchange category" false, "mandatory category" false } }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 category", "group id" 100909072, "doc" { "category name" "fall performances", "category top remark" "fall performances are below", "category bottom remark" "please note that if you must miss an event, tickets are only transferable to future performances", "category quota ordered" 12, "interchange category" false, "mandatory category" false } } create category json = json dumps(payload) create category response = requests post(url=product endpoint, data=create category json, headers=headers, timeout=10) response { 'success' true, 'doc' { 'cat id' 251125, 'msg' 'category created successfully', 'msg type' 'success' } }