Quickstart

Go from nothing to a fulfilled order in a handful of API calls

This quickstart walks through the smallest end-to-end flow in Jungle: create a product, set up a location to hold stock, bring in inventory, push an order, and fulfil it. Each step links to a fuller guide if you want more detail.

All calls are made against the GraphQL endpoint at https://ape.cafe/graphql.

1. Authenticate

Every request needs an Authorization header carrying your API key:

Authorization: ApiKey <your-api-key>

See Obtaining keys for how to get one, and Getting started for the basics of making requests.

2. Create a product

mutation {
  productCreate(input: { name: "Classic Fruit Bowl", barcode: "F62545" }) {
    ok
    ... on MutationSuccess {
      objects {
        id
        typename
      }
    }
  }
}

Keep the returned product id — you'll set its SKU and stock against it. More in Products.

3. Create your locations

Create a top-level location for your warehouse, and a child location (a shelf or bin) to hold stock. Tag each with the capabilities it needs — ship so orders can be shipped from the warehouse, and store so the shelf can hold inventory.

mutation {
  locationCreate(input: { name: "Main Warehouse" }) {
    location {
      id
      name
    }
  }
}
mutation {
  capabilitiesSet(
    input: { capabilityIds: ["ship"], object: { id: "your_warehouse_id", typename: "Location" } }
  ) {
    ok
  }
}

Now add a shelf beneath it and give it the store capability:

mutation {
  locationCreate(input: { name: "Shelf A", parentId: "your_warehouse_id" }) {
    location {
      id
      name
    }
  }
}
mutation {
  capabilitiesSet(
    input: { capabilityIds: ["store"], object: { id: "your_shelf_id", typename: "Location" } }
  ) {
    ok
  }
}

See Locations for the full picture.

4. Set inventory

Tell Jungle how much stock sits on the shelf:

mutation {
  inventorySetAtLocation(input: { locationId: "your_shelf_id", items: [{ sku: "F62545", quantity: 50 }] }) {
    ok
  }
}

More in Updating inventory.

5. Create an order

Push an order and let Jungle work out how to fulfil it with the AUTO method:

mutation {
  orderConsumeWithAllocations(
    input: {
      reference: "ORDER-0001"
      orderedAt: "now"
      billingAddress: {
        contactPerson: { name: "King Kong" }
        lines: ["1 Daintree Lane"]
        countryCode: "AU"
        suburb: "Cape Tribulation"
        postalCode: "4873"
      }
      allocations: [{ method: AUTO, lineItems: [{ quantity: 2, sku: "F62545" }] }]
    }
  ) {
    orderId
  }
}

There's much more an order can carry — see Orders with fulfilments.

6. Fulfil the order

With stock in the system and an order allocated, the order is ready to be picked, packed, and shipped. This is typically done by a warehouse operator in the Jungle App, or driven through the API.

Next steps

Can't find what you're looking for? Contact us