Skip to main content
Before merchants can use your gateway, they must register and verify ownership of their OCID. This guide covers the secure onboarding process.

Overview

  1. Merchant provides their OCID
  2. You fetch their metadata from the blockchain registry
  3. Merchant signs a challenge to prove ownership
  4. You verify the signature and store the merchant

Step 1: Get Your OCID

Before onboarding merchants, you need your own OCID:
  1. Mint an OCID on the Router Registry smart contract
  2. Set your metadata URL pointing to your /metadata.json
  3. Store your OCID and private key securely (e.g., .env file)

Step 2: Collect Merchant OCID

Create a registration form where merchants provide their OCID:

Step 3: Fetch Merchant Metadata

Always fetch metadata through an independent channel, never from a URL provided by the merchant directly. Use the Router Registry or Opencharge index.

Step 4: Verify Ownership

The merchant signs your challenge to prove they control the private key:

Security Considerations

Unreachable Metadata URLs

If a merchant’s metadata URL is unreachable:
  • Do not onboard them
  • This may indicate the OCID is compromised
  • Merchants can take their metadata offline as a safety measure

Signature Verification

Always verify:
  1. The metadata config is signed by the publicKey in the config
  2. The challenge is signed by the same public key
  3. Optionally, that the public key owns the OCID NFT on-chain

Unique OCIDs

OCIDs are unique across the ecosystem. Store them under a unique index:

Auth Middleware

After onboarding, authenticate all requests from merchants:

Next Steps