Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.truthlocks.com/llms.txt

Use this file to discover all available pages before exploring further.

Creates a tenant-custom receipt type with a JSON Schema for payload validation. Platform-defined types (payment_receipt, security_event_receipt, delivery_receipt, compliance_receipt, custom_receipt) are read-only and cannot be overridden or replaced. Custom types are isolated to the authenticated tenant by row-level security. Other tenants cannot see or use your custom types.

Request body

FieldTypeRequiredDescription
namestringYesUnique snake_case identifier (e.g. invoice_receipt). Must not conflict with platform type names.
display_namestringYesHuman-readable label shown in the console UI.
versionstringNoSemVer string (default 1.0.0). Create multiple versions to manage schema evolution.
schemaobjectYesValid JSON Schema (draft 2020-12) describing the required payload structure.
descriptionstringNoPlain-text description for documentation.

Schema Requirements

The schema field must be a valid JSON Schema (draft 2020-12). Include a required array to enforce mandatory payload fields when minting.
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "required": ["invoice_number", "amount", "currency"],
  "properties": {
    "invoice_number": { "type": "string" },
    "amount":         { "type": "integer", "description": "Amount in smallest currency unit" },
    "currency":       { "type": "string", "minLength": 3, "maxLength": 3 }
  },
  "additionalProperties": false
}

Versioning

Create multiple versions of the same type by passing different version values (1.0.0, 2.0.0, etc.). Receipts always pin the version at mint time so existing receipts are unaffected when you introduce a new version. To deprecate an old version, use PATCH /v1/receipt-types/{name} with {"status": "deprecated"}.

Responses