Grid Daemon REST API (0.4.0)

Download OpenAPI specification:Download

A REST API providing HTTP/JSON interface to Grid.

Transaction

Fetches the statuses for a set of batches

Fetches an array of objects with a status and id for each batch requested. There are four possible statuses with string values 'COMMITTED', 'INVALID', 'PENDING', and 'UNKNOWN'. The batch(es) you want to check can be specified using the id filter parameter. If a wait time is specified in the URL, the API will wait to respond until all batches are committed, or the time in seconds has elapsed. If the value of wait is not set (i.e., ?wait&id=...), or it is set to any non-integer value other than false, the wait time will be just under the API's specified timeout (usually 300). Note that because this route does not return full resources, the response will not be paginated, and there will be no head or paging properties.

query Parameters
id
required
string

A comma-separated list of batch IDs or data change IDs

wait
integer

The number of seconds to wait for batches to be committed before returning.

service_id
string

The ID of the service the request should be sent to. This parameter is required if running on Splinter. Format: <circuit-id>::<service-id>

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Locations

Lists all locations

query Parameters
service_id
string

The ID of the service the request should be sent to. This parameter is required if running on Splinter. Format: <circuit-id>::<service-id>

offset
integer

The index of the first element to be in the page

limit
integer

The maximum number of elements in a page

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "paging": {
    }
}

Submits a list of locations to be added

This endpoint can be used to submit locations to the underlying distributed ledger. The operation called by this endpoint will depend on which distributed ledger is supporting this deployment of Grid. Regardless of the underlying ledger, the body of this request must be a valid list of Grid Locations. If the Grid Daemon is running against Splinter, then the service_id query parameter is required for this request. The Grid Daemon will use the service ID to forward the transaction to an endpoint on the Splinter Daemon for the Scabbard service corresponding to the provided service ID.

query Parameters
service_id
string

The ID of the service the request should be sent to. This parameter is required if running on Splinter. Format: <circuit-id>::<service-id>

wait
integer

The number of seconds to wait for batches to be committed before returning.

Request Body schema: application/json

A JSON list of Locations

Array of objects (CreateLocation)

Responses

Request samples

Content type
application/json
{
  • "data": [
    ]
}

Response samples

Content type
application/json
{
  • "link": {
    }
}

Fetches a single location with the given ID

path Parameters
location_id
required
string

ID of the location to fetch

query Parameters
service_id
string

The ID of the service the request should be sent to. This parameter is required if running on Splinter. Format: <circuit-id>::<service-id>

Responses

Response samples

Content type
application/json
{
  • "location_id": 99474000005,
  • "location_namespace": "UNSET_NAMESPACE",
  • "owner": "02cd3181dbd7d1539f470436ce222c53ab5e514f67809dc0095895e6cdfba97612",
  • "properties": [
    ],
  • "service_id": "12345-QWERTY:gsAA"
}

Updates a single location with the given ID

path Parameters
location_id
required
string

ID of the location to update

query Parameters
service_id
string

The ID of the service the request should be sent to. This parameter is required if running on Splinter. Format: <circuit-id>::<service-id>

Request Body schema: application/json

A JSON Location

location_id
string
location_namespace
string (NamespaceEnum)
Enum: "UNSET_NAMESPACE" "GS1"
Array of objects (PropertyValue)
service_id
string (ServiceID)

Responses

Request samples

Content type
application/json
{
  • "location_id": 99474000005,
  • "location_namespace": "UNSET_NAMESPACE",
  • "properties": [
    ],
  • "service_id": "12345-QWERTY:gsAA"
}

Response samples

Content type
application/json
{
  • "link": {
    }
}

Remove a Location

path Parameters
location_id
required
string

ID of the location to delete

query Parameters
service_id
string

The ID of the service the request should be sent to. This parameter is required if running on Splinter. Format: <circuit-id>::<service-id>

Responses

Response samples

Content type
application/json
{
  • "link": {
    }
}

Pike

Lists all organizations

query Parameters
service_id
string

The ID of the service the request should be sent to. This parameter is required if running on Splinter. Format: <circuit-id>::<service-id>

offset
integer

The index of the first element to be in the page

limit
integer

The maximum number of elements in a page

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "paging": {
    }
}

Submits organizations to be added

This endpoint can be used to submit organizations to the underlying distributed ledger. The operation called by this endpoint will depend on which distributed ledger is supporting this deployment of Grid. Regardless of the underlying ledger, the body of this request must be a valid list of Grid Organizations. If the Grid Daemon is running against Splinter, then the service_id query parameter is required for this request. The Grid Daemon will use the service ID to forward the transaction to an endpoint on the Splinter Daemon for the Scabbard service corresponding to the provided service ID.

query Parameters
service_id
string

The ID of the service the request should be sent to. This parameter is required if running on Splinter. Format: <circuit-id>::<service-id>

wait
integer

The number of seconds to wait for batches to be committed before returning.

Request Body schema: application/json

A JSON list of Organizations

Array of objects (Organization)

Responses

Request samples

Content type
application/json
{
  • "data": [
    ]
}

Response samples

Content type
application/json
{
  • "link": {
    }
}

Fetches a single organization with the given ID

path Parameters
id
required
string

ID of the organization to fetch

query Parameters
service_id
string

The ID of the service the request should be sent to. This parameter is required if running on Splinter. Format: <circuit-id>::<service-id>

Responses

Response samples

Content type
application/json
{
  • "id": "philips001",
  • "name": "Philips",
  • "alternate_ids": [
    ],
  • "locations": [
    ],
  • "metadata": [
    ],
  • "service_id": "12345-QWERTY:gsAA",
  • "last_updated": 1557949075
}

Updates a single organization with the given ID

path Parameters
id
required
string

ID of the organization to update

query Parameters
service_id
string

The ID of the service the request should be sent to. This parameter is required if running on Splinter. Format: <circuit-id>::<service-id>

Request Body schema: application/json

A JSON Organization

id
string
name
string
locations
Array of strings
alternate_ids
Array of strings
Array of objects (Metadata)
service_id
string (ServiceID)
last_updated
integer (Timestamp)

Responses

Request samples

Content type
application/json
{
  • "id": "philips001",
  • "name": "Philips",
  • "locations": [
    ],
  • "alternate_ids": [
    ],
  • "metadata": [
    ],
  • "service_id": "12345-QWERTY:gsAA",
  • "last_updated": 1557949075
}

Response samples

Content type
application/json
{
  • "link": {
    }
}

Lists all agents

path Parameters
org_id
required
string

ID of the organization the agent belongs to

query Parameters
service_id
string

The ID of the service the request should be sent to. This parameter is required if running on Splinter. Format: <circuit-id>::<service-id>

offset
integer

The index of the first element to be in the page

limit
integer

The maximum number of elements in a page

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "paging": {
    }
}

Submits a list of agents to be added to the organization

path Parameters
org_id
required
string

ID of the organization the agents belong to

query Parameters
service_id
string

The ID of the service the request should be sent to. This parameter is required if running on Splinter. Format: <circuit-id>::<service-id>

Request Body schema: application/json

A JSON list of Agents

Array of objects (Agent)

Responses

Request samples

Content type
application/json
{
  • "data": [
    ]
}

Response samples

Content type
application/json
{
  • "link": {
    }
}

Fetches an agent with the given public key

path Parameters
org_id
required
string

ID of the organization the agent belongs to

public_key
required
string

Public key of the agent to fetch

query Parameters
service_id
string

The ID of the service the request should be sent to. This parameter is required if running on Splinter. Format: <circuit-id>::<service-id>

Responses

Response samples

Content type
application/json
{
  • "public_key": "038bba5708acc262464c9fe30d3de9e905a9a5fa30cedd151dd9cd09ea26d46d00",
  • "org_id": 13600,
  • "active": "true",
  • "roles": [
    ],
  • "metadata": [
    ],
  • "service_id": "12345-QWERTY:gsAA",
  • "last_updated": 1557949075
}

Updates a single agent with the given public key belonging to the organization with the given org ID

path Parameters
org_id
required
string

ID of the organization the agent belongs to

public_key
required
string

Public key of the agent to update

query Parameters
service_id
string

The ID of the service the request should be sent to. This parameter is required if running on Splinter. Format: <circuit-id>::<service-id>

Request Body schema: application/json

A JSON Agent

public_key
string
org_id
string
active
boolean
Array of objects (Role)
Array of objects (Metadata)
service_id
string (ServiceID)
last_updated
integer (Timestamp)

Responses

Request samples

Content type
application/json
{
  • "public_key": "038bba5708acc262464c9fe30d3de9e905a9a5fa30cedd151dd9cd09ea26d46d00",
  • "org_id": 13600,
  • "active": "true",
  • "roles": [
    ],
  • "metadata": [
    ],
  • "service_id": "12345-QWERTY:gsAA",
  • "last_updated": 1557949075
}

Response samples

Content type
application/json
{
  • "link": {
    }
}

Lists all roles for a single organization

path Parameters
org_id
required
string

Org ID of the organization to list roles for

query Parameters
service_id
string

The ID of the service the request should be sent to. This parameter is required if running on Splinter. Format: <circuit-id>::<service-id>

offset
integer

The index of the first element to be in the page

limit
integer

The maximum number of elements in a page

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "paging": {
    }
}

Submits a list of roles to be added to the organization

path Parameters
org_id
required
string

ID of the organization the roles belong to

query Parameters
service_id
string

The ID of the service the request should be sent to. This parameter is required if running on Splinter. Format: <circuit-id>::<service-id>

Request Body schema: application/json

A JSON list of Roles

Array of objects (Role)

Responses

Request samples

Content type
application/json
{
  • "data": [
    ]
}

Response samples

Content type
application/json
{
  • "link": {
    }
}

Lists all roles for a single organization

path Parameters
org_id
required
string

Org ID of the organization the role belongs to

role_name
required
string

Role name of the role to fetch

query Parameters
service_id
string

The ID of the service the request should be sent to. This parameter is required if running on Splinter. Format: <circuit-id>::<service-id>

offset
integer

The index of the first element to be in the page

limit
integer

The maximum number of elements in a page

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "paging": {
    }
}

Updates a single role with the given role name belonging to the organization with the given org ID

path Parameters
org_id
required
string

ID of the organization the agent belongs to

role_name
required
string

Role name of the role to update

query Parameters
service_id
string

The ID of the service the request should be sent to. This parameter is required if running on Splinter. Format: <circuit-id>::<service-id>

Request Body schema: application/json

A JSON Role

name
string
org_id
string
description
string
permissions
Array of strings
allowed_organizations
Array of strings
inherit_from
Array of strings
last_updated
integer (Timestamp)

Responses

Request samples

Content type
application/json
{
  • "name": "alpha.Drivers",
  • "org_id": 314156,
  • "description": "What this role is for",
  • "permissions": [
    ],
  • "allowed_organizations": [
    ],
  • "inherit_from": [
    ],
  • "last_updated": 1557949075
}

Response samples

Content type
application/json
{
  • "link": {
    }
}

Remove a Role

path Parameters
org_id
required
string

ID of the organization the role belongs to

role_name
required
string

Role name of the role to delete

query Parameters
service_id
string

The ID of the service the request should be sent to. This parameter is required if running on Splinter. Format: <circuit-id>::<service-id>

Responses

Response samples

Content type
application/json
{
  • "link": {
    }
}

Products

Lists all products

query Parameters
service_id
string

The ID of the service the request should be sent to. This parameter is required if running on Splinter. Format: <circuit-id>::<service-id>

offset
integer

The index of the first element to be in the page

limit
integer

The maximum number of elements in a page

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "paging": {
    }
}

Add a list of products

query Parameters
service_id
string

The ID of the service the request should be sent to. This parameter is required if running on Splinter. Format: <circuit-id>::<service-id>

offset
integer

The index of the first element to be in the page

limit
integer

The maximum number of elements in a page

Request Body schema: application/json

A JSON list of Products

Array of objects (CreateProduct)

Responses

Request samples

Content type
application/json
{
  • "data": [
    ]
}

Response samples

Content type
application/json
{
  • "link": {
    }
}

Fetches a single product with the given ID

path Parameters
product_id
required
string

ID of the product to fetch

query Parameters
service_id
string

The ID of the service the request should be sent to. This parameter is required if running on Splinter. Format: <circuit-id>::<service-id>

Responses

Response samples

Content type
application/json
{
  • "product_id": 122765988220,
  • "product_namespace": "UNSET_NAMESPACE",
  • "owner": "02cd3181dbd7d1539f470436ce222c53ab5e514f67809dc0095895e6cdfba97612",
  • "properties": [
    ],
  • "service_id": "12345-QWERTY:gsAA",
  • "last_updated": 1557949075
}

Updates a single product with the given ID

path Parameters
product_id
required
string

ID of the product to fetch

query Parameters
service_id
string

The ID of the service the request should be sent to. This parameter is required if running on Splinter. Format: <circuit-id>::<service-id>

Request Body schema: application/json

A JSON Product

product_id
string
product_namespace
string (NamespaceEnum)
Enum: "UNSET_NAMESPACE" "GS1"
Array of objects (PropertyValue)
service_id
string (ServiceID)
last_updated
integer (Timestamp)

Responses

Request samples

Content type
application/json
{
  • "product_id": 122765988220,
  • "product_namespace": "UNSET_NAMESPACE",
  • "properties": [
    ],
  • "service_id": "12345-QWERTY:gsAA",
  • "last_updated": 1557949075
}

Response samples

Content type
application/json
{
  • "link": {
    }
}

Deletes a single product with the given ID

path Parameters
product_id
required
string

ID of the product to fetch

query Parameters
service_id
string

The ID of the service the request should be sent to. This parameter is required if running on Splinter. Format: <circuit-id>::<service-id>

Responses

Response samples

Content type
application/json
{
  • "link": {
    }
}

Purchase Orders

Lists all purchase orders

query Parameters
service_id
string

The ID of the service the request should be sent to. This parameter is required if running on Splinter. Format: <circuit-id>::<service-id>

offset
integer

The index of the first element to be in the page

limit
integer

The maximum number of elements in a page

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "paging": {
    }
}

Adds a list of purchase orders

query Parameters
service_id
string

The ID of the service the request should be sent to. This parameter is required if running on Splinter. Format: <circuit-id>::<service-id>

offset
integer

The index of the first element to be in the page

limit
integer

The maximum number of elements in a page

Request Body schema: application/json

A JSON list of Purchase Orders

Array of objects (CreatePurchaseOrder)

Responses

Request samples

Content type
application/json
{
  • "data": [
    ]
}

Response samples

Content type
application/json
{
  • "link": {
    }
}

Fetches a single purchase order with the given UID

path Parameters
uid
required
string

ID of the PO to fetch

query Parameters
service_id
string

The ID of the service the request should be sent to. This parameter is required if running on Splinter. Format: <circuit-id>::<service-id>

Responses

Response samples

Content type
application/json
{
  • "uid": 99474000005,
  • "workflow_state": "create",
  • "buyer_org_id": "Org 1",
  • "seller_org_id": "Org 2",
  • "is_closed": false,
  • "alternate_ids": [
    ],
  • "versions": [
    ],
  • "created_at": 1557949075,
  • "workflow_id": "collaborative::v1",
  • "service_id": "12345-QWERTY:gsAA"
}

Updates a single purchase order with the given UID

path Parameters
uid
required
string

ID of the PO to fetch

query Parameters
service_id
string

The ID of the service the request should be sent to. This parameter is required if running on Splinter. Format: <circuit-id>::<service-id>

Request Body schema: application/json

A JSON Purchase Order

po_uid
string
workflow_state
string
is_closed
boolean
accepted_version_number
string
Array of objects (PurchaseOrderVersion)
alternate_ids
Array of strings
service_id
string (ServiceID)

Responses

Request samples

Content type
application/json
{
  • "po_uid": 99474000005,
  • "workflow_state": "create",
  • "is_closed": false,
  • "accepted_version_number": 1,
  • "version_updates": [
    ],
  • "alternate_ids": [
    ],
  • "service_id": "12345-QWERTY:gsAA"
}

Response samples

Content type
application/json
{
  • "link": {
    }
}

Lists all purchase order versions for a purchase order

path Parameters
uid
required
string

ID of the PO to fetch versions for

query Parameters
service_id
string

The ID of the service the request should be sent to. This parameter is required if running on Splinter. Format: <circuit-id>::<service-id>

offset
integer

The index of the first element to be in the page

limit
integer

The maximum number of elements in a page

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "paging": {
    }
}

Adds a list of purchase order versions for a purchase order

path Parameters
uid
required
string

ID of the PO to fetch versions for

query Parameters
service_id
string

The ID of the service the request should be sent to. This parameter is required if running on Splinter. Format: <circuit-id>::<service-id>

offset
integer

The index of the first element to be in the page

limit
integer

The maximum number of elements in a page

Request Body schema: application/json

A JSON list of Purchase Order Versions

Array of objects (PurchaseOrderVersion)

Responses

Request samples

Content type
application/json
{
  • "data": [
    ]
}

Response samples

Content type
application/json
{
  • "link": {
    }
}

Fetches a single purchase order version with the given ID

path Parameters
version_id
required
string

ID of the version to fetch

uid
required
string

ID of the PO to fetch

query Parameters
service_id
string

The ID of the service the request should be sent to. This parameter is required if running on Splinter. Format: <circuit-id>::<service-id>

offset
integer

The index of the first element to be in the page

limit
integer

The maximum number of elements in a page

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "paging": {
    }
}

Updates a single purchase order version with the given ID

path Parameters
version_id
required
string

ID of the version to be updated

uid
required
string

ID of the PO this version belongs to

query Parameters
service_id
string

The ID of the service the request should be sent to. This parameter is required if running on Splinter. Format: <circuit-id>::<service-id>

offset
integer

The index of the first element to be in the page

limit
integer

The maximum number of elements in a page

Request Body schema: application/json

A JSON list of Purchase Order Versions

Array of objects (PurchaseOrderVersion)

Responses

Request samples

Content type
application/json
{
  • "data": [
    ]
}

Response samples

Content type
application/json
{
  • "link": {
    }
}

Lists all purchase order revisions for a purchase order version

path Parameters
version_id
required
string

ID of the version to fetch

uid
required
string

ID of the PO to fetch versions for

query Parameters
service_id
string

The ID of the service the request should be sent to. This parameter is required if running on Splinter. Format: <circuit-id>::<service-id>

offset
integer

The index of the first element to be in the page

limit
integer

The maximum number of elements in a page

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "paging": {
    }
}

Fetches a single purchase order version revision with the given revision number

path Parameters
revision_number
required
number

Number of the revision to fetch

version_id
required
string

ID of the version the revision belongs to

uid
required
string

ID of the PO the revision belongs to

query Parameters
service_id
string

The ID of the service the request should be sent to. This parameter is required if running on Splinter. Format: <circuit-id>::<service-id>

offset
integer

The index of the first element to be in the page

limit
integer

The maximum number of elements in a page

Responses

Response samples

Content type
application/json
{
  • "revision_number": 7,
  • "submitter": "02cd3181dbd7d1539f470436ce222c53ab5e514f67809dc0095895e6cdfba97612",
  • "created_at": 1557949075,
  • "order_xml_v3_4": "<xml content>",
  • "service_id": "12345-QWERTY:gsAA"
}

Schemas

Lists all schemas

query Parameters
service_id
string

The ID of the service the request should be sent to. This parameter is required if running on Splinter. Format: <circuit-id>::<service-id>

offset
integer

The index of the first element to be in the page

limit
integer

The maximum number of elements in a page

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "paging": {
    }
}

Add a list of schemas

query Parameters
service_id
string

The ID of the service the request should be sent to. This parameter is required if running on Splinter. Format: <circuit-id>::<service-id>

offset
integer

The index of the first element to be in the page

limit
integer

The maximum number of elements in a page

Request Body schema: application/json

A JSON list of Schemas

Array of objects (CreateSchema)

Responses

Request samples

Content type
application/json
{
  • "data": [
    ]
}

Response samples

Content type
application/json
{
  • "link": {
    }
}

Fetches a single schema with the given name

path Parameters
schema_name
required
string

Name of the schema to fetch

query Parameters
service_id
string

The ID of the service the request should be sent to. This parameter is required if running on Splinter. Format: <circuit-id>::<service-id>

Responses

Response samples

Content type
application/json
{
  • "name": "Lightbulb",
  • "description": "Example Lightbulb schema",
  • "owner": "philips001",
  • "properties": [
    ],
  • "service_id": "12345-QWERTY:gsAA",
  • "last_updated": 1557949075
}

Updates a single schema with the given name

path Parameters
schema_name
required
string

Name of the schema to fetch

query Parameters
service_id
string

The ID of the service the request should be sent to. This parameter is required if running on Splinter. Format: <circuit-id>::<service-id>

Request Body schema: application/json

A JSON Schema

name
string
owner
string
Array of objects (PropertyDefinition)
service_id
string (ServiceID)
last_updated
integer (Timestamp)

Responses

Request samples

Content type
application/json
{
  • "name": "Lightbulb",
  • "owner": "philips001",
  • "properties": [
    ],
  • "service_id": "12345-QWERTY:gsAA",
  • "last_updated": 1557949075
}

Response samples

Content type
application/json
{
  • "link": {
    }
}