Tool reference · 22 tools

Shop, gift cards, codes and promotions

Products with sizes and colors, product photos, vendors, shop settings, gift cards, discount codes and sales promotions.

Ask it in plain words

  • "Add a Black Friday code for 20% off the shop and camps."
  • "Stop selling the old team shirt."
  • "Run a promotion banner for holiday gift cards."

Worked examples: Black Friday discount code.

get_products

Shop products Reads

Every product the gym sells on the website shop or at the front desk: price, status, category, where it is sold, sizes and other options, each variant's price and stock. Products only: never orders or buyers.

Takes no parameters.

Call shape
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "get_products",
    "arguments": {}
  }
}

add_product

Add a product Changesdry_run

Add a product to the shop and/or the front desk (owners and managers). Ask for the price and the sizes; never guess them. It is saved as a draft unless on_sale is true, so the owner can add photos first (upload_photo with purpose product). Sold on the website and picked up at the gym unless told otherwise.

ParameterTypeDescription
title requiredstringe.g. Ninja Team T-shirt (up to 100 characters)
price requirednumberDollars
compare_at_pricenumberThe old price shown crossed out, in dollars; 0 to remove
descriptionstringWhat families read on the product page (up to 3,000 characters)
categorystring: tshirts | tanks | hoodies | shorts | socks | hats | clothing | bottles | grip | bags | stickers | books | food | lessons | fee | otherSets the sales tax kind: lessons (a private lesson or session sold online with no date: the gym sets the time; name the option Coach for one price per coach), tshirts, tanks, hoodies, shorts, socks, hats, clothing, bottles, grip (grip socks, chalk, tape), bags, stickers, books, food (drinks and snacks), fee (spectator or other fee, front desk only), other
option_namestringThe first option's name, e.g. Size
sizesarray of stringThe first option's values in order, e.g. ["YS", "YM", "S", "M"]. Replaces the list: a size left out is removed with its stock. [] = one size
second_option_namestringA second option, e.g. Color; empty to remove it
second_option_valuesarray of stringe.g. ["Black", "Red"]; every pair with the sizes becomes a variant
sold_on_websitebooleantrue = sold in the website shop
sold_at_front_deskbooleantrue = sold at the front desk
offered_at_registrationbooleanOffer it on the competition registration form (needs sold_on_website)
pickupbooleanCan be picked up at the gym
shippingbooleanCan be shipped
on_salebooleantrue = on sale now; false = a draft that isn't sold. To stop selling, use stop_selling_product
dry_runbooleantrue = only show what would change, save nothing. Use it first for anything the owner hasn't seen yet.
Call shape
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "add_product",
    "arguments": {
      "title": "<title>",
      "price": 1,
      "dry_run": true
    }
  }
}

update_product

Change a product Changesdry_run

Change a product: name, price, description, category, sizes and options, where it is sold, pickup or shipping, each variant's price, stock or SKU, or put a draft on sale (owners and managers). Send only what changes; everything else, photos included, stays.

ParameterTypeDescription
product requiredstringThe product's current name
new_titlestringThe product's new name
pricenumberDollars
compare_at_pricenumberThe old price shown crossed out, in dollars; 0 to remove
descriptionstringWhat families read on the product page (up to 3,000 characters)
categorystring: tshirts | tanks | hoodies | shorts | socks | hats | clothing | bottles | grip | bags | stickers | books | food | lessons | fee | otherSets the sales tax kind: lessons (a private lesson or session sold online with no date: the gym sets the time; name the option Coach for one price per coach), tshirts, tanks, hoodies, shorts, socks, hats, clothing, bottles, grip (grip socks, chalk, tape), bags, stickers, books, food (drinks and snacks), fee (spectator or other fee, front desk only), other
option_namestringThe first option's name, e.g. Size
sizesarray of stringThe first option's values in order, e.g. ["YS", "YM", "S", "M"]. Replaces the list: a size left out is removed with its stock. [] = one size
second_option_namestringA second option, e.g. Color; empty to remove it
second_option_valuesarray of stringe.g. ["Black", "Red"]; every pair with the sizes becomes a variant
sold_on_websitebooleantrue = sold in the website shop
sold_at_front_deskbooleantrue = sold at the front desk
offered_at_registrationbooleanOffer it on the competition registration form (needs sold_on_website)
pickupbooleanCan be picked up at the gym
shippingbooleanCan be shipped
on_salebooleantrue = on sale now; false = a draft that isn't sold. To stop selling, use stop_selling_product
variantsarray of objectPer-variant price, stock or SKU changes
variants[].variant requiredstringThe variant's name from get_products, e.g. M or Black / M
variants[].pricenumberIts own price in dollars; 0 = the product's price
variants[].stockintegerHow many are in stock; -1 = not tracked
variants[].skustringThe variant's SKU (stock code); empty removes it
dry_runbooleantrue = only show what would change, save nothing. Use it first for anything the owner hasn't seen yet.
Call shape
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "update_product",
    "arguments": {
      "product": "<product>",
      "dry_run": true
    }
  }
}

stop_selling_product

Stop selling a product Changesdry_runconfirm

Take a product off sale, on the website and at the front desk: it becomes a draft, kept with its photos and stock, and update_product with on_sale: true sells it again (owners and managers). Ask the owner to confirm, then send confirm: true. Nothing is deleted.

ParameterTypeDescription
product requiredstringThe product's id or exact name, from get_products
confirmbooleanMust be true, after the owner has said yes
dry_runbooleantrue = only show what would change, save nothing. Use it first for anything the owner hasn't seen yet.
Call shape
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "stop_selling_product",
    "arguments": {
      "product": "<product>",
      "dry_run": true
    }
  }
}

get_discount_codes

Discount codes Reads

The gym's discount codes: the code, the discount, where it works, start and end dates, limits, whether it is active and how many times it has been used. Totals only: never who used it.

Takes no parameters.

Call shape
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "get_discount_codes",
    "arguments": {}
  }
}

add_discount_code

Create a discount code Changesdry_run

Create a discount code customers type at checkout (owners and managers). Ask the owner for the discount, where it works and any dates or limits; never guess them.

ParameterTypeDescription
code requiredstringWhat customers type, e.g. COACH10 (letters and numbers, 3 to 30)
kind requiredstring: percent | amount | free_shippingpercent off, a dollar amount off, or free shipping (shop orders only)
valuenumberThe percent (1 to 100) or the dollars off
works_for requiredarray of shop | registration | camp | party | classWhere it works: shop (shop orders), registration (competition registrations), camp (camps and special events), party (party bookings), class (class drop-ins and sessions)
starts_onstringYYYY-MM-DD; empty = now
ends_onstringYYYY-MM-DD; empty = never
most_usesintegerHow many times it can be used in all; 0 = no limit
once_per_customerbooleantrue = each customer can use the code only once
members_onlybooleanOnly for families with a membership
minimum_ordernumberDollars; 0 = none
notestringA private note, e.g. Coaches' families (up to 120 characters)
activebooleanDefault true
dry_runbooleantrue = only show what would change, save nothing. Use it first for anything the owner hasn't seen yet.
Call shape
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "add_discount_code",
    "arguments": {
      "code": "<code>",
      "kind": "percent",
      "works_for": [
        "shop"
      ],
      "dry_run": true
    }
  }
}

update_discount_code

Change a discount code Changesdry_run

Change a discount code: the code itself, the discount, where it works, dates, limits or note, or switch it back on (owners and managers). Send only what changes.

ParameterTypeDescription
code requiredstringThe code as it is now
new_codestringThe new code customers type; leave out to keep the current one
kindstring: percent | amount | free_shippingpercent off, a dollar amount off, or free shipping (shop orders only)
valuenumberThe percent (1 to 100) or the dollars off
works_forarray of shop | registration | camp | party | classWhere it works: shop (shop orders), registration (competition registrations), camp (camps and special events), party (party bookings), class (class drop-ins and sessions)
starts_onstringYYYY-MM-DD; empty = now
ends_onstringYYYY-MM-DD; empty = never
most_usesintegerHow many times it can be used in all; 0 = no limit
once_per_customerbooleantrue = each customer can use the code only once
members_onlybooleanOnly for families with a membership
minimum_ordernumberDollars; 0 = none
notestringA private note, e.g. Coaches' families (up to 120 characters)
activebooleantrue = works at checkout. To switch it off use turn_off_discount_code
dry_runbooleantrue = only show what would change, save nothing. Use it first for anything the owner hasn't seen yet.
Call shape
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "update_discount_code",
    "arguments": {
      "code": "<code>",
      "dry_run": true
    }
  }
}

turn_off_discount_code

Switch a discount code off Changesdry_runconfirm

Stop a discount code from working at checkout; it is kept, with its uses, and update_discount_code with active: true switches it on again (owners and managers). Ask the owner to confirm, then send confirm: true.

ParameterTypeDescription
code requiredstringThe code to turn off, as customers type it
confirmbooleanMust be true, after the owner has said yes
dry_runbooleantrue = only show what would change, save nothing. Use it first for anything the owner hasn't seen yet.
Call shape
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "turn_off_discount_code",
    "arguments": {
      "code": "<code>",
      "dry_run": true
    }
  }
}

get_gift_cards_online

Gift cards on the website Reads

Whether the website sells gift cards (the gift cards page) and the amounts it offers. Gift cards themselves, their balances and buyers stay in the back office.

Takes no parameters.

Call shape
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "get_gift_cards_online",
    "arguments": {}
  }
}

update_gift_cards_online

Change gift cards on the website Changesdry_runconfirm

Switch gift card sales on the website on or off, or change the amounts offered (owners and managers). Switching sales off needs the owner's yes and confirm: true. Selling, using or voiding a card is done at the front desk.

ParameterTypeDescription
sell_onlinebooleanfalse = stop selling gift cards on the website (cards already sold keep working)
amountsarray of numberUp to 6 dollar amounts to offer, $5 to $500, e.g. [25, 50, 100]
confirmbooleanMust be true, after the owner has said yes
dry_runbooleantrue = only show what would change, save nothing. Use it first for anything the owner hasn't seen yet.
Call shape
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "update_gift_cards_online",
    "arguments": {
      "dry_run": true
    }
  }
}

get_promotions

Promotions Reads

The gym's own promotions and the ready-made ones for the big sale days (Black Friday class pack sale, gift card bonus, birthday party deal, early-bird camps, shop sale, toy drive, Parents' Night Out): what each one is, whether it's off, scheduled, running or ended, its dates, code and banner words, the suggested dates and amounts for the ones that are off, and what must be set up first.

Takes no parameters.

Call shape
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "get_promotions",
    "arguments": {}
  }
}

set_promotion

Turn on or change a promotion Changesdry_run

Turn on a promotion, change one, or make the gym's own (key "new" with name and kind) (owners only). It starts and ends by itself on its dates; a code promotion makes the discount code (shown in Money > Discount codes too). Use the suggested values from get_promotions unless the owner said otherwise, and confirm the dates, code and amount first.

ParameterTypeDescription
key requiredstringThe promotion's id from get_promotions (e.g. bf-packs, gift-bonus, or an own one's own-... id), or "new" to make the gym's own
namestringOwn promotions: its name, e.g. Winter Break Special
kindstring: code | bannerOwn promotions: a discount code, or a banner only
works_forstring: pack | party | camp | class | registration | shopOwn code promotions: class packs, birthday parties, camps and special events, drop-in classes, competition entries or the shop
button_pagestringOwn promotions: the website page the banner's button opens, e.g. /camps (leave out for the page that fits the discount)
button_wordsstringOwn promotions: the button's words, up to 30 letters
starts requiredstringFirst day, YYYY-MM-DD
ends requiredstringLast day, YYYY-MM-DD
codestringDiscount code customers type (code promotions only), e.g. BLACKFRIDAY
discount_typestring: percent | amountpercent off or dollars off (code promotions)
discountnumberThe percent (1-90) or dollars (1-1000) off
every_dollarsnumberGift card bonus: for every this many dollars in gift cards...
bonus_dollarsnumber...the buyer gets a bonus card of this many dollars
bannerbooleanShow the banner at the top of the website on those days (default true)
banner_wordsstringOwn banner words (up to 110 letters); leave out to use the suggested words
dry_runbooleantrue = only show what would change, save nothing. Use it first for anything the owner hasn't seen yet.
Call shape
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "set_promotion",
    "arguments": {
      "key": "<key>",
      "starts": "<starts>",
      "ends": "<ends>",
      "dry_run": true
    }
  }
}

turn_off_promotion

Turn off a promotion Changesdry_run

Turn off a promotion now (owners only): its banner comes down and its discount code stops working.

ParameterTypeDescription
key requiredstringThe promotion's key from get_promotions
dry_runbooleantrue = only show what would change, save nothing. Use it first for anything the owner hasn't seen yet.
Call shape
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "turn_off_promotion",
    "arguments": {
      "key": "<key>",
      "dry_run": true
    }
  }
}

delete_promotion

Delete one of the gym's own promotions Changesdry_run

Delete one of the gym's own promotions (owners only); its code stops working. Ready-made ones can only be turned off.

ParameterTypeDescription
key requiredstringThe own promotion's id from get_promotions (own-...)
dry_runbooleantrue = only show what would change, save nothing. Use it first for anything the owner hasn't seen yet.
Call shape
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "delete_promotion",
    "arguments": {
      "key": "<key>",
      "dry_run": true
    }
  }
}

get_shop_settings

Shop settings Reads

The website shop's settings: whether the Shop page is on, gear offered at competition registration and its discount, pickup at the gym and its note, shipping and its price, free shipping over an amount, the order number prefix, and which shipping update emails customers get. Settings only: never orders or buyers.

Takes no parameters.

Call shape
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "get_shop_settings",
    "arguments": {}
  }
}

update_shop_settings

Change the shop settings Changesdry_runconfirm

Change the website shop's settings (owners and managers): the Shop page on or off, gear at competition registration and its discount, pickup and its note, shipping and its price, free shipping over an amount, the order number prefix, and the automatic shipping update emails. Send only what changes. Switching the Shop page, gear at registration, pickup, shipping or a shipping email off needs confirm: true after the owner says yes. At least one of pickup or shipping stays on.

ParameterTypeDescription
shop_page_on_websitebooleantrue shows the Shop page on the website
gear_offered_at_competition_registrationbooleantrue offers gear while families register for a competition
registration_discount_per_itemnumberDollars off each product bought with a competition registration; 0 = none
pickup_at_the_gymbooleantrue lets customers pick orders up at the gym
pickup_notestringShown at checkout and in the receipt, e.g. At the front desk (up to 160 characters)
shippingbooleanOrders can be shipped (US addresses)
shipping_price_per_ordernumberDollars
free_shipping_overnumberDollars; 0 = no free shipping
order_number_prefixstringUp to 8 letters or digits, e.g. WNA; empty for none
out_for_delivery_emailbooleantrue emails the customer when an order is out for delivery
delivered_emailbooleantrue emails the customer when an order is delivered
delivery_problem_emailbooleantrue emails the customer when a delivery has a problem
confirmbooleanMust be true, after the owner has said yes
dry_runbooleantrue = only show what would change, save nothing. Use it first for anything the owner hasn't seen yet.
Call shape
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "update_shop_settings",
    "arguments": {
      "dry_run": true
    }
  }
}

get_vendors

Vendors Reads

The vendors whose products the gym sells for them (Money > Vendors; owners only): each vendor's name, the email their monthly statement goes to, their share of each sale, the card fee they carry, and which products they own. Not sales, amounts owed or payouts.

Takes no parameters.

Call shape
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "get_vendors",
    "arguments": {}
  }
}

save_vendor

Add or change a vendor Changesdry_run

Add a vendor, or change one's name, statement email, share of each sale or card fee (owners only; Money > Vendors). Ask the owner for the share and the fee; never guess them. A changed share applies to sales from now on. This never pays anyone: payouts are marked in the back office.

ParameterTypeDescription
vendor requiredstringThe vendor's name (an existing one to change it, or a new one to add it)
new_namestringThe vendor's new name
statement_emailstringWhere their monthly statement is emailed (on the 1st, copied to the owners); empty for none
their_share_percentnumberTheir share of each sale: 100 = all of it, 80 = the gym keeps 20%
card_fee_they_carry_percentnumber0 to 20; taken off card sales only; 0 = the gym absorbs card fees
dry_runbooleantrue = only show what would change, save nothing. Use it first for anything the owner hasn't seen yet.
Call shape
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "save_vendor",
    "arguments": {
      "vendor": "<vendor>",
      "dry_run": true
    }
  }
}

get_product_photos

A product's photos Reads

One product's photos in order (photo 1 is the main one shown in the shop), each with its description and a link to see it, and whether the product page shows a size guide. Use the photo numbers with set_product_main_photo or remove_product_photo.

ParameterTypeDescription
product requiredstringThe product's name
Call shape
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "get_product_photos",
    "arguments": {
      "product": "<product>"
    }
  }
}

set_product_main_photo

Choose a product's main photo Changesdry_run

Make one of a product's photos the main one: it shows first in the shop and on the product page (owners and managers). The other photos keep their order.

ParameterTypeDescription
product requiredstringThe product's id or exact name, from get_products
photo requiredintegerThe photo's number from get_product_photos
dry_runbooleantrue = only show what would change, save nothing. Use it first for anything the owner hasn't seen yet.
Call shape
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "set_product_main_photo",
    "arguments": {
      "product": "<product>",
      "photo": 1,
      "dry_run": true
    }
  }
}

remove_product_photo

Remove a product photo Changesdry_runconfirm

Take one photo off a product (owners and managers). Show the owner which photo it is (its see_it link) and ask; then send confirm: true. The picture stays in the gym's photo library.

ParameterTypeDescription
product requiredstringThe product's id or exact name, from get_products
photo requiredintegerThe photo's number from get_product_photos
confirmbooleanMust be true, after the owner has said yes
dry_runbooleantrue = only show what would change, save nothing. Use it first for anything the owner hasn't seen yet.
Call shape
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "remove_product_photo",
    "arguments": {
      "product": "<product>",
      "photo": 1,
      "dry_run": true
    }
  }
}

remove_size_guide

Take a product's size guide off Changesdry_runconfirm

Take the size guide (how to measure and each size's measurements) off a product's page (owners and managers). NinjaHQ can add it again later; it can't be added from here. Ask the owner, then send confirm: true.

ParameterTypeDescription
product requiredstringThe product's id or exact name, from get_products
confirmbooleanMust be true, after the owner has said yes
dry_runbooleantrue = only show what would change, save nothing. Use it first for anything the owner hasn't seen yet.
Call shape
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "remove_size_guide",
    "arguments": {
      "product": "<product>",
      "dry_run": true
    }
  }
}

All 318 tools

Ask NinjaHQ

Answers from our Help Center and website

Ask anything about NinjaHQ, or try:

AI answers from NinjaHQ's own pages and can make mistakes. Your questions are sent to Anthropic, the AI company, to answer; NinjaHQ doesn't keep them. Privacy