Katu9
Transaction

Create transaction

Creates a new payment transaction (deposit or withdrawal). For production environment, merchant status must be ACTIVE. Sandbox environment can be used with any merchant status. **Webhook:** On success, triggers all active merchant webhooks subscribing to the `transaction.created` event. The webhook POSTs a JSON payload with the transaction data and an HMAC SHA256 signature in the `X-Katu9-Signature` header. **Audit Trail:** Each transaction creation is recorded in the `transaction_history` table for auditing.

POST
/transaction

Authorization

AuthorizationRequiredBearer <token>

In: header

Request Body

application/jsonRequired
amountRequirednumber

Amount of the transaction

Format: "float"
currencystring

Currency code

Default: "INR"Value in: "INR"
typeRequiredstring

Type of transaction

Value in: "DEPOSIT" | "WITHDRAWAL"
metadataobject

Additional metadata for the transaction

paymentMethodIdstring

ID of the payment method to use

Format: "uuid"
requestedAmountnumber

Original requested amount before any conversions

Format: "float"
withdrawalRecipientobject
expiryMinutesinteger

Minutes until the payment link expires

Default: 60
redirectUrlstring

URL to redirect after payment completion

Format: "uri"

Response Body

Transaction created successfully

TypeScript Definitions

Use the response body type in TypeScript.

dataobject

Invalid request parameters

TypeScript Definitions

Use the response body type in TypeScript.

responseRequiredobject | object

Unauthorized

TypeScript Definitions

Use the response body type in TypeScript.

errorRequiredobject

Forbidden - Production environment requires ACTIVE merchant status

TypeScript Definitions

Use the response body type in TypeScript.

errorRequiredobject

Payment method not found

TypeScript Definitions

Use the response body type in TypeScript.

errorRequiredobject

Server error

TypeScript Definitions

Use the response body type in TypeScript.

errorRequiredobject
curl -X POST "https://api.katu9.com/transaction" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "amount": 1000,
    "currency": "INR",
    "type": "DEPOSIT",
    "metadata": {},
    "paymentMethodId": "b6df8625-cd25-4123-b345-638aa7b5d011",
    "requestedAmount": 0.1,
    "withdrawalRecipient": {
      "accountNumber": "string",
      "ifscCode": "string",
      "accountName": "string",
      "bankName": "string"
    },
    "expiryMinutes": 60,
    "redirectUrl": "http://example.com"
  }'
const body = JSON.stringify({
  "amount": 1000,
  "currency": "INR",
  "type": "DEPOSIT",
  "metadata": {},
  "paymentMethodId": "b6df8625-cd25-4123-b345-638aa7b5d011",
  "requestedAmount": 0.1,
  "withdrawalRecipient": {
    "accountNumber": "string",
    "ifscCode": "string",
    "accountName": "string",
    "bankName": "string"
  },
  "expiryMinutes": 60,
  "redirectUrl": "http://example.com"
})

fetch("https://api.katu9.com/transaction", {
  headers: {
    "Authorization": "Bearer <token>"
  },
  body
})
package main

import (
  "fmt"
  "net/http"
  "io/ioutil"
  "strings"
)

func main() {
  url := "https://api.katu9.com/transaction"
  body := strings.NewReader(`{
    "amount": 1000,
    "currency": "INR",
    "type": "DEPOSIT",
    "metadata": {},
    "paymentMethodId": "b6df8625-cd25-4123-b345-638aa7b5d011",
    "requestedAmount": 0.1,
    "withdrawalRecipient": {
      "accountNumber": "string",
      "ifscCode": "string",
      "accountName": "string",
      "bankName": "string"
    },
    "expiryMinutes": 60,
    "redirectUrl": "http://example.com"
  }`)
  req, _ := http.NewRequest("POST", url, body)
  req.Header.Add("Authorization", "Bearer <token>")
  req.Header.Add("Content-Type", "application/json")
  res, _ := http.DefaultClient.Do(req)
  defer res.Body.Close()
  body, _ := ioutil.ReadAll(res.Body)

  fmt.Println(res)
  fmt.Println(string(body))
}
import requests

url = "https://api.katu9.com/transaction"
body = {
  "amount": 1000,
  "currency": "INR",
  "type": "DEPOSIT",
  "metadata": {},
  "paymentMethodId": "b6df8625-cd25-4123-b345-638aa7b5d011",
  "requestedAmount": 0.1,
  "withdrawalRecipient": {
    "accountNumber": "string",
    "ifscCode": "string",
    "accountName": "string",
    "bankName": "string"
  },
  "expiryMinutes": 60,
  "redirectUrl": "http://example.com"
}
response = requests.request("POST", url, json = body, headers = {
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
})

print(response.text)
{
  "data": {
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "type": "DEPOSIT",
    "amount": 0.1,
    "currency": "string",
    "status": "string",
    "fee": 0.1,
    "netAmount": 0.1,
    "createdAt": "2019-08-24T14:15:22Z",
    "updatedAt": "2019-08-24T14:15:22Z"
  }
}
{
  "error": {
    "message": "string",
    "details": {}
  }
}
{
  "error": {
    "message": "string",
    "details": {}
  }
}
{
  "error": {
    "message": "string",
    "details": {}
  }
}
{
  "error": {
    "message": "string",
    "details": {}
  }
}
{
  "error": {
    "message": "string",
    "details": {}
  }
}