BPN OpenAPI
  1. External Provider
BPN OpenAPI
  • Getting Started
    • Introduction to BPN
    • Key Concepts & Terminology
    • Architecture Overview
  • Onboarding & Prerequisites
    • Product Demo
    • Sandbox & Test Environment
    • Signature Authentication Mechanism
  • Use Case
    • Transfer
    • Vault
    • On/Off Ramp
    • Compliance (Travel Rule Information Submission)
    • Fiat Collection(BRL PIX for example)
  • API Reference
    • Account Management
      • Inquiry Master VA Balance
      • Create Virtaul Account
      • Get Virtual Account Detail
      • List Virtual Account
      • Send Email Verify Code
      • Query bank info by account number
      • Payout via Virtual Account
      • Refund Virtual Account Order
      • Get Virtual Account Order Detail
      • List Virtual Account Orders
      • Submit Invoice
      • Get Invoice list Status
      • List Banks
      • Add Bank Account
      • List Bank Account
      • List RFI Sub Virtual Account
      • Get Sub Virtual Account RFI Template Info
      • Sub Virtual Account Submit RFI
    • Wallet
      • List Wallets
      • List Sub Account
      • Create Sub Account
      • Wallet Internal Transfer
      • Get Asset Balance
      • Get Deposit Address
      • Add Deposit Sender
      • Add Withdraw Whitelist
      • Delete Withdraw Whiltelist
      • Request Withdraw
      • Query Transaction History
    • FX
      • Inquery FX Rate
    • BPN Transactions
      • Get Stablecoin Quote
      • Create Stable Order
      • Get Order (Single) Detail
      • List Orders(Batch)
    • Reconciliation
      • Get Reconciliation Order List By Page
    • Crypto Payment Link
      • Abnormal fund
        • Abnormal funds
        • Matchable Payment links
        • Link Order(Abnormal fund)
        • Submit to platform
      • Create Payment Link
      • List Payment links
      • Get Curreny Network Config
    • External Provider
      • FE: Create stablecoin collection sub-account link
      • Create stablecoin collection sub-account link
        POST
      • Get sub wallet account
        GET
      • List sub wallet accounts
        GET
      • Change sub wallet status
        POST
      • Query stablecoin collection order list
        GET
      • Accept stablecoin collection order
        POST
      • Reject stablecoin collection order
        POST
      • Query stablecoin collection order status
        GET
      • Query USD balance
        GET
      • Get quote
        GET
      • USD Payout (withdrawal)
        POST
      • Query USD Payout order status
        GET
      • Query USD Payout order list
        GET
    • Mock
      • Mock Virtual account Payin Order
  • Webhooks & Events
    • Resend Fail Webhook
    • Open Virtual Account Status
    • Virtual Account Payment Status
    • Virtual Account Invoice update
    • Transaction Status Notification
    • KYB Status Notification
    • Deposit Sender Detail Required
    • Abnormal Fund Notification
    • Sub Wallet Update
    • Crypto Deposit Order Notification
    • Collect Order Updated
    • Usd Payout Order Updated
  • Appendix
    • Enum
    • Virtual Account(VA) Support List & KYB requirement
  • Release Notes & Changelog
    • Version History
  • Schemas
    • walletBalance
    • walletAddress
    • transactionRecord
  1. External Provider

FE: Create stablecoin collection sub-account link

1. Embedding#

Embed the page by loading the URL returned by the server in an iframe.

2. Close event: postMessage contract#

When the user clicks the close button inside the collect page, the iframe sends a postMessage to the parent window so the parent can hide the iframe, close a modal, or perform other actions.

2.1 Message payload#

FieldTypeDescription
typestringAlways 'MERCHANT_COLLECT_CLOSED'; use this to identify the close event
sourcestringAlways 'merchant-collect'; identifies the sending page
Example:
{
  "type": "MERCHANT_COLLECT_CLOSED",
  "source": "merchant-collect"
}

2.2 When the message is sent#

The message is sent only when the page is inside an iframe (i.e. window.parent !== window).
It is sent to window.parent with targetOrigin set to '*'.

3. Parent page: how to listen#

3.1 Plain JavaScript#

3.2 Validate origin (recommended)#

To avoid accepting messages from other origins, validate event.origin against an allowlist:
Previous
Get Curreny Network Config
Next
Create stablecoin collection sub-account link
Built with