Add Till

This API enables you to create a new Till for your store. You can also create or attach existing custom fields to a till. The till-level custom fields enable brands to add additional information about the till especially when the brand has multiple tills mapped to a store. For example, till code, till name, description about till etc. The custom fields that you create for a till will be available for all the tills under the org.

👍

Note

For detailed information about our APIs and for hands-on testing, refer documentation in API overview and step-by-step guide on making your first API call in Make your first API call .

API endpoint example

https://eu.api.capillarytech.com/v2/orgEntity/till

Prerequisites

  • Authentication - Basic or OAuth authentication details
  • Access group resource - Access to Organisation resource
  • Configuration - If you want to create more than five custom fields, create a ticket to the sustenance team and increase the limit in the configuration PRODUCT_CONF_ORG_AUDITABLE_CUSTOM_FIELDS_LIMIT. By default, the maximum value is set as five.

Resource information

URIv2/orgEntity/till
HTTP methodPOST
Rate limitDefault
Batch supportNA

Request body parameters

Parameter
(Parameters marked with * are mandatory)
TypeDescription
name*stringName for the till. The Till name specified will also be copied to Till code in the backend.
password*stringPassword for the till
storeId*longStore ID of the parent Store to in which the Till has to be created.
descriptionstringDescription for the till.
billablebooleanSpecify if the till is used for billing. By default, the value is set as true.
storeServerIdlongStore server ID of the parent Store if available.
customFieldsarray-objSpecify the Custom fields to be added to org and attached to the till. You can either create new custom fields or add existing custom fields to the till.
name stringName for the custom field. This parameter is mandatory if you are creating custom fields.
value stringValue assigned to the custom field. This parameter is mandatory if you are creating custom fields.
typestringType of the custom field (e.g., text, number, date). This parameter is applicable when you are creating a new custom field.
dataTypestringData type of the value stored in the field (e.g., string, integer, boolean). This parameter is applicable when you are creating a new custom field.
rulestringClient-side validation rule for the field (Infix expression). This parameter is applicable when you are creating a new custom field.
serverRulestringServer-side validation rule for the field (Infix expression). This parameter is applicable when you are creating a new custom field.
regexstringRegular expression for validating the field value. This parameter is applicable when you are creating a new custom field.
errorstringError message to be displayed. This parameter is applicable when you are creating a new custom field.
optionsintComma-separated options for selection fields. For example, for drop-down custom field type, you can enter "valueA, valueB, valueC". This parameter is applicable when you are creating a new custom field.
disableAtServerintFlag indicating if the field is disabled on the server-side (0: enabled, 1: disabled). This parameter is applicable when you are creating a new custom field.
enableAuditTrailintFlag indicating if changes to the field need to be tracked (0: not tracked, 1: tracked). You can add up to 5 custom fields for audit logging. This parameter is applicable when you are creating a new custom field.
isPiiDataintFlag indicating if the field contains Personally Identifiable Information (PII) (0: no, 1: yes). This parameter is applicable when you are creating a new custom field.
isPsiDataintFlag indicating if the field contains Protected Sensitive Information (PSI) (0: no, 1: yes). Refer to the PSI data documentation for more information on classifying PSI data. This parameter is applicable when you are creating a new custom field.
helptextstringHelp text displayed for the user regarding the field. This parameter is applicable when you are creating a new custom field.
attrsstringAdditional attributes associated with the custom fields. This parameter is applicable when you are creating a new custom field.
curl --location 'https://eu.api.capillarytech.com/v2/orgEntity/till' \
--header 'Authorization: Basic cmFuZG9tE6MjAyY2I5NjJhYzU5MDc1Yjk2NGIwNzE1MmQyMzRiNzA=' \
--header 'Content-Type: application/json' \
--data '{
  "description": "Testing description",
  "storeId": 50154731,
  "password": "123",
  "billable": true,
  "name": "new_till2239"
}'
curl --location 'https://eu.api.capillarytech.com/v2/orgEntity/till' \
--header 'Authorization: Basic cmFuZG9tE6MjAyY2I5NjJhYzU5MDc1Yjk2NGIwNzE1MmQyMzRiNzA=' \
--header 'Content-Type: application/json' \
--data '{
  "description": "Testing description",
  "storeId": 50154731,
  "password": "123",
  "billable": true,
  "name": "new_till2239",
  "customFields": [
    {
      "name": "cf_1",
      "type": "text",
      "dataType": "string",
      "label": "Custom Field Label",
      "defaultValue": "14",
      "phase": "",
      "position": 1,
      "rule": "",
      "serverRule": "",
      "regex": "",
      "error": "",
      "options": "",
      "isDisabled": 0,
      "isCompulsory": 0,
      "disableAtServer": 0,
      "isUpdatable": 1,
      "enableAuditTrail": 0,
      "isPiiData": 0,
      "isPsiData": 0,
      "helptext": "This is a custom field",
      "attrs": "",
      "value": "15"
    }
  ]
}'
curl --location 'https://eu.api.capillarytech.com/v2/orgEntity/till' \
--header 'Authorization: Basic cmFuZG9tE6MjAyY2I5NjJhYzU5MDc1Yjk2NGIwNzE1MmQyMzRiNzA=' \
--header 'Content-Type: application/json' \
--data '{
  "description": "Testing description",
  "storeId": 50154731,
  "password": "123",
  "billable": true,
  "name": "new_till_2",
  "customFields": [
    {
      "name": "cf_1",
      "value": "16"
    }
  ]
}'

Response parameters

ParameterDescription
createdIdThe till ID created.
warningsWarnings if any.
{
    "createdId": 50157065,
    "warnings": []
}

API-specific error codes

Error codeDescription
1207TIll name already exists. Use a unique name.
1214The parent store is not valid. Use a valid parent store ID
1023The number of custom fields that can be created is reached. In the org settings, increase the limit of PRODUCT_CONF_ORG_AUDITABLE_CUSTOM_FIELDS_LIMIT. Default value: 5.
1024The custom field parameter is null or empty. Enter a value for the parameter.
1025There are multiple custom fields with the same name. Use a unique custom field name.
Language
Authorization
Basic
base64
:
URL
Click Try It! to start a request and see the response here!