CropPath for developers

All guides

Sandbox for trying the API

Available

One request gives you a test company with demo data and an API token valid for 24 hours, on CropPath's sandbox server.

The sandbox is a separate CropPath server at https://sandbox-txng.theio.vn, for trying the HTTP API and the SDKs without installing anything. It holds test data only and is fully separate from the live service at https://txng.theio.vn: nothing in the sandbox reaches the live service. Never put real company data or personal data into it.

Create a sandbox account

Send one request, with no body and no credentials. You get a test company of your own and an API token for it:

curl -sS -X POST https://sandbox-txng.theio.vn/v1/sandbox/accounts
# 201 Created
# {"tenant_id": "sbx-q7rk2m4xw5ta3bnc", "api_token": "agt_...", "expires_at": 1791853399.6,
#  "base_url": "https://sandbox-txng.theio.vn"}

Within a few minutes of the answer, the company is filled with demo data: a packing house, a growing area and its grower, devices, and a lot of 128 measured fruits with its lab results, cartons, seal and shipment. Companies are filled one at a time, so it takes longer when many accounts were created just before yours. Until then, lists such as GET /v1/lots may be empty or incomplete, and the demo lot is listed before the filling ends: wait until the demo lot has the status shipped before you change anything, because recalling it earlier stops the demo data from being added.

Call the API

CROPPATH_TOKEN=agt_...    # the api_token of the answer
curl -sS "https://sandbox-txng.theio.vn/v1/lots?limit=10" \
  -H "Authorization: Bearer $CROPPATH_TOKEN"

The token belongs to one company, so the X-Tenant header is optional; if you send it, it must be your tenant_id (any other value answers 403). Another company's records answer 404, as if they did not exist. The API reference applies; only the address is different.

Use an SDK

The API SDKs take the server's address as their base URL. Give them the sandbox's address, the token and your tenant_id:

TypeScript

const api = createCropPathClient({
  baseUrl: "https://sandbox-txng.theio.vn",
  token: process.env.CROPPATH_TOKEN!,
  tenant: "sbx-q7rk2m4xw5ta3bnc",
});

Java

CropPathClient client = CropPathClient.builder()
    .baseUrl("https://sandbox-txng.theio.vn")
    .apiToken(System.getenv("CROPPATH_TOKEN"))
    .tenant("sbx-q7rk2m4xw5ta3bnc")
    .build();

C#

using var client = new CropPathClient(new CropPathClientOptions
{
    BaseUrl = "https://sandbox-txng.theio.vn",
    ApiToken = Environment.GetEnvironmentVariable("CROPPATH_TOKEN"),
    Tenant = "sbx-q7rk2m4xw5ta3bnc",
});

Go

client, err := croppath.New("https://sandbox-txng.theio.vn",
	croppath.WithAPIToken(os.Getenv("CROPPATH_TOKEN")),
	croppath.WithTenant("sbx-q7rk2m4xw5ta3bnc"))

Limits

The sandbox is for testing only: its data is demo data, not real traceability records. Creating an account works only on the sandbox; on the live service, POST /v1/sandbox/accounts answers 404.

In the API reference

Downloads

This portal serves these files: you do not need access to the source repository.