Create a payment link

API request

POST /developers/v1/payment-links

Create a hosted payment link for payers.

curl -X POST "https://api.mainmoney.net/api/v2/developers/v1/payment-links" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -d '{"amount":5000,"currencyCode":"CDF","merchantReference":"order-123","redirectUrl":"https://merchant.example/checkout/return","title":"Order #123","description":"Demo checkout","metadata":{"orderId":"123"},"brandColor":"#FF3976"}'

Create a payment link

Create a hosted checkout link. Payers complete payment on Mainmoney; you receive webhooks and optional redirect callbacks.

Request body

FieldRequiredDescription
amountYesPayment amount in link currency
currencyCodeYesISO currency code (e.g. CDF)
merchantReferenceYesYour public payment id (1–128 chars: letters, digits, ., _, -)
redirectUrlNoHTTPS URL for signed payer return
titleNoCheckout title (defaults to business name)
descriptionNoCheckout description
metadataNoArbitrary JSON echoed on link responses
brandColorNoHex accent color on the pay page

Developer links are created as single-use (LIMITED, maxUses: 1) so each merchantReference maps to one checkout.

Response fields

FieldDescription
idPayment link id
slugPublic pay slug
urlPayer checkout URL
merchantReferenceRequired. Public payment identifier (status, redirects, webhooks)
titleOptional checkout title (defaults to business name)
descriptionOptional checkout description
metadataOptional JSON metadata returned on link responses

Logo defaults to app logo, then business profile logo. Upload a logo when creating the app in the developer dashboard.

Discover capabilities with GET /developers/v1/config. Sandbox links use Mainmoney test credentials and do not credit your business wallet.