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
AuthorizationRequiredBearer <token>In: header
Request Body
application/jsonRequiredamountRequirednumberAmount of the transaction
"float"currencystringCurrency code
"INR"Value in: "INR"typeRequiredstringType of transaction
"DEPOSIT" | "WITHDRAWAL"metadataobjectAdditional metadata for the transaction
paymentMethodIdstringID of the payment method to use
"uuid"requestedAmountnumberOriginal requested amount before any conversions
"float"withdrawalRecipientobjectexpiryMinutesintegerMinutes until the payment link expires
60redirectUrlstringURL to redirect after payment completion
"uri"Response Body
Transaction created successfully
TypeScript Definitions
Use the response body type in TypeScript.
dataobjectInvalid request parameters
TypeScript Definitions
Use the response body type in TypeScript.
responseRequiredobject | objectUnauthorized
TypeScript Definitions
Use the response body type in TypeScript.
errorRequiredobjectForbidden - Production environment requires ACTIVE merchant status
TypeScript Definitions
Use the response body type in TypeScript.
errorRequiredobjectPayment method not found
TypeScript Definitions
Use the response body type in TypeScript.
errorRequiredobjectServer error
TypeScript Definitions
Use the response body type in TypeScript.
errorRequiredobjectcurl -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": {}
}
}