Setup instructions:
- Visit Mercury and log in to your account
- Go to Settings > Developer > API Tokens
- Create a new API token with "Read Only" access
- Important: Add your server's IP address to the token's whitelist
- Copy the full token (including the
secret-token: prefix) and paste it below
- After a successful connection, go to the Accounts tab to set up new accounts
Field descriptions:
- API Token: Your full Mercury API token including the
secret-token: prefix (required)
- Base URL: Mercury API URL (optional, defaults to https://api.mercury.com/api/v1)
Note: For sandbox testing, use https://api-sandbox.mercury.com/api/v1 as the Base URL.
Mercury requires IP whitelisting - make sure to add your IP in the Mercury dashboard.
<% error_msg = local_assigns[:error_message] || @error_message %>
<% if error_msg.present? %>
<%= form.submit is_new_record ? "Save Configuration" : "Update Configuration",
class: "inline-flex items-center justify-center rounded-lg px-4 py-2 text-sm font-medium text-white bg-gray-900 hover:bg-gray-800 focus:outline-none focus:ring-2 focus:ring-gray-900 focus:ring-offset-2 transition-colors" %>
<% end %>
<% items = local_assigns[:mercury_items] || @mercury_items || Current.family.mercury_items.where.not(token: [nil, ""]) %>