API Environments
Rebell provides two separate environments for integration and production use:Sandbox
Base URL:
https://sandbox-api.rebellapp.comFor integration, functional testing, and signature verification. Payments are simulated and do not settle.Production
Base URL:
https://api.rebellapp.comLive payment environment. Requires merchant onboarding and contract activation.Environment Separation Rules
Merchant Credentials
Once you complete merchant onboarding (regulatory, KYB, and contractual steps), Rebell provisions a credential set that identifies and authenticates your business.Credential Components
- Client-Id
- RSA Public Key
- keyVersion
Unique merchant identifierA unique identifier for your merchant account, included in every API request header.
RSA Signing Model
All API requests must be signed with your RSA-2048 private key using SHA256.What Rebell Validates
Rebell validates every request for:- ✅ Signature integrity - Cryptographic signature matches request content
- ✅ Timestamp freshness - Request is within 5-minute tolerance window
- ✅ Merchant identity - Client-Id matches registered merchant
- ✅ Payload consistency - Request body hasn’t been tampered with
Purpose of Signing
Merchant Authentication
Merchant Authentication
Ensures that the request originates from the legitimate merchant who owns the Client-Id and private key.
Request Integrity
Request Integrity
Prevents tampering with request content during transmission. Any modification invalidates the signature.
Replay Attack Prevention
Replay Attack Prevention
Timestamp validation prevents attackers from capturing and replaying old requests.
Required HTTP Headers
Every server-to-server API call must include these headers:| Header | Required | Description |
|---|---|---|
Client-Id | Yes | Identifies the merchant |
Request-Time | Yes | ISO 8601 timestamp (UTC) |
Signature | Yes | RSA signature block |
Content-Type | Yes | Must be application/json |
Timestamp Requirement
Example:Signature Construction
Follow these three steps to generate a valid signature:1
Build the Signing String
Concatenate the following components:Examples:
2
Sign with RSA-SHA256
Use your private key to sign the string:Implementation examples:
3
Format the Signature Header
Format the signature header as:Example:Important notes:
- Signature is base64url-encoded (not standard base64)
- Newlines must not be inserted in the signature payload
- Ensure all JSON fields are serialized consistently
Complete Example
Here’s a complete signed request:Validation Process
This request will be validated for:Key Rotation
Merchants may rotate keys at any time without downtime.Rotation Process
1
Generate New Key Pair
Create a new RSA-2048 key pair while keeping the old one active.
2
Upload New Public Key
Upload the new public key to Rebell. You’ll receive a new
keyVersion identifier.3
Gradual Migration
Gradually migrate traffic to use the new key while the old key remains active.
4
Deprecate Old Key
Once all traffic has migrated, deprecate the old key through the merchant portal.
Rotation Rules
New keyVersion
Every new public key uploaded to Rebell receives a new keyVersion identifier
Multi-Version Support
Rebell accepts signatures generated with any active keyVersion
Gradual Migration
Migrate traffic gradually and deprecate old keys safely
Secure Storage
Private keys must be stored in a secure KMS/HSM
Security Best Practices
Key Storage
Your private key is the most critical security asset. Follow these guidelines:Use HSM or Cloud KMS
Use HSM or Cloud KMS
Store private keys in dedicated hardware security modules (HSM) or cloud-based key management systems (AWS KMS, Google Cloud KMS, Azure Key Vault).Never:
- Store keys in application code
- Commit keys to version control
- Share keys via email or chat
Restrict Access
Restrict Access
Limit private key access to only the backend services that need to sign requests. Use role-based access control (RBAC) and audit all key access.
Regular Rotation
Regular Rotation
Rotate keys every 6-12 months or immediately if:
- Key may have been compromised
- Team member with key access leaves
- Security audit recommends rotation
Environment Separation
Environment Separation
Use completely separate keys for sandbox and production environments. Never share keys between environments.
Clock Synchronization
Ensure your servers use Network Time Protocol (NTP) to maintain accurate time synchronization. Clock drift can cause valid requests to be rejected due to timestamp validation failures.Check your server time:Sync with NTP:
Troubleshooting
Common signature validation errors and solutions:Invalid Signature Error
Invalid Signature Error
Cause: Signature doesn’t match the signing stringSolutions:
- Verify signing string format (HTTP method, path, Client-Id, timestamp, body)
- Ensure JSON serialization is consistent (no extra whitespace)
- Check that you’re using the correct private key
- Verify base64url encoding (not standard base64)
Timestamp Out of Range
Timestamp Out of Range
Cause: Request-Time differs from server time by more than 5 minutesSolutions:
- Synchronize your server clock with NTP
- Check for timezone issues (must be UTC)
- Verify ISO 8601 format:
2024-01-10T12:22:30Z
Invalid Client-Id
Invalid Client-Id
Cause: Client-Id not recognized or inactiveSolutions:
- Verify you’re using the correct Client-Id for the environment
- Check that merchant account is active
- Ensure you’re not mixing sandbox and production credentials
Invalid keyVersion
Invalid keyVersion
Cause: keyVersion doesn’t match any active keysSolutions:
- Verify keyVersion in signature header
- Check that key hasn’t been deprecated
- Ensure public key was successfully uploaded