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.
Authorization
Authorization
RequiredBearer <token>In: header
Request Body
application/json
Requiredamount
RequirednumberAmount of the transaction
"float"
currency
stringCurrency code
"INR"
Value in: "INR"
type
RequiredstringType of transaction
"DEPOSIT" | "WITHDRAWAL"
metadata
objectAdditional metadata for the transaction
paymentMethodId
stringID of the payment method to use
"uuid"
requestedAmount
numberOriginal requested amount before any conversions
"float"
withdrawalRecipient
objectexpiryMinutes
integerMinutes until the payment link expires
60
redirectUrl
stringURL to redirect after payment completion
"uri"
Response Body
Transaction created successfully
TypeScript Definitions
Use the response body type in TypeScript.
data
objectInvalid request parameters
TypeScript Definitions
Use the response body type in TypeScript.
response
Requiredobject | objectUnauthorized
TypeScript Definitions
Use the response body type in TypeScript.
error
RequiredobjectForbidden - Production environment requires ACTIVE merchant status
TypeScript Definitions
Use the response body type in TypeScript.
error
RequiredobjectPayment method not found
TypeScript Definitions
Use the response body type in TypeScript.
error
RequiredobjectServer error
TypeScript Definitions
Use the response body type in TypeScript.
error
Requiredobjectcurl -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": {}
}
}