API Reference

CreateStockAdjustment

Create a stock adjustment

Parameters

input - StockAdjustmentInput
Data of the stock adjustment

Example

mutation {
  CreateStockAdjustment(
    input: {
      id: null,
      label: "SA00000001",
      notes: null,
      total_units: null,
      status: "active",
      dated_at: null,
      to_location: {
        id: 100007,
        label: "eligendi"
      },
      line_items: [
        {
          temporary_id: 1705673189792,
          is_kit: false,
          quantity: 2,
          cost: 668.7955,
          weight: 0,
          description: "",
          location: {
            id: 100006,
            label: "assumenda"
          },
          variant: {
            id: 100110,
            label: "Amazeballs Humbro Sneakers"
          }
        },
        {
          temporary_id: 1705677189792,
          is_kit: false,
          quantity: 20,
          cost: 668.7955,
          weight: 0,
          description: "",
          location: {
            id: 100006,
            label: "Rio"
          },
          variant: {
            id: 100220,
            label: "Jalapenos
          }
          batch_numbers:[ 
            {
              batch_number:{
                id:189000
              }
              quantity:12
            },
            {
              batch_number:{
                id:189666
              }
              quantity:8
            }
          ]
        }
      ]
    }
  ) {
    id
  }
}

Returned data

{
  "data": {
    "CreateStockAdjustment": {
      "id": 100010
    }
  }
}

UpdateStockAdjustment

Update a stock adjustment

Parameters

id - ID
Id of the stock adjustment
input - StockAdjustmentInput
Data of the stock adjustment

Example

mutation UpdateStockAdjustment($id: ID!, $input: StockAdjustmentInput!) {
  UpdateStockAdjustment(id: $id, input: $input) {
    id
  }
}
{
  "id": 100010,
  "input": {
    "notes": "<p>Adjustment of warehouse stock level</p>"
  }
}

Returned data

{
  "data": {
    "UpdateStockAdjustment": {
      "id": 100010,
    }
  }
}

DeleteStockAdjustment

Delete a stock adjustment

Parameters

id - ID
Id of the stock adjustment

Example

mutation DeleteStockAdjustment($id: ID!) {
  DeleteStockAdjustment(id: $id)
}
{
  "id": 100010
}

Returned data

{
  "data": {
    "DeleteStockAdjustment": true
  }
}

StockAdjustmentInput data type

id - Int
Unique identifier of the stock adjustment
label - String
Title of the stock adjustment
notes - String
Notes attached to the stock adjustment
total_units - Float
Total units of the stock adjustment
status - Enum
Status of the stock adjustment (enum values : active, cancelled, completed, unpublished).
dated_at - Date
Date of the stock adjustment
to_location - LocationInput - Subquery
Destination location if products are moved from a location to an other
line_items - Array of LineItemInput - Subquery
List of the line items of the order.