Skip to main content

API Reference

The HedgePayments API is organized around REST. Our API has predictable resource-oriented URLs, accepts JSON-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes and authentication.

Base URL

All API requests should be made to:
https://api.hedgepayments.com/v1
For sandbox/testing:
https://api-sandbox.hedgepayments.com/v1

Authentication

All API requests require authentication via Bearer token:
curl https://api.hedgepayments.com/v1/users \
  -H "Authorization: Bearer YOUR_API_KEY"
See the Authentication Guide for details on obtaining and managing API keys.

Products

The HedgePayments API is organized by product:

SideBet Endpoints

EndpointDescription
POST /sidebet/users/{id}/roundups/enableEnable round-ups for a user
GET /sidebet/users/{id}/roundups/settingsGet round-up settings
PUT /sidebet/users/{id}/roundups/settingsUpdate round-up settings
GET /sidebet/users/{id}/roundups/pendingGet pending round-ups
POST /sidebet/users/{id}/roundups/transferTrigger manual transfer

CoverPay Endpoints

EndpointDescription
POST /coverpay/prequalifyPre-qualify user for BNPL
POST /coverpay/paymentsCreate a CoverPay payment
GET /coverpay/payments/{id}Get payment details
GET /coverpay/paymentsList all payments
POST /coverpay/payments/{id}/cancelCancel a payment

Bankroll Endpoints

EndpointDescription
POST /bankroll/payments/check-eligibilityCheck if user can pay
POST /bankroll/paymentsProcess a payment
GET /bankroll/users/{id}/balanceGet user balance
POST /bankroll/users/{id}/cardsCreate virtual card
POST /bankroll/p2p/sendSend P2P payment

Common Endpoints

These endpoints work across all products:
EndpointDescription
POST /usersCreate a user
GET /users/{id}Get user details
POST /walletsCreate a wallet
GET /wallets/{id}Get wallet details
POST /webhooksRegister webhook

Response Format

All responses are JSON with a consistent structure: Success Response:
{
  "success": true,
  "data": {
    // Response data here
  },
  "meta": {
    "requestId": "req_abc123",
    "timestamp": "2024-01-15T10:30:00Z"
  }
}
Error Response:
{
  "success": false,
  "error": {
    "code": "INSUFFICIENT_BALANCE",
    "message": "User does not have sufficient balance",
    "details": {
      "required": 50.00,
      "available": 25.00
    }
  },
  "meta": {
    "requestId": "req_abc123",
    "timestamp": "2024-01-15T10:30:00Z"
  }
}

HTTP Status Codes

CodeDescription
200Success
201Created
400Bad Request — Invalid parameters
401Unauthorized — Invalid API key
403Forbidden — Insufficient permissions
404Not Found — Resource doesn’t exist
409Conflict — Duplicate request
422Unprocessable — Business logic error
429Rate Limited — Too many requests
500Server Error — Something went wrong

Rate Limits

TierRequests/minuteRequests/day
Sandbox10010,000
Production1,000100,000
EnterpriseCustomCustom

Idempotency

For POST requests, you can include an Idempotency-Key header to safely retry requests:
curl -X POST https://api.hedgepayments.com/v1/bankroll/payments \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Idempotency-Key: unique-request-id-123" \
  -d '{"amount": 50.00, "userId": "user-123"}'

Webhooks

HedgePayments sends webhooks for important events. See the Webhooks Guide for setup instructions. Common Events:
  • sidebet.roundup.processed
  • sidebet.transfer.completed
  • coverpay.payment.created
  • coverpay.payment.completed
  • coverpay.payment.failed
  • bankroll.payment.completed
  • bankroll.p2p.sent
  • bankroll.card.created

SDKs

npm install @hedgepayments/sdk