---
title: "Create a transaction"
method: POST
path: "/transactions"
---

# Create a transaction

`POST /transactions`

## Request body

- object
  - `description` string, required — Description of the transaction.
  - `amount` integer, required — Amount of the transaction.
  - `currency` object, required — Currency information.
    - `iso` string — The ISO code of the currency (e.g., XOF).
  - `callback_url` string, uri — URL to receive transaction updates.
  - `custom_metadata` object — Additional metadata related to the transaction.
  - `customer` object — Customer associated with the transaction.
    - `id` integer — Customer ID if already exists
    - `email` string, email — Customer's email address.
    - `firstname` string — Customer's last name.
    - `lastname` string — Customer's last name.
    - `phone_number` object — Customer's phone number.
      - `number` integer — Phone number without national prefix.
      - `country` string — Country code.

## Response `201`

Transaction created successfully.

- object
  - `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.

## Other responses

- `400` — Invalid request body.
- `401` — Unauthorized. Provide a valid secret key.
- `422` — Validation error.

---

[API](https://skmtc.net/fedapay/apis/customer-api.md) · [All operations](https://skmtc.net/fedapay/apis/customer-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/fedapay/customer-api/versions/e6bade118d1a/schema)
