Host
Example Mutation
mutation ApplyHostChange($id: ID!) {
applyHostChange(id: $id) {
id,
clientId,
applyTo,
rawMatch,
change
}
}
# Example variables
{
"id": "<ID>"
}Mutation
bulkApplyHostChanges — Returns boolean
Scopes Required: manage_host_changes
Apply a list of host changes in bulk from multiple connections. Will return false if any of the changes failed to apply
| Arguments | Type | Description |
|---|---|---|
|
changes |
The changes to apply |
|
|
allowCreation |
Boolean |
Whether to allow the creation of items encountered in the list of |
|
autoProcessQueue |
Boolean |
Whether to automatically process the queue after applying the change, defaults to true |
Example Mutation
mutation BulkApplyHostChanges($changes: [ApplyHostChangeInput!]!) {
bulkApplyHostChanges(changes: $changes)
}
# Example variables
{
"changes": [
{
"id": "<ID>"
}
]
}Mutation
bulkIgnoreHostChanges — Returns boolean
Scopes Required: manage_host_changes
| Arguments | Type | Description |
|---|---|---|
|
ids |
The ID of the host change to apply |
|
|
autoProcessQueue |
Boolean |
Whether to automatically process the queue after applying the change, defaults to true |
Example Mutation
mutation BulkIgnoreHostChanges($ids: [ID!]!) {
bulkIgnoreHostChanges(ids: $ids)
}
# Example variables
{
"ids": [
"<IDS>"
]
}Mutation
createHostConnection — Returns HostConnection
Scopes Required: modify_host_connections
| Arguments | Type | Description |
|---|---|---|
|
type |
The type of host connection this is |
|
|
outlet |
The ID of the Outlet to connect to this host file |
|
|
priceSet |
The ID of the Price Set to connect to this host file (if null, it will use the default price set) |
|
|
metadata |
Any metadata related to the host type. Each host may expect this to be formatted in a certain way |
|
|
settings |
The settings to provide to the host connection |
|
|
credentials |
The credentials to use for the host connection. Each host will have this specified in a certain way |
Example Mutation
mutation CreateHostConnection($type: HostConnectionTypeEnum!, $outlet: ID!, $metadata: JSON!, $settings: JSON!, $credentials: JSON!) {
createHostConnection(type: $type, outlet: $outlet, metadata: $metadata, settings: $settings, credentials: $credentials) {
id,
type,
metadata,
settings,
credentials
}
}
# Example variables
{
"type": "METCASH",
"outlet": "<OUTLET>",
"metadata": "<METADATA>",
"settings": "<SETTINGS>",
"credentials": "<CREDENTIALS>"
}Mutation
createItemFromHost — Returns HostAppliableInterface
Scopes Required: manage_host_changes
| Arguments | Type | Description |
|---|---|---|
|
id |
String! |
The ID of the item to create from the connection (this is the ID from the connection) |
|
type |
The type of item that should be created |
|
|
connection |
The ID that the item should be created from |
|
|
changeId |
The ID of the host change that this item is being created from |
Example Mutation
mutation CreateItemFromHost($id: String!, $type: HostAppliableTypeEnum!, $connection: ID!) {
createItemFromHost(id: $id, type: $type, connection: $connection) {
id,
name
}
}
# Example variables
{
"id": "<ID>",
"type": "PRODUCT",
"connection": "<CONNECTION>"
}Mutation
deleteHostConnection — Returns HostConnection
Scopes Required: modify_host_connections
| Arguments | Type | Description |
|---|---|---|
|
id |
The ID of the host connection you wish to update |
Example Mutation
mutation DeleteHostConnection($id: ID!) {
deleteHostConnection(id: $id) {
id,
type,
metadata,
settings,
credentials
}
}
# Example variables
{
"id": "<ID>"
}Example Mutation
mutation DeleteHostIdentifier($connection: ID!, $identifier: String!, $product: ID!) {
deleteHostIdentifier(connection: $connection, identifier: $identifier, product: $product)
}
# Example variables
{
"connection": "<CONNECTION>",
"identifier": "<IDENTIFIER>",
"product": "<PRODUCT>"
}Mutation
ignoreHostChange — Returns HostChange
Scopes Required: manage_host_changes
| Arguments | Type | Description |
|---|---|---|
|
id |
The ID of the host change to apply |
|
|
autoProcessQueue |
Boolean |
Whether to automatically process the queue after applying the change, defaults to true |
Example Mutation
mutation IgnoreHostChange($id: ID!) {
ignoreHostChange(id: $id) {
id,
clientId,
applyTo,
rawMatch,
change
}
}
# Example variables
{
"id": "<ID>"
}Mutation
mapHostIdentifier — Returns HostAppliableInterface
Scopes Required: manage_host_changes
| Arguments | Type | Description |
|---|---|---|
|
type |
The type of item to map |
|
|
id |
The ID of the item in Shopfront that is being mapped |
|
|
connection |
The ID of the host connection that will contain the mapping |
|
|
hostIdentifier |
String! |
The identifier from the host connection to map |
Example Mutation
mutation MapHostIdentifier($type: HostAppliableTypeEnum!, $id: ID!, $connection: ID!, $hostIdentifier: String!) {
mapHostIdentifier(type: $type, id: $id, connection: $connection, hostIdentifier: $hostIdentifier) {
id,
name
}
}
# Example variables
{
"type": "PRODUCT",
"id": "<ID>",
"connection": "<CONNECTION>",
"hostIdentifier": "<HOST_IDENTIFIER>"
}Mutation
separateDuplicateHostIdentifiers — Returns [HostMappingProduct]
Scopes Required: manage_host_changes
| Arguments | Type | Description |
|---|---|---|
|
product |
The ID of the product with the duplicate mapping to separate |
|
|
connection |
The ID of the connection of the duplicate mappings to separate |
|
|
inventory |
The inventory levels of the separated products |
Example Mutation
mutation SeparateDuplicateHostIdentifiers($product: ID!, $connection: ID!) {
separateDuplicateHostIdentifiers(product: $product, connection: $connection) {
__typename
}
}
# Example variables
{
"product": "<PRODUCT>",
"connection": "<CONNECTION>"
}Mutation
updateHostConnection — Returns HostConnection
Scopes Required: modify_host_connections
| Arguments | Type | Description |
|---|---|---|
|
id |
The ID of the host connection you wish to update |
|
|
metadata |
Any metadata related to the host type. Each host may expect this to be formatted in a certain way |
|
|
settings |
The settings to provide to the host connection |
|
|
credentials |
The credentials to use for the host connection. Each host will have this specified in a certain way |
|
|
autoProcessQueue |
Boolean |
Whether to automatically process the queue after updating the settings |
Example Mutation
mutation UpdateHostConnection($id: ID!, $metadata: JSON!, $settings: JSON!, $credentials: JSON!) {
updateHostConnection(id: $id, metadata: $metadata, settings: $settings, credentials: $credentials) {
id,
type,
metadata,
settings,
credentials
}
}
# Example variables
{
"id": "<ID>",
"metadata": "<METADATA>",
"settings": "<SETTINGS>",
"credentials": "<CREDENTIALS>"
}