Host

Mutation

applyHostChange — Returns HostChange

Scopes Required: manage_host_changes

Arguments Type Description

id

ID!

The ID of the host change to apply

autoProcessQueue

Boolean

Whether to automatically process the queue after applying the change, defaults to true

applyTo

ID

The item to apply the change to, if not specified it will be automatically matched

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

[ApplyHostChangeInput!]!

The changes to apply

allowCreation

Boolean

Whether to allow the creation of items encountered in the list of changes. The usage of this flag will override the automatic settings of the connection for the duration of the changes

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

[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 BulkIgnoreHostChanges($ids: [ID!]!) {
    bulkIgnoreHostChanges(ids: $ids)
}

# Example variables
{
    "ids": [
        "<IDS>"
    ]
}

Mutation

createHostConnection — Returns HostConnection

Scopes Required: modify_host_connections

Arguments Type Description

type

HostConnectionTypeEnum!

The type of host connection this is

outlet

ID!

The ID of the Outlet to connect to this host file

priceSet

ID

The ID of the Price Set to connect to this host file (if null, it will use the default price set)

metadata

JSON!

Any metadata related to the host type. Each host may expect this to be formatted in a certain way

settings

JSON!

The settings to provide to the host connection

credentials

JSON!

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

HostAppliableTypeEnum!

The type of item that should be created

connection

ID!

The ID that the item should be created from

changeId

ID

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

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>"
}

Mutation

deleteHostIdentifier — Returns boolean

Scopes Required: manage_host_changes

Arguments Type Description

connection

ID!

The ID of the host connection to delete the identifier from

identifier

String!

The ID of the identifier to remove

product

ID!

The ID of the product to delete the identifier from

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

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

HostAppliableTypeEnum!

The type of item to map

id

ID!

The ID of the item in Shopfront that is being mapped

connection

ID!

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

ID!

The ID of the product with the duplicate mapping to separate

connection

ID!

The ID of the connection of the duplicate mappings to separate

inventory

[SeparateHostItem!]

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

ID!

The ID of the host connection you wish to update

metadata

JSON!

Any metadata related to the host type. Each host may expect this to be formatted in a certain way

settings

JSON!

The settings to provide to the host connection

credentials

JSON!

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>"
}