Overview
A Merchant Gateway onboards merchants and helps them receive payments through the Opencharge network. You receive orders from merchants, coordinate with Payment Gateways (which handle end-user payments), and process settlements back to merchants.OpenAPI Specification
View the complete Merchant Gateway OpenAPI specification
What You Build
As a merchant gateway, you provide:- Merchant onboarding - Register and verify merchants on your platform
- Order routing - Receive orders and return redirect URLs to Payment Gateways
- Settlement processing - Receive payment proofs and settle funds to merchants
- Webhook notifications - Informing merchants when payments complete
Base URL
Host your API at the endpoint you register in the Router Registry:Endpoints you implement on your server
| Endpoint | Method | Description |
|---|---|---|
/metadata.json | GET | Your gateway’s public metadata |
/capabilities | GET | Partner-specific capabilities |
/orders/checkout | POST | Receive orders from merchants, return redirect URL |
/transfer/create | POST | Process internal and 3rd party transfers |
/transfer/webhook | POST | Receive payment proofs from settlement providers |
/payment/create | POST | Accept payment requests from 3rd party apps |
/payment/settle | POST | Complete payments with settlement proofs |
/verify/{txid} | GET | Verify transaction status |
Flow
The Merchant Gateway sits between merchants and Payment Gateways. When a merchant receives an order, you route it to a Payment Gateway that handles the actual payment UI.Authentication
Verify merchant requests using these headers:| Header | Description |
|---|---|
X-OC-ID | Merchant’s OCID |
X-OC-Timestamp | Unix timestamp in seconds |
X-OC-Nonce | Unique request identifier |
X-OC-Signature | Signature of canonical request |
/metadata.json.
Order Verification
When you receive an order at/orders/checkout:
- Verify the merchant signature on the order
- Check the merchant is registered with your gateway
- Validate order details (amount, currency, expiration)
- Select a Payment Gateway to handle the payment
- Return the redirect URL to the Payment Gateway’s checkout page
Receiving Payment Proofs
When a Payment Gateway completes a payment, it sends a proof to your/transfer/webhook. You then forward this proof to the merchant.
Notifying Merchants
After receiving a payment proof, send a signed proof to the merchant’s/transfer/webhook:
Settlement
As a Merchant Gateway, you sit between Payment Gateways and merchants. You must be able to settle proofs you receive. When you receive a proof from a Payment Gateway:- Verify the proof is valid and signed by a trusted Payment Gateway
- Forward the proof (or create your own proof) to the merchant
- Ensure the merchant trusts you as a settlement provider (your OCID is in their
acceptsarray)