---
updatedAt: 2026-05-22T18:18:28.000Z
agentTools:
  projectIndex: https://docs.kyshi.co/llms.txt
---

# Initialize transaction

Creates a pending transaction and returns a hosted checkout URL. A 201 means the request was accepted, not that the customer has paid: verify before releasing value.

# OpenAPI definition

```json
{
  "openapi": "3.0.0",
  "paths": {
    "/v1/transactions/initialize": {
      "post": {
        "description": "Creates a pending transaction and returns a hosted checkout URL. A 201 means the request was accepted, not that the customer has paid: verify before releasing value.",
        "operationId": "initializeTransaction",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InitiatePaymentDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/SuccessResponseDto"
                    },
                    {
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/PublicInitializeTransactionDto"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Missing or invalid request parameter.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "No valid API key provided.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          },
          "403": {
            "description": "The API key lacks permission for this request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          },
          "404": {
            "description": "Resource not found. A 404 on an object you just created is usually a test/live mode mismatch.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          },
          "422": {
            "description": "Business rule failure, such as an unsupported currency or insufficient balance.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on Kyshi’s end.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponseDto"
                }
              }
            }
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "summary": "Initialize transaction",
        "tags": [
          "Transactions"
        ],
        "x-readme": {
          "code-samples": [
            {
              "language": "typescript",
              "name": "Kyshi SDK",
              "code": "import { Kyshi } from '@kyshi/mor-sdk';\n\nconst kyshi = new Kyshi({ secretKey: process.env.KYSHI_SECRET_KEY! });\n\nconst result = await kyshi.transactions.initialize({\n  \"email\": \"dom@yopmail.com\",\n  \"firstName\": \"Dom\",\n  \"lastName\": \"Aba\",\n  \"phoneNumber\": \"2250734567890\",\n  \"localCurrency\": \"XOF\",\n  \"reference\": \"ORDER-100045\",\n  \"channels\": [\n    \"mobile_money\"\n  ],\n  \"amount\": 1000,\n  \"amountCurrency\": \"local\",\n  \"metadata\": {\n    \"orderId\": \"ORDER-100045\",\n    \"source\": \"checkout\"\n  },\n  \"redirectUrl\": \"https://merchant.example.com/payments/return\",\n  \"feeBearer\": \"CUSTOMER\",\n  \"taxChargeable\": \"EXCLUSIVE\",\n  \"chargeType\": \"BANK_TRANSFER\",\n  \"expiresAt\": \"2026-09-30T23:59:59Z\"\n});",
              "install": "npm install @kyshi/mor-sdk"
            },
            {
              "language": "curl",
              "code": "curl --request POST \\\n  --url 'https://api.kyshi.co/v1/transactions/initialize' \\\n  --header 'x-api-key: YOUR_API_KEY' \\\n  --header 'Content-Type: application/json' \\\n  --data '{\n  \"email\": \"dom@yopmail.com\",\n  \"firstName\": \"Dom\",\n  \"lastName\": \"Aba\",\n  \"phoneNumber\": \"2250734567890\",\n  \"localCurrency\": \"XOF\",\n  \"reference\": \"ORDER-100045\",\n  \"channels\": [\n    \"mobile_money\"\n  ],\n  \"amount\": 1000,\n  \"amountCurrency\": \"local\",\n  \"metadata\": {\n    \"orderId\": \"ORDER-100045\",\n    \"source\": \"checkout\"\n  },\n  \"redirectUrl\": \"https://merchant.example.com/payments/return\",\n  \"feeBearer\": \"CUSTOMER\",\n  \"taxChargeable\": \"EXCLUSIVE\",\n  \"chargeType\": \"BANK_TRANSFER\",\n  \"expiresAt\": \"2026-09-30T23:59:59Z\"\n}'"
            },
            {
              "language": "javascript",
              "name": "Node.js (fetch)",
              "code": "const response = await fetch('https://api.kyshi.co/v1/transactions/initialize', {\n  method: 'POST',\n  headers: {\n    'x-api-key': process.env.KYSHI_API_KEY,\n    'Content-Type': 'application/json',\n  },\n  body: JSON.stringify({\n  \"email\": \"dom@yopmail.com\",\n  \"firstName\": \"Dom\",\n  \"lastName\": \"Aba\",\n  \"phoneNumber\": \"2250734567890\",\n  \"localCurrency\": \"XOF\",\n  \"reference\": \"ORDER-100045\",\n  \"channels\": [\n    \"mobile_money\"\n  ],\n  \"amount\": 1000,\n  \"amountCurrency\": \"local\",\n  \"metadata\": {\n    \"orderId\": \"ORDER-100045\",\n    \"source\": \"checkout\"\n  },\n  \"redirectUrl\": \"https://merchant.example.com/payments/return\",\n  \"feeBearer\": \"CUSTOMER\",\n  \"taxChargeable\": \"EXCLUSIVE\",\n  \"chargeType\": \"BANK_TRANSFER\",\n  \"expiresAt\": \"2026-09-30T23:59:59Z\"\n}),\n});\n\nconst result = await response.json();"
            }
          ]
        }
      }
    }
  },
  "info": {
    "title": "Kyshi MoR Public API",
    "description": "Public API reference for Kyshi integrators.",
    "version": "1.0",
    "contact": {}
  },
  "tags": [
    {
      "name": "Transactions",
      "description": "Collect one-time payments through hosted checkout or a direct bank-transfer charge."
    }
  ],
  "servers": [
    {
      "url": "https://api.kyshi.co",
      "description": "Production and Sandbox"
    }
  ],
  "components": {
    "securitySchemes": {
      "ApiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "x-api-key"
      }
    },
    "schemas": {
      "SuccessResponseDto": {
        "type": "object",
        "properties": {
          "status": {
            "type": "boolean",
            "example": true,
            "description": "`true` on success."
          },
          "message": {
            "type": "string",
            "example": "Success"
          },
          "code": {
            "type": "number",
            "example": 200,
            "description": "Mirrors the HTTP status code."
          },
          "data": {
            "type": "object",
            "example": {},
            "description": "The endpoint-specific payload."
          }
        },
        "required": [
          "status",
          "message",
          "code",
          "data"
        ]
      },
      "ErrorResponseDto": {
        "type": "object",
        "properties": {
          "status": {
            "type": "boolean",
            "example": false,
            "description": "`false` on failure."
          },
          "message": {
            "type": "string",
            "example": "Unsupported Merchant Currency",
            "description": "Human-readable summary. Log it, but do not branch on it: the wording can change."
          },
          "code": {
            "type": "number",
            "example": 422,
            "description": "Mirrors the HTTP status code."
          },
          "data": {
            "type": "object",
            "example": {},
            "description": "Always empty on failure."
          }
        },
        "required": [
          "status",
          "message",
          "code",
          "data"
        ]
      },
      "PublicFeeBreakdownDto": {
        "type": "object",
        "properties": {
          "fee": {
            "type": "number",
            "example": 57
          },
          "vat": {
            "type": "number",
            "example": 180
          },
          "processorFee": {
            "type": "number",
            "example": 0
          },
          "stampDuty": {
            "type": "number",
            "example": 0
          },
          "allInclusiveKyshiFee": {
            "type": "number",
            "example": 57
          },
          "totalFees": {
            "type": "number",
            "example": 237
          },
          "others": {
            "type": "object",
            "additionalProperties": true,
            "example": {}
          }
        },
        "required": [
          "fee",
          "vat",
          "processorFee",
          "stampDuty",
          "allInclusiveKyshiFee",
          "totalFees",
          "others"
        ]
      },
      "PublicInitializeTransactionDto": {
        "type": "object",
        "properties": {
          "authorizationUrl": {
            "type": "string",
            "example": "https://merchant.kyshi.co/checkout/KYSHI-1790057506631"
          },
          "accessCode": {
            "type": "string",
            "example": "KYSHI-1790057506631"
          },
          "reference": {
            "type": "string",
            "example": "KYSHI-1790057506631"
          },
          "hostedCheckout": {
            "type": "boolean",
            "example": true
          },
          "provider": {
            "type": "string",
            "enum": [
              "PROVIDUS_BANK",
              "STERLING",
              "VFD",
              "PAYSTACK",
              "FLUTTERWAVE",
              "CHOICE",
              "STITCH",
              "PAGA",
              "STRIPE",
              "ASSET_MFB",
              "MOMENTPAY",
              "PAWAPAY"
            ],
            "example": "PAWAPAY"
          },
          "rate": {
            "type": "number",
            "example": 622.78
          },
          "feeBreakdown": {
            "$ref": "#/components/schemas/PublicFeeBreakdownDto"
          }
        },
        "required": [
          "authorizationUrl",
          "accessCode",
          "reference"
        ]
      },
      "InitiatePaymentDto": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "example": "dom@yopmail.com"
          },
          "firstName": {
            "type": "string",
            "example": "Dom"
          },
          "lastName": {
            "type": "string",
            "example": "Aba"
          },
          "phoneNumber": {
            "type": "string",
            "example": "2250734567890"
          },
          "localCurrency": {
            "type": "string",
            "enum": [
              "NGN",
              "KES",
              "ZAR",
              "GHS",
              "XOF",
              "USD"
            ],
            "example": "XOF"
          },
          "reference": {
            "type": "string",
            "example": "ORDER-100045"
          },
          "channels": {
            "example": [
              "mobile_money"
            ],
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "amount": {
            "type": "number",
            "example": 1000
          },
          "amountCurrency": {
            "type": "string",
            "enum": [
              "settlement",
              "local"
            ],
            "example": "local",
            "description": "How to interpret 'amount'. Defaults to 'settlement' for backward compatibility."
          },
          "metadata": {
            "type": "object",
            "example": {
              "orderId": "ORDER-100045",
              "source": "checkout"
            }
          },
          "redirectUrl": {
            "type": "string",
            "example": "https://merchant.example.com/payments/return"
          },
          "feeBearer": {
            "type": "string",
            "enum": [
              "MERCHANT",
              "CUSTOMER"
            ],
            "example": "CUSTOMER"
          },
          "taxChargeable": {
            "type": "string",
            "enum": [
              "INCLUSIVE",
              "EXCLUSIVE"
            ],
            "example": "EXCLUSIVE"
          },
          "chargeType": {
            "type": "string",
            "enum": [
              "BANK_TRANSFER"
            ],
            "example": "BANK_TRANSFER"
          },
          "expiresAt": {
            "type": "string",
            "example": "2026-09-30T23:59:59Z"
          }
        },
        "required": [
          "email",
          "firstName",
          "lastName",
          "phoneNumber",
          "localCurrency",
          "reference",
          "channels",
          "amount",
          "metadata",
          "redirectUrl",
          "feeBearer",
          "taxChargeable",
          "chargeType",
          "expiresAt"
        ]
      }
    }
  },
  "security": [
    {
      "ApiKeyAuth": []
    }
  ]
}
```