Welcome!

These pages contain the documentation for the boxtribute GraphQL API (queries only). Have fun exploring!

You can interact with the API in either of the following ways:

  • Open the endpoint address in your browser. This launches the GraphQL explorer
  • Send POST requests to the endpoint from a script or the command line, passing your GraphQL query in the query field of the request JSON
Contact

boxtribute Support

help@boxtribute.org

https://www.boxtribute.org

API Endpoints
https://api.boxtribute.org
Version

v2.5.2

Terms of Service

In line with the Service Agreement and other related documents as signed with Boxtribute (Stichting Boxwise)

Authentication and Authorization

For using the API, you have to authenticate, and then are given a unique token holding your user information and permissions. You have to pass the token along when requesting data from the API.

  1. You need your username and password that you log in to app.boxtribute.org with. Pass it in the JSON part of a POST response to api.boxtribute.org/token, like {"username": "my-email-address", "password": "PASSWORD"}
  2. Copy the content of the access_token field of the response JSON
  3. Paste the token into the HTTP headers when sending a request to the API, like {"Authorization": "Bearer TOKEN"}
  4. When using the GraphQL explorer, paste the header into the respective field in the bottom left.

Queries

base

Description

Return Base with specified ID. Accessible for clients who are members of this base.

Response

Returns a Base

Arguments
Name Description
id - ID!

Example

Query
query base($id: ID!) {
  base(id: $id) {
    id
    name
    organisation {
      ...OrganisationFragment
    }
    deletedOn
    beneficiaries {
      ...BeneficiaryPageFragment
    }
    currencyName
    locations {
      ...ClassicLocationFragment
    }
    products {
      ...ProductFragment
    }
    tags {
      ...TagFragment
    }
    distributionSpots {
      ...DistributionSpotFragment
    }
    distributionEvents {
      ...DistributionEventFragment
    }
    distributionEventsBeforeReturnedFromDistributionState {
      ...DistributionEventFragment
    }
    distributionEventsInReturnedFromDistributionState {
      ...DistributionEventFragment
    }
    distributionEventsTrackingGroups {
      ...DistributionEventsTrackingGroupFragment
    }
    distributionEventsStatistics {
      ...DistributionEventsStatisticsFragment
    }
  }
}
Variables
{"id": "4"}
Response
{
  "data": {
    "base": {
      "id": "4",
      "name": "Lesvos",
      "organisation": Organisation,
      "deletedOn": "2016-10-17T01:08:03",
      "beneficiaries": BeneficiaryPage,
      "currencyName": "drops",
      "locations": [ClassicLocation],
      "products": [Product],
      "tags": [Tag],
      "distributionSpots": [DistributionSpot],
      "distributionEvents": [DistributionEvent],
      "distributionEventsBeforeReturnedFromDistributionState": [
        DistributionEvent
      ],
      "distributionEventsInReturnedFromDistributionState": [
        DistributionEvent
      ],
      "distributionEventsTrackingGroups": [
        DistributionEventsTrackingGroup
      ],
      "distributionEventsStatistics": [
        DistributionEventsStatistics
      ]
    }
  }
}

bases

Description

Return all non-deleted Bases that the client is authorized to view.

Response

Returns [Base!]!

Arguments
Name Description
filterInput - FilterBaseInput

Example

Query
query bases($filterInput: FilterBaseInput) {
  bases(filterInput: $filterInput) {
    id
    name
    organisation {
      ...OrganisationFragment
    }
    deletedOn
    beneficiaries {
      ...BeneficiaryPageFragment
    }
    currencyName
    locations {
      ...ClassicLocationFragment
    }
    products {
      ...ProductFragment
    }
    tags {
      ...TagFragment
    }
    distributionSpots {
      ...DistributionSpotFragment
    }
    distributionEvents {
      ...DistributionEventFragment
    }
    distributionEventsBeforeReturnedFromDistributionState {
      ...DistributionEventFragment
    }
    distributionEventsInReturnedFromDistributionState {
      ...DistributionEventFragment
    }
    distributionEventsTrackingGroups {
      ...DistributionEventsTrackingGroupFragment
    }
    distributionEventsStatistics {
      ...DistributionEventsStatisticsFragment
    }
  }
}
Variables
{"filterInput": FilterBaseInput}
Response
{
  "data": {
    "bases": [
      {
        "id": "4",
        "name": "Lesvos",
        "organisation": Organisation,
        "deletedOn": "2016-10-17T01:08:03",
        "beneficiaries": BeneficiaryPage,
        "currencyName": "drops",
        "locations": [ClassicLocation],
        "products": [Product],
        "tags": [Tag],
        "distributionSpots": [DistributionSpot],
        "distributionEvents": [DistributionEvent],
        "distributionEventsBeforeReturnedFromDistributionState": [
          DistributionEvent
        ],
        "distributionEventsInReturnedFromDistributionState": [
          DistributionEvent
        ],
        "distributionEventsTrackingGroups": [
          DistributionEventsTrackingGroup
        ],
        "distributionEventsStatistics": [
          DistributionEventsStatistics
        ]
      }
    ]
  }
}

beneficiaries

Description

Return all Beneficiaries that the client is authorized to view. Optionally pass filter.

Response

Returns a BeneficiaryPage!

Arguments
Name Description
paginationInput - PaginationInput
filterInput - FilterBeneficiaryInput

Example

Query
query beneficiaries(
  $paginationInput: PaginationInput,
  $filterInput: FilterBeneficiaryInput
) {
  beneficiaries(
    paginationInput: $paginationInput,
    filterInput: $filterInput
  ) {
    elements {
      ...BeneficiaryFragment
    }
    pageInfo {
      ...PageInfoFragment
    }
    totalCount
  }
}
Variables
{
  "paginationInput": PaginationInput,
  "filterInput": FilterBeneficiaryInput
}
Response
{
  "data": {
    "beneficiaries": {
      "elements": [Beneficiary],
      "pageInfo": PageInfo,
      "totalCount": 123
    }
  }
}

beneficiary

Description

Return Beneficiary with specified ID. Accessible for clients who are members of the beneficiary's base

Response

Returns a Beneficiary

Arguments
Name Description
id - ID!

Example

Query
query beneficiary($id: ID!) {
  beneficiary(id: $id) {
    id
    firstName
    lastName
    dateOfBirth
    age
    comment
    base {
      ...BaseFragment
    }
    groupIdentifier
    gender
    languages
    familyHead {
      ...BeneficiaryFragment
    }
    active
    isVolunteer
    signed
    registered
    signature
    dateOfSignature
    tokens
    transactions {
      ...TransactionFragment
    }
    createdBy {
      ...UserFragment
    }
    createdOn
    lastModifiedBy {
      ...UserFragment
    }
    lastModifiedOn
    tags {
      ...TagFragment
    }
  }
}
Variables
{"id": "4"}
Response
{
  "data": {
    "beneficiary": {
      "id": "4",
      "firstName": "Some",
      "lastName": "One",
      "dateOfBirth": "2020-11-20",
      "age": 25,
      "comment": "very nice",
      "base": Base,
      "groupIdentifier": "xyz789",
      "gender": "Male",
      "languages": ["nl"],
      "familyHead": Beneficiary,
      "active": false,
      "isVolunteer": true,
      "signed": false,
      "registered": true,
      "signature": "abc123",
      "dateOfSignature": "2020-11-20",
      "tokens": 987,
      "transactions": [Transaction],
      "createdBy": User,
      "createdOn": "2016-10-17T01:08:03",
      "lastModifiedBy": User,
      "lastModifiedOn": "2016-10-17T01:08:03",
      "tags": [Tag]
    }
  }
}

beneficiaryDemographics

Response

Returns a BeneficiaryDemographicsData

Arguments
Name Description
baseId - Int!

Example

Query
query beneficiaryDemographics($baseId: Int!) {
  beneficiaryDemographics(baseId: $baseId) {
    facts {
      ...BeneficiaryDemographicsResultFragment
    }
    dimensions {
      ...BeneficiaryDemographicsDimensionsFragment
    }
  }
}
Variables
{"baseId": 123}
Response
{
  "data": {
    "beneficiaryDemographics": {
      "facts": [BeneficiaryDemographicsResult],
      "dimensions": BeneficiaryDemographicsDimensions
    }
  }
}

box

Description

Return Box with specified label identifier. For a box in InTransit, Receiving, or NotDelivered state, clients of both source and target base of the underlying shipment are allowed to view it. Otherwise the client must be permitted to access the base of the box location

Response

Returns a Box

Arguments
Name Description
labelIdentifier - String!

Example

Query
query box($labelIdentifier: String!) {
  box(labelIdentifier: $labelIdentifier) {
    id
    labelIdentifier
    location {
      ...LocationFragment
    }
    distributionEvent {
      ...DistributionEventFragment
    }
    numberOfItems
    product {
      ...ProductFragment
    }
    size {
      ...SizeFragment
    }
    displayUnit {
      ...UnitFragment
    }
    measureValue
    state
    qrCode {
      ...QrCodeFragment
    }
    createdBy {
      ...UserFragment
    }
    createdOn
    lastModifiedBy {
      ...UserFragment
    }
    lastModifiedOn
    deletedOn
    comment
    tags {
      ...TagFragment
    }
    history {
      ...HistoryEntryFragment
    }
    shipmentDetail {
      ...ShipmentDetailFragment
    }
  }
}
Variables
{"labelIdentifier": "abc123"}
Response
{
  "data": {
    "box": {
      "id": "4",
      "labelIdentifier": "abc123",
      "location": Location,
      "distributionEvent": DistributionEvent,
      "numberOfItems": 987,
      "product": Product,
      "size": "XL",
      "displayUnit": Unit,
      "measureValue": 123.45,
      "state": "InStock",
      "qrCode": QrCode,
      "createdBy": User,
      "createdOn": "2016-10-17T01:08:03",
      "lastModifiedBy": User,
      "lastModifiedOn": "2016-10-17T01:08:03",
      "deletedOn": "2016-10-17T01:08:03",
      "comment": "very new",
      "tags": [Tag],
      "history": [HistoryEntry],
      "shipmentDetail": ShipmentDetail
    }
  }
}

boxes

Description

Return page of non-deleted Boxes in base with specified ID. Optionally pass filters

Response

Returns a BoxPage!

Arguments
Name Description
baseId - ID!
paginationInput - PaginationInput
filterInput - FilterBoxInput

Example

Query
query boxes(
  $baseId: ID!,
  $paginationInput: PaginationInput,
  $filterInput: FilterBoxInput
) {
  boxes(
    baseId: $baseId,
    paginationInput: $paginationInput,
    filterInput: $filterInput
  ) {
    elements {
      ...BoxFragment
    }
    pageInfo {
      ...PageInfoFragment
    }
    totalCount
  }
}
Variables
{
  "baseId": 4,
  "paginationInput": PaginationInput,
  "filterInput": FilterBoxInput
}
Response
{
  "data": {
    "boxes": {
      "elements": [Box],
      "pageInfo": PageInfo,
      "totalCount": 987
    }
  }
}

createdBoxes

Response

Returns a CreatedBoxesData

Arguments
Name Description
baseId - Int!

Example

Query
query createdBoxes($baseId: Int!) {
  createdBoxes(baseId: $baseId) {
    facts {
      ...CreatedBoxesResultFragment
    }
    dimensions {
      ...CreatedBoxDataDimensionsFragment
    }
  }
}
Variables
{"baseId": 987}
Response
{
  "data": {
    "createdBoxes": {
      "facts": [CreatedBoxesResult],
      "dimensions": CreatedBoxDataDimensions
    }
  }
}

distributionEvent

Response

Returns a DistributionEvent

Arguments
Name Description
id - ID!

Example

Query
query distributionEvent($id: ID!) {
  distributionEvent(id: $id) {
    id
    distributionSpot {
      ...DistributionSpotFragment
    }
    name
    state
    plannedStartDateTime
    plannedEndDateTime
    packingListEntries {
      ...PackingListEntryFragment
    }
    boxes {
      ...BoxFragment
    }
    unboxedItemsCollections {
      ...UnboxedItemsCollectionFragment
    }
    distributionEventsTrackingGroup {
      ...DistributionEventsTrackingGroupFragment
    }
  }
}
Variables
{"id": 4}
Response
{
  "data": {
    "distributionEvent": {
      "id": "4",
      "distributionSpot": DistributionSpot,
      "name": "xyz789",
      "state": "Planning",
      "plannedStartDateTime": "2016-10-17T01:08:03",
      "plannedEndDateTime": "2016-10-17T01:08:03",
      "packingListEntries": [PackingListEntry],
      "boxes": [Box],
      "unboxedItemsCollections": [UnboxedItemsCollection],
      "distributionEventsTrackingGroup": DistributionEventsTrackingGroup
    }
  }
}

distributionEventsTrackingGroup

Response

Returns a DistributionEventsTrackingGroup

Arguments
Name Description
id - ID!

Example

Query
query distributionEventsTrackingGroup($id: ID!) {
  distributionEventsTrackingGroup(id: $id) {
    id
    state
    distributionEvents {
      ...DistributionEventFragment
    }
    distributionEventsTrackingEntries {
      ...DistributionEventsTrackingEntryFragment
    }
    createdOn
  }
}
Variables
{"id": "4"}
Response
{
  "data": {
    "distributionEventsTrackingGroup": {
      "id": "4",
      "state": "InProgress",
      "distributionEvents": [DistributionEvent],
      "distributionEventsTrackingEntries": [
        DistributionEventsTrackingEntry
      ],
      "createdOn": "2016-10-17T01:08:03"
    }
  }
}

distributionSpot

Response

Returns a DistributionSpot

Arguments
Name Description
id - ID!

Example

Query
query distributionSpot($id: ID!) {
  distributionSpot(id: $id) {
    id
    name
    base {
      ...BaseFragment
    }
    boxes {
      ...BoxPageFragment
    }
    comment
    latitude
    longitude
    distributionEvents {
      ...DistributionEventFragment
    }
  }
}
Variables
{"id": 4}
Response
{
  "data": {
    "distributionSpot": {
      "id": 4,
      "name": "abc123",
      "base": Base,
      "boxes": BoxPage,
      "comment": "abc123",
      "latitude": 123.45,
      "longitude": 987.65,
      "distributionEvents": [DistributionEvent]
    }
  }
}

distributionSpots

Response

Returns [DistributionSpot!]!

Example

Query
query distributionSpots {
  distributionSpots {
    id
    name
    base {
      ...BaseFragment
    }
    boxes {
      ...BoxPageFragment
    }
    comment
    latitude
    longitude
    distributionEvents {
      ...DistributionEventFragment
    }
  }
}
Response
{
  "data": {
    "distributionSpots": [
      {
        "id": 4,
        "name": "abc123",
        "base": Base,
        "boxes": BoxPage,
        "comment": "abc123",
        "latitude": 123.45,
        "longitude": 123.45,
        "distributionEvents": [DistributionEvent]
      }
    ]
  }
}

location

Description

Return ClassicLocation with specified ID. Accessible for clients who are members of the location's base

Response

Returns a ClassicLocation

Arguments
Name Description
id - ID!

Example

Query
query location($id: ID!) {
  location(id: $id) {
    id
    base {
      ...BaseFragment
    }
    name
    seq
    isShop
    isStockroom
    boxes {
      ...BoxPageFragment
    }
    defaultBoxState
    createdBy {
      ...UserFragment
    }
    createdOn
    lastModifiedBy {
      ...UserFragment
    }
    lastModifiedOn
  }
}
Variables
{"id": "4"}
Response
{
  "data": {
    "location": {
      "id": "4",
      "base": Base,
      "name": "abc123",
      "seq": 123,
      "isShop": true,
      "isStockroom": true,
      "boxes": BoxPage,
      "defaultBoxState": "InStock",
      "createdBy": User,
      "createdOn": "2016-10-17T01:08:03",
      "lastModifiedBy": User,
      "lastModifiedOn": "2016-10-17T01:08:03"
    }
  }
}

locations

Description

Return all ClassicLocations that the client is authorized to view.

Response

Returns [ClassicLocation!]!

Example

Query
query locations {
  locations {
    id
    base {
      ...BaseFragment
    }
    name
    seq
    isShop
    isStockroom
    boxes {
      ...BoxPageFragment
    }
    defaultBoxState
    createdBy {
      ...UserFragment
    }
    createdOn
    lastModifiedBy {
      ...UserFragment
    }
    lastModifiedOn
  }
}
Response
{
  "data": {
    "locations": [
      {
        "id": "4",
        "base": Base,
        "name": "xyz789",
        "seq": 123,
        "isShop": true,
        "isStockroom": false,
        "boxes": BoxPage,
        "defaultBoxState": "InStock",
        "createdBy": User,
        "createdOn": "2016-10-17T01:08:03",
        "lastModifiedBy": User,
        "lastModifiedOn": "2016-10-17T01:08:03"
      }
    ]
  }
}

metrics

Description

Return various metrics about stock and beneficiaries for client's organisation.

Response

Returns a Metrics

Arguments
Name Description
organisationId - ID

Example

Query
query metrics($organisationId: ID) {
  metrics(organisationId: $organisationId) {
    numberOfFamiliesServed
    numberOfBeneficiariesServed
    numberOfSales
    stockOverview {
      ...StockOverviewFragment
    }
  }
}
Variables
{"organisationId": "4"}
Response
{
  "data": {
    "metrics": {
      "numberOfFamiliesServed": 987,
      "numberOfBeneficiariesServed": 987,
      "numberOfSales": 987,
      "stockOverview": StockOverview
    }
  }
}

movedBoxes

Response

Returns a MovedBoxesData

Arguments
Name Description
baseId - Int!

Example

Query
query movedBoxes($baseId: Int!) {
  movedBoxes(baseId: $baseId) {
    facts {
      ...MovedBoxesResultFragment
    }
    dimensions {
      ...MovedBoxDataDimensionsFragment
    }
  }
}
Variables
{"baseId": 123}
Response
{
  "data": {
    "movedBoxes": {
      "facts": [MovedBoxesResult],
      "dimensions": MovedBoxDataDimensions
    }
  }
}

organisation

Description

Return Organisation with specified ID.

Response

Returns an Organisation

Arguments
Name Description
id - ID!

Example

Query
query organisation($id: ID!) {
  organisation(id: $id) {
    id
    name
    bases {
      ...BaseFragment
    }
  }
}
Variables
{"id": 4}
Response
{
  "data": {
    "organisation": {
      "id": 4,
      "name": "Helpful Helpers",
      "bases": [Base]
    }
  }
}

organisations

Description

Return all Organisations.

Response

Returns [Organisation!]!

Example

Query
query organisations {
  organisations {
    id
    name
    bases {
      ...BaseFragment
    }
  }
}
Response
{
  "data": {
    "organisations": [
      {
        "id": "4",
        "name": "Helpful Helpers",
        "bases": [Base]
      }
    ]
  }
}

packingListEntry

Response

Returns a PackingListEntry

Arguments
Name Description
id - ID!

Example

Query
query packingListEntry($id: ID!) {
  packingListEntry(id: $id) {
    id
    product {
      ...ProductFragment
    }
    size {
      ...SizeFragment
    }
    numberOfItems
    matchingPackedItemsCollections {
      ...ItemsCollectionFragment
    }
    state
  }
}
Variables
{"id": 4}
Response
{
  "data": {
    "packingListEntry": {
      "id": "4",
      "product": Product,
      "size": Size,
      "numberOfItems": 123,
      "matchingPackedItemsCollections": [ItemsCollection],
      "state": "NotStarted"
    }
  }
}

product

Description

Return Product with specified ID. Accessible for clients who are members of the product's base

Response

Returns a Product

Arguments
Name Description
id - ID!

Example

Query
query product($id: ID!) {
  product(id: $id) {
    id
    name
    type
    category {
      ...ProductCategoryFragment
    }
    sizeRange {
      ...SizeRangeFragment
    }
    base {
      ...BaseFragment
    }
    price
    gender
    comment
    inShop
    createdBy {
      ...UserFragment
    }
    createdOn
    lastModifiedBy {
      ...UserFragment
    }
    lastModifiedOn
    deletedOn
  }
}
Variables
{"id": "4"}
Response
{
  "data": {
    "product": {
      "id": "4",
      "name": "gloves",
      "type": "Custom",
      "category": ProductCategory,
      "sizeRange": SizeRange,
      "base": Base,
      "price": 987.65,
      "gender": "Men",
      "comment": "abc123",
      "inShop": true,
      "createdBy": User,
      "createdOn": "2016-10-17T01:08:03",
      "lastModifiedBy": User,
      "lastModifiedOn": "2016-10-17T01:08:03",
      "deletedOn": "2016-10-17T01:08:03"
    }
  }
}

productCategories

Description

Return all ProductCategories.

Response

Returns [ProductCategory!]!

Example

Query
query productCategories {
  productCategories {
    id
    name
    products {
      ...ProductPageFragment
    }
    hasGender
  }
}
Response
{
  "data": {
    "productCategories": [
      {
        "id": "4",
        "name": "Clothing",
        "products": ProductPage,
        "hasGender": false
      }
    ]
  }
}

productCategory

Description

Return ProductCategory with specified ID.

Response

Returns a ProductCategory

Arguments
Name Description
id - ID!

Example

Query
query productCategory($id: ID!) {
  productCategory(id: $id) {
    id
    name
    products {
      ...ProductPageFragment
    }
    hasGender
  }
}
Variables
{"id": 4}
Response
{
  "data": {
    "productCategory": {
      "id": "4",
      "name": "Clothing",
      "products": ProductPage,
      "hasGender": true
    }
  }
}

products

Description

Return all Products (incl. deleted) that the client is authorized to view.

Response

Returns a ProductPage!

Arguments
Name Description
paginationInput - PaginationInput

Example

Query
query products($paginationInput: PaginationInput) {
  products(paginationInput: $paginationInput) {
    elements {
      ...ProductFragment
    }
    pageInfo {
      ...PageInfoFragment
    }
    totalCount
  }
}
Variables
{"paginationInput": PaginationInput}
Response
{
  "data": {
    "products": {
      "elements": [Product],
      "pageInfo": PageInfo,
      "totalCount": 123
    }
  }
}

qrCode

Description

Return QrCode with specified code (an MD5 hash in hex format of length 32), or an error in case of insufficient permission or missing resource.

Response

Returns a QrCodeResult!

Arguments
Name Description
code - String!

Example

Query
query qrCode($code: String!) {
  qrCode(code: $code) {
    ... on QrCode {
      ...QrCodeFragment
    }
    ... on InsufficientPermissionError {
      ...InsufficientPermissionErrorFragment
    }
    ... on ResourceDoesNotExistError {
      ...ResourceDoesNotExistErrorFragment
    }
  }
}
Variables
{"code": "xyz789"}
Response
{"data": {"qrCode": QrCode}}

qrExists

Response

Returns a Boolean

Arguments
Name Description
code - String

Example

Query
query qrExists($code: String) {
  qrExists(code: $code)
}
Variables
{"code": "abc123"}
Response
{"data": {"qrExists": false}}

shipment

Description

Return Shipment with specified ID. Clients are authorized to view a shipment if they're member of either the source or the target base

Response

Returns a Shipment

Arguments
Name Description
id - ID!

Example

Query
query shipment($id: ID!) {
  shipment(id: $id) {
    id
    labelIdentifier
    sourceBase {
      ...BaseFragment
    }
    targetBase {
      ...BaseFragment
    }
    state
    startedBy {
      ...UserFragment
    }
    startedOn
    sentBy {
      ...UserFragment
    }
    sentOn
    receivingStartedBy {
      ...UserFragment
    }
    receivingStartedOn
    completedBy {
      ...UserFragment
    }
    completedOn
    canceledBy {
      ...UserFragment
    }
    canceledOn
    transferAgreement {
      ...TransferAgreementFragment
    }
    details {
      ...ShipmentDetailFragment
    }
  }
}
Variables
{"id": "4"}
Response
{
  "data": {
    "shipment": {
      "id": 4,
      "labelIdentifier": "xyz789",
      "sourceBase": Base,
      "targetBase": Base,
      "state": "Preparing",
      "startedBy": User,
      "startedOn": "2016-10-17T01:08:03",
      "sentBy": User,
      "sentOn": "2016-10-17T01:08:03",
      "receivingStartedBy": User,
      "receivingStartedOn": "2016-10-17T01:08:03",
      "completedBy": User,
      "completedOn": "2016-10-17T01:08:03",
      "canceledBy": User,
      "canceledOn": "2016-10-17T01:08:03",
      "transferAgreement": TransferAgreement,
      "details": [ShipmentDetail]
    }
  }
}

shipments

Description

Return all Shipments that the client is authorized to view.

Response

Returns [Shipment!]!

Example

Query
query shipments {
  shipments {
    id
    labelIdentifier
    sourceBase {
      ...BaseFragment
    }
    targetBase {
      ...BaseFragment
    }
    state
    startedBy {
      ...UserFragment
    }
    startedOn
    sentBy {
      ...UserFragment
    }
    sentOn
    receivingStartedBy {
      ...UserFragment
    }
    receivingStartedOn
    completedBy {
      ...UserFragment
    }
    completedOn
    canceledBy {
      ...UserFragment
    }
    canceledOn
    transferAgreement {
      ...TransferAgreementFragment
    }
    details {
      ...ShipmentDetailFragment
    }
  }
}
Response
{
  "data": {
    "shipments": [
      {
        "id": "4",
        "labelIdentifier": "xyz789",
        "sourceBase": Base,
        "targetBase": Base,
        "state": "Preparing",
        "startedBy": User,
        "startedOn": "2016-10-17T01:08:03",
        "sentBy": User,
        "sentOn": "2016-10-17T01:08:03",
        "receivingStartedBy": User,
        "receivingStartedOn": "2016-10-17T01:08:03",
        "completedBy": User,
        "completedOn": "2016-10-17T01:08:03",
        "canceledBy": User,
        "canceledOn": "2016-10-17T01:08:03",
        "transferAgreement": TransferAgreement,
        "details": [ShipmentDetail]
      }
    ]
  }
}

standardProduct

Description

Return StandardProduct with specified ID, or an error in case of insufficient permission or missing resource.

Response

Returns a StandardProductResult

Arguments
Name Description
id - ID!

Example

Query
query standardProduct($id: ID!) {
  standardProduct(id: $id) {
    ... on StandardProduct {
      ...StandardProductFragment
    }
    ... on InsufficientPermissionError {
      ...InsufficientPermissionErrorFragment
    }
    ... on ResourceDoesNotExistError {
      ...ResourceDoesNotExistErrorFragment
    }
  }
}
Variables
{"id": "4"}
Response
{"data": {"standardProduct": StandardProduct}}

standardProducts

Description

Return standard products of latest version. Optionally include all standard products enabled for specified base.

Response

Returns a StandardProductsResult

Arguments
Name Description
baseId - ID

Example

Query
query standardProducts($baseId: ID) {
  standardProducts(baseId: $baseId) {
    ... on StandardProductPage {
      ...StandardProductPageFragment
    }
    ... on InsufficientPermissionError {
      ...InsufficientPermissionErrorFragment
    }
    ... on UnauthorizedForBaseError {
      ...UnauthorizedForBaseErrorFragment
    }
  }
}
Variables
{"baseId": 4}
Response
{"data": {"standardProducts": StandardProductPage}}

stockOverview

Response

Returns a StockOverviewData

Arguments
Name Description
baseId - Int!

Example

Query
query stockOverview($baseId: Int!) {
  stockOverview(baseId: $baseId) {
    facts {
      ...StockOverviewResultFragment
    }
    dimensions {
      ...StockOverviewDataDimensionsFragment
    }
  }
}
Variables
{"baseId": 987}
Response
{
  "data": {
    "stockOverview": {
      "facts": [StockOverviewResult],
      "dimensions": StockOverviewDataDimensions
    }
  }
}

tag

Description

Return Tag with specified ID. Accessible for clients who are members of the tag's base

Response

Returns a Tag

Arguments
Name Description
id - ID!

Example

Query
query tag($id: ID!) {
  tag(id: $id) {
    id
    name
    description
    color
    type
    taggedResources {
      ... on Box {
        ...BoxFragment
      }
      ... on Beneficiary {
        ...BeneficiaryFragment
      }
    }
    base {
      ...BaseFragment
    }
  }
}
Variables
{"id": "4"}
Response
{
  "data": {
    "tag": {
      "id": "4",
      "name": "abc123",
      "description": "abc123",
      "color": "abc123",
      "type": "Box",
      "taggedResources": [Box],
      "base": Base
    }
  }
}

tags

Description

Return all non-deleted Tags that the client is authorized to view. Optionally filter for tags of certain type.

Response

Returns [Tag!]!

Arguments
Name Description
tagType - TagType

Example

Query
query tags($tagType: TagType) {
  tags(tagType: $tagType) {
    id
    name
    description
    color
    type
    taggedResources {
      ... on Box {
        ...BoxFragment
      }
      ... on Beneficiary {
        ...BeneficiaryFragment
      }
    }
    base {
      ...BaseFragment
    }
  }
}
Variables
{"tagType": "Box"}
Response
{
  "data": {
    "tags": [
      {
        "id": 4,
        "name": "abc123",
        "description": "abc123",
        "color": "abc123",
        "type": "Box",
        "taggedResources": [Box],
        "base": Base
      }
    ]
  }
}

topProductsCheckedOut

Response

Returns a TopProductsCheckedOutData

Arguments
Name Description
baseId - Int!

Example

Query
query topProductsCheckedOut($baseId: Int!) {
  topProductsCheckedOut(baseId: $baseId) {
    facts {
      ...TopProductsCheckedOutResultFragment
    }
    dimensions {
      ...TopProductsDimensionsFragment
    }
  }
}
Variables
{"baseId": 987}
Response
{
  "data": {
    "topProductsCheckedOut": {
      "facts": [TopProductsCheckedOutResult],
      "dimensions": TopProductsDimensions
    }
  }
}

topProductsDonated

Response

Returns a TopProductsDonatedData

Arguments
Name Description
baseId - Int!

Example

Query
query topProductsDonated($baseId: Int!) {
  topProductsDonated(baseId: $baseId) {
    facts {
      ...TopProductsDonatedResultFragment
    }
    dimensions {
      ...TopProductsDimensionsFragment
    }
  }
}
Variables
{"baseId": 987}
Response
{
  "data": {
    "topProductsDonated": {
      "facts": [TopProductsDonatedResult],
      "dimensions": TopProductsDimensions
    }
  }
}

transferAgreement

Description

Return TransferAgreement with specified ID. Clients are authorized to view an agreement if they're member of at least one of the agreement's source or target bases

Response

Returns a TransferAgreement

Arguments
Name Description
id - ID!

Example

Query
query transferAgreement($id: ID!) {
  transferAgreement(id: $id) {
    id
    sourceOrganisation {
      ...OrganisationFragment
    }
    targetOrganisation {
      ...OrganisationFragment
    }
    state
    type
    requestedBy {
      ...UserFragment
    }
    requestedOn
    acceptedBy {
      ...UserFragment
    }
    acceptedOn
    terminatedBy {
      ...UserFragment
    }
    terminatedOn
    validFrom
    validUntil
    comment
    sourceBases {
      ...BaseFragment
    }
    targetBases {
      ...BaseFragment
    }
    shipments {
      ...ShipmentFragment
    }
  }
}
Variables
{"id": 4}
Response
{
  "data": {
    "transferAgreement": {
      "id": "4",
      "sourceOrganisation": Organisation,
      "targetOrganisation": Organisation,
      "state": "UnderReview",
      "type": "SendingTo",
      "requestedBy": User,
      "requestedOn": "2016-10-17T01:08:03",
      "acceptedBy": User,
      "acceptedOn": "2016-10-17T01:08:03",
      "terminatedBy": User,
      "terminatedOn": "2016-10-17T01:08:03",
      "validFrom": "2016-10-17T01:08:03",
      "validUntil": "2016-10-17T01:08:03",
      "comment": "xyz789",
      "sourceBases": [Base],
      "targetBases": [Base],
      "shipments": [Shipment]
    }
  }
}

transferAgreements

Description

Return all TransferAgreements that the client is authorized to view. Without any arguments, return transfer agreements that involve client's organisation, regardless of agreement state. Optionally filter for agreements of certain state(s).

Response

Returns [TransferAgreement!]!

Arguments
Name Description
states - [TransferAgreementState!]

Example

Query
query transferAgreements($states: [TransferAgreementState!]) {
  transferAgreements(states: $states) {
    id
    sourceOrganisation {
      ...OrganisationFragment
    }
    targetOrganisation {
      ...OrganisationFragment
    }
    state
    type
    requestedBy {
      ...UserFragment
    }
    requestedOn
    acceptedBy {
      ...UserFragment
    }
    acceptedOn
    terminatedBy {
      ...UserFragment
    }
    terminatedOn
    validFrom
    validUntil
    comment
    sourceBases {
      ...BaseFragment
    }
    targetBases {
      ...BaseFragment
    }
    shipments {
      ...ShipmentFragment
    }
  }
}
Variables
{"states": ["UnderReview"]}
Response
{
  "data": {
    "transferAgreements": [
      {
        "id": 4,
        "sourceOrganisation": Organisation,
        "targetOrganisation": Organisation,
        "state": "UnderReview",
        "type": "SendingTo",
        "requestedBy": User,
        "requestedOn": "2016-10-17T01:08:03",
        "acceptedBy": User,
        "acceptedOn": "2016-10-17T01:08:03",
        "terminatedBy": User,
        "terminatedOn": "2016-10-17T01:08:03",
        "validFrom": "2016-10-17T01:08:03",
        "validUntil": "2016-10-17T01:08:03",
        "comment": "abc123",
        "sourceBases": [Base],
        "targetBases": [Base],
        "shipments": [Shipment]
      }
    ]
  }
}

user

Description

Return User with specified ID. Some fields might be restricted.

Response

Returns a User

Arguments
Name Description
id - ID

Example

Query
query user($id: ID) {
  user(id: $id) {
    id
    organisation {
      ...OrganisationFragment
    }
    name
    email
    validFirstDay
    validLastDay
    bases {
      ...BaseFragment
    }
    lastLogin
    lastAction
  }
}
Variables
{"id": "4"}
Response
{
  "data": {
    "user": {
      "id": 4,
      "organisation": Organisation,
      "name": "xyz789",
      "email": "abc123",
      "validFirstDay": "2020-11-20",
      "validLastDay": "2020-11-20",
      "bases": [Base],
      "lastLogin": "2016-10-17T01:08:03",
      "lastAction": "2016-10-17T01:08:03"
    }
  }
}

users

Description

Return all Users. Accessible for god users only

Response

Returns [User!]!

Example

Query
query users {
  users {
    id
    organisation {
      ...OrganisationFragment
    }
    name
    email
    validFirstDay
    validLastDay
    bases {
      ...BaseFragment
    }
    lastLogin
    lastAction
  }
}
Response
{
  "data": {
    "users": [
      {
        "id": 4,
        "organisation": Organisation,
        "name": "xyz789",
        "email": "abc123",
        "validFirstDay": "2020-11-20",
        "validLastDay": "2020-11-20",
        "bases": [Base],
        "lastLogin": "2016-10-17T01:08:03",
        "lastAction": "2016-10-17T01:08:03"
      }
    ]
  }
}

Types

Base

Description

Representation of a base. The base is managed by a specific Organisation.

Fields
Field Name Description
id - ID!
name - String!
organisation - Organisation!
deletedOn - Datetime
beneficiaries - BeneficiaryPage List of all Beneficiaries registered in this base. Optionally pass filters
Arguments
paginationInput - PaginationInput
filterInput - FilterBeneficiaryInput
currencyName - String
locations - [ClassicLocation!]! List of all non-deleted ClassicLocations present in this base
products - [Product!]! List of all non-deleted Products registered in this base
Arguments
filterInput - FilterProductInput
tags - [Tag!] List of all non-deleted Tags registered in this base. Optionally filter for a resource type
Arguments
resourceType - TaggableResourceType
distributionSpots - [DistributionSpot!]!
distributionEvents - [DistributionEvent!]!
Arguments
distributionEventsBeforeReturnedFromDistributionState - [DistributionEvent!]!
distributionEventsInReturnedFromDistributionState - [DistributionEvent!]!
distributionEventsTrackingGroups - [DistributionEventsTrackingGroup!]!
distributionEventsStatistics - [DistributionEventsStatistics!]!
Example
{
  "id": 4,
  "name": "Lesvos",
  "organisation": Organisation,
  "deletedOn": "2016-10-17T01:08:03",
  "beneficiaries": BeneficiaryPage,
  "currencyName": "drops",
  "locations": [ClassicLocation],
  "products": [Product],
  "tags": [Tag],
  "distributionSpots": [DistributionSpot],
  "distributionEvents": [DistributionEvent],
  "distributionEventsBeforeReturnedFromDistributionState": [
    DistributionEvent
  ],
  "distributionEventsInReturnedFromDistributionState": [
    DistributionEvent
  ],
  "distributionEventsTrackingGroups": [
    DistributionEventsTrackingGroup
  ],
  "distributionEventsStatistics": [
    DistributionEventsStatistics
  ]
}

BasicDimensionInfo

Fields
Field Name Description
id - Int
name - String
Possible Types
BasicDimensionInfo Types

DimensionInfo

TagDimensionInfo

ProductDimensionInfo

Example
{"id": 123, "name": "abc123"}

Beneficiary

Description

Representation of a beneficiary. The beneficiary is registered in a specific Base.

Fields
Field Name Description
id - ID!
firstName - String!
lastName - String!
dateOfBirth - Date
age - Int If dateOfBirth is not set, age will be null.
comment - String
base - Base
groupIdentifier - String! All members of a family have the same group identifier
gender - HumanGender
languages - [Language!]
familyHead - Beneficiary Null if this beneficiary is the family head
active - Boolean!
isVolunteer - Boolean!
signed - Boolean!
registered - Boolean!
signature - String
dateOfSignature - Date
tokens - Int Number of tokens the beneficiary holds (sum of all transaction values)
transactions - [Transaction!] List of all Transactions that this beneficiary executed
createdBy - User
createdOn - Datetime
lastModifiedBy - User
lastModifiedOn - Datetime
tags - [Tag!]
Example
{
  "id": "4",
  "firstName": "Some",
  "lastName": "One",
  "dateOfBirth": "2020-11-20",
  "age": 25,
  "comment": "very nice",
  "base": Base,
  "groupIdentifier": "abc123",
  "gender": "Male",
  "languages": ["nl"],
  "familyHead": Beneficiary,
  "active": true,
  "isVolunteer": true,
  "signed": true,
  "registered": false,
  "signature": "abc123",
  "dateOfSignature": "2020-11-20",
  "tokens": 987,
  "transactions": [Transaction],
  "createdBy": User,
  "createdOn": "2016-10-17T01:08:03",
  "lastModifiedBy": User,
  "lastModifiedOn": "2016-10-17T01:08:03",
  "tags": [Tag]
}

BeneficiaryDemographicsData

Fields
Field Name Description
facts - [BeneficiaryDemographicsResult]
dimensions - BeneficiaryDemographicsDimensions
Example
{
  "facts": [BeneficiaryDemographicsResult],
  "dimensions": BeneficiaryDemographicsDimensions
}

BeneficiaryDemographicsDimensions

Fields
Field Name Description
tag - [TagDimensionInfo]
Example
{"tag": [TagDimensionInfo]}

BeneficiaryDemographicsResult

Fields
Field Name Description
age - Int
gender - HumanGender
createdOn - Date
deletedOn - Date
tagIds - [Int!]
count - Int
Example
{
  "age": 987,
  "gender": "Male",
  "createdOn": "2020-11-20",
  "deletedOn": "2020-11-20",
  "tagIds": [123],
  "count": 987
}

BeneficiaryPage

Description

Utility type holding a page of Beneficiaries.

Fields
Field Name Description
elements - [Beneficiary!]
pageInfo - PageInfo!
totalCount - Int!
Example
{
  "elements": [Beneficiary],
  "pageInfo": PageInfo,
  "totalCount": 987
}

Boolean

Description

The Boolean scalar type represents true or false.

Example
true

Box

Description

Representation of a box storing items of a Product in a Location

Fields
Field Name Description
id - ID!
labelIdentifier - String! Sequence of numbers for identifying the box, usually written on box label
location - Location If the client is not authorized to access the location's base, return null instead of raising an authorization error. This enables the target side of a shipment to scan boxes that are not yet reconciliated into their stock (but still registered at the source side)
distributionEvent - DistributionEvent
numberOfItems - Int
product - Product If the client is not authorized to access the product's base, return null instead of raising an authorization error. This enables the target side of a shipment to scan boxes that are not yet reconciliated into their stock (but still registered at the source side)
size - Size If the box holds a 'measure' product (i.e. classified by a package measure like 500gr), its size is null
displayUnit - Unit Information about the unit that the measure shall be displayed in. If the box holds a product with size (e.g. clothing), its unit is null
measureValue - Float The value of the measure, expressed in unit. If the box holds a product with size (e.g. clothing), its measure value is null
state - BoxState!
qrCode - QrCode
createdBy - User
createdOn - Datetime
lastModifiedBy - User
lastModifiedOn - Datetime
deletedOn - Datetime
comment - String
tags - [Tag!]
history - [HistoryEntry!] Sorted by date, newest first
shipmentDetail - ShipmentDetail Returns null if box is not part of an active shipment
Example
{
  "id": "4",
  "labelIdentifier": "xyz789",
  "location": Location,
  "distributionEvent": DistributionEvent,
  "numberOfItems": 987,
  "product": Product,
  "size": "XL",
  "displayUnit": Unit,
  "measureValue": 123.45,
  "state": "InStock",
  "qrCode": QrCode,
  "createdBy": User,
  "createdOn": "2016-10-17T01:08:03",
  "lastModifiedBy": User,
  "lastModifiedOn": "2016-10-17T01:08:03",
  "deletedOn": "2016-10-17T01:08:03",
  "comment": "very new",
  "tags": [Tag],
  "history": [HistoryEntry],
  "shipmentDetail": ShipmentDetail
}

BoxPage

Description

Utility type holding a page of Boxes.

Fields
Field Name Description
elements - [Box!]!
pageInfo - PageInfo!
totalCount - Int!
Example
{
  "elements": [Box],
  "pageInfo": PageInfo,
  "totalCount": 987
}

BoxResult

BoxState

Description

Classificators for Box state.

Values
Enum Value Description

InStock

Lost

MarkedForShipment

Receiving

Donated

Scrap

InTransit

NotDelivered

Example
"InStock"

ClassicLocation

Description

Representation of a classic physical location used to store Boxes (e.g. a warehouse). The location is part of a specific Base.

Fields
Field Name Description
id - ID!
base - Base
name - String
seq - Int Used for ordering purposes
isShop - Boolean!
isStockroom - Boolean!
boxes - BoxPage List of all Boxes (incl. deleted) in this classic location
Arguments
paginationInput - PaginationInput
filterInput - FilterBoxInput
defaultBoxState - BoxState Default state for boxes in this classic location
createdBy - User
createdOn - Datetime
lastModifiedBy - User
lastModifiedOn - Datetime
Example
{
  "id": 4,
  "base": Base,
  "name": "xyz789",
  "seq": 987,
  "isShop": false,
  "isStockroom": false,
  "boxes": BoxPage,
  "defaultBoxState": "InStock",
  "createdBy": User,
  "createdOn": "2016-10-17T01:08:03",
  "lastModifiedBy": User,
  "lastModifiedOn": "2016-10-17T01:08:03"
}

CreatedBoxDataDimensions

Fields
Field Name Description
product - [ProductDimensionInfo]
category - [DimensionInfo]
tag - [TagDimensionInfo]
Example
{
  "product": [ProductDimensionInfo],
  "category": [DimensionInfo],
  "tag": [TagDimensionInfo]
}

CreatedBoxesData

Fields
Field Name Description
facts - [CreatedBoxesResult]
dimensions - CreatedBoxDataDimensions
Example
{
  "facts": [CreatedBoxesResult],
  "dimensions": CreatedBoxDataDimensions
}

CreatedBoxesResult

Fields
Field Name Description
createdOn - Date
categoryId - Int
productId - Int
gender - ProductGender
tagIds - [Int!]
boxesCount - Int
itemsCount - Int
Example
{
  "createdOn": "2020-11-20",
  "categoryId": 987,
  "productId": 123,
  "gender": "Men",
  "tagIds": [987],
  "boxesCount": 987,
  "itemsCount": 123
}

DataCube

Example
{
  "facts": [BeneficiaryDemographicsResult],
  "dimensions": BeneficiaryDemographicsDimensions
}

Date

Example
"2020-11-20"

Datetime

Example
"2016-10-17T01:08:03"

DimensionInfo

Fields
Field Name Description
id - Int
name - String
Example
{"id": 123, "name": "abc123"}

Dimensions

DistributionEvent

Fields
Field Name Description
id - ID!
distributionSpot - DistributionSpot
name - String
state - DistributionEventState!
plannedStartDateTime - Datetime!
plannedEndDateTime - Datetime!
packingListEntries - [PackingListEntry!]!
boxes - [Box!]!
unboxedItemsCollections - [UnboxedItemsCollection!]!
distributionEventsTrackingGroup - DistributionEventsTrackingGroup
Example
{
  "id": 4,
  "distributionSpot": DistributionSpot,
  "name": "abc123",
  "state": "Planning",
  "plannedStartDateTime": "2016-10-17T01:08:03",
  "plannedEndDateTime": "2016-10-17T01:08:03",
  "packingListEntries": [PackingListEntry],
  "boxes": [Box],
  "unboxedItemsCollections": [UnboxedItemsCollection],
  "distributionEventsTrackingGroup": DistributionEventsTrackingGroup
}

DistributionEventState

Description

TODO: Add description here once specs are final/confirmed

Values
Enum Value Description

Planning

Packing

OnDistro

ReturnedFromDistribution

ReturnTrackingInProgress

Completed

Example
"Planning"

DistributionEventTrackingFlowDirection

Values
Enum Value Description

In

Out

BackToBox

Example
"In"

DistributionEventsStatistics

Fields
Field Name Description
productName - String!
genderLabel - String!
categoryLabel - String!
sizeLabel - String!
inflow - Int!
outflow - Int!
earliestPossibleDistroDate - String!
latestPossibleDistroDate - String!
potentiallyInvolvedDistributionSpots - String!
involvedDistributionEventIds - String!
distroEventTrackingGroupId - String!
productId - String!
sizeId - String!
Example
{
  "productName": "xyz789",
  "genderLabel": "abc123",
  "categoryLabel": "xyz789",
  "sizeLabel": "xyz789",
  "inflow": 987,
  "outflow": 123,
  "earliestPossibleDistroDate": "xyz789",
  "latestPossibleDistroDate": "abc123",
  "potentiallyInvolvedDistributionSpots": "abc123",
  "involvedDistributionEventIds": "xyz789",
  "distroEventTrackingGroupId": "xyz789",
  "productId": "abc123",
  "sizeId": "abc123"
}

DistributionEventsTrackingEntry

Fields
Field Name Description
id - ID!
product - Product!
size - Size!
numberOfItems - Int!
distributionEventsTrackingGroup - DistributionEventsTrackingGroup!
dateTimeOfTracking - Datetime!
flowDirection - DistributionEventTrackingFlowDirection!
Example
{
  "id": "4",
  "product": Product,
  "size": Size,
  "numberOfItems": 123,
  "distributionEventsTrackingGroup": DistributionEventsTrackingGroup,
  "dateTimeOfTracking": "2016-10-17T01:08:03",
  "flowDirection": "In"
}

DistributionEventsTrackingGroup

Fields
Field Name Description
id - ID!
state - DistributionEventsTrackingGroupState!
distributionEvents - [DistributionEvent!]!
distributionEventsTrackingEntries - [DistributionEventsTrackingEntry!]!
createdOn - Datetime!
Example
{
  "id": "4",
  "state": "InProgress",
  "distributionEvents": [DistributionEvent],
  "distributionEventsTrackingEntries": [
    DistributionEventsTrackingEntry
  ],
  "createdOn": "2016-10-17T01:08:03"
}

DistributionEventsTrackingGroupState

Values
Enum Value Description

InProgress

Completed

Example
"InProgress"

DistributionSpot

Fields
Field Name Description
id - ID!
name - String
base - Base
boxes - BoxPage Not implemented, only for compatibility with Location interface
Arguments
paginationInput - PaginationInput
filterInput - FilterBoxInput
comment - String!
latitude - Float
longitude - Float
distributionEvents - [DistributionEvent!]!
Example
{
  "id": 4,
  "name": "abc123",
  "base": Base,
  "boxes": BoxPage,
  "comment": "xyz789",
  "latitude": 987.65,
  "longitude": 987.65,
  "distributionEvents": [DistributionEvent]
}

FilterBaseInput

Fields
Input Field Description
includeDeleted - Boolean
Example
{"includeDeleted": false}

FilterBeneficiaryInput

Description

Optional filter values when retrieving Beneficiaries. If several fields are defined (not null), they are combined into a filter expression using logical AND (i.e. the filter returns only elements for which all fields are true).

Fields
Input Field Description
createdFrom - Date Filter for all beneficiaries who were created on this date (incl.), or later.
createdUntil - Date Filter for all beneficiaries who were created on this date (incl.), or earlier.
active - Boolean
isVolunteer - Boolean
registered - Boolean
pattern - String Filter for all beneficiaries where pattern is (case-insensitive) part of first name, last name, or comment, or where pattern matches the group identifier
Example
{
  "createdFrom": "2020-11-20",
  "createdUntil": "2020-11-20",
  "active": false,
  "isVolunteer": true,
  "registered": true,
  "pattern": "xyz789"
}

FilterBoxInput

Description

Optional filter values when retrieving Boxes. If several fields are defined (not null), they are combined into a filter expression using logical AND (i.e. the filter returns only elements for which all fields are true).

Fields
Input Field Description
states - [BoxState!] Filter for all boxes that have one of the specified states.
lastModifiedFrom - Date Filter for all boxes that who were last modified on this date (incl.), or later.
lastModifiedUntil - Date Filter for all boxes that who were last modified on this date (incl.), or earlier.
productGender - ProductGender
productCategoryId - Int
productId - Int
sizeId - Int
tagIds - [Int!] Filter for all boxes that have at least one of the specified tags.
Example
{
  "states": ["InStock"],
  "lastModifiedFrom": "2020-11-20",
  "lastModifiedUntil": "2020-11-20",
  "productGender": "Men",
  "productCategoryId": 123,
  "productId": 123,
  "sizeId": 123,
  "tagIds": [987]
}

FilterProductInput

Fields
Input Field Description
includeDeleted - Boolean
type - ProductTypeFilter
Example
{"includeDeleted": false, "type": "Custom"}

Float

Description

The Float scalar type represents signed double-precision fractional values as specified by IEEE 754.

Example
123.45

HistoryEntry

Fields
Field Name Description
id - ID!
changes - String!
changeDate - Datetime
user - User
Example
{
  "id": 4,
  "changes": "abc123",
  "changeDate": "2016-10-17T01:08:03",
  "user": User
}

HumanGender

Values
Enum Value Description

Male

Female

Diverse

Example
"Male"

ID

Description

The ID scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as "4") or integer (such as 4) input value will be accepted as an ID.

Example
"4"

InsufficientPermissionError

Fields
Field Name Description
name - String! e.g. 'product:write' missing
Example
{"name": "abc123"}

Int

Description

The Int scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.

Example
987

ItemsCollection

Fields
Field Name Description
id - ID!
product - Product
size - Size
numberOfItems - Int
location - Location
distributionEvent - DistributionEvent
Possible Types
ItemsCollection Types

UnboxedItemsCollection

Box

Example
{
  "id": "4",
  "product": Product,
  "size": Size,
  "numberOfItems": 987,
  "location": Location,
  "distributionEvent": DistributionEvent
}

Language

Description

Language codes.

Values
Enum Value Description

nl

en

fr

de

ar

ckb

Example
"nl"

Location

Fields
Field Name Description
id - ID!
base - Base
name - String
boxes - BoxPage
Arguments
paginationInput - PaginationInput
filterInput - FilterBoxInput
Possible Types
Location Types

ClassicLocation

DistributionSpot

Example
{
  "id": 4,
  "base": Base,
  "name": "abc123",
  "boxes": BoxPage
}

Metrics

Fields
Field Name Description
numberOfFamiliesServed - Int Return number of families served by client's organisation in optional date range. If after and before are specified, construct date range for filtering. If one of after or before is specified, construct half-open date range. If none is specified, the result is an all-time number.
Arguments
after - Date
before - Date
numberOfBeneficiariesServed - Int Like numberOfFamiliesServed but add up all members of served families
Arguments
after - Date
before - Date
numberOfSales - Int Return number of sales performed by client's organisation in optional date range. See numberOfFamiliesServed about using the after and before parameters.
Arguments
after - Date
before - Date
stockOverview - StockOverview Return number of boxes, and number of contained items, managed by client's organisation.
Example
{
  "numberOfFamiliesServed": 987,
  "numberOfBeneficiariesServed": 987,
  "numberOfSales": 123,
  "stockOverview": StockOverview
}

MovedBoxDataDimensions

Fields
Field Name Description
category - [DimensionInfo]
size - [DimensionInfo]
tag - [TagDimensionInfo!]!
target - [TargetDimensionInfo]
dimension - [DimensionInfo!]! 'Dimension' in the sense of Mass or Volume
Example
{
  "category": [DimensionInfo],
  "size": [DimensionInfo],
  "tag": [TagDimensionInfo],
  "target": [TargetDimensionInfo],
  "dimension": [DimensionInfo]
}

MovedBoxesData

Fields
Field Name Description
facts - [MovedBoxesResult]
dimensions - MovedBoxDataDimensions
Example
{
  "facts": [MovedBoxesResult],
  "dimensions": MovedBoxDataDimensions
}

MovedBoxesResult

Description

A box can be moved in various ways:

  • within a base (location ID with InStock/Donated)
  • because it's lost (Lost)
  • because it becomes scrap (Scrap)
  • because it's about to be shipped (target base ID with MarkedForShipment)
  • because it's being shipped (target base ID with InTransit/Receiving)
Fields
Field Name Description
movedOn - Date!
targetId - ID!
categoryId - Int!
productName - String!
gender - ProductGender!
sizeId - Int Null for boxes with measure-product
dimensionId - Int 'Dimension' in the sense of Mass or Volume; null for boxes with size-product
absoluteMeasureValue - Float Null for boxes with size-product
organisationName - String Shipment target organisation name; null for BoxState/OutgoingLocation target types
tagIds - [Int!]
itemsCount - Int!
boxesCount - Int!
Example
{
  "movedOn": "2020-11-20",
  "targetId": "4",
  "categoryId": 123,
  "productName": "abc123",
  "gender": "Men",
  "sizeId": 123,
  "dimensionId": 987,
  "absoluteMeasureValue": 123.45,
  "organisationName": "abc123",
  "tagIds": [123],
  "itemsCount": 123,
  "boxesCount": 123
}

Organisation

Description

Representation of an organisation.

Fields
Field Name Description
id - ID!
name - String!
bases - [Base!] List of all non-deleted Bases managed by this organisation. Accessible for any authenticated user
Arguments
filterInput - FilterBaseInput
Example
{
  "id": "4",
  "name": "Helpful Helpers",
  "bases": [Base]
}

PackingListEntry

Fields
Field Name Description
id - ID!
product - Product
size - Size
numberOfItems - Int!
matchingPackedItemsCollections - [ItemsCollection!]!
state - PackingListEntryState!
Example
{
  "id": "4",
  "product": Product,
  "size": Size,
  "numberOfItems": 987,
  "matchingPackedItemsCollections": [ItemsCollection],
  "state": "NotStarted"
}

PackingListEntryState

Values
Enum Value Description

NotStarted

PackingInProgress

Packed

Example
"NotStarted"

PageInfo

Description

Additional information passed along in *Page types. The client shall use the has*Page fields to determine whether to fetch more data.

Fields
Field Name Description
hasPreviousPage - Boolean! If true, a previous page is available.
hasNextPage - Boolean! If true, a next page is available.
startCursor - String! An identifier for the first element on the page. The client shall use it for the PaginationInput.before field
endCursor - String! An identifier for the last element on the page. The client shall use it for the PaginationInput.after field
Example
{
  "hasPreviousPage": true,
  "hasNextPage": false,
  "startCursor": "abc123",
  "endCursor": "abc123"
}

PaginationInput

Description

Optional input for queries/fields that return a page of elements. The specified fields must be either none OR first OR after, first OR before, last. Other combinations result in unexpected behavior and/or errors. The default page size (first and last, resp.) is 50. This format is inspired by https://relay.dev/graphql/connections.htm#sec-Forward-pagination-arguments

Fields
Input Field Description
after - String Indicate requesting paginating of the first X elements after this cursor. By default, the first relevant element of the database. See also PageInfo.endCursor
first - Int
before - String Indicate requesting paginating of the last X elements before this cursor. See also PageInfo.startCursor
last - Int
Example
{"after": "c00ffeeb33f", "first": 50, "before": null, "last": null}

Product

Description

Representation of a product, containing information about ProductCategory, size, and ProductGender. The product is registered in a specific Base.

Fields
Field Name Description
id - ID!
name - String!
type - ProductType!
category - ProductCategory!
sizeRange - SizeRange!
base - Base
price - Float
gender - ProductGender
comment - String
inShop - Boolean!
createdBy - User
createdOn - Datetime
lastModifiedBy - User
lastModifiedOn - Datetime
deletedOn - Datetime
Example
{
  "id": "4",
  "name": "gloves",
  "type": "Custom",
  "category": ProductCategory,
  "sizeRange": SizeRange,
  "base": Base,
  "price": 987.65,
  "gender": "Men",
  "comment": "xyz789",
  "inShop": false,
  "createdBy": User,
  "createdOn": "2016-10-17T01:08:03",
  "lastModifiedBy": User,
  "lastModifiedOn": "2016-10-17T01:08:03",
  "deletedOn": "2016-10-17T01:08:03"
}

ProductCategory

Description

Representation of a product category.

Fields
Field Name Description
id - ID!
name - String!
products - ProductPage List of all products registered in bases the client is authorized to view.
Arguments
paginationInput - PaginationInput
hasGender - Boolean! Non-clothing categories don't have a product gender.
Example
{
  "id": 4,
  "name": "Clothing",
  "products": ProductPage,
  "hasGender": false
}

ProductDimensionInfo

Fields
Field Name Description
id - Int
name - String
gender - ProductGender
Example
{
  "id": 123,
  "name": "xyz789",
  "gender": "Men"
}

ProductGender

Description

Classificators for Product gender.

Values
Enum Value Description

Men

Women

UnisexAdult

UnisexKid

UnisexBaby

TeenGirl

TeenBoy

Girl

Boy

none

Example
"Men"

ProductPage

Description

Utility type holding a page of Products.

Fields
Field Name Description
elements - [Product!]!
pageInfo - PageInfo!
totalCount - Int!
Example
{
  "elements": [Product],
  "pageInfo": PageInfo,
  "totalCount": 987
}

ProductType

Description

Classificators for Product type.

Values
Enum Value Description

Custom

StandardInstantiation

Example
"Custom"

ProductTypeFilter

Values
Enum Value Description

Custom

StandardInstantiation

All

Example
"Custom"

QrCode

Description

Representation of a QR code, possibly associated with a Box.

Fields
Field Name Description
id - ID!
code - String!
box - BoxResult Box associated with the QR code (null if none associated), or an error in case of insufficient permission or missing authorization for box's base
createdOn - Datetime
Example
{
  "id": "4",
  "code": "xyz789",
  "box": Box,
  "createdOn": "2016-10-17T01:08:03"
}

QrCodeResult

ResourceDoesNotExistError

Fields
Field Name Description
id - ID
name - String!
Example
{
  "id": "4",
  "name": "xyz789"
}

Result

Shipment

Description

Representation of a shipment of boxes between two bases of two distinct organisations. The content is tracked via ShipmentDetails

Fields
Field Name Description
id - ID!
labelIdentifier - String! Unique identifier of the shipment, constructed from ID, start date, source and target base names. E.g. S042-230815-THxLE
sourceBase - Base!
targetBase - Base!
state - ShipmentState
startedBy - User!
startedOn - Datetime!
sentBy - User
sentOn - Datetime
receivingStartedBy - User
receivingStartedOn - Datetime
completedBy - User
completedOn - Datetime
canceledBy - User
canceledOn - Datetime
transferAgreement - TransferAgreement If no agreement associated with the shipment, it's an intra-org one
details - [ShipmentDetail!]!
Example
{
  "id": 4,
  "labelIdentifier": "xyz789",
  "sourceBase": Base,
  "targetBase": Base,
  "state": "Preparing",
  "startedBy": User,
  "startedOn": "2016-10-17T01:08:03",
  "sentBy": User,
  "sentOn": "2016-10-17T01:08:03",
  "receivingStartedBy": User,
  "receivingStartedOn": "2016-10-17T01:08:03",
  "completedBy": User,
  "completedOn": "2016-10-17T01:08:03",
  "canceledBy": User,
  "canceledOn": "2016-10-17T01:08:03",
  "transferAgreement": TransferAgreement,
  "details": [ShipmentDetail]
}

ShipmentDetail

Description

Representation of a box in a shipment. Boxes might be added or removed on the source side, and received or marked as lost on the target side. All properties (product, location, size, quantity) at source and target side are tracked here

Fields
Field Name Description
id - ID!
sourceProduct - Product
targetProduct - Product
sourceLocation - ClassicLocation
targetLocation - ClassicLocation
sourceSize - Size
targetSize - Size
sourceQuantity - Int
targetQuantity - Int
box - Box!
shipment - Shipment!
createdBy - User!
createdOn - Datetime!
removedBy - User
removedOn - Datetime
lostBy - User
lostOn - Datetime
receivedBy - User
receivedOn - Datetime
Example
{
  "id": 4,
  "sourceProduct": Product,
  "targetProduct": Product,
  "sourceLocation": ClassicLocation,
  "targetLocation": ClassicLocation,
  "sourceSize": Size,
  "targetSize": Size,
  "sourceQuantity": 987,
  "targetQuantity": 123,
  "box": Box,
  "shipment": Shipment,
  "createdBy": User,
  "createdOn": "2016-10-17T01:08:03",
  "removedBy": User,
  "removedOn": "2016-10-17T01:08:03",
  "lostBy": User,
  "lostOn": "2016-10-17T01:08:03",
  "receivedBy": User,
  "receivedOn": "2016-10-17T01:08:03"
}

ShipmentState

Values
Enum Value Description

Preparing

Sent

Receiving

Completed

Canceled

Lost

Example
"Preparing"

Size

Description

Representation of product size (e.g. clothing size "XL", shoe size 39).

Fields
Field Name Description
id - ID!
label - String!
Example
{
  "id": "4",
  "label": "abc123"
}

SizeRange

Description

Representation of group of sizes (e.g. clothing sizes "S, M, L, XL"), or of a dimension (mass or volume).

Fields
Field Name Description
id - ID!
label - String!
sizes - [Size!]! List of sizes belonging to the group
units - [Unit!]! List of units belonging to the dimension
Example
{
  "id": "4",
  "label": "abc123",
  "sizes": [Size],
  "units": [Unit]
}

StandardProduct

Description

Representation of a standard product, containing information about ProductCategory, size, and ProductGender. Users can enable this standard product for their bases which creates a standard product instantiation.

Fields
Field Name Description
id - ID!
name - String!
category - ProductCategory!
sizeRange - SizeRange!
gender - ProductGender!
version - Int!
enabledForBases - [Base!] All bases that this standard product is enabled for.
addedBy - User
addedOn - Datetime
deprecatedBy - User
deprecatedOn - Datetime
precededByProduct - StandardProduct
supercededByProduct - StandardProduct
Example
{
  "id": "4",
  "name": "abc123",
  "category": ProductCategory,
  "sizeRange": SizeRange,
  "gender": "Men",
  "version": 123,
  "enabledForBases": [Base],
  "addedBy": User,
  "addedOn": "2016-10-17T01:08:03",
  "deprecatedBy": User,
  "deprecatedOn": "2016-10-17T01:08:03",
  "precededByProduct": StandardProduct,
  "supercededByProduct": StandardProduct
}

StandardProductPage

Description

Utility type holding a page of StandardProducts.

Fields
Field Name Description
elements - [StandardProduct!]!
pageInfo - PageInfo!
totalCount - Int!
Example
{
  "elements": [StandardProduct],
  "pageInfo": PageInfo,
  "totalCount": 123
}

StandardProductResult

Example
StandardProduct

StandardProductsResult

Example
StandardProductPage

StockOverview

Fields
Field Name Description
productCategoryName - String
numberOfBoxes - Int
numberOfItems - Int
Example
{
  "productCategoryName": "abc123",
  "numberOfBoxes": 987,
  "numberOfItems": 987
}

StockOverviewData

Fields
Field Name Description
facts - [StockOverviewResult!]!
dimensions - StockOverviewDataDimensions!
Example
{
  "facts": [StockOverviewResult],
  "dimensions": StockOverviewDataDimensions
}

StockOverviewDataDimensions

Fields
Field Name Description
category - [DimensionInfo!]!
size - [DimensionInfo!]!
tag - [TagDimensionInfo!]!
location - [DimensionInfo!]!
dimension - [DimensionInfo!]! 'Dimension' in the sense of Mass or Volume
Example
{
  "category": [DimensionInfo],
  "size": [DimensionInfo],
  "tag": [TagDimensionInfo],
  "location": [DimensionInfo],
  "dimension": [DimensionInfo]
}

StockOverviewResult

Fields
Field Name Description
categoryId - Int!
productName - String!
gender - ProductGender!
sizeId - Int Null for boxes with measure-product
dimensionId - Int 'Dimension' in the sense of Mass or Volume; null for boxes with size-product
absoluteMeasureValue - Float Null for boxes with size-product
tagIds - [Int!]
locationId - Int!
boxState - BoxState!
itemsCount - Int!
boxesCount - Int!
Example
{
  "categoryId": 123,
  "productName": "xyz789",
  "gender": "Men",
  "sizeId": 987,
  "dimensionId": 987,
  "absoluteMeasureValue": 987.65,
  "tagIds": [987],
  "locationId": 123,
  "boxState": "InStock",
  "itemsCount": 123,
  "boxesCount": 987
}

String

Description

The String scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.

Example
"abc123"

Tag

Description

Representation of a tag.

Fields
Field Name Description
id - ID!
name - String!
description - String
color - String
type - TagType!
taggedResources - [TaggableResource!] List of boxes and/or beneficiaries that have this tag assigned
base - Base!
Example
{
  "id": "4",
  "name": "abc123",
  "description": "xyz789",
  "color": "xyz789",
  "type": "Box",
  "taggedResources": [Box],
  "base": Base
}

TagDimensionInfo

Fields
Field Name Description
id - Int
name - String
color - String Hex color code
Example
{
  "id": 123,
  "name": "abc123",
  "color": "abc123"
}

TagType

Description

Classificators for Tag type.

Values
Enum Value Description

Box

Beneficiary

All

Example
"Box"

TaggableResource

Description

Union for resources that tags can be applied to.

Types
Union Types

Box

Beneficiary

Example
Box

TaggableResourceType

Description

Classificator for resources that a Tag can be applied to (according to TaggableResource).

Values
Enum Value Description

Box

Beneficiary

Example
"Box"

TargetDimensionInfo

Fields
Field Name Description
id - ID
name - String
type - TargetType
Example
{
  "id": "4",
  "name": "abc123",
  "type": "Shipment"
}

TargetType

Values
Enum Value Description

Shipment

OutgoingLocation

BoxState

Example
"Shipment"

TopProductsCheckedOutData

Fields
Field Name Description
facts - [TopProductsCheckedOutResult]
dimensions - TopProductsDimensions
Example
{
  "facts": [TopProductsCheckedOutResult],
  "dimensions": TopProductsDimensions
}

TopProductsCheckedOutResult

Fields
Field Name Description
checkedOutOn - Date
productId - Int
categoryId - Int
rank - Int
itemsCount - Int
Example
{
  "checkedOutOn": "2020-11-20",
  "productId": 987,
  "categoryId": 123,
  "rank": 987,
  "itemsCount": 123
}

TopProductsDimensions

Fields
Field Name Description
size - [DimensionInfo] Always null for topProductsCheckedOut query
product - [ProductDimensionInfo]
category - [DimensionInfo]
Example
{
  "size": [DimensionInfo],
  "product": [ProductDimensionInfo],
  "category": [DimensionInfo]
}

TopProductsDonatedData

Fields
Field Name Description
facts - [TopProductsDonatedResult]
dimensions - TopProductsDimensions
Example
{
  "facts": [TopProductsDonatedResult],
  "dimensions": TopProductsDimensions
}

TopProductsDonatedResult

Fields
Field Name Description
createdOn - Date
donatedOn - Date
sizeId - Int
productId - Int
categoryId - Int
rank - Int
itemsCount - Int
Example
{
  "createdOn": "2020-11-20",
  "donatedOn": "2020-11-20",
  "sizeId": 123,
  "productId": 123,
  "categoryId": 987,
  "rank": 123,
  "itemsCount": 987
}

Transaction

Description

Representation of a transaction executed by a beneficiary (spending or receiving tokens).

Fields
Field Name Description
id - ID!
beneficiary - Beneficiary!
product - Product
count - Int Number of transferred products
tokens - Int Value of the transaction
description - String
createdBy - User
createdOn - Datetime!
Example
{
  "id": "4",
  "beneficiary": Beneficiary,
  "product": Product,
  "count": 123,
  "tokens": 123,
  "description": "abc123",
  "createdBy": User,
  "createdOn": "2016-10-17T01:08:03"
}

TransferAgreement

Description

Representation of an agreement between two organisations prior to start mutual shipments.

Fields
Field Name Description
id - ID!
sourceOrganisation - Organisation!
targetOrganisation - Organisation!
state - TransferAgreementState
type - TransferAgreementType!
requestedBy - User!
requestedOn - Datetime!
acceptedBy - User
acceptedOn - Datetime
terminatedBy - User
terminatedOn - Datetime
validFrom - Datetime!
validUntil - Datetime
comment - String
sourceBases - [Base!] List of all non-deleted bases of the source organisation included in the agreement
Arguments
filterInput - FilterBaseInput
targetBases - [Base!] List of all non-deleted bases of the target organisation included in the agreement
Arguments
filterInput - FilterBaseInput
shipments - [Shipment!]!
Example
{
  "id": "4",
  "sourceOrganisation": Organisation,
  "targetOrganisation": Organisation,
  "state": "UnderReview",
  "type": "SendingTo",
  "requestedBy": User,
  "requestedOn": "2016-10-17T01:08:03",
  "acceptedBy": User,
  "acceptedOn": "2016-10-17T01:08:03",
  "terminatedBy": User,
  "terminatedOn": "2016-10-17T01:08:03",
  "validFrom": "2016-10-17T01:08:03",
  "validUntil": "2016-10-17T01:08:03",
  "comment": "xyz789",
  "sourceBases": [Base],
  "targetBases": [Base],
  "shipments": [Shipment]
}

TransferAgreementState

Values
Enum Value Description

UnderReview

Accepted

Rejected

Canceled

Expired

Example
"UnderReview"

TransferAgreementType

Values
Enum Value Description

SendingTo

ReceivingFrom

Bidirectional

Example
"SendingTo"

UnauthorizedForBaseError

Fields
Field Name Description
id - ID! e.g. 'product:write' present but not for requested base
name - String! Empty string if base does not exist
organisationName - String! Empty string if base does not exist
Example
{
  "id": 4,
  "name": "abc123",
  "organisationName": "xyz789"
}

UnboxedItemsCollection

Fields
Field Name Description
id - ID!
product - Product
size - Size
numberOfItems - Int
label - String
location - Location
distributionEvent - DistributionEvent
Example
{
  "id": "4",
  "product": Product,
  "size": Size,
  "numberOfItems": 987,
  "label": "xyz789",
  "location": Location,
  "distributionEvent": DistributionEvent
}

Unit

Description

Representation of dimensional unit (e.g. kilogram or liter)

Fields
Field Name Description
id - ID!
name - String!
symbol - String!
Example
{
  "id": "4",
  "name": "xyz789",
  "symbol": "xyz789"
}

User

Description

Representation of a boxtribute user.

Fields
Field Name Description
id - ID!
organisation - Organisation The Organisation the user is a member of. Meaningful only if the currently authenticated user queries themselves
name - String First and last name. Accessible to any authenticated user
email - String Available only if the currently authenticated user queries themselves
validFirstDay - Date
validLastDay - Date
bases - [Base] List of all Bases this user can access. Meaningful only if the currently authenticated user queries themselves
lastLogin - Datetime
lastAction - Datetime
Example
{
  "id": "4",
  "organisation": Organisation,
  "name": "xyz789",
  "email": "abc123",
  "validFirstDay": "2020-11-20",
  "validLastDay": "2020-11-20",
  "bases": [Base],
  "lastLogin": "2016-10-17T01:08:03",
  "lastAction": "2016-10-17T01:08:03"
}