Skip to main content
By default the widget opens with just your widget ID, and link parameters are prefills the customer can change. Sign the link on your server when the payment details must not change, for example:
  • a fixed-price checkout, where the customer must send exactly the amount you quoted;
  • a buy where the stablecoins must go to a wallet you chose;
  • a widget that should only open from links you issued.
A signed link’s parameters are locked, it expires, and nobody can open your widget with their own values. The signing secret is under Settings → Ramps → Website widget → Signing secret & security. Keep it on your server; it never belongs in a browser or mobile app. Pass the signed URL to the script in place of the options object: Onstacks.open(signedUrl, callbacks). If your integration depends on signed links, turn off Allow unsigned links in the same settings section; otherwise a link with the signature removed would still open with its parameters editable. Widgets set up before unsigned links existed have it off already.

Signing

  1. Sort the parameters by name.
  2. Join them as key=value with &, using the raw values (not URL-encoded).
  3. HMAC-SHA256 that string with your signing secret.
  4. Add the hex digest as sig and build the URL: https://<host>/w/<widget-id>?<params>&sig=<sig>.
Node.js

Parameters

Changing any parameter after signing invalidates the link. An expired, unsigned or altered link shows a not-found page, and the script calls onError with expired when it can tell before opening.