Developers

Store settings

Summary of store settings endpoints

All endpoints take optional query parameters that enhance the response objects:

  • include — enhance the response objects (e.g. include=translations). Supported values are:
    • translations — includes translations for all translatable objects and keys.
  • language_code — display all top-level values in the given language context.

Get store settings data

GET /admin/api/ecommerce/v1/settings

Example response:

Status: 200 OK
{
  "uuid": "48a094e9-de92-471d-812a-8894b724731a",
  "id": 1,
  "notification_email": "admin@mystore.com",
  "reply_email": "admin@mystore.com",
  "cancel_url": "http://helloworld.voog.com",
  "return_url": "http://helloworld.voog.com",
  "currency": "EUR",
  "currency_symbol": "€",
  "tax_rate": "20.0",
  "value_date_days": 14,
  "created_at": "2016-11-21T12:24:36.000Z",
  "updated_at": "2017-03-29T14:11:59.000Z",
  "missing_required_settings?": false,
  "missing_required_settings": [],
  "enabled": true,
  "default_language": "en",
  "image_id": 1,
  "decimal_places": 2,
  "company_name": "MyStore (EN)",
  "bank_details": "http://helloworld.voog.com",
  "terms_url": "http://helloworld.voog.com/terms",
  "address": {
    "id": 1,
    "name": "MyStore Admin",
    "company_name": "MyStore",
    "address1": "W 5th Ave, 1",
    "address2": "",
    "city": "Anchorage",
    "zip_code": "99507",
    "state": "Alaska",
    "country_code": "US",
    "phone": null,
    "instructions": null,
    "created_at": "2016-10-11T14:24:21.000Z",
    "updated_at": "2017-03-27T08:20:59.000Z"
  },
  "order_sequence": {
    "prefix": "#",
    "suffix": null,
    "padding": 4,
    "last_number": 0
  },
  "translations": {
    "company_name": {
      "et": "MyStore (EN)",
      "en": "MyStore (ET)"
    },
    "bank_details": {
      "et": "",
      "en": ""
    },
    "terms_url": {
      "et": "http://helloworld.voog.com/tingimused",
      "en": "http://helloworld.voog.com/terms"
    }
  }
}

Attributes

  • notification_email - all store notification emails are sent to this email address
  • reply_email - used for the "Reply-To" address in customer emails
  • return_url - When paying with outside gateways (Paypal/Bank links), this address is used as a return path for successful payments
  • cancel_url - Similar to return_url, but used for cancelled or rejected payments
  • currency - three-digit currency code, e.g "EUR", "USD" etc.
  • currency_symbol - this is used to compact prices, so instead of "200 EUR", we'd use "€200"
  • tax_rate - VAT percentage, e.g. "20.0"
  • value_date_days - used to determine the invoice's payment due date
  • decimal_places - determines how numbers are rounded when displaying amounts
  • missing_required_settings? - if this is true, all buy buttons are disabled and no purchases can be made in your store
  • missing_required_settings - list of fields that are invalid
  • enabled - if set to "false", the whole store is disabled and no purchases can be made
  • default_language - language code that is used for default translation strings
  • image_id - points to an image asset that is used as the logo on the store's invoices. See the Assets API.
  • company_name - Your company's name that is used on the invoice and email notifications
  • bank_details- payment data for offline invoices (Bank name, account no., reference codes etc.)
  • terms_url - URL that points to the Terms of Service of your store
  • address - Your store's address that is shown on the invoice

  • order_sequence - this can be used to customize the order numbers in the store

    • prefix - This is prepended to the order number
    • suffix - This is appended to the order number
    • padding - Minimum number of digits to display
    • last_number- Which number is used to start counting from
      {
        "prefix": "#",
        "suffix": "-04-2017",
        "padding": 4,
        "last_number": 10
      }
    

    this will output #0011-04-2017 as the next order number

  • translations - Read more about translations.

Update store settings

PUT /admin/api/ecommerce/v1/settings

This request updates the store settings with the given attributes

Example request:

PUT http://helloworld.voog.co/admin/api/ecommerce/v1/settings?include=translations

Example data:

{
  "notification_email": "notifications@mystore.com",
  "value_date_days": 7,
  "translations": {
    "company_name": {
      "et": "MyStore English",
      "en": "MyStore Eesti"
    },
  }
}

Example response:

Status: 200 OK
{
  "uuid": "48a094e9-de92-471d-812a-8894b724731a",
  "id": 1,
  "notification_email": "notifications@mystore.com",
  "reply_email": "admin@mystore.com",
  "cancel_url": "http://helloworld.voog.com",
  "return_url": "http://helloworld.voog.com",
  "currency": "EUR",
  "currency_symbol": "€",
  "tax_rate": "20.0",
  "value_date_days": 7,
  "created_at": "2016-11-21T12:24:36.000Z",
  "updated_at": "2017-03-29T14:11:59.000Z",
  "missing_required_settings?": false,
  "missing_required_settings": [],
  "enabled": true,
  "default_language": "en",
  "image_id": 1,
  "decimal_places": 2,
  "company_name": "MyStore English",
  "bank_details": "http://helloworld.voog.com",
  "terms_url": "http://helloworld.voog.com/terms",
  "address": {
    "id": 1,
    "name": "MyStore Admin",
    "company_name": "MyStore",
    "address1": "W 5th Ave, 1",
    "address2": "",
    "city": "Anchorage",
    "zip_code": "99507",
    "state": "Alaska",
    "country_code": "US",
    "phone": null,
    "instructions": null,
    "created_at": "2016-10-11T14:24:21.000Z",
    "updated_at": "2017-03-27T08:20:59.000Z"
  },
  "order_sequence": {
    "prefix": "#",
    "suffix": null,
    "padding": 4,
    "last_number": 0
  },
  "translations": {
    "company_name": {
      "et": "MyStore English",
      "en": "MyStore Eesti"
    },
    "bank_details": {
      "et": "",
      "en": ""
    },
    "terms_url": {
      "et": "http://helloworld.voog.com/tingimused",
      "en": "http://helloworld.voog.com/terms"
    }
  }
}