Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Worked example

End to end with a registered schema — one-time collection, issue, read back, update, transfer, viewer link — with the calls, bodies and what to store.

One client, one registered schema (ingot-registry-record), one record from creation to transfer. Every call carries commerce-api-key, issuer-address and Content-Type: application/json; <base_url> is the environment's host — see URL per environment. The viewer host is https://port.startrail.io in production and https://port-stg.startbahn.jp on the test environment.

The big picture

#
Step
Endpoint
You provide
You store

0

Collection, once

POST /commerce/collection

payload.name, payload.symbol

collectionAddress — it goes into every later call and into the viewer link

1

Resolve the schema

GET /schema-registry/name/ingot-registry-record?version=latest

—

cid (optional: issuance resolves a name form itself)

2

Issue

POST /commerce/srrs

requestId, one entry with collectionAddress and the document

tokenId, metadataCID, requestId

3

Read back

GET /collection/{collectionAddress}/srr/{tokenId}

—

— ; poll until metadataDigest = metadataCID

4

Update

PATCH /commerce/srrs/{tokenId}/metadata

baseCid = last metadataCID, collectionAddress, the change

new metadataCID

5

Transfer

POST /commerce/srrs/transfers

tokenId, collectionAddress, to, transferType

transferMetadataCID

6

Confirm

step 3 route, or webhooks

—

—

0. Collection (once)

201 → result.collectionAddress, status: waiting_for_mining. Usable once mined; confirm with Get Collection of LUW or the collection_created webhook. See Create Collection.

1. Resolve the schema

200 → cid, schemaUri (ipfs://<cid>), version. You can skip this and put the name form straight into $schema; the pinned document ends up on the latest version either way.

2. Issue

201:

Answer
What to do

201

Store tokenId, metadataCID, requestId

400 with Details

The document breaks the schema; fix it and send again with a new requestId

400 Duplicate Request Error … / Request Content Error …

You already sent this; read the result from step 3 instead

403

The wallet is not enabled for registered schemas; contact Startbahn

Timeout, no answer

Resend with the same requestId: a request that went through is refused instead of issued twice

3. Read back

Answer
Meaning

404 SRR not found: 0x8B116A8896538377328936279E64B11303cBf7B1/561308332886

Not indexed yet — poll every few seconds

200, metadataDigest ≠ the CID you expect

Indexed, but the last transaction is not yet

200, metadataDigest = metadataCID

Done

The document itself is at https://cdn.startrail.io/ipfs/<metadataDigest>; $schema in it is the CID form and any storage URL you sent is ipfs://<cid>. See Get SRR by collection and token id and subgraph lag.

4. Update

A beneficiary is assigned. The whole change is one PATCH; baseCid is the metadataCID of step 2.

200:

Answer
What to do

200

Store metadataCID: it is the next baseCid. Poll step 3 until metadataDigest equals it

204

Nothing changed; the version stays

400 with Details

Invalid change (a required field missing, an enum value); nothing is written

404

Unknown token, wrong collectionAddress, or a baseCid nothing resolves: read metadataDigest from step 3 and rebuild

Later events follow the same pattern: a sale is another prepend.beneficiaries; a custodian change is set.custody; an assay certificate is set.assay. Send one update at a time per record and chain baseCid — see Update metadata.

5. Transfer

The record is reserved for the buyer's email; the certificate moves when the buyer signs in.

201 → results[0].mode: reserved, transferMetadataCID, nextStep. If the buyer never signs in, complete it yourself with POST /commerce/srrs/561308332886/transfers/claim and payload.preimage = "buyer@example.com", or cancel it with DELETE /commerce/srrs/561308332886/transfers/pending?collectionAddress=0x8B11…. See Transfers.

Poll step 3: transferCommitment is set once the reservation is mined; ownerAddress changes once the transfer executes. The transferReservationComplete and transferExecutionComplete webhooks fire at the same points.

The certificate page for the record:

Checklist

Last updated

Was this helpful?