Skip to Content
FeaturesPayments

Payments

Overview

The Payments feature manages how Siyahfy stores accept money from customers. Vendors can configure multiple payment gateways — currently Razorpay and Cashfree — along with Cash on Delivery (COD) and manual payment methods. The system handles payment creation, verification via webhooks, refund processing, and subscription billing for Siyahfy platform plans.

How It Works

Payment Flow (Razorpay)

  1. When a customer selects Razorpay, the backend creates a Razorpay order using the vendor’s Razorpay API keys.
  2. The frontend opens the Razorpay checkout widget.
  3. Customer completes payment (UPI, card, net banking, etc.).
  4. Razorpay sends a webhook to the backend confirming payment status.
  5. The backend verifies the webhook signature and updates the order status.

Payment Flow (Cashfree)

  1. The backend creates a Cashfree payment session with order details.
  2. Customer is redirected to the Cashfree payment page.
  3. After payment, Cashfree sends a webhook notification.
  4. The backend verifies payment status via Cashfree’s API and updates the order.

Payment Method Setup

Vendors configure their payment methods through the admin panel:

  • Enter Razorpay Key ID and Key Secret
  • Enter Cashfree App ID and Secret Key
  • Enable/disable COD with conditions
  • Configure Stripe (available but optional)
  • Set custom payment method labels and logos

Key API Endpoints

Payment Method Configuration

POST/api/get-payment-methodsAuth Required

Get configured payment methods for a store

POST/api/manage-paymentAuth Required

Add or update a payment method configuration (Razorpay, Cashfree, Stripe)

POST/api/updatePaymentMethodsAuth Required

Bulk update payment method settings and display order

POST/api/ensure-stripe-payment-methodAuth Required

Ensure Stripe payment method record exists for a store

POST/api/onboarding/payment-helpAuth Required

Submit a help request for payment setup during onboarding

Razorpay Payments

POST/api/getRazoryPayOrderId

Create a Razorpay order and return the order ID for frontend checkout

POST/razorpay/webhook

Receive and process Razorpay payment webhooks (payment.captured, subscription events)

Cashfree Payments

POST/api/payment-cashfree

Create a Cashfree payment session for an order

POST/api/payment/webhook-cashfree

Receive and process Cashfree payment webhooks

GET/api/order-status-cashfree/:orderId

Check payment status for a Cashfree order

Storefront Payment APIs

POST/api/client-payment-methods

Get available payment methods for the storefront checkout page

Subscription Payments

POST/razorpay/cancel-subscriptionAuth Required

Cancel a vendor's Razorpay subscription for their Siyahfy plan

Database Tables

TablePurpose
payment_methodsPayment gateway configurations per store — API keys, enabled status, display settings
ordersPayment status, method used, transaction ID stored per order
vendor_subscriptionsRazorpay subscription IDs for vendor plan billing
refundsRefund records linked to orders with amounts and status
  • Orders — Payments are processed as part of the order flow
  • Shipping — COD is a payment method tied to shipping configuration
  • Storefront — Checkout page where customers select payment methods
  • Integrations — Razorpay and Cashfree are third-party integrations