Resources

Versions and V1 → V2 migration

The differences between the legacy V1 and V2, and the steps to migrate an existing integration.

Version status#

VersionStatusUse
V2RecommendedAny new integration.
V1Legacy, maintainedExisting integrations; to migrate to V2.

Both versions share merchant accounts, tokens and balances: a V2 payment shows up in get-transactions (V1), a V1 collection credits the balance read by GET /V2/balances. You can therefore migrate endpoint by endpoint.

Differences#

TopicV1V2
Tokentoken field in body or queryAuthorization: Bearer header
Test modeNonetest_… key, sandbox, separate balances
CountriesDR Congo (country: "CD")Countries open in the database (country: "COD", optional)
Phone numberLocal, 10 digitsLocal or international
ProviderInferred from the prefixInferred from the number, or explicit provider
IdentifierUUID (orderNumber)DEP-…, PAY-…, RFD-… + your reference
IdempotencyNonereference unique per token
Statusesprocessed, pending, done, failed…pending, completed, failed
ResultUnsigned callback, sent onceHMAC-signed notification, redelivered, history and resend
PayoutBalance debited on confirmation, no feeBalance debited at initiation (under lock), credited back on failure, payout fee
Other operationsCross-network transfer, statisticsRefund, payout cancellation, status refresh, providers, availability, prediction
Errorssuccess: false + messageStable code + message
Official SDKsNonePHP, Laravel, Node.js, Python, Java, .NET, WooCommerce (SDKs and tools)

Migrate to V2#

  1. Get your test key (GET /V2/account or the merchant area) and your signing secret (webhook_secret, live token).
  2. Move the token from the body to the Authorization: Bearer header.
  3. Replace POST /V1/payment/mobile with POST /V2/deposits and POST /V1/payment/withdrawal with POST /V2/payouts; drop country: "CD" (or pass COD); callback becomes callback_url.
  4. Add a unique reference to each request and store the returned id.
  5. Adapt status reading: done → completed, processed / pending → pending, failed / canceled → failed.
  6. Replace the V1 callback handling with the signature verification of V2 notifications.
  7. Test with the test key and the test numbers, then switch to the live token.
  8. The shortest path: use an SDK (PHP, Laravel, Node.js, Python, Java, .NET) or the WooCommerce plugin: they only speak V2 and already handle the header, the reference, the statuses and the signature.

Before (V1)

curl -X POST "https://api.labyrinthe-rdc.com/api/V1/payment/mobile" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{"token":"VOTRE_TOKEN","phone":"0812345678","amount":1000,"currency":"CDF","country":"CD","callback":"https://boutique.example/callback"}'

After (V2)

curl -X POST "https://api.labyrinthe-rdc.com/api/V2/deposits" \
  -H "Authorization: Bearer test_xxxxxxxxxxxxxxxx" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{"amount":"1000","currency":"CDF","phone":"0812345678","reference":"ORDER-42","callback_url":"https://boutique.example/webhooks/labpay"}'

Fees differ: in V1, the customer pays the amount plus 7%; in V2, fees follow your account rate (see Limits and fees). Check the amounts shown to your customers before switching.