Custom Parameters

How to set-up and utilize custom parameters

Last updated 27 May 2024

Custom parameters offer you the flexibility to configure unique inputs tailored to your needs when utilizing Skrym services. We currently support the use of custom parameters within the delivery checkout offering, with plans to extend support to additional services in the future. This page will guide you in creating these custom parameters in Skrym.

Support

Custom parameters require you to access our dashboard: SCOPE

Getting started

Creating and managing custom parameters is easy, just follow these steps:

Datatypes

Custom parameters can be defined as different datatypes, You can also specify if the parameter is a single value or a list of values (array[]).

DatatypeDescription
booleanA simple yes/no value, sometimes referred to as a tag/flag.
numberAny number
stringText
objectA object contains multiple other datatypes and works as a parent for the values

Specially structured strings, resembling non-json strings like arrays are also supported. Learn more about how they are supported under parsing schemas.

Custom Datatype Operations

The following operations are supported for the different custom parameter datatypes:

OperationCustom parameter datatypeDescription
lessnumberReturns true if the value of a custom parameter is less than a value, false otherwise
greaternumberReturns true if the value of a custom parameter is greater than a value, false otherwise
leqnumberReturns true if the value of a custom parameter is less or equal to a value, false otherwise
geqnumberReturns true if the value of a custom parameter is greater or equal to a value, false otherwise
equalsnumber, string, booleanReturns true if the value of a custom parameter equals a value, false otherwise
notEqualsnumber, string, booleanReturns true if the value of a custom parameter is not equal to a value, false otherwise
contains[]number, []string, []booleanReturns true if a value is contained in the custom parameter, false otherwise
notContains[]number, []string, []booleanReturns true if a value is not contained in the custom parameter, false otherwise
containsSubstringstringReturns true if a value is a substring of the custom parameter, false otherwise

How to use custom parameters in the delivery checkout

Setting up custom parameters in the checkout strategy

Each custom parameter can be used in the delivery checkout to customize the ranking of transport method. These custom parameters can be used when setting up conditions for the different paths in the checkout strategy. Here's how they can be set

Using them in the checkout flow

Custom parameters are expected to be sent in when making a request for a list of possible delivery options.

They are expected to be sent in JSON format, i.e. A custom parameter called fragile whose value is true can be sent in as "fragile":true. Specially structured strings, that don't strictly adhere to json format are also supported by the use of parsing schemas. For more information, please refer to the section below on parsing schemas.

Here's where the custom parameters can be passed in for each of our checkout integrations:

IntegrationFieldDescriptionDocumentation
klarna
order.tagsCan be sent in as part of the tags field within the order field in the requestKlarna Shipping Option Name.
skrym
customParamsCan be sent in as part of the customParams field in the requestSkrym checkout API.

Parsing schemas

Certain systems may be limited in the formats they can send their data in. In order to enable Skrym to interpret these formats accurately, we support the creation of parsing schemas. These schemas facilitate the conversion of structured strings into a JSON format that Skrym can seamlessly process.

Here's how you can work with parsing schemas using SCOPE