pagehive

set_site_shop

Start or change a site's shop.

ShopsChanges dataPro and upUpdated

What it does

Start or change a site's shop. A site without a shop starts one when currency is sent, without Stripe: the catalog tables are made at once and only checkout waits for an active Stripe account. connection_id: one of the Hive's Stripe connections (from list_shop_connections), or null to stop the site taking payments (its shop stays; the connection stays for the Hive). currency: the shop's one currency, such as eur (prices are not converted). automatic_tax: Stripe Tax at checkout (the owner needs Stripe Tax set up). ship_countries: two-letter codes the shop ships to, such as NL, BE and DE; an empty list means the Stripe account's country. download_limit: downloads per file per order for digital products (default 5, null for no limit). download_days: days after payment the downloads work (default null, no end). Send any of them. A new Stripe account can't be made here; the owner connects one on the site's Shop tab in /hive (setup_url from get_site_shop). Needs can_shop.

Plans

Needs a paid plan: Pro or Ultra. On other plans your agent gets an error that says so. See Limits for what each plan includes.

Parameters

NameTypeAbout
site_idrequiredstringThe id of the site. list_sites gives the ids of your sites.
connection_idstring or nullThe id of one of the Hive's Stripe connections, from list_shop_connections, or null to stop the site selling.
currencystringThe shop's one currency, a three-letter code such as eur or usd. Prices in the tables are not converted.
automatic_taxbooleantrue to let Stripe calculate tax at checkout (the owner needs Stripe Tax set up in their Stripe account).
ship_countriesarray of stringTwo-letter country codes the shop ships to, such as ["NL", "BE", "DE"]. An empty list means the Stripe account's country. Rates live in the shop's shipping table.
download_limitinteger or nullDigital downloads: how often a buyer may download each file of an order, 1 to 1000, or null for no limit. Default 5. A download counts once it starts.
download_daysinteger or nullDigital downloads: days after payment that the order's downloads work, 1 to 3650, or null for no end (the default).

Example

Call set_site_shop with these arguments:

{
  "site_id": "01a1…",
  "currency": "eur",
  "ship_countries": ["NL", "BE", "DE"],
  "download_limit": 5
}

Ids like 01a1… stand for your own. list_sites and list_tables give you the real ones.

Related guides