Skip to content

How to Use the API

This section explains how to integrate and use the Magma OnePay API V1 for handling payments (payin) and payouts. It provides a step-by-step guide to generate and use 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 defined your USER SECRET and generated your PRIVATE API KEY from the Developer section on the MagmaOnePay Dashboard, you must include them in the header of all API requests.

These keys authorize your requests and ensure 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
X-User-Secret: SECRET_KEY
  • Authorization: contains your Private API Key
  • X-User-Secret: contains the Secret Key you Provided
  • Requests must come from a whitelisted public IP address

Replace PRIVATE_API_KEY and USER_SECRET with the values generated in the Dashboard. Make sure to use test keys in test mode and live keys in production.

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.