Orders

Mutation

addOrderReviewComment — Returns OrderActivity

No scope required

Add a comment to the provided review

Arguments Type Description

review

ID!

The ID of the order review the comment is being added to

to

OrderActivityCommentToEnum!

What the comment should be applied to, if PRODUCT is specified, id must be provided

id

ID

The ID of the product to apply the comment to, should only be provided when PRODUCT is specified in to

comment

String!

The comment to add to the review

Example Mutation
mutation AddOrderReviewComment($review: ID!, $to: OrderActivityCommentToEnum!, $comment: String!) {
    addOrderReviewComment(review: $review, to: $to, comment: $comment) {
        processTime
    }
}

# Example variables
{
    "review": "<REVIEW>",
    "to": "ORDER",
    "comment": "<COMMENT>"
}

Mutation

cancelOrder — Returns Order

Scopes Required: stock_delete

Cancel an existing order, this won't adjust any inventory

Arguments Type Description

id

ID!

The ID of the order to cancel

Example Mutation
mutation CancelOrder($id: ID!) {
    cancelOrder(id: $id) {
        id,
        type,
        status,
        completed,
        undergoingReview
    }
}

# Example variables
{
    "id": "<ID>"
}

Mutation

createOrder — Returns Order

No scope required

Create a new order, you can also generate orders through this mutation

Arguments Type Description

type

OrderTypeEnum!

The type of order to create

from

ID

Where the order is from, or null if from all suppliers (orders only)

to

ID!

Who the order is to

orderDate

Date

The date of the order / invoice / transfer, defaults to today's date

dueDate

Date

The date that the order is due to be received / paid

invoiceNumber

String

The invoice / order number of the order

feePercentage

Float

The order fee percentage

enteredAs

DefaultOrderTaxEnum

How the costs should be displayed on the order page (Does not represent how the cost values are actually stored)

reference

String

The reference number of the order

notes

String

Any public notes about this order, this can be printed out on the order

internalNotes

String

Any internal notes about this order, this will not be displayed outside Shopfront

includeFreight

Boolean

Whether the invoice includes freight or not, defaults to true

mergeable

Boolean

Whether the order should be able to be merged, note this does not affect merging through the API, only through the UI, defaults to TRUE except for when order type is set to RECEIVE

products

[OrderProductInput]

The products on the order, not valid to use when generating an order

generate

OrderGenerationInput

How the order should be generated, not valid to use when providing a list of products

Example Mutation
mutation CreateOrder($type: OrderTypeEnum!, $to: ID!) {
    createOrder(type: $type, to: $to) {
        id,
        type,
        status,
        completed,
        undergoingReview
    }
}

# Example variables
{
    "type": "ORDER",
    "to": "<TO>"
}

Mutation

createOrderByMatch — Returns Order

No scope required

Create a new order

Arguments Type Description

type

OrderTypeEnum!

The type of order to create

from

ID!

Where the order is from

to

ID!

Who the order is to

orderDate

Date

The date of the order / invoice / return, defaults to today's date

dueDate

Date

The date that the order is due to be received / paid

invoiceNumber

String

The invoice / order number of the order

feePercentage

Float

The order fee percentage

enteredAs

DefaultOrderTaxEnum

How the costs should be displayed on the order page (Does not represent how the cost values are actually stored)

reference

String

The reference number of the order

notes

String

Any public notes about this order, this can be printed out on the order

internalNotes

String

Any internal notes about this order, this will not be displayed outside Shopfront

attachments

[OrderAttachmentInput!]

A list of URL attachments to add to the order

includeFreight

Boolean

Whether the invoice includes freight or not, defaults to true

expectedTotal

Float

The expected total of the invoice

totalFees

Float

The total fees, this will be automatically distributed across each product as per the supplier settings, this cannot be used when specifying fees individually

totalFreight

Float

The total freight, this will be automatically distributed across each product as per the supplier settings, this cannot be used when specifying freight individually

mergeable

Boolean

Whether the order should be able to be merged, note this does not affect merging through the API, only through the UI, defaults to TRUE except for when order type is set to RECEIVE

products

[OrderProductMatchInput]

The products on the order, not valid to use when generating an order

Example Mutation
mutation CreateOrderByMatching($type: OrderTypeEnum!, $from: ID!, $to: ID!) {
    createOrderByMatch(type: $type, from: $from, to: $to) {
        id,
        type,
        status,
        completed,
        undergoingReview
    }
}

# Example variables
{
    "type": "ORDER",
    "from": "<FROM>",
    "to": "<TO>"
}

Mutation

createOrderReview — Returns OrderReview

No scope required

Create a new review for an existing order, reviews can also be automatically created on the store's settings

Arguments Type Description

order

ID!

The ID of the order to create the review for

reviewers

[ID!]

A list of people to review the order, if they don't have permission to review the order they will be automatically removed. If this is not specified or null, then the default reviewers will be added

Example Mutation
mutation CreateOrderReview($order: ID!) {
    createOrderReview(order: $order) {
        id,
        status,
        orderStatus,
        createdAt
    }
}

# Example variables
{
    "order": "<ORDER>"
}

Mutation

deleteOrderAttachment — Returns MediaAttachment

Scopes Required: stock_edit_order delete_order_attachment

Arguments Type Description

id

ID!

The ID of the order attachment to delete

Example Mutation
mutation DeleteOrderAttachment($id: ID!) {
    deleteOrderAttachment(id: $id) {
        id,
        name,
        url,
        mimeType,
        thumbnail
    }
}

# Example variables
{
    "id": "<ID>"
}

Mutation

deleteOrderReviewAttachment — Returns MediaAttachment

Scopes Required: review_order delete_order_attachment

Arguments Type Description

id

ID!

The ID of the order review attachment to delete

Example Mutation
mutation DeleteOrderReviewAttachment($id: ID!) {
    deleteOrderReviewAttachment(id: $id) {
        id,
        name,
        url,
        mimeType,
        thumbnail
    }
}

# Example variables
{
    "id": "<ID>"
}

Mutation

markOrdersAsRelated — Returns boolean

Scopes Required: stock_edit_order

This marks multiple orders as being related to a single invoice, it doesn't affect the invoice in any way

Arguments Type Description

orders

[ID!]!

The orders to be marked as related

relateTo

ID!

The ID of the order that the orders relate to

clearCurrentlyRelated

Boolean

Whether we should clear all of the orders that relate to the relateTo before applying the new orders

Example Mutation
mutation MarkOrdersAsRelated($orders: [ID!]!, $relateTo: ID!) {
    markOrdersAsRelated(orders: $orders, relateTo: $relateTo)
}

# Example variables
{
    "orders": [
        "<ORDERS>"
    ],
    "relateTo": "<RELATE_TO>"
}

Mutation

markReviewAsCancelled — Returns OrderReview

Scopes Required: review_order

Mark a review as cancelled, a new review will need to be created before processing the order

Arguments Type Description

id

ID!

The ID of the review to cancel

Example Mutation
mutation MarkReviewAsCancelled($id: ID!) {
    markReviewAsCancelled(id: $id) {
        id,
        status,
        orderStatus,
        createdAt
    }
}

# Example variables
{
    "id": "<ID>"
}

Mutation

markReviewAsCompleted — Returns OrderReview

Scopes Required: review_order

Mark a review as completed, this will then allow you to continue to process the order

Arguments Type Description

id

ID!

The ID of the review to complete

Example Mutation
mutation MarkReviewAsCompleted($id: ID!) {
    markReviewAsCompleted(id: $id) {
        id,
        status,
        orderStatus,
        createdAt
    }
}

# Example variables
{
    "id": "<ID>"
}

Mutation

receiveOrder — Returns OrderReceiveResults

Scopes Required: stock_receive

Receive an order, this will update inventory and costs for all products on the order

Arguments Type Description

id

ID!

The ID of the order to receive

Example Mutation
mutation ReceiveOrder($id: ID!) {
    receiveOrder(id: $id) {
        __typename
    }
}

# Example variables
{
    "id": "<ID>"
}

Mutation

reopenOrder — Returns Order

Scopes Required: stock_edit_order

Reopen an order that has been sent

Arguments Type Description

id

ID!

The ID of the sent order to reopen

Example Mutation
mutation ReopenOrder($id: ID!) {
    reopenOrder(id: $id) {
        id,
        type,
        status,
        completed,
        undergoingReview
    }
}

# Example variables
{
    "id": "<ID>"
}

Mutation

reopenReview — Returns OrderReview

Scopes Required: review_order

Reopen a completed review, marking as in progress

Arguments Type Description

id

ID!

The ID of the review to reopen

Example Mutation
mutation ReopenReview($id: ID!) {
    reopenReview(id: $id) {
        id,
        status,
        orderStatus,
        createdAt
    }
}

# Example variables
{
    "id": "<ID>"
}

Mutation

sendOrder — Returns OrderSendResults

Scopes Required: stock_send

This will mark an order as sent, if this order is from multiple suppliers, it will split into several orders

Arguments Type Description

id

ID!

The ID of the order to send

Example Mutation
mutation SendOrder($id: ID!) {
    sendOrder(id: $id) {
        __typename
    }
}

# Example variables
{
    "id": "<ID>"
}

Mutation

updateOrder — Returns Order

No scope required

Update an existing order

Arguments Type Description

id

ID!

The ID of the order to update

from

ID

Where the order is from, if not specified it won't change where the order is from

to

ID

Where the order is to, if not specified it won't change where the order is to

status

OrderStatusEnum

What status the order is at when the update was expected, this is used just for validation

orderDate

Date

The date of the order / invoice / transfer

dueDate

Date

The date that the order is due to be received / paid

invoiceNumber

String

The invoice / order number

reference

String

The reference for this order

enteredAs

DefaultOrderTaxEnum

How the costs should be displayed on the order page (Does not represent how the cost values are actually stored)

notes

String

Any public notes about the order, this can be printed

internalNotes

String

Any internal notes about this order, this will not be displayed outside Shopfront

includeFreight

Boolean

Whether the invoice includes freight or not

expectedTotal

Float

The total that the invoice is expected to match to

feePercentage

Float

The order fee percentage

products

[OrderProductInput]

The products on the order

Example Mutation
mutation UpdateOrder($id: ID!) {
    updateOrder(id: $id) {
        id,
        type,
        status,
        completed,
        undergoingReview
    }
}

# Example variables
{
    "id": "<ID>"
}

Mutation

updateOrderReviewerStatus — Returns OrderReviewer

Scopes Required: review_order

Modify a user's review on an in progress review

Arguments Type Description

review

ID!

The ID of the review to modify the reviewers on

reviewer

ID!

The reviewer to change the review status for

status

OrderReviewerStatusEnum!

The status to change to

Example Mutation
mutation UpdateOrderReviewerStatus($review: ID!, $reviewer: ID!, $status: OrderReviewerStatusEnum!) {
    updateOrderReviewerStatus(review: $review, reviewer: $reviewer, status: $status) {
        status
    }
}

# Example variables
{
    "review": "<REVIEW>",
    "reviewer": "<REVIEWER>",
    "status": "NO_REVIEW"
}

Mutation

updateOrderReviewers — Returns [OrderReviewer]

Scopes Required: modify_order_reviewers

Modify who the reviewers are for an order review, any reviewer who has already reviewed cannot be removed

Arguments Type Description

review

ID!

The ID of the review to modify the reviewers on

reviewers

[ID!]!

The reviewers to assign to the order, any new reviewers will be notified

Example Mutation
mutation UpdateOrderReviewers($review: ID!, $reviewers: [ID!]!) {
    updateOrderReviewers(review: $review, reviewers: $reviewers) {
        status
    }
}

# Example variables
{
    "review": "<REVIEW>",
    "reviewers": [
        "<REVIEWERS>"
    ]
}