Webshop

An object representing a shop. The unique identifier of the shop is shown in the admin web interface at the top of the page next to its name.

Properties

Property Description
adminLanguage Administration-interface language. Visible and writable by administrators only.
articlePageTitleFormat The format for titles on article pages if they are not explicitly set.
articlegroupPageTitleFormat The format for titles on article-group pages if they are not explicitly set.
baseCurrency The base currency of the shop.
category The category of products sold in the shop.
companyNumber The organisation number displayed on the shop site.
children All subshops in the case this shop is a supershop.
contactEmail The contact email of the shop.
created Date and time of when the shop was created. Visible to shop administrators only.
customPagePageTitleFormat The format for titles on custom pages if they are not explicitly set.
defaultLanguage The default language of the shop.
defaultDeliveryCountry The default delivery country when orders are placed in the shop.
expirationDate Date of when the shop subscription expires. Absent for demo shops. Visible to shop administrators only.
favicon The URL of the favicon, if any.
isShopSystem Whether or not this webshop is included in a shop system.
logolink The URL to which the user is redirected when clicking on the shop logotype as an object, by language.
logotype The URL of the logotype image, by language.
name The name of the shop as an object, by language.
parent Whether or not this webshop has a parent. This combined with isShopsystem can be used to identify a subshop or supershop.
piwikId The piwid identifier of the webshop. This is deprecated.
startPageTitle The title of the start page, by language.
startPageMetaDescription Text to be used for the HTML meta element named description on the start page, by language.
startPageMetaKeywords Text to be used for the HTML meta element named keywords on the start page, by language.
subscriptionInvoices An array of unique identifiers for subscription invoices. Visible to administrators only.
type Shop version, e.g. "plus", "basic" or "lite".
uid The unique identifier of a shop.
url The URL to the start page, by language.
vatCountry In which country VAT is paid.
vatSupport If VAT is used in the webshop.
languages A list of IETF language codes. Administrators will see all the existing languages in the shop while non-administrators will see only those that are active.
minimalOrderCost The minimum order cost per currency that is needed to allow an order checkout. See minimalOrderCost

minimalOrderCost

Property Description
cost Cost keyed per currency.
target Wether it affects total or basket cost.
{
  "minimalOrderCost": {
    "cost": {
      "SEK": 1000
      "USD": 200
    },
    "target": "total"
  }
}

Methods

count

Takes a filter object and returns the number of shops found, as an integer.

Parameters

A filter object specifying which shops to count. See Filter objects on the page List selection.

Example

The request below returns the number of shops found where the base currency is Euro.

API Console
Webshop.count(
  {
    "/baseCurrency": "EUR"
  }
)
Response
1

get

Fetches information about a shop, if you supply its unique identifier.

Parameters

Parameter Description
uid The unique identifier of a shop.
query Which info to return. See Query language.

Example

API Console
Webshop.get(22222, true)
Response
{
  "baseCurrency": "EUR",
  "defaultLanguage": "sv",
  "favicon": "http://admin.abicart.se/shop/22222/favicon-8a0b22.png",
  "logolink": {
    "en": "http://admin.abicart.se/",
    "sv": "http://admin.abicart.se/"
  },
  "logotype": {
    "en": "http://admin.abicart.se/shop/22222/logotypes/standard-log-7350bd.png",
    "sv": "http://admin.abicart.se/shop/22222/logotypes/standard-log-7350bd.png"
  },
  "name": {
    "sv": "Demobutik.com"
  },
  "type": "plus",
  "uid": 22222,
  "url": {
    "en": "http://demobutik.com/ecommerce/",
    "sv": "http://demobutik.com/webshop/"
  }
}

getSchema

Fetches a JSON Schema that can be used for client-side validation.

Parameters

The unique identifier of a shop.

list

Fetches multiple shops as an array of objects. You can only list the shops for which you are an administrator.

Parameters

Parameter Description
query Which info to return. See Query language.
selection Which shops to list. See List selection.

set

Updates a shop.

Parameters

Parameter Description
uid The unique identifier of a shop.
patch An object containing the properties and values to set for the shop.
query A query specifying what to return after a successful set (optional).

Example

API Console
Webshop.set(123456, {"name": {"en": "Bird shop", "sv": "F├ągelbutiken"}}, ["uid", "name"])
Response
{
  "uid": 123456,
  "name": {
    "en": "Bird shop",
    "sv": "F├ągelbutiken"
  }
}

validate

Validates the data to be set. The performed validation is the same as in set; it validates the resulting object and includes all the required properties. However, nothing is saved.

Parameters

Parameter Description
uid The unique identifier of an existing shop.
patch An object containing the properties and values to set before validating.

Returns

An array of validation-error objects, each containing the keys pointer (a property referenced using a JSON Pointer) and message (a readable text in the language of the context). If there are no validation errors, then an empty array is returned.

activateTrialPeriod

When called the shop expirationDate will be set 30 days from the current date. This will only work with admin access and only if expirationDate has not been set earlier.

Errors

Code Message Description
4001 Trial period already set. The expirationDate has already been set with a date.

Example

API Console
Webshop.activateTrialPeriod()
Response
null