Transactions API
Overview
Section titled “Overview”Jina Connect uses a credit-based wallet system. Tenants purchase credits via Razorpay, and credits are deducted per message sent.
Transaction Endpoints
Section titled “Transaction Endpoints”| Method | Endpoint | Description |
|---|---|---|
GET | /transaction/tenant-transactions/ | List transactions |
GET | /transaction/tenant-transactions/{id}/ | Get transaction details |
Razorpay Endpoints
Section titled “Razorpay Endpoints”| Method | Endpoint | Description |
|---|---|---|
POST | /razorpay/razor-pay/ | Create a Razorpay order |
POST | /razorpay/razor-webhook/ | Razorpay webhook (payment confirmation) |
Payment Flow
Section titled “Payment Flow”1. Client creates order → POST /razorpay/razor-pay/2. Client completes Razorpay checkout3. Razorpay sends webhook → POST /razorpay/razor-webhook/4. Credits added to tenant wallet5. Transaction record createdTransaction Record
Section titled “Transaction Record”| Field | Description |
|---|---|
tenant | Tenant FK |
amount | Credit amount |
type | Credit / Debit |
description | Transaction description |
reference_id | External reference (Razorpay order ID) |
created_at | Timestamp |
Wallet Balance
Section titled “Wallet Balance”Check the tenant’s current wallet balance:
curl http://localhost:8000/tenants/host-wallet/ \ -H "Authorization: Bearer <token>"Credit Deduction
Section titled “Credit Deduction”Credits are deducted automatically when messages are sent. Pricing is configured per TenantWAApp with different rates for:
- Template messages
- Session messages
- Media messages
- Per-channel rates