Assets
Efficiently store and deliver images and PDFs, for attachment to Versa receipts.
Upload an asset (as a sender)
Supported asset types include:
- PNG
- JPEG
- WEBP
Assets have a 50 megabyte (MB) size limit.
curl -F "file=@/path/to/your/invoice.pdf;filename=invoice.pdf" \
--header 'Authorization: Basic CLIENT_ID:CLIENT_SECRET' \
https://registry.versa.org/asset
Success response:
{
"asset_id": "asset_5ed073abbf3a4b49a8c03191f87d8ffe"
}
Including assets in a receipt (as a sender)
Any asset in the Receipt schema can be populated with the "asset_id" of the file you uploaded, e.g.
{
"receipt_asset_id": "asset_5ed073abbf3a4b49a8c03191f87d8ffe"
}
Fetch an asset (as a receiver)
Go to https://registry.versa.org/asset/ASSET_ID to fetch the asset.
Any "asset_id" field in the schema corresponds to a file that can be retrieved in this way.
We encourage receivers to store copies of assets themselves. The hosted images should be treated as a cache. We regularly purge old assets.