Record refund
record_refundRecord an already-issued refund against the original receipt as the seller, producing a counter-signed, append-only entry that keeps charge and refund visible.
Instructions
Record a refund against an already-chained receipt, as the SELLER. The refund becomes its own counter-signed entry that references the original — nothing is edited or deleted, so the chain stays append-only and both the charge and the refund remain visible. Requires ledger configuration (TERSIGN_LEDGER_URL/_API_KEY/_SELLER_ID) and performs one network write; errors if the original digest is not on your chain. This RECORDS a refund you have already made — it moves no money. Returns the refund record, its digest, the ledger counter-signature and sequence number.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| amount | Yes | refunded amount as a decimal STRING in the original settlement currency, e.g. "12.50". A string, not a number, so no precision is lost. Partial refunds are allowed | |
| reason | Yes | why the refund was issued, in your own words; recorded verbatim for whoever reads the chain later | |
| originalDigest | Yes | 0x-prefixed keccak256 digest of the receipt being refunded — the digest returned by issue_receipt, and it must already exist on your chain |