Andamio Logo
API/Guides

Sponsored Transactions

Pay your users' transaction fees from a sponsor wallet you run

The Andamio API builds transactions. Who pays the fees is your choice. By default the user's own wallet pays, as described in Transaction Handling. On eight course routes you can name a sponsor wallet you run instead, so your users never need ADA.

Andamio does not pay the fees of a transaction built through the Andamio API. Your sponsor wallet does.

Want Andamio to sponsor for you?

That is Andamio Issuer, a separate product with its own key, the Andamio Issuer API key. Andamio builds, sponsors and submits Issuer transactions. An Andamio Issuer API key gets a 403 on every Andamio API transaction build route.

These eight routes accept an optional sponsor_data object. Each returns the same response as a self-funded build.

RequestResponse
POST /api/v2/tx/global/user/access-token/mint{ unsigned_tx }
POST /api/v2/tx/instance/owner/course/create{ course_id, unsigned_tx }
POST /api/v2/tx/course/owner/teachers/manage{ unsigned_tx }
POST /api/v2/tx/course/teacher/modules/manage{ unsigned_tx }
POST /api/v2/tx/course/teacher/assignments/assess{ unsigned_tx }
POST /api/v2/tx/course/student/assignment/commit{ unsigned_tx }
POST /api/v2/tx/course/student/assignment/update{ unsigned_tx }
POST /api/v2/tx/course/student/credential/claim{ unsigned_tx }

The project routes and the other transaction routes build self-funded transactions only.

The sponsor_data Object

sponsor_data names the sponsor wallet and two UTxO references. The two references come from getStaticInfo() in the utxos.dev SDK, which you call yourself. Do not pick arbitrary UTxOs: the sponsorship contract requires these exact references.

FieldRequiredDescription
sponsor_addressYesBech32 address of the sponsor wallet that pays the fees
static_utxo_refYesUTxO reference (txhash#index) from getStaticInfo()
collateral_utxo_refYesCollateral UTxO reference (txhash#index) from getStaticInfo()
access_token_receiverMint onlyBech32 address of the user's wallet that receives the access token. Must differ from sponsor_address

On the seven course routes, add sponsor_data to the body you would send for a self-funded build:

{
  "alias": "student1",
  "course_id": "ff80aaaf03a273b8f5c558168dc0e2377eea810badbae6eceefc14ef",
  "slt_hash": "a1b2c3d4...",
  "assignment_info": "My submission",
  "sponsor_data": {
    "sponsor_address": "addr1...",
    "static_utxo_ref": "<txhash>#0",
    "collateral_utxo_ref": "<txhash>#1"
  }
}

On access-token/mint, send either initiator_data (self-funded) or sponsor_data (sponsored). Sending neither or both returns a 400.

After the Build

The route returns an unsigned transaction. The Andamio API has no submit route: the sponsor's signature, the user's signature and submission to Cardano are yours. After you submit it, register it with POST /api/v2/tx/register and monitor it exactly as in Transaction Handling.

Sponsor signing is not documented here

The Andamio API contract does not describe how the sponsor wallet adds its signature to a sponsored build. It names only the utxos.dev sponsorship contract and the SDK's getStaticInfo(). Follow the utxos.dev documentation for that step.

Errors

A sponsored build returns the same errors as a self-funded build, plus these:

StatusMeaning
400 Bad RequestOn access-token/mint: neither or both of initiator_data and sponsor_data, or access_token_receiver equals sponsor_address.
403 ForbiddenThe request used an Andamio Issuer API key. Andamio API transaction build routes take a developer key.

Andamio keeps no sponsorship quota for these builds. Your tier's normal API quotas still apply.

Next Steps