Javascript
const { FedaPay, Transaction } = require('fedapay'); FedaPay.setApiKey('YOUR_SECRET_API_KEY'); FedaPay.setEnvironment('sandbox'); const transaction = await Transaction.create({ description: 'Payment for order #1234', amount: 1000, currency: { iso: 'XOF' }, callback_url: 'https://example.com/callback', mode: 'mtn_open', customer: { id: 1 } });
{ "id": 123, "reference": "<string>", "amount": 123, "description": "<string>", "callback_url": "<string>", "status": "<string>", "created_at": "2023-11-07T05:31:56Z", "updated_at": "2023-11-07T05:31:56Z" }
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Bearer <token>
<token>
Transaction created successfully.
The response is of type object.
object