Merchant
In the Delivery Gateway system, the merchant is your e-commerce platform or platforms. That is to say, the merchant is the entity that accepts orders from customers and contracts with logistics providers to deliver those orders.
The merchant configuration provides a set of default settings for a number of Delivery Gateway features. It allows you to provide information that can be reused for any delivery.
The merchant ID
The merchant ID is your merchant's unique identifier. It is automatically generated when you register a new merchant, and it is used to identify the merchant to the Web Plugin and the Merchant API. The easiest, most convenient way of accessing Delivery Gateway features is to use a lightweight frontend integration, utilizing our embedded UI: you can use the merchant ID to connect your merchant to the integration.
For more information, check out Frontend integration.
For backend integration, the Merchant API also uses the ID to identify your merchant. You can query it in the id field of the Merchant object type.
You can't change your merchant ID.
Merchant configuration
This section is about merchant configuration via the Merchant API. For information on how to configure your merchant in the Admin dashboard, see Merchant configuration.
With the Merchant API, you can create and update your merchant configuration via the Merchant object type. Merchant configuration queries and mutations both have two required fields for each configuration object:
key: The enumerator for a given configuration option: MerchantConfigurationEnum.value: The value of that configuration option.
For example, you can configure a default currency for your merchant. The key field in the configuration is CURRENCY. The value field will contain the currency code of your preferred currency.
To query the Merchant object type, you can use the me keyword. Let's query the currency with the configuration field that takes a key argument:
query {
me {
configuration(key: CURRENCY) {
key
value
}
}
}
{
"data": {
"me": {
"configuration": {
"key": "CURRENCY",
"value": "EUR"
}
}
}
}
You can also query multiple or even all merchant configurations with the configurations field. Both configuration and configurations has, in addition to key and value, subfields for the default value and the description of the configuration option. Let's list all the options:
query {
me {
configurations {
key
description
value
default
}
}
}
{
"data": {
"me": {
"configurations": [
{
"key": "UI_ALLOWED_REFERRERS",
"description": "Allowed HTTP referrers for embedded UI",
"value": "",
"default": null
},
{
"key": "SENDER_NAME",
"description": "Default sender name for shipments",
"value": "Ny Shop's Name",
"default": null
},
{
"key": "FORCE_DEFAULT_SENDER",
"description": "Always send shipment with the default sender",
"value": "true",
"default": "false"
},
{
"key": "SENDER_EMAIL",
"description": "Default sender email for shipments",
"value": "example@email.com",
"default": null
},
]
}
}
}
You can update the merchant configuration at any time with the updateMerchantConfiguration mutation. It allows you to update one setting at a time. Let's change the currency to USD:
mutation {
updateMerchantConfiguration(
input: {
key: CURRENCY,
value: "USD",
}
) {
key
value
}
}
{
"data": {
"updateMerchantConfiguration": {
"key": "CURRENCY",
"value": "USD"
}
}
}