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.
SupportCustom 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[]
).
Datatype | Description |
---|---|
boolean | A simple yes/no value, sometimes referred to as a tag/flag. |
number | Any number |
string | Text |
object | A 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:
Operation | Custom parameter datatype | Description |
---|---|---|
less | number | Returns true if the value of a custom parameter is less than a value, false otherwise |
greater | number | Returns true if the value of a custom parameter is greater than a value, false otherwise |
leq | number | Returns true if the value of a custom parameter is less or equal to a value, false otherwise |
geq | number | Returns true if the value of a custom parameter is greater or equal to a value, false otherwise |
equals | number , string , boolean | Returns true if the value of a custom parameter equals a value, false otherwise |
notEquals | number , string , boolean | Returns true if the value of a custom parameter is not equal to a value, false otherwise |
contains | []number , []string , []boolean | Returns true if a value is contained in the custom parameter, false otherwise |
notContains | []number , []string , []boolean | Returns true if a value is not contained in the custom parameter, false otherwise |
containsSubstring | string | Returns 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:
Integration | Field | Description | Documentation |
---|---|---|---|
klarna | order.tags | Can be sent in as part of the tags field within the order field in the request | Klarna Shipping Option Name. |
skrym | customParams | Can be sent in as part of the customParams field in the request | Skrym 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