POST
/
transactions
NodeJs
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"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
description
string
required

Description of the transaction.

amount
integer
required

Amount of the transaction.

currency
object
required

Currency information.

callback_url
string<uri>

URL to receive transaction updates.

metadata
object

Additional metadata related to the transaction.

customer
object

Customer associated with the transaction.

fees
integer

Transaction fees.

Response

Transaction created successfully.

id
integer

Transaction ID.

reference
string

Transaction reference.

amount
integer

Transaction amount.

description
string

Transaction description.

callback_url
string

Transaction callback URL.

status
string

Transaction status (e.g., 'pending', 'approved', 'canceled').

created_at
string<date-time>

Date and time of transaction creation.

updated_at
string<date-time>

Date and time of last transaction update.