Skip to main content

How do I tag a request with a referral code?

Add the referralCode field on a Route or Bundle request. The executing contract emits ShortcutExecuted, and the higher 16 bytes of requestId contain that code.

J
Written by Javier Diaz

Add the referralCode field on a Route or Bundle request that should be attributed to a campaign or integration surface. The executing contract emits a ShortcutExecuted event you can analyze later.

Definition

Request tracking tags the transaction the API builds so usage and rewards associated with that code can be read on-chain.

How it works

  • Include referralCode on POST /api/v1/shortcuts/route or POST /api/v1/shortcuts/bundle (on Bundle it is a request option, not an action field).

  • When the transaction runs, the contract emits ShortcutExecuted(accountId, requestId).

  • Use accountId to identify requests from your project’s integration.

  • In requestId, the higher 16 bytes contain the referralCode.

How Enso does this

The field and event layout are documented in Request Tracking. The Bundle API lists referralCode among request options. This is not a partner-fee parameter; fees are configured in the Developer Portal.

Use a stable code your backend can recognize later. The request-tracking guide does not describe the referral code as changing pathfinding or fees.

FAQ

Does the referral code belong in the action array?

No. On Bundle it is a request option (a query parameter in REST, or part of the first SDK argument), not an action.

Is a referral code required?

No. Add it only when you want that on-chain attribution.

Related articles

  • What is request tracking or a referral code?

  • How do I set a partner fee on user trades?

  • How do I call the Route API with curl?

  • How do I authenticate Enso API requests?

  • What is the Enso Bundle API?

Sources

Did this answer your question?