Skip to content

How to Use the API

This section explains how to use the Magma OnePay API V1 for handling payments (payin) and payouts. It provides a step-by-step guide to retrieve your API keys, check available countries and payment methods, initiate transactions, validate them, and handle notifications. Following these steps will help ensure a smooth integration with our platform and avoid common issues that users may encounter.

Using Your PRIVATE_KEY (TOKEN)

Once you have retrieved your PRIVATE_KEY from the Developer section on the MagmaOnePay Dashboard, include it in the header of all your API requests. This key authorizes your requests and ensures secure communication with the Magma OnePay API. Here is an example of how to set the header in your requests:

http
GET /your-endpoint HTTP/1.1
Host: api.magmaonepay.com
Authorization: Bearer PRIVATE_KEY

Replace PRIVATE_KEY with the actual key you obtained from the Dashboard dependant on your mode (live or test)

Collection

  1. Retrieve Your Private Key

    • Obtain your API keys from the Dashboard. Use the test mode keys for development and the live mode keys for production.
  2. Check Available Countries and Payment Methods

    • Use the endpoint to retrieve the list of countries and payment methods available for payin transactions.
  3. Initiate a Payment

    • Call the API to initiate a payment. Provide necessary details such as the amount, currency, payment method...
  4. Validate a Payment

    • Validate the payment details to ensure they are correct. Confirm the payment if required.
  5. Wait for Notification

    • Once the payment is processed, wait for a notification about the transaction status. Ensure your application can handle these notifications.
  6. Get Payment Status manualy

    • You can call the API to retrieve the status of a payment. This helps in confirming whether the payment has been success, is pending, or failed.

Payout

  1. Retrieve Your Private Key

    • Obtain your API keys from the Dashboard. Use the test mode keys for development and the live mode keys for production.
  2. Check Available Countries and Payment Methods

    • Use the endpoint to retrieve the list of countries and payment methods available for payout transactions.
  3. Do a Payout

    • Call the API to proccess a payout. Provide necessary details such as the amount, currency, payout method...
  4. Wait for Notification

    • Once the payout is processed, wait for a notification about the transaction status. Ensure your application can handle these notifications.
  5. Get Payout Status

    • You can call the API to retrieve the status of a payout. This helps in confirming whether the payout has been success, is pending, or failed.