Integration best practices

These practices keep your integration reliable when a call fails, a webhook is missed or a sender is slow, and keep the load on your systems and on Notabene low. Each one links to the page that explains it.

Access tokens

  • Reuse your access token for every call, and request a new one shortly before expires_in runs out, as described in Authentication.

  • Request it with your environment’s base URL as the audience.

  • When your customers’ devices call Notabene, give them a delegate token, never your access token.

  • Send a User-Agent header that names your organization, your integration and its version.

Timeouts and retries

  • Give each call a connect timeout of 5 seconds and a read timeout of 15 seconds.

  • Retry only a 429, a 5xx or a call that got no answer, and correct any other 4xx before you send it again.

  • Wait a random time of up to 1, 2 and then 4 seconds before each retry, add 10 seconds after a 429, and give up after 3 retries, as Rate limiting shows.

  • Stay under 6,000 calls every 300 seconds.

Transfers

  • Store the ref before you create a transfer, and send the same ref when you retry, so a timeout never creates a second transfer.

  • Send the funds only when the transfer is ready to settle, then record the transaction hash on it as soon as they are sent.

  • Credit a deposit only when its transfer is Settled.

  • Every 15 minutes, and when your service starts, list your Active, ReadyToSettle and SettledIncompleteAuthorization transfers, so you still act if a webhook is missed, as Go live describes.

Deposit lookups

  • Look up every deposit your wallet receives with GET /api/v1/transfers/match, as soon as it arrives.

  • While nothing is found, retry after 30 seconds, then after 1, 2, 4 and 8 minutes, then every 15 minutes, adding a few seconds at random to each wait.

  • Stop after 2 hours, and then treat the deposit as having arrived without Travel Rule data, as Deposits describes.

  • Add memo_tag for assets that use a destination tag or a memo.

Formats

  • Send asset as a CAIP-19 identifier, at least for any token that exists on more than one blockchain, as Assets explains.

  • Send addresses as CAIP-10 account IDs.

  • Send amount as a decimal string in whole units of the asset, never as a number or in its smallest unit.

Webhooks

  • Subscribe to transfer.created.v3, transfer.status_changed.v3, transfer.agent_status_changed.v3 and requirements.pending.v3.

  • Verify the Svix signature on the raw body before you use an event, ignore a repeat with the same svix-id, and answer with a 2xx status.

  • Handle events in any order, and read the transfer with GET /api/v1/transfers/{id} for its details, as Webhooks explains.

Errors

  • Log the status, the title and detail or the errors, and the traceId of every failed call, and give support the traceId, as Errors explains.

Check your code with a coding assistant

Your coding assistant can compare your code with this page. Open it in each repository that calls Notabene and paste the prompt below, which keeps it to reading the code that calls Notabene and this page, and changing nothing.

Review how this codebase calls the Notabene API against the practices at https://devx.notabene.id/v2.1/docs/integration-review-v21.md

- Read only. Do not change files, and do not run code, tests or builds.
- Fetch only that page. Make no calls to the Notabene API or to any other service.
- Look only at the code that calls Notabene: its requests, its access tokens and its webhook endpoint.
- For each practice, answer follows, does not follow or not found, with one line on what the code does.
- Leave out code, file names, internal systems, credentials and personal data.
- End with the practices the code does not follow, most serious first.
Review how this codebase calls the Notabene API against the practices at https://devx.notabene.id/v2.1/docs/integration-review-v21.md

- Read only. Do not change files, and do not run code, tests or builds.
- Fetch only that page. Make no calls to the Notabene API or to any other service.
- Look only at the code that calls Notabene: its requests, its access tokens and its webhook endpoint.
- For each practice, answer follows, does not follow or not found, with one line on what the code does.
- Leave out code, file names, internal systems, credentials and personal data.
- End with the practices the code does not follow, most serious first.

Check each practice answered not found yourself, because the assistant gives that answer whenever the code it read does not show it. The result stays with you, and nothing reaches Notabene unless you send it. To share it, send it to your Solutions Engineer by email or Slack, or to [email protected] if you do not have one.


Did this page help you?