> ## Documentation Index
> Fetch the complete documentation index at: https://developer.gcashier.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Accept Payments with Virtual Accounts (VA Collection)

> Open virtual accounts, receive cross-border payments, create compliant trade orders, and reconcile funds — all through the Gcashier Pay collection API.

Gcashier Pay's collection system is built around **Virtual Accounts (VAs)**. Each VA is a dedicated bank account number issued in your merchant name that overseas buyers can transfer funds into directly. Once a payment arrives, Gcashier Pay fires a trade receipt webhook so you can reconcile the incoming flow against your trade orders. This guide walks you through every stage: opening a VA, receiving payment notifications, creating trade orders, and associating collection flows with those orders.

## Overview

<Steps>
  <Step title="Open a VA account (sp1103)">
    Request a virtual account for a specific currency and country.
  </Step>

  <Step title="Receive VA opening notification (sp3102 webhook)">
    Gcashier Pay delivers your account number, bank name, and SWIFT code.
  </Step>

  <Step title="Query VA details (sp2101)">
    Retrieve your active VAs and their current status at any time.
  </Step>

  <Step title="Receive trade receipt notification (sp3103 webhook)">
    Gcashier Pay notifies you when funds arrive on a VA.
  </Step>

  <Step title="Create a trade order (sp1104)">
    Submit the underlying commercial transaction matching the received funds.
  </Step>

  <Step title="Associate the collection flow with the trade order (sp1105)">
    Link the incoming payment flow to your trade order for compliance clearance.
  </Step>
</Steps>

***

## Step 1 — Open a VA Account

Call **POST /api/sp1103** to request a new virtual account. Each VA is tied to a specific currency, country, and business type (identified by `parentCode`).

### parentCode Values

| Code | Business Type                             |
| ---- | ----------------------------------------- |
| `S`  | Platform e-commerce (marketplace sellers) |
| `D`  | Independent online store                  |
| `T`  | Offline / physical goods trade            |
| `F`  | Service trade                             |

<Note>
  Choose the `parentCode` that best matches your primary business model. This affects the compliance documents and trade order types required for each collection flow.
</Note>

### Request Example

<CodeGroup>
  ```json sp1103 Request theme={null}
  {
    "merOrderNo": "VA20240601001",
    "parentCode": "D",
    "applyCode": "APL0000123",
    "area": "SG",
    "currency": "USD",
    "acctSimpleName": "AcmeSGUSD",
    "shopName": "Acme Trade Store",
    "shopUrl": "https://shop.acme-trade.com",
    "isSameName": "Y",
    "callbackUrl": "https://api.acme-trade.com/webhooks/gcashier/va-opening",
    "storeHoldCertify": "https://docs.acme-trade.com/certify/store_cert.pdf",
    "busDesDocument": "https://docs.acme-trade.com/certify/business_desc.pdf"
  }
  ```

  ```json sp1103 Response theme={null}
  {
    "bizFlow": "BF20240601000200",
    "status": "ACCEPT"
  }
  ```
</CodeGroup>

A `status` of `ACCEPT` means the VA application has been received. The actual account details are delivered asynchronously via the **sp3102** webhook.

***

## Step 2 — Receive the VA Opening Notification

Gcashier Pay posts the VA details to your `callbackUrl` once the account is ready. Save `accountNo` and `swiftCode` — these are what your buyers will use to send funds.

### sp3102 Webhook Payload

<CodeGroup>
  ```json sp3102 Webhook — VA Opened Successfully theme={null}
  {
    "bizFlow": "BF20240601000200",
    "merOrderNo": "VA20240601001",
    "code": "S00000",
    "message": "Virtual account opened successfully.",
    "accountName": "Acme Trade Pte Ltd",
    "accountNo": "SG12345678901234",
    "swiftCode": "GCSGSGSX",
    "bankName": "Gcashier Pay Partner Bank",
    "bankAddress": "1 Raffles Quay, Singapore 048583",
    "area": "SG",
    "currency": "USD",
    "status": "ON"
  }
  ```

  ```json sp3102 Webhook — VA Opening Failed theme={null}
  {
    "bizFlow": "BF20240601000200",
    "merOrderNo": "VA20240601001",
    "code": "S00002",
    "message": "VA opening rejected: shop URL is unreachable.",
    "status": "FAIL"
  }
  ```
</CodeGroup>

***

## Step 3 — Query VA Details

Use **POST /api/sp2101** to retrieve all VAs associated with your merchant account, or look up a specific VA by `bizFlow` or `merOrderNo`.

<CodeGroup>
  ```json sp2101 Request theme={null}
  {
    "bizFlow": "BF20240601000200"
  }
  ```

  ```json sp2101 Response theme={null}
  {
    "code": "S00000",
    "message": "success",
    "data": [
      {
        "accountName": "Acme Trade Pte Ltd",
        "accountNo": "SG12345678901234",
        "swiftCode": "GCSGSGSX",
        "bankName": "Gcashier Pay Partner Bank",
        "bankAddress": "1 Raffles Quay, Singapore 048583",
        "area": "SG",
        "currency": "USD",
        "status": "ON"
      }
    ]
  }
  ```
</CodeGroup>

| VA Status | Meaning                                    |
| --------- | ------------------------------------------ |
| `ON`      | Active and accepting inbound payments      |
| `OFF`     | Suspended — contact support to re-activate |
| `OPENING` | Application still under review             |

***

## Step 4 — Receive Trade Receipt Notifications

When a buyer transfers funds to your VA, Gcashier Pay fires the **sp3103** webhook to your callback URL. This delivers the inbound `flowNo` that you'll use when associating the payment with a trade order.

### sp3103 Webhook Payload

<CodeGroup>
  ```json sp3103 Webhook — Funds Received theme={null}
  {
    "flowNo": "FL20240601999001",
    "receiveAmount": "5000.00",
    "receiveCurrency": "USD",
    "vaAccount": "SG12345678901234",
    "senderName": "Shanghai Buyer Co Ltd",
    "actualReceiveAmount": "4997.50",
    "availableFlag": "Y"
  }
  ```
</CodeGroup>

| Field                 | Description                                                               |
| --------------------- | ------------------------------------------------------------------------- |
| `flowNo`              | Unique identifier for this inbound payment — save this for sp1105         |
| `receiveAmount`       | Gross amount received before fees                                         |
| `actualReceiveAmount` | Net amount credited to your balance after bank fees                       |
| `availableFlag`       | `Y` = funds are available for use; `N` = funds are on hold pending review |

<Warning>
  Only process the `flowNo` once `availableFlag` is `Y`. Funds that are still on hold (`N`) cannot be exchanged or withdrawn until they clear compliance review.
</Warning>

***

## Step 5 — Create a Trade Order

Before you can withdraw or exchange the received funds, you must submit a trade order that documents the underlying commercial transaction. Call **POST /api/sp1104** with the goods or services details matching the payment.

### Request Example

<CodeGroup>
  ```json sp1104 Request theme={null}
  {
    "callbackUrl": "https://api.acme-trade.com/webhooks/gcashier/trade-order",
    "merOrderNo": "ORD20240601001",
    "currency": "USD",
    "amount": "5000.00",
    "tradeType": "00",
    "buyerName": "Shanghai Buyer Co Ltd",
    "buyerArea": "CN",
    "transcationDate": "2024-06-01",
    "transcationCert": "https://docs.acme-trade.com/trade/invoice_ORD001.pdf",
    "goodsList": [
      {
        "goodsName": "Wireless Headphones Model X",
        "goodsNo": "SKU-WH-001",
        "goodsQuantity": "100",
        "goodsPrice": "30.00",
        "goodsAmount": "3000.00",
        "goodsCurrency": "USD"
      },
      {
        "goodsName": "Portable Speaker Model Y",
        "goodsNo": "SKU-PS-002",
        "goodsQuantity": "50",
        "goodsPrice": "40.00",
        "goodsAmount": "2000.00",
        "goodsCurrency": "USD"
      }
    ],
    "logStatus": "1",
    "logNo": "SF1234567890",
    "logCompany": "SF Express",
    "logisticsType": "AIR",
    "logisticsArea": "CN"
  }
  ```

  ```json sp1104 Response theme={null}
  {
    "contractNo": "CTR20240601000301",
    "code": "S00001",
    "message": "Trade order submitted successfully."
  }
  ```
</CodeGroup>

| `tradeType` | Meaning              |
| ----------- | -------------------- |
| `00`        | Physical goods trade |
| `01`        | Services trade       |

Save the `contractNo` — you'll reference it when associating the collection flow in the next step.

### sp3104 Webhook — Trade Order Result

<CodeGroup>
  ```json sp3104 Webhook theme={null}
  {
    "contractNo": "CTR20240601000301",
    "merOrderNo": "ORD20240601001",
    "status": "SUCC",
    "code": "S00000",
    "message": "Trade order approved."
  }
  ```
</CodeGroup>

| Status   | Meaning                                             |
| -------- | --------------------------------------------------- |
| `ACCEPT` | Order received and under review                     |
| `SUCC`   | Trade order approved                                |
| `FAIL`   | Trade order rejected — review `message` for details |

***

## Step 6 — Associate the Collection Flow with a Trade Order

Link the inbound payment (`flowNo` from sp3103) to your approved trade order (`contractNo` from sp1104) by calling **POST /api/sp1105**. This step is required before the collected funds can be released for exchange or withdrawal.

<CodeGroup>
  ```json sp1105 Request theme={null}
  {
    "contactNo": "CTR20240601000301",
    "flowNo": "FL20240601999001",
    "callbackUrl": "https://api.acme-trade.com/webhooks/gcashier/association"
  }
  ```

  ```json sp1105 Response theme={null}
  {
    "bizFlow": "BF20240601000400",
    "code": "S00001",
    "message": "Association request submitted."
  }
  ```
</CodeGroup>

### sp3105 Webhook — Association Result

<CodeGroup>
  ```json sp3105 Webhook — Passed theme={null}
  {
    "bizFlow": "BF20240601000400",
    "flowNo": "FL20240601999001",
    "contactNo": "CTR20240601000301",
    "status": "02",
    "code": "S00000",
    "message": "Association approved. Funds released."
  }
  ```
</CodeGroup>

| Status | Meaning                                                           |
| ------ | ----------------------------------------------------------------- |
| `02`   | Association passed — funds are released                           |
| `03`   | Association rejected — mismatch between payment and order details |

You can also query association status at any time via **POST /api/sp2104** using `bizFlow`.

***

## E-commerce Order Collection (sp1106)

If you operate a platform or independent e-commerce store, you can upload batch order data to Gcashier Pay for reconciliation and compliance purposes using **POST /api/sp1106**.

<CodeGroup>
  ```json sp1106 Request theme={null}
  {
    "transType": "D",
    "orderList": [
      {
        "orderNo": "ECOM20240601001",
        "amount": "299.99",
        "currency": "USD",
        "dateTime": "2024-06-01 10:30:00",
        "commodity": "Wireless Headphones Model X",
        "quantity": "1",
        "logisticsName": "DHL",
        "logisticsNo": "DHL9876543210",
        "platform": "acme-trade.com",
        "shopUrl": "https://shop.acme-trade.com/products/wh-model-x",
        "buyerName": "Li Wei",
        "buyerArea": "CN"
      },
      {
        "orderNo": "ECOM20240601002",
        "amount": "159.99",
        "currency": "USD",
        "dateTime": "2024-06-01 11:15:00",
        "commodity": "Portable Speaker Model Y",
        "quantity": "2",
        "logisticsName": "FedEx",
        "logisticsNo": "FX1122334455",
        "platform": "acme-trade.com",
        "shopUrl": "https://shop.acme-trade.com/products/ps-model-y",
        "buyerName": "Wang Fang",
        "buyerArea": "CN"
      }
    ]
  }
  ```

  ```json sp1106 Response theme={null}
  {
    "code": "success",
    "message": "E-commerce orders uploaded successfully."
  }
  ```
</CodeGroup>

| `transType` | Meaning                                    |
| ----------- | ------------------------------------------ |
| `S`         | Platform e-commerce (e.g., Shopee, Lazada) |
| `D`         | Independent station (your own storefront)  |

<Tip>
  Upload e-commerce orders as soon as they ship. Gcashier Pay uses this data during association reviews — having order records already in the system speeds up flow approval significantly.
</Tip>
