Skip to main content

API Integration

The Payment Link uses HUB2 API endpoints. The available endpoints are listed in the following documentation:

API Payment Links

Authentication

Your integration uses the same HUB2 API keys for authentication, but the key must have payment creation permissions:
  • Api.payment_create
  • Api.payment_intent_create
  • Api.payment_intent_read
  • Api.payment_intent_auth_create
  • Api.payment_fees_read

Permissions configuration

API Endpoints

Payment links use creation and read endpoints similar to standard endpoints
  • POST /payment-links/ - Create a payment link by defining the necessary payment methods. Payment and payment intent will be handled based on the customer journey. Here is an example.
curl --location 'https://api.hub2.io/payment-links' \
--header 'environment: sandbox' \
--header 'merchantId: [REDACTED]' \
--header 'Content-Type: application/json' \
--header 'ApiKey: [REDACTED]' \
--data '{
    "purchaseReference": "<YOUR_INTERNAL_CUSTOMER_REFERENCE>",
    "description":"Payment Links are the fastest way to start accepting payments from your customers.",
    "amount": 500,
    "currency": "XOF",
    "type":"single_use",
    "expirationDate": "2025-10-28T20:30:00",
    "paymentMethods": [
        "mobile_money"
    ],
    "country": "CI",
    "providers": [
        "Orange",
        "Wave",
        "MTN",
        "Moov"
    ],
    "successUrl":"pay.hub2.io/success",
    "failureUrl":"pay.hub2.io/failure"
    
}'
  • PATCH /payment-links/{id}/close - Close a payment link before expiration
  • GET /payment-links - List created payment links
  • GET /payment-links/{id} - Retrieve a specific payment link and display associated payments attempts

Webhooks

This uses the same webhooks as the payment endpoints. If you have already configured webhooks for payments/, no additional steps are required. Otherwise, see:

Webhooks Integration Guide