Issue with a registered schema
What changes on POST /commerce/srrs when metadata.$schema points at a registered schema — validation, file URLs, limits, error naming.
POST <base_url>/port/api/v1/commerce/srrs
Same route, headers, body envelope and response as Issue & Transfer. An entry whose metadata.$schema is a registered schema (any of the three forms) is treated as below; entries on the official schema keep the existing rules. The two kinds can be mixed in one payload.
What changes per entry
Validation
common-js, as sent
Against the latest published version of the schema, in the pinned form (after storage URLs became ipfs://<cid>)
Version
Converted to the latest official version
Moved to the latest published version of the lineage; refused if not valid against it
name / image / description defaults
Filled in when absent
Nothing is added or changed; your document is validated as it is
isDigital → digitalComponents
Auto-initialised
Not touched
attachmentFiles
Folded into metadata.digitalComponents / metadata.attachmentFiles
Refused (400) — the fold would add keys your schema may not allow
externalUrls
First entry becomes metadata.external_url
Ignored; put links in a field of your own schema
File URLs
Only thumbnailURL, image, contractTerms.fileURL are file fields; external hosts refused
Any string value that is the finalUrl of a file in Startbahn storage (public category) is stored as ipfs://<cid>, whatever the field is called. URLs on other hosts are kept as they are
Size
≤ 204800 bytes serialized
Same
Where errors are raised
gogh-api
gogh-api for the request checks; schema errors come from the convert step and are passed on as 400
Order of checks
All checks run on the whole payload before anything is signed; the first failure refuses the whole request and nothing is issued.
1
Headers
—
401
2
Every entry has metadata
—
400 Some of the metadata is not defined
3
DTO: field types, $schema names a published schema
payload.<index>.<field>
400, array of messages
4
Each metadata ≤ 204800 bytes
payload[<index>]
400
5
No attachmentFiles on a registered-schema entry
(externalId <externalId>)
400
6
File URLs of official-schema entries
[<externalId>] <field>: <url>
400
7
issuer-address and every artistAddress are LUWs
—
400 Address not found: …
8
Convert step (validation in the pinned form, storage files, version)
metadataBatch[<index>] when the batch has more than one entry
400 Some metadata is failed to be converted: …
9
Request log: requestId and content replay
—
400
10
Typed data: closed-release wallet check, quota, duplicates
txs[<index>] (bulk)
403 / 400 passed through
11
Signing and execution
—
201, or 500
The convert step runs in chunks of 100 entries; the index in metadataBatch[<index>] is the position in your payload, not in the chunk.
Request
The fields are those of the example schema used throughout this section; your schema defines its own. artistAddress is required by the route whatever the schema; for records that have no artist use the issuer LUW.
Response
201 with the same shape as the official route. metadataCID is the CID of the pinned document ($schema rewritten to ipfs://<cid> of the latest version, storage URLs rewritten to ipfs://<cid>), so it differs from a CID you compute over the document you sent — use POST /commerce/metadata to get it beforehand.
201 means accepted, not mined. Confirm through the webhook or by polling the read route until metadataDigest equals metadataCID — see subgraph lag.
Errors specific to registered schemas
400
payload.<i>.metadata is invalid. Check it against the metadata JSON schema. Details: $schema path is invalid, cid is not found ({}).
$schema is ipfs://<cid> but no published schema has that CID
400
payload.<i>.metadata is invalid. Check it against the metadata JSON schema. Details: $schema path is invalid, file is not found ({}).
$schema is a name form with no published version, a gateway URL, or any other unknown URL
400
payload[<i>]: metadata exceeds the maximum size of 204800 bytes (serialized size: <n> bytes)
One entry is too large
400
attachmentFiles is not supported for metadata on a registry schema (externalId <externalId>)
attachmentFiles given on a registered-schema entry
400
Some metadata is failed to be converted: metadata failed validation against JSON schema. Details: <path> <message> (<params>). …
The document breaks the schema (in its pinned form, against the latest version)
400
Some metadata is failed to be converted: metadataBatch[<i>]: metadata failed validation against JSON schema. Details: …
Same, in a payload with more than one entry
400
… Details: refers to a file that is not in storage ({"url":"<url>"}).
A storage URL whose file was never uploaded
400
… Details: refers to a file whose CID is not calculated yet, retry shortly ({"url":"<url>"}).
Uploaded, CID still computing
400
… Details: /$schema names v<old> of <name>; an SRR is issued on the latest version, v<latest>, and the metadata is not valid against it ({"named":"<old>","latest":"<latest>"}). …
$schema names an older version and the document does not fit the latest one; the remaining details are the latest version's errors
403
Licensed user <issuer-address> is not enabled for registered metadata schemas
Closed release, wallet not enabled — contact Startbahn
500
schema registry resolution failed
The registry could not be read; retry
The full catalogue, including everything shared with the official route, is in Errors, limits and edge cases.
Last updated
Was this helpful?