1. Quick Start
Flashpay API
  • Quick Start
    • Overview
    • Integrating Guide
  • Payments
    • New payment intent
      POST
    • Payment details by ID
      GET
  • Schemas
    • Sample Schemas
      • Pet
      • Category
      • Tag
    • Schemas
      • AuthEmailLoginDto
      • AuthRegisterDto
      • AuthConfirmEmailDto
      • AuthForgotPasswordDto
      • AuthResetPasswordDto
      • CreateTransactionDto
      • CreateTransactionPayload
      • CreateKnownTransactionDto Copy
      • UpdateTransactionStatusDto
      • CreateAccountDto
      • CreateBankDto
      • UpdateBankDto
      • CreateBusinessDto
      • UpdateBusinessDto
      • CreateUserBusinessDto
      • CreateRoleDto
      • CreateTransactionFeeDto
      • UpdateTransactionFeeDto
      • CreateUserBankDto
      • CreateRolePermissionDto
  1. Quick Start

Integrating Guide

Integration Guide#

Initiating a Payment#

1. Create a Transaction (Server-side)#

From your server, call the Flashpay API with the payment details. You'll receive a transactionId in the response.

2. Redirect the Customer (Primary)#

Redirect the customer to the Flashpay checkout page using the transactionId:
The Flashpay checkout handles all payment UI, bank selection, and status updates. When the payment is complete, the customer is redirected to the redirectUrl you provided.

Alternative: Embed In-Page (SDK)#

If you prefer an in-page checkout without a full redirect, use the Flashpay SDK. Create the transaction the same way (step 1 above), then embed using one of the options below.

Vanilla JS#

React#

import { FlashpayCheckout } from "@flash-pay/react";

<FlashpayCheckout
  transactionId="txn_xxx"
  onSuccess={(data) => console.log(data)}
  onFailure={(data) => console.log(data)}
/>

Vue#

<script setup>
import { FlashpayCheckout } from "@flash-pay/vue";
</script>

<template>
  <FlashpayCheckout
    transactionId="txn_xxx"
    @success="(data) => console.log(data)"
    @failure="(data) => console.log(data)"
  />
</template>

Payment Status#

Once a payment reaches a terminal state, Flashpay will:
Redirect flow: redirect the customer to your redirectUrl
SDK/embed flow: fire the onSuccess or onFailure callback
StatusTerminal
SUCCESSFULYes
COMPLETEDYes
FAILEDYes
CANCELLEDYes
EXPIREDYes
For server-side verification, listen for webhook events or poll the transaction status endpoint using your secret key.
Modified at 2026-05-27 09:06:57
Previous
Overview
Next
New payment intent
Built with