orders

Retrieve a list of orders that the currently logged in user can access.

Arguments

external_ids ([ExternalID!])

Optional IDs of the desired orders in an external system.

organization_filter (OrganizationFilterInput)

Optional filter to narrow the results to an organization, optionally exclude the organization's descendants.

pagination (Pagination!)

Pagination parameters for the query results.

product_key (ProductKey)
Deprecation notice

Please use the product_keys filter instead.

The product key you are interested in.

product_keys ([ProductKey!])

The product keys you are interested in.

sentera_ids ([ID!])

Optionally filter results by a list of Order IDs

sort_by ([OrdersSortCondition!])

The fields and directions to sort the results by. If not provided, results
are sorted by creation date in descending order.

statuses ([OrderStatus!])

The list of order statuses you are interested in. If not provided all orders are returned.

Return fields

page (Int!)

The page of results returned in this structure when using pagination.

page_size (Int!)

The number of results returned in this structure when using pagination.

present (Boolean!)

Whether or not there are any results in this structure.

results ([Order!]!)

A collection of orders matching the query constraints.

total_count (Int!)

The total number of items matching the query constraints.

Examples

Query for orders

Retrieve a list of orders you can access. Automatically traverses down your organization hierarchy.

Try this example in GraphiQL
query Orders {
  orders(pagination: { page: 1, page_size: 10}) {
    results {
      organization {
        sentera_id
      }
      settings {
        row_fill
        row_spacing {
          value
          unit
        }
        crop_type
        male_row_count
      }
      task {
        status
      }
    }
  }
}

{
  "data": {
    "orders": {
      "results": [
        {
          "organization": {
            "sentera_id": "121amqh_OR_phgrAcme_CV_deve_a7f4fbad8_221216_115034"
          },
          "settings": {
            "row_fill": null,
            "row_spacing": {
              "value": 12,
              "unit": "INCHES"
            },
            "crop_type": null,
            "male_row_count": null,
            "male_seed_rate": null
          },
          "task": {
            "status": "OPEN"
          }
        }
      ]
    }
  }
}

Orders by External ID

Retrieve a list of orders you can access filtered to a specific external ID.

Try this example in GraphiQL
query Orders {
  orders(external_ids: "abc.123", pagination: { page: 1, page_size: 10}) {
    results {
      organization_sentera_id
      external_id
      settings {
        row_fill
        row_spacing {
          value
          unit
        }
        crop_type
        male_row_count
      }
      task {
        status
      }
    }
  }
}

{
  "data": {
    "orders": {
      "results": [
        {
          "organization_sentera_id": "121amqh_OR_phgrAcme_CV_deve_a7f4fbad8_221216_115034",
          "external_id": "abc.123",
          "settings": {
            "row_fill": null,
            "row_spacing": {
              "value": 12,
              "unit": "INCHES"
            },
            "crop_type": null,
            "male_row_count": null,
            "male_seed_rate": null
          },
          "task": {
            "status": "OPEN"
          }
        }
      ]
    }
  }
}

Orders by External ID filter

Retrieve a list of orders you can access filtered to a specific external ID using the filter argument.

Try this example in GraphiQL
query Orders {
  orders(
    filter: {
      all: {
        external_id: { equals: "abc.123" }
      }
    }
    pagination: { page: 1, page_size: 10 }
  ) {
    results {
      organization_sentera_id
      external_id
      settings {
        row_fill
        row_spacing {
          value
          unit
        }
        crop_type
        male_row_count
      }
      task {
        status
      }
    }
  }
}

{
  "data": {
    "orders": {
      "results": [
        {
          "organization_sentera_id": "121amqh_OR_phgrAcme_CV_deve_a7f4fbad8_221216_115034",
          "external_id": "abc.123",
          "settings": {
            "row_fill": null,
            "row_spacing": {
              "value": 12,
              "unit": "INCHES"
            },
            "crop_type": null,
            "male_row_count": null,
            "male_seed_rate": null
          },
          "task": {
            "status": "OPEN"
          }
        }
      ]
    }
  }
}

Orders by Status filter

Retrieve a list of orders you can access filtered to one or more statuses using the filter argument.

Try this example in GraphiQL
query Orders {
  orders(
    filter: {
      all: {
        status: { any_of: [PENDING, PROCESSING] }
      }
    }
    pagination: { page: 1, page_size: 10 }
  ) {
    results {
      organization_sentera_id
      status
      external_id
      settings {
        row_fill
        row_spacing {
          value
          unit
        }
        crop_type
        male_row_count
      }
      task {
        status
      }
    }
  }
}

{
  "data": {
    "orders": {
      "results": [
        {
          "organization_sentera_id": "121amqh_OR_phgrAcme_CV_deve_a7f4fbad8_221216_115034",
          "status": "PENDING",
          "external_id": "abc.123",
          "settings": {
            "row_fill": null,
            "row_spacing": {
              "value": 12,
              "unit": "INCHES"
            },
            "crop_type": null,
            "male_row_count": null,
            "male_seed_rate": null
          },
          "task": {
            "status": "OPEN"
          }
        }
      ]
    }
  }
}

Orders with deal information

Retrive the information on the deal against which orders have been placed.

Try this example in GraphiQL
query Orders {
  orders(pagination: { page: 1, page_size: 10}) {
    results {
      organization_sentera_id
      deal {
        deal_number
      }
      settings {
        row_fill
        row_spacing {
          value
          unit
        }
        crop_type
        male_row_count
      }
      task {
        status
      }
    }
  }
}

{
  "data": {
    "orders": {
      "results": [
        {
          "organization_sentera_id": "121amqh_OR_phgrAcme_CV_deve_a7f4fbad8_221216_115034",
          "deal": {
            "deal_number": "231213001"
          },
          "settings": {
            "row_fill": null,
            "row_spacing": {
              "value": 12,
              "unit": "INCHES"
            },
            "crop_type": null,
            "male_row_count": null,
            "male_seed_rate": null
          },
          "task": {
            "status": "OPEN"
          }
        }
      ]
    }
  }
}

Orders by Product Keys filter

Retrieve a list of orders filtered to one or more product keys using the filter argument.

Try this example in GraphiQL
query Orders {
  orders(
    filter: {
      all: {
        product_key: { any_of: [FIELD_SCALE_STAND_COUNT, FIELD_SCALE_AERIAL_WEED_SCOUT] }
      }
    }
    pagination: { page: 1, page_size: 10 }
  ) {
    results {
      organization_sentera_id
      product {
        name
        sku
      }
      status
    }
  }
}

{
  "data": {
    "orders": {
      "results": [
        {
          "organization_sentera_id": "121amqh_OR_phgrAcme_CV_deve_a7f4fbad8_221216_115034",
          "product": {
            "name": "Field Scale Stand Count",
            "sku": "FS-SC-001"
          },
          "status": "PENDING",
          "external_id": "abc.123"
        }
      ]
    }
  }
}

Orders by Sentera IDs filter

Retrieve a list of orders filtered to specific order IDs using the filter argument.

Try this example in GraphiQL
query Orders {
  orders(
    filter: {
      all: {
        sentera_id: { any_of: ["ord5678_OR_phgrAcme_CV_deve_a7f4fbad8_221216_115034", "ord9012_OR_phgrAcme_CV_deve_a7f4fbad8_221216_115034"] }
      }
    }
    pagination: { page: 1, page_size: 10 }
  ) {
    results {
      organization_sentera_id
      sentera_id
      external_id
    }
  }
}

{
  "data": {
    "orders": {
      "results": [
        {
          "organization_sentera_id": "121amqh_OR_phgrAcme_CV_deve_a7f4fbad8_221216_115034",
          "sentera_id": "ord5678_OR_phgrAcme_CV_deve_a7f4fbad8_221216_115034",
          "external_id": "north-2"
        },
        {
          "organization_sentera_id": "121amqh_OR_phgrAcme_CV_deve_a7f4fbad8_221216_115034",
          "sentera_id": "ord9012_OR_phgrAcme_CV_deve_a7f4fbad8_221216_115034",
          "external_id": "north-1"
        }
      ]
    }
  }
}

Orders using multiple sort_by conditions

Retrieve a list of orders sorted by multiple fields.

Try this example in GraphiQL
query Orders {
  orders(
    sort_by: [
      { organization_name: ASCENDING }
      { created_at: DESCENDING }
    ]
    pagination: { page: 1, page_size: 10 }
  ) {
    results {
      organization_sentera_id
      external_id
      created_at
      organization {
        name
      }
    }
  }
}

{
  "data": {
    "orders": {
      "results": [
        {
          "organization_sentera_id": "121amqh_OR_phgrAcme_CV_deve_a7f4fbad8_221216_115034",
          "external_id": "north-2",
          "created_at": "2024-06-15T10:00:00Z",
          "organization": {
            "name": "Acme Ag"
          }
        },
        {
          "organization_sentera_id": "121amqh_OR_phgrAcme_CV_deve_a7f4fbad8_221216_115034",
          "external_id": "north-1",
          "created_at": "2024-05-01T10:00:00Z",
          "organization": {
            "name": "Acme Ag"
          }
        }
      ]
    }
  }
}

Orders by External ID and Status filter

Retrieve a list of orders by combining multiple filters in the filter argument.

Try this example in GraphiQL
query Orders {
  orders(
    filter: {
      all: {
        external_id: { equals: "abc.123" }
        status: { any_of: [PENDING, PROCESSING] }
      }
    }
    pagination: { page: 1, page_size: 10 }
  ) {
    results {
      organization_sentera_id
      status
      external_id
    }
  }
}

{
  "data": {
    "orders": {
      "results": [
        {
          "organization_sentera_id": "121amqh_OR_phgrAcme_CV_deve_a7f4fbad8_221216_115034",
          "status": "PENDING",
          "external_id": "abc.123"
        }
      ]
    }
  }
}