logoFOMO Developers
PaymentIntegration Guides

Web Integration

FOMO Pay API - Web Integration

Web Integration Guide v1.1.2

1. Change Log

1.1 V1.0.0

Initial release.

1.2 V1.0.1-V1.0.7

(Removed)

1.3 V1.0.9

Specify transaction options for DPT DIRECT and DPT HOSTED mode.

1.4 V1.0.10

Update transaction options for WECHATPAY DIRECT (JSAPI) mode.

1.5 V1.0.11

Update transaction options for ALIPAY DIRECT (WAP) mode.

1.6 V1.0.12

Update transaction options for ALIPAY DIRECT (APP, MINI_APP) mode.

1.7 V1.1.0

Introduce card tokenization supportability for Customer-Initiated Transactions (CIT) and Merchant-Initiated Transactions (MIT) for DIRECT mode.

  • New APIs to support card token creation, retrieval, and deletion.
  • Update transaction options for DIRECT mode.

1.8 V1.1.1

  • Specify transaction options for DPT DIRECT and DPT HOSTED mode to support fraud detection.
  • Adjusted formatting

1.9 V1.1.2

  • Updated parameter descriptions for WECHATPAY DIRECT (JSAPI) mode and added parameter descriptions for WECHATPAY DIRECT (MWEB) mode
  • Added detailed explanation of the returnUrl parameter in Appendix 9.8 to clarify its usage and integration process.

2. PCI Compliance

To accept card payment in Direct Mode, you must submit a copy of your PCI-DSS certificate (for all relevant SAQs) to FOMO Pay to clear relevant compliance requirements.

For more information for SAQs, please visit:
https://www.pcisecuritystandards.org/documents/Understanding_SAQs_PCI_DSS_v3.pdf

3. Sequence Diagram

3.1 Hosted Mode

3.2 Direct Mode

4. Security and Encryption

4.1 Transport Security

Transport Layer Security (TLS) 1.2

4.2 Message Authentication

RFC 7617 HTTP Basic Authentication (https://tools.ietf.org/html/rfc7617)

The following key is required:

  1. MID (<MID>) generated by FOMO Pay.
  2. Pre-Shared Key (<PSK>) generated by FOMO Pay.

Please ensure <PSK>never leaves your server and managed by trusted parties only. Failing to do so will result in unauthorized access to your account. If you believe your <PSK>is lost, contact FOMO Pay immediately.

HTTP Authorization header is required in all requests. The Authorization header is constructed as follow.

Authorization: <AuthorizationType> <BasicCredentials>

<AuthorizationType>: fixed value Basic (without quote).

<BasicCredentials>: generated as follow.

"Base64(<MID>:<PSK>)"

Example:

Merchant setup:

KeyValue
<MID>100000000000001
<PSK>E00F270DE323E2B187532D8E4B306EB2841AF0BFF08132BAB7F0E62BED6419BB

Calculation:

Calculate <BasicCredentials> from:

Base64("100000000000001:E00F270DE323E2B187532D8E4B306EB2841AF0BFF08132BAB7F0E62BED6419BB")

Which yields:

MTAwMDAwMDAwMDAwMDAxOkUwMEYyNzBERTMyM0UyQjE4NzUzMkQ4RTRCMzA2RUIyODQxQUYwQkZGMDgxMzJCQUI3RjBFNjJCRUQ2NDE5QkI=

Authorization header:

Authorization: Basic MTAwMDAwMDAwMDAwMDAxOkUwMEYyNzBERTMyM0UyQjE4NzUzMkQ4RTRCMzA2RUIyODQxQUYwQkZGMDgxMzJCQUI3RjBFNjJCRUQ2NDE5QkI=

Include Authorization header in every request you send to FOMO Pay. Never include this header when you send request to other non-FOMO Pay servers.

5. Symbols and Abbreviated Terms

5.1 Required Flag

AbbreviationDescription
MMandatory
OOptional
CConditional
XNot supported

6. Message Types and Specification

6.1 Create an Order (Hosted Mode)

Request

Request Metadata

NameValue
URLhttps://ipg.fomopay.net/api/orders
MethodPOST/PUT
Content-Typeapplication/json
⚠️Connection error might occur during transaction creation. Do NOT create another transaction yet. Instead, retry using PUT method with the same requesting JSON. Multiple POST requests with the same orderNo will result in HTTP 409 error.
POST
/api/orders

Authorization

Authorization
Authorization<token>

Set to Basic <Base64(MID:PSK)>.

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

Example:

Request Examples

HTTP request code snippets for this endpoint.

curl -X POST "https://ipg.fomopay.net/api/orders" \  -H "Content-Type: application/json" \  -d '{    "mode": "HOSTED",    "orderNo": "WEB-ORDER-10001",    "subject": "FOMO Pay Demo Order",    "description": "Hosted checkout example",    "amount": "10.00",    "currencyCode": "SGD",    "notifyUrl": "https://merchant.example.com/payments/notify",    "returnUrl": "https://merchant.example.com/payments/return",    "backUrl": "https://merchant.example.com/payments/cancel",    "sourceOfFunds": [      "CARD",      "PAYNOW"    ]  }'

Response Examples

Sample response payloads generated from the OpenAPI schema.

{
  "id": "ord_01HQZ6Q3F1WB4G3WQ7D6A0S9R9",
  "subMid": "100000000000002",
  "orderNo": "WEB-ORDER-10001",
  "mode": "HOSTED",
  "subject": "FOMO Pay Demo Order",
  "description": "Hosted checkout example",
  "amount": "10.00",
  "currencyCode": "SGD",
  "status": "CREATED",
  "createdAt": 1711977000,
  "notifyUrl": "https://merchant.example.com/payments/notify",
  "returnUrl": "https://merchant.example.com/payments/return",
  "backUrl": "https://merchant.example.com/payments/cancel",
  "primaryTransactionId": "txn_01HQZ6T50Y7Y8FQ40R8Q9MZ7XM",
  "url": "https://pay.fomopay.net/redirect/ord_01HQZ6Q3F1WB4G3WQ7D6A0S9R9"
}

{
  "id": "ord_01HQZ6Q3F1WB4G3WQ7D6A0S9R9",
  "subMid": "100000000000002",
  "orderNo": "WEB-ORDER-10001",
  "mode": "HOSTED",
  "subject": "FOMO Pay Demo Order",
  "description": "Hosted checkout example",
  "amount": "10.00",
  "currencyCode": "SGD",
  "status": "CREATED",
  "createdAt": 1711977000,
  "notifyUrl": "https://merchant.example.com/payments/notify",
  "returnUrl": "https://merchant.example.com/payments/return",
  "backUrl": "https://merchant.example.com/payments/cancel",
  "primaryTransactionId": "txn_01HQZ6T50Y7Y8FQ40R8Q9MZ7XM",
  "url": "https://pay.fomopay.net/redirect/ord_01HQZ6Q3F1WB4G3WQ7D6A0S9R9"
}

{
  "hint": "req_01HQZ6PXG1PF1R2S1P33H0M2KJ",
  "code": "INVALID_REQUEST",
  "message": "orderNo already exists"
}
{
  "hint": "string",
  "code": "string",
  "message": "string"
}
{
  "hint": "string",
  "code": "string",
  "message": "string"
}
{
  "hint": "string",
  "code": "string",
  "message": "string"
}
{
  "hint": "string",
  "code": "string",
  "message": "string"
}
{
  "hint": "string",
  "code": "string",
  "message": "string"
}
{
  "hint": "string",
  "code": "string",
  "message": "string"
}

6.2 Create an Order - (Direct Mode)

Request

Request Metadata

NameValue
URLhttps://ipg.fomopay.net/api/orders
MethodPOST/PUT
Content-Typeapplication/json
⚠️Connection error might occur during transaction creation. Do NOT create another transaction yet. Instead, retry using PUT method with the same requesting JSON to avoid duplicate charge. Multiple POST requests with the same orderNo will result in HTTP 409 error.
POST
/api/orders

Authorization

Authorization
Authorization<token>

Set to Basic <Base64(MID:PSK)>.

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

Example:

Request Examples

HTTP request code snippets for this endpoint.

curl -X POST "https://ipg.fomopay.net/api/orders" \  -H "Content-Type: application/json" \  -d '{    "mode": "HOSTED",    "orderNo": "WEB-ORDER-10001",    "subject": "FOMO Pay Demo Order",    "description": "Hosted checkout example",    "amount": "10.00",    "currencyCode": "SGD",    "notifyUrl": "https://merchant.example.com/payments/notify",    "returnUrl": "https://merchant.example.com/payments/return",    "backUrl": "https://merchant.example.com/payments/cancel",    "sourceOfFunds": [      "CARD",      "PAYNOW"    ]  }'

Response Examples

Sample response payloads generated from the OpenAPI schema.

{
  "id": "ord_01HQZ6Q3F1WB4G3WQ7D6A0S9R9",
  "subMid": "100000000000002",
  "orderNo": "WEB-ORDER-10001",
  "mode": "HOSTED",
  "subject": "FOMO Pay Demo Order",
  "description": "Hosted checkout example",
  "amount": "10.00",
  "currencyCode": "SGD",
  "status": "CREATED",
  "createdAt": 1711977000,
  "notifyUrl": "https://merchant.example.com/payments/notify",
  "returnUrl": "https://merchant.example.com/payments/return",
  "backUrl": "https://merchant.example.com/payments/cancel",
  "primaryTransactionId": "txn_01HQZ6T50Y7Y8FQ40R8Q9MZ7XM",
  "url": "https://pay.fomopay.net/redirect/ord_01HQZ6Q3F1WB4G3WQ7D6A0S9R9"
}

{
  "id": "ord_01HQZ6Q3F1WB4G3WQ7D6A0S9R9",
  "subMid": "100000000000002",
  "orderNo": "WEB-ORDER-10001",
  "mode": "HOSTED",
  "subject": "FOMO Pay Demo Order",
  "description": "Hosted checkout example",
  "amount": "10.00",
  "currencyCode": "SGD",
  "status": "CREATED",
  "createdAt": 1711977000,
  "notifyUrl": "https://merchant.example.com/payments/notify",
  "returnUrl": "https://merchant.example.com/payments/return",
  "backUrl": "https://merchant.example.com/payments/cancel",
  "primaryTransactionId": "txn_01HQZ6T50Y7Y8FQ40R8Q9MZ7XM",
  "url": "https://pay.fomopay.net/redirect/ord_01HQZ6Q3F1WB4G3WQ7D6A0S9R9"
}

{
  "hint": "req_01HQZ6PXG1PF1R2S1P33H0M2KJ",
  "code": "INVALID_REQUEST",
  "message": "orderNo already exists"
}
{
  "hint": "string",
  "code": "string",
  "message": "string"
}
{
  "hint": "string",
  "code": "string",
  "message": "string"
}
{
  "hint": "string",
  "code": "string",
  "message": "string"
}
{
  "hint": "string",
  "code": "string",
  "message": "string"
}
{
  "hint": "string",
  "code": "string",
  "message": "string"
}
{
  "hint": "string",
  "code": "string",
  "message": "string"
}

6.3 Query an Order

Request

Request Metadata

NameValue
URLhttps://ipg.fomopay.net/api/orders/[orderId]
(Please replace [orderId] with id obtained in order creation response. Please note orderNo is different from orderId.)
MethodGET
GET
/api/orders/{orderId}

Authorization

Authorization
Authorization<token>

Set to Basic <Base64(MID:PSK)>.

In: header

Path Parameters

orderId*string

Please replace [orderId] with id obtained in order creation response. Please note orderNo is different from orderId.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

Example:

Request Examples

HTTP request code snippets for this endpoint.

curl -X GET "https://ipg.fomopay.net/api/orders/string"

Response Examples

Sample response payloads generated from the OpenAPI schema.

{
  "id": "ord_01HQZ8BMN9KQXFM5T7RM0Q45Q0",
  "subMid": "100000000000002",
  "orderNo": "WEB-ORDER-10002",
  "mode": "DIRECT",
  "subject": "Direct payment example",
  "description": "Direct mode payment",
  "amount": "10.00",
  "currencyCode": "SGD",
  "status": "SUCCESS",
  "createdAt": 1711977300,
  "notifyUrl": "https://merchant.example.com/payments/notify",
  "returnUrl": "https://merchant.example.com/payments/return",
  "primaryTransactionId": "txn_01HQZ8CVAJX0B1AAYTRM4Q2FRJ",
  "url": "https://pay.fomopay.net/card/3ds/ord_01HQZ8BMN9KQXFM5T7RM0Q45Q0",
  "threeDSecure": true
}
{
  "hint": "string",
  "code": "string",
  "message": "string"
}
{
  "hint": "string",
  "code": "string",
  "message": "string"
}
{
  "hint": "req_01HQZ8M7SC7V7SCMNH3DG7J8WW",
  "code": "ORDER_NOT_FOUND",
  "message": "orderId does not exist"
}
{
  "hint": "string",
  "code": "string",
  "message": "string"
}
{
  "hint": "string",
  "code": "string",
  "message": "string"
}

6.4 Create a Refund Transaction

Request

Request Metadata

NameValue
URLhttps://ipg.fomopay.net/api/orders/[orderId]/transactions
(Please replace [orderId] with id obtained in order creation response. Please note orderNo is different from orderId.)
MethodPOST/PUT
Content-Typeapplication/json
⚠️Connection error might occur during transaction creation. Do NOT create another transaction yet. Instead, retry using PUT method with the same requesting JSON to avoid duplicate refund. Multiple POST requests with the same transactionNo will result in HTTP 409 error.
POST
/api/orders/{orderId}/transactions

Authorization

Authorization
Authorization<token>

Set to Basic <Base64(MID:PSK)>.

In: header

Path Parameters

orderId*string

Please replace [orderId] with id obtained in order creation response. Please note orderNo is different from orderId.

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

Example:

Request Examples

HTTP request code snippets for this endpoint.

curl -X POST "https://ipg.fomopay.net/api/orders/string/transactions" \  -H "Content-Type: application/json" \  -d '{    "type": "REFUND",    "originalId": "txn_01HQZ8CVAJX0B1AAYTRM4Q2FRJ",    "transactionNo": "REFUND-10001",    "amount": "10.00",    "currencyCode": "SGD",    "subject": "Refund for order WEB-ORDER-10001"  }'

Response Examples

Sample response payloads generated from the OpenAPI schema.

{
  "id": "txn_01HQZ9M3DHK9C6SJQ5RHB94W8M",
  "type": "REFUND",
  "originalId": "txn_01HQZ8CVAJX0B1AAYTRM4Q2FRJ",
  "transactionNo": "REFUND-10001",
  "subject": "Refund for order WEB-ORDER-10001",
  "status": "CREATED",
  "createdAt": 1711977600,
  "amount": "10.00",
  "currencyCode": "SGD"
}
{
  "id": "txn_01HQZ9M3DHK9C6SJQ5RHB94W8M",
  "type": "REFUND",
  "originalId": "txn_01HQZ8CVAJX0B1AAYTRM4Q2FRJ",
  "transactionNo": "REFUND-10001",
  "subject": "Refund for order WEB-ORDER-10001",
  "status": "CREATED",
  "createdAt": 1711977600,
  "amount": "10.00",
  "currencyCode": "SGD"
}
{
  "hint": "req_01HQZ9H3A0N4X5P5A3D5SPX29V",
  "code": "REFUND_AMOUNT_EXCEEDED",
  "message": "refund amount exceeds remaining refundable amount"
}
{
  "hint": "string",
  "code": "string",
  "message": "string"
}
{
  "hint": "string",
  "code": "string",
  "message": "string"
}
{
  "hint": "string",
  "code": "string",
  "message": "string"
}
{
  "hint": "string",
  "code": "string",
  "message": "string"
}
{
  "hint": "string",
  "code": "string",
  "message": "string"
}
{
  "hint": "string",
  "code": "string",
  "message": "string"
}
{
  "hint": "string",
  "code": "string",
  "message": "string"
}
{
  "hint": "string",
  "code": "string",
  "message": "string"
}

6.5 Query a Transaction

Request (For SALE/REFUND/DISPUTE transactions)

Request Metadata

NameValue
URLhttps://ipg.fomopay.net/api/orders/[orderId]/transactions/[transactionId]
(Please replace [orderId] with id obtained in order creation response, [transactionId] with id obtained in transaction creation response. Please note orderNo is different from orderId and transactionNo is different from transactionId.)
MethodGET
GET
/api/orders/{orderId}/transactions/{transactionId}

Authorization

Authorization
Authorization<token>

Set to Basic <Base64(MID:PSK)>.

In: header

Path Parameters

orderId*string

Please replace [orderId] with id obtained in order creation response. Please note orderNo is different from orderId.

transactionId*string

Please replace [transactionId] with id obtained in transaction creation response. Please note transactionNo is different from transactionId.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

Example:

Request Examples

HTTP request code snippets for this endpoint.

curl -X GET "https://ipg.fomopay.net/api/orders/string/transactions/string"

Response Examples

Sample response payloads generated from the OpenAPI schema.

{
  "id": "txn_01HQZ9M3DHK9C6SJQ5RHB94W8M",
  "type": "REFUND",
  "originalId": "txn_01HQZ8CVAJX0B1AAYTRM4Q2FRJ",
  "transactionNo": "REFUND-10001",
  "subject": "Refund for order WEB-ORDER-10001",
  "status": "SUCCESS",
  "createdAt": 1711977600,
  "amount": "10.00",
  "currencyCode": "SGD",
  "sourceOfFund": "CARD"
}
{
  "hint": "string",
  "code": "string",
  "message": "string"
}
{
  "hint": "string",
  "code": "string",
  "message": "string"
}
{
  "hint": "string",
  "code": "string",
  "message": "string"
}
{
  "hint": "req_01HQZAGD7B2PQJ4GH9T2NEV5CS",
  "code": "TRANSACTION_NOT_FOUND",
  "message": "transactionId does not exist"
}
{
  "hint": "string",
  "code": "string",
  "message": "string"
}
{
  "hint": "string",
  "code": "string",
  "message": "string"
}
{
  "hint": "string",
  "code": "string",
  "message": "string"
}

6.6 Retrieve Orders

Request

Request Metadata

ParameterFormatImportant Notes
filterJSON object converted to stringSupported keys are since, till, id, orderNo, mode, and status. till must be greater than since and no more than 180 days later.
rangeJSON list converted to stringFormat is [begin,end]. end must be greater than begin and no more than begin + 100.
sortJSON list converted to stringMust be ["createdAt","ASC"] or ["createdAt","DESC"].

Query Encoding Example

Raw filter{"since":1577808000,"till":1577894400,"status":"SUCCESS"}
Raw range[20,30]
Raw sort["createdAt","ASC"]
URL-encoded filter%7B%22since%22%3A1577808000%2C%22till%22%3A1577894400%2C%22status%22%3A%22SUCCESS%22%7D
URL-encoded range%5B20%2C30%5D
URL-encoded sort%5B%22createdAt%22%2C%22ASC%22%5D
Final URLhttps://ipg.fomopay.net/api/orders?filter=%7B%22since%22%3A1577808000%2C%22till%22%3A1577894400%2C%22status%22%3A%22SUCCESS%22%7D&amp;range=%5B20%2C30%5D&amp;sort=%5B%22createdAt%22%2C%22ASC%22%5D
GET
/api/orders

Authorization

Authorization
Authorization<token>

Set to Basic <Base64(MID:PSK)>.

In: header

Query Parameters

filter*string

JSON object converted to string. Supported keys are:

  • since: Only take orders created after this time (inclusive)
  • till: Only take orders created before this time (exclusive). Must be greater than since and no more than since plus 180 days
  • id: Unique order ID generated by FOMO Pay, can be used for query
  • orderNo: Order number generated by merchant
  • mode: One of HOSTED and DIRECT
  • status: See Appendix 2
range*string

JSON list converted to string.

  • 0: Number of orders to skip
  • 1: Number of orders to skip plus number of orders to take. Must be greater than begin value and no more than begin value plus 100
sort*string

JSON list converted to string.

  • 0: Must be createdAt
  • 1: One of ASC and DESC

Response Body

application/json

application/json

application/json

application/json

application/json

Example:

Request Examples

HTTP request code snippets for this endpoint.

curl -X GET "https://ipg.fomopay.net/api/orders?filter=%7B%22since%22%3A1577808000%2C%22till%22%3A1577894400%2C%22status%22%3A%22SUCCESS%22%7D&range=%5B20%2C30%5D&sort=%5B%22createdAt%22%2C%22ASC%22%5D"

Response Examples

Sample response payloads generated from the OpenAPI schema.

[
  {
    "id": "ord_01HQZ8BMN9KQXFM5T7RM0Q45Q0",
    "subMid": "100000000000002",
    "orderNo": "WEB-ORDER-10002",
    "mode": "DIRECT",
    "subject": "Direct payment example",
    "description": "Direct mode payment",
    "amount": "10.00",
    "currencyCode": "SGD",
    "status": "SUCCESS",
    "createdAt": 1711977300,
    "notifyUrl": "https://merchant.example.com/payments/notify",
    "returnUrl": "https://merchant.example.com/payments/return",
    "primaryTransactionId": "txn_01HQZ8CVAJX0B1AAYTRM4Q2FRJ",
    "url": "https://pay.fomopay.net/card/3ds/ord_01HQZ8BMN9KQXFM5T7RM0Q45Q0",
    "threeDSecure": true
  }
]
{
  "hint": "string",
  "code": "string",
  "message": "string"
}
{
  "hint": "string",
  "code": "string",
  "message": "string"
}
{
  "hint": "string",
  "code": "string",
  "message": "string"
}
{
  "hint": "string",
  "code": "string",
  "message": "string"
}
Response HeaderValue
Content-Typeapplication/json
Content-Rangeorders [begin]-[end]/[total]

6.7 Retrieve Transactions in an Order

Request

Request Metadata

ParameterFormatImportant Notes
filterJSON object converted to stringSupported keys are id, transactionNo, type, and status.
rangeJSON list converted to stringFormat is [begin,end]. end must be greater than begin and no more than begin + 100.
sortJSON list converted to stringMust be ["createdAt","ASC"] or ["createdAt","DESC"].

Query Encoding Example

Raw filter{"type":"REFUND","status":"SUCCESS"}
Raw range[5,10]
Raw sort["createdAt","ASC"]
URL-encoded filter%7B%22type%22%3A%22REFUND%22%2C%22status%22%3A%22SUCCESS%22%7D
URL-encoded range%5B5%2C10%5D
URL-encoded sort%5B%22createdAt%22%2C%22ASC%22%5D
Final URLhttps://ipg.fomopay.net/api/orders/100500020200101000000000/transactions?filter=%7B%22type%22%3A%22REFUND%22%2C%22status%22%3A%22SUCCESS%22%7D&amp;range=%5B5%2C10%5D&amp;sort=%5B%22createdAt%22%2C%22ASC%22%5D
GET
/api/orders/{orderId}/transactions

Authorization

Authorization
Authorization<token>

Set to Basic <Base64(MID:PSK)>.

In: header

Path Parameters

orderId*string

Please replace [orderId] with id obtained in order creation response. Please note orderNo is different from orderId.

Query Parameters

filter*string

JSON object converted to string. Supported keys are:

  • id: Unique transaction ID generated by FOMO Pay, can be used for query
  • transactionNo: Transaction number generated by merchant
  • type: One of SALE, REFUND and DISPUTE
  • status: See Appendix 3
range*string

JSON list converted to string.

  • 0: Number of transactions to skip
  • 1: Number of transactions to skip plus number of transactions to take. Must be greater than begin value and no more than begin value plus 100
sort*string

JSON list converted to string.

  • 0: Must be createdAt
  • 1: One of ASC and DESC

Response Body

application/json

application/json

application/json

application/json

Example:

Request Examples

HTTP request code snippets for this endpoint.

curl -X GET "https://ipg.fomopay.net/api/orders/string/transactions?filter=%7B%22type%22%3A%22REFUND%22%2C%22status%22%3A%22SUCCESS%22%7D&range=%5B5%2C10%5D&sort=%5B%22createdAt%22%2C%22ASC%22%5D"

Response Examples

Sample response payloads generated from the OpenAPI schema.

[
  {
    "id": "txn_01HQZ9M3DHK9C6SJQ5RHB94W8M",
    "type": "REFUND",
    "originalId": "txn_01HQZ8CVAJX0B1AAYTRM4Q2FRJ",
    "transactionNo": "REFUND-10001",
    "subject": "Refund for order WEB-ORDER-10001",
    "status": "SUCCESS",
    "createdAt": 1711977600,
    "amount": "10.00",
    "currencyCode": "SGD",
    "sourceOfFund": "CARD"
  }
]
{
  "hint": "string",
  "code": "string",
  "message": "string"
}
{
  "hint": "string",
  "code": "string",
  "message": "string"
}
{
  "hint": "string",
  "code": "string",
  "message": "string"
}
Response HeaderValue
Content-Typeapplication/json
Content-Rangetransactions [begin]-[end]/[total]

6.8 Create Token for Credit Card

Request

NameValue
URLhttps://ipg.fomopay.net/api/tokens?channel=CARD&amp;subMid=[subMID]
[subMID] is an optional field.
MethodPOST
Content-Typeapplication/json

Request Body

KeyField NameField TypeRequiredComments
typeTokenization TypestringMMust be CARD
cardCard DetailsstringM[See Appendix 5 Note 13]

Example Request Body

{
  "type": "card",
  "card": {
    "number": "4417123456789113",
    "expiryYear": "28",
    "expiryMonth": "08",
    "nameOnCard": "First Last Name"
  }
}

Response

Response Body

KeyField NameField TypeRequiredComments
idToken IDstringM
typeTokenization TypestringMMust be CARD
cardCard DetailsstringM[See Appendix 5 Note 13]

Response Status Code

HTTP status codeComments
200Successful
201Created
400Bad Request
401Unauthorized Access
429Too Many Requests
500Server Error

Example Response Body

{
  "id": "c19JQHRQyWvgVNKPevtt25fR1p",
  "type": "card",
  "card": {
    "number": "441712xxxxxx9113",
    "expiryYear": "28",
    "expiryMonth": "08",
    "nameOnCard": "First Last Name"
  }
}

6.9 Get Token

Request

NameValue
URLhttps://ipg.fomopay.net/api/tokens/[tokenId]?channel=CARD&amp;subMid=[subMID]
[subMID] is an optional field.
MethodPOST
Content-Typeapplication/json

Request Body

N/A

Response

Response Body

KeyField NameField TypeRequiredComments
idToken IDstringM
typeTokenization TypestringMMust be card
cardCard DetailsstringM[See Appendix 5 Note 13]

Response Status Code

HTTP status codeComments
200Successful
201Created
400Bad Request
401Unauthorized Access
429Too Many Requests
500Server Error

6.10 Delete Token

Request

NameValue
URLhttps://ipg.fomopay.net/api/tokens/[tokenId]?channel=CARD&amp;subMid=[subMID]
[subMID] is an optional field.
MethodDELETE
Content-Typeapplication/json

Request Body

N/A

Response

Response Body

N/A

Response Status Code

HTTP status codeComments
204No Content
400Bad Request
401Unauthorized Access
429Too Many Requests
500Server Error

7. Transaction Status Update Notification

A transaction status update will be sent to client server when any transaction status has changed.

7.1 Security

⚠️HTTP header field (aka header key) is case-insensitive (https://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.2). While FOMO Pay will try to ensure header fields (not header value) in lower case, please make sure your code will also work when you see header fields in upper case.

FOMO Pay will send notification to webhook URL using HTTP POST method in the following format:

Headers
FieldValue
Content-Type
X-FOMOPay-Authorization
application/json
FOMOPAY1-HMAC-SHA256 <HMACCredentials>
Body
<payload>

The <HMACCredentials> is in following format (field order might change):

Version=1.1,Credential=<MID>,Nonce=<Nonce>,Timestamp=<Timestamp>,Signature=<Signature>

The verification algorithm is as follows:

  1. Client extracts the following HTTP headers from HTTP request.
Version[version]
Credential[credential]
Nonce[nonce]
Timestamp[timestamp]
Signature[signature]
  1. If one or more conditions of the following does not satisfy, reject the request.
  • [version] is 1.1
  • [credential] is your <MID>
  • [nonce] has a length between 16-64 and was not used by gateway notification within 300 seconds
  • [timestamp] (UNIX timestamp in seconds) within ±300 seconds of current time
  1. Client reads request body [payload] from HTTP request.
  2. Client concatenates [payload], [timestamp] and [nonce] to get string [message] to be verified.
  3. Client calculate signature (in lowercase hexadecimal) with HMAC-SHA256 using <PSK> as key and [message] as message.
  4. Reject if the calculated signature does not match [signature].

Example:

Merchant setup:

KeyValue
<MID>100000000000001
<PSK>E00F270DE323E2B187532D8E4B306EB2841AF0BFF08132BAB7F0E62BED6419BB

Notification received at notifyUrl:

Assume current time is 1/Jan/2020 00:02 (GMT+8)

Headers (irrelevant headers omitted)
FieldValue
content-type
x-fomopay-authorization
application/json
FOMOPAY1-HMAC-SHA256 Version=1.1,Credential=100000000000001,Nonce=b39c7ec8fa58be1041eb3921c9ceb98b,Timestamp=1577808000,Signature=596ecb8f2636ff88eea7b4d4b4841ae822eaa4f1eea9cb1ce1da2953c9db0b05
Body
{"orderId":"100500020200101000000000","orderNo":"order-20200101-000005","transactionId":"100510120200101000000000","transactionNo":"partialrefund-02"}

Verification:

  1. Client extracts the following data from HTTP request.
[version] = 1.1
[credential] = 100000000000001
[nonce] = b39c7ec8fa58be1041eb3921c9ceb98b
[timestamp] = 1577808000
[signature] = 596ecb8f2636ff88eea7b4d4b4841ae822eaa4f1eea9cb1ce1da2953c9db0b05
  1. Verify the following conditions.
  • [version] is 1.1 (true)
  • [credential] is your <MID> (true)
  • [nonce] has a length between 16-64 and was not used by gateway notification within 300 seconds (true)
  • [timestamp] (UNIX timestamp in seconds) within ±300 seconds of current time (true)
  1. Client reads request body [payload] from HTTP request (please DO NOT parse the JSON).
{"orderId":"100500020200101000000000","orderNo":"order-20200101-000005","transactionId":"100510120200101000000000","transactionNo":"partialrefund-02"}
  1. Client concatenates [payload], [timestamp] and [nonce] to get string [message] to be verified.
{"orderId":"100500020200101000000000","orderNo":"order-20200101-000005","transactionId":"100510120200101000000000","transactionNo":"partialrefund-02"}1577808000b39c7ec8fa58be1041eb3921c9ceb98b
  1. Client calculates signature (in lowercase hexadecimal) with HMAC-SHA256 using <PSK> as key and [message] as message.
Calculated signature = 596ecb8f2636ff88eea7b4d4b4841ae822eaa4f1eea9cb1ce1da2953c9db0b05
  1. Reject if the calculated signature does not match [signature].

Calculated signature matches the [signature] received. Merchant server shall reply with HTTP 200 OK immediately at this point. Please continue your business logic after the reply is sent.

7.2 Notification Request

POST notifyUrl
Content-Type: application/json

notifyUrl is in order creation request.

KeyField NameField TypeRequiredComments
orderIdFOMO Pay order IDstringMFOMO Pay ID of the order containing the transaction
orderNoMerchant order numberstringMMerchant order number of the order containing the transaction
transactionIdFOMO Pay transaction IDstringMTransaction ID that triggered the notification
transactionNoMerchant transaction numberstringOMerchant transaction number for merchant created transactions. Not applicable otherwise

7.3 Notification Response

HTTP Status Code

200

⚠️Client must respond with HTTP status code 200 as early as possible before any other processing logic. Gateway will retry immediately for up to 3 times when HTTP status code is not 200, response not received in 20 seconds, connection dropped or response body too large. Gateway will suspend (for 5 minutes) sending notification to client if more than 3 notifications fail (notifications for same transaction is counted only once) in 1 minute. All notifications during suspension will be discarded.

HTTP redirection will NOT be followed. HTTP status code 301 (Moved Permanently) or 302 (Found) will be considered as notification failure.

HTTP status code 204 (No Content) will also be considered as notification failure.

Response HTTP body shall not exceed 5 KiB in size, its content will be ignored.

Merchant server shall query latest order status / transaction status using orderId and transactionId received depending on needs.

8. Fraud Detection

⚠️Fraud detection is only enabled for merchants who are classified as high-risk by FOMO Pay.
Merchants who are not classified as high-risk can skip this section.

High-risk merchants who need to process card payments and perform fraud detection might be required to provide the following fields, and we will handle the fraud detection process.

This section is intended to provide specific clarification on the fraud detection process. These fields are specifically highlighted here as they are required for enabling fraud detection. For detailed parameter integration, please refer to Appendices 9.4 and 9.5.

8.1 Direct Mode

Transaction Options
KeyField TypeRequiredComments
payerEmailstringMPayer's email.
payerUserAgentstringMPayer's browser information.
See appendix 9.7 - PayerUserAgent
shippingAddressobjectORequired for physical goods; provides shipping details.
See appendix 9.6 - TPaymentAddress
payerIPstringM

8.2 Hosted Mode

Transaction Options
KeyField TypeRequiredComments
payerEmailstringMPayer's email.

9. Appendix

9.1 List of Source of Fund

⚠️Depending on your arrangement with FOMO Pay, your account might not have all the following source of funds.
Source of FundComment
ALIPAYAlipay. Supported types:
  • WEB (Web payment)
  • WAP (Wap payment)
  • APP (In-App payment)
  • MINI_APP (Mini-program payment)
CARDCard payment. Supported card brands:
  • Visa
  • Mastercard
  • American Express
  • Discover
  • Diners Club International
BROWSERBrowser payment. Supported types:
  • Apple Pay
  • Google Pay
  • Microsoft Pay

Other browser payments conforming to Payment Request API
NETSPAYNETS QR code payment
WECHATPAYWeChat Pay. Supported types:
  • NATIVE (QR code payment)
  • JSAPI (Web payment in WeChat App)
  • APP (In-App payment)
  • WXA (Mini-program payment)
  • MWEB (H5 payment)
UNIONPAYUnionPay online payment (UPOP)
GRABPAYGrabPay web payment
PAYNOWPayNow QR code payment
SHOPEEPAYShopeePay. Supported types:
  • MPM (Merchant presented QR code payment)
  • APP (In-App payment or mobile web payment)
ATOMEAtome (3 interest-free installments)
DPTDigital Payment Token payment. Supported types:
  • BTC (Bitcoin)
  • ETH (Ethereum)
  • USDT (Tether, via Ethereum/ERC20 or Tron/TRC20)
  • USDC (USD Coin, via Ethereum/ERC20 or Tron/TRC20)
PAYPALCheckout with PayPal

9.2 Order Status

StatusComment
CREATEDOrder has been created and is ready for payment or payment is being processed
FAILOrder has failed due to linked primary SALE transaction (as indicated in primaryTransactionId) failed
ERRORThe order is in a status that cannot be recovered automatically, please contact FOMO Pay
SUCCESSOrder has been paid successfully and no refund has been created (for primary transaction). Related SALE transaction is indicated in primaryTransactionId
REFUNDOrder has been previously paid successfully and its primary transaction (as indicated in primaryTransactionId) has now been (partially) refunded
CLOSEDOrder is closed, no new SALE transaction can be created

9.3 Transaction Status

StatusComment
CREATEDFor type SALE:
Transaction has been created and waiting for payment or payment is being processed. Please DO NOT create another payment yet to avoid duplicate charge
For type REFUND:
Refund has been submitted and is being processed. Please DO NOT create another refund yet to avoid duplicate refund
FAILFor type SALE:
Payment failed. Any charges will be automatically reversed or refunded if already captured
For type REFUND:
Refund failed
ERRORThe transaction is in a status that cannot be recovered automatically, please contact FOMO Pay
SUCCESSFor type SALE:
Transaction has been captured successfully
For type REFUND:
Transaction has been refunded successfully
REFUNDFor type SALE:
Transaction was previously paid successfully and there are refund transactions created for this sale transactions (does not indicate if the refund transactions are successful)
For type REFUND:
Not applicable
CLOSEDFor type SALE:
Transaction is closed (e.g. transaction not paid within timeout)
For type REFUND:
Not applicable
VOIDFor type SALE:
Transaction has been voided
For type REFUND:
Not applicable

9.4 Transaction Options (HOSTED mode)

⚠️Missing transactionOptions while creating a HOSTED mode order will not fail order creation. However, when a customer selects a payment method which requires corresponding transactionOptions, the payment will fail. Other payment methods (if any) will not be affected if they don’t require any transactionOptions.
SourceOfFundTransaction Options
KeyField TypeRequiredComment
ATOMEpayerNamestringMPayer full name
payerEmailstringOPayer email address
payerPhonestringMPayer phone number
shippingAddressobjectM[Note 1]
billingAddressobjectM[Note 1]
paymentItemsobject[]M[Note 1]
DPT[Note 2]---
PAYPALshippingAddressobjectO[Note 1]
paymentItemsobject[]O[Note 1]
CARD(Fraud Detection)payerEmailstringMPayer email address

[1] Please find below for data types for each key.

KeyField Type
shippingAddressSee Appendix 6 - TPaymentAddress
billingAddressSee Appendix 6 - TPaymentAddress
paymentItemsSee Appendix 6 - TPaymentItem

[2] Please approach FOMO Pay for detailed KYC requirements.

9.5 Transaction Options (DIRECT mode)

SourceOfFundTransaction Options
Response Fields
KeyField TypeRequiredCommentthreeDSecureurlcodeUrl
ALIPAY
(WEB)
txnTypestringMWEBXMX
timeoutnumberM60-7200
ALIPAY
(WAP)
txnTypestringMWAPXMX
osTypestringMOne of
IOS
ANDROID
timeoutnumberM60-7200
ALIPAY
(APP)
txnTypestringMAPP[Note 10]
osTypestringMOne of
IOS
ANDROID
timeoutnumberM60-7200
ALIPAY
(MINI_APP)
txnTypestringMMINI_APP[Note 11]
paymentMethodTypestringM[Note 9]
timeoutnumberM60-7200
CARDtimeoutnumberM60-7200MCX
expiryYearstringM00-99
expiryMonthstringM1-12 [Note 1]
nameOnCardstringM
numberstringM
securityCodestringM
ipstringMCustomer IP
threeDSecurestringOOne of
enforced
auto
disabled
[Note 2]
CARD (Fraud Detection)timeoutnumberM60-7200
expiryYearstringM00-99
expiryMonthstringM1-12 [Note 1]
nameOnCardstringM
numberstringM
securityCodestringM
ipstringMCustomer IP
threeDSecurestringOOne of
enforced
auto
disabled
[Note 2]
payerUserAgentstringMSee Appendix 9.7
payerIPstringM
payerNamestringO
payerEmailstringMPayer email address
payerPhonestringO
shippingAddressobjectO[Note 8]
billingAddressobjectO[Note 8]
paymentItemsobject[]O[Note 8]
payerTypestringO[Note 16]
payerobjectC[Note 17]
CARD
(CIT Format)
timeoutnumberM60-7200
ipstringMCustomer IP
threeDSecurestringOOne of enforced
auto
disabled
[Note 2]
txnTypestringMREGULAR
[Note 12]
cardobjectC[Note 13]
tokenobjectC[Note 13]
CARD
(CIT Format and Fraud Detection)
timeoutnumberM60-7200
ipstringMCustomer IP
threeDSecurestringOOne of enforced
auto
disabled
[Note 2]
txnTypestringMREGULAR
[Note 12]
cardobjectC[Note 13]
tokenobjectC[Note 13]
payerUserAgentstringMSee Appendix 9.7
payerIPstringM
payerNamestringO
payerEmailstringMPayer email address
payerPhonestringO
shippingAddressobjectO[Note 8]
billingAddressobjectO[Note 8]
paymentItemsobject[]O[Note 8]
payerTypestringO[Note 16]
payerobjectC[Note 17]
CARD
(MIT Format)
[Note 15]
timeoutnumberM60-7200
ipstringMCustomer IP
threeDSecurestringC[Note 14]
txnTypestringCOne of RECURRING
UNSCHEDULED
cardobjectC[Note 13]
tokenobjectC[Note 13]
merchantInitiated booleanC[Note 14]
merchantInitiatedReasonstringC[Note 14]
originalIdstringC[Note 14]
CARD
(MIT Format and Fraud Detection)
[Note 15]
timeoutnumberM60-7200
ipstringMCustomer IP
threeDSecurestringC[Note 14]
txnTypestringCOne of RECURRING
UNSCHEDULED
cardobjectC[Note 13]
tokenobjectC[Note 13]
merchantInitiated booleanC[Note 14]
merchantInitiatedReasonstringC[Note 14]
originalIdstringC[Note 14]
payerUserAgentstringMSee Appendix 9.7
payerIPstringM
payerNamestringO
payerEmailstringMPayer email address
payerPhonestringO
shippingAddressobjectO[Note 8]
billingAddressobjectO[Note 8]
paymentItemsobject[]O[Note 8]
payerTypestringO[Note 16]
payerobjectC[Note 17]
NETSPAYtimeoutnumberM60-7200XMX
WECHATPAY
(NATIVE)
txnTypestringMNATIVEXXM
timeoutnumberM60-7200
WECHATPAY
(JSAPI)
txnTypestringMJSAPIXMX
timeoutnumberM60-7200
openidstringM[Note 3]
openidEncryptedbooleanODefault false
[Note 3]
ipstringMCustomer IP
openidTypestringOValues: auto (default), primary, secondary
WECHATPAY
(APP)
txnTypestringMAPP[Note 4]
timeoutnumberM60-7200
WECHATPAY
(WXA)
txnTypestringMWXA[Note 5]
timeoutnumberM60-7200
openidstringM[Note 3]
WECHATPAY
(MWEB)
txnTypestringMMWEBXMX
timeoutnumberM60-7200
ipstringMCustomer IP
UNIONPAY
(WEB)
txnTypestringMWEBXMX
timeoutnumberM60-7200
UNIONPAY
(QRCODE)
txnTypestringMQRCODEXXM
timeoutnumberM60-7200
GRABPAYtimeoutnumberM60-7200XMX
PAYNOWtimeoutnumberM60-7200XXM
SHOPEEPAY
(MPM)
txnTypestringMMPMXXM
timeoutnumberM60-7200
SHOPEEPAY
(APP)
txnTypestringMAPP[Note 6]
timeoutnumberM60-3600
platformTypestringMOne of
app
pc
mweb
ATOMEtimeoutnumberM60-7200XMX
payerNamestringMFull name
payerEmailstringOEmail address
payerPhonestringMPhone number
shippingAddressobjectM[Note 8]
billingAddressobjectM[Note 8]
paymentItemsobject[]M[Note 8]
DPTtimeoutnumberM60-7200XMX
[Note 7]---
PAYPALtxnTypestringMWEBXMX
timeoutnumberM60-7200
shippingAddressobjectO[Note 8]
paymentItemsobject[]O[Note 8]

[*] Please include returnUrl in request if url in Response Fields is mandatory or conditional.

[*] Transaction timeout may not work with some of the source of funds due to the following reasons. Do not infer transaction status even if the transaction appears to be timed out. Instead, always use transaction status retrieved from FOMO Pay.

  • Some sourceOfFunds use different start time from order creation time for timeout calculations (which renders timeouts less useful)
  • Some sourceOfFunds accept timeouts but do not follow timeouts accurately
  • Some sourceOfFunds do not accept timeouts at all

[1] Zero-padding or leading zero is a valid and supported convention for representing months. E.g. Both “8” and “08” (for August) are supported.

[2] Description of 3-D Secure Options.

OptionComment
auto(Default to this value if not provided.) The merchant chooses to use FOMO Pay 3-D Secure rules.
Response threeDSecure flag can be true or false depending on evaluation result.
(Indicative Mode only: Indicates merchant has no preference on 3-D Secure, check threeDSecure in response for final decision.)
enforcedRequires customers complete 3-D Secure challenge before pre-authorization. Reject the payment if the customer fails to complete the challenge or 3-D Secure is not supported by the card issuer.
Response threeDSecure will be true.
(Indicative Mode only: Indicates merchant prefers payment with 3-D Secure enabled, check threeDSecure in response for final decision.)
disabledIndicates the payment shall be pre-authorized without 3-D Secure challenge. Reject the payment if 3-D Secure is required by the card issuer.
Response threeDSecure will be false.
(Indicative Mode only: Indicates merchant prefers payment with 3-D Secure disabled, check threeDSecure in response for final decision.)

[3] Please approach FOMO Pay for configuration and instructions on getting openid.

[4] Response field will be an object named payReq in the following format.

KeyField NameField TypeRequiredComments
appidWeChat App IDstringMPlease approach FOMO Pay for App ID binding
partneridWeChat MIDstringMPlease approach FOMO Pay for MID registration or binding
prepayidPrepay session IDstringM
packageExtended datastringM
noncestrCryptographic noncestringM
timestampUnix timestampstringM
signSignaturestringM

[5] Response field will be an object named payReq in the following format.

KeyField NameField TypeRequiredComments
appidWeChat App IDstringMPlease approach FOMO Pay for App ID binding
timestampUnix timestampstringM
noncestrCryptographic noncestringM
packageExtended datastringM
signTypeHashing algorithm used for signingstringM
paysignSignaturestringM

[6] Please include returnUrl in request. Response field will be an object named payReq in the following format.

KeyField NameField TypeRequiredComments
appMobile deep linkstringMMobile deep link to launch Shopee App
httpUniversal linkstringMRedirect to a web page which will detect and launch Shopee App if installed

[7] Please approach FOMO Pay for detailed KYC requirements.

[8] Please find data types below for each key.

KeyField Type
shippingAddressSee Appendix 6 - TPaymentAddress
billingAddressSee Appendix 6 - TPaymentAddress
paymentItemsSee Appendix 6 - TPaymentItem

[9] Please find the allowed paymentMethodType below.

paymentMethodTypeWallet that hosts the mini program
TRUEMONEYTrueMoney Wallet
ALIPAY_HKAlipayHK Wallet
TNGTouch 'n Go eWallet
ALIPAY_CNAlipayCN Wallet
GCASHGCash Wallet
DANADANA Wallet

[10] Response field will be an object named payReq in the following format.

KeyField NameField TypeRequiredComments
normalUrlPayment URLstringM(Non-SDK integration solution) The payment URL that redirects users to a WAP or Web page in the browser or in the WebView
paymentDataPayment data for SDKstringC(SDK integration solution) Returned if the merchant app has integrated the Alipay+ client SDK. Contains payment data that is used by the Alipay+ client SDK to render the checkout page

[11] Response field will be an object named payReq in the following format.

KeyField NameField TypeRequiredComments
normalUrlPayment datastringMPayment data for mini program

[12] txnType options will be based on whether a regular card transaction, customer-initiated transaction or a merchant-initiated transaction is done.

Nature of Transaction txnTypeComments
Customer-InitiatedREGULARFor customer-transaction with or without token either REGULAR or can leave field as undefined
Merchant-InitiatedRECURRINGFor eventual merchant-initiated transaction, starting from the first transaction must use either RECURRING or UNSCHEDULED
UNSCHEDULED

[13] Data types and fields for the card and token object. The card and token objects are used to initiate CIT or MIT transactions. It is recommended that only one; either the card or token object be sent at payload. If both are sent, the card object will take precedence to initiate the card transaction.

Card

KeyField TypeRequiredComments
numberstringM
expiryYearstringM00-99
expiryMonthstringMZero-padding is supported. 1-12.
securityCodestringO
nameOnCardstringO

Token

KeyField TypeRequiredComments
idstringMTokenized card details
securityCodestringO

[14] Additional fields and specification for threeDSecure field for MIT.

KeyField TypeRequiredComments
merchantInitiatedbooleanCMust be false for 1st transaction.
Must be true for subsequent transactions (2nd, 3rd, 4th etc.)
merchantInitiatedReasonstringCMust be present for subsequent transactions.
One of below:
DELAYED_CHARGE
RESUBMISSION
NO_SHOW
REAUTHORIZATION
originalIdstringCMust be present for subsequent transactions. This refers to the primaryTransactionId for the 1st transaction.
threeDSecurestringCMust be enforced for the 1st transaction.
Must be disabled for subsequent transactions.

[15] Sample request body for MITs

// 1st Transaction
// where threeDSecure is enforced and merchantInitiated is false
{
  "mode": "DIRECT",
  "orderNo": "TEST_MIT001",
  "subject": "FOMOPAY UAT TEST",
  "description": "FOMOPAY UAT TEST",
  "backUrl": "https://fomopay.com/",
  "returnUrl": "https://fomopay.com/",
  "notifyUrl": "http://localhost:443",
  "currencyCode": "SGD",
  "amount": "12.34",
  "sourceOfFund": "CARD",
  "transactionOptions": {
    "timeout": 300,
    "txnType": "RECURRING",
    "ip": "167.163.152.53",
    "threeDSecure": "enforced",
    "merchantInitiated": false,
    "token": {
      "id": "c1FbwzRxQ6xMj3EWvydzkV0SkA"
    }
  }
}
// 2nd Transaction and onwards
// where threeDSecure is disabled, merchantInitiated is true
// merchantInitiatedReason and originalId (primaryTransactionId of the 1st transaction) is required for 2nd transaction onwards
{
  "mode": "DIRECT",
  "orderNo": "TEST_MIT002",
  "subject": "FOMOPAY UAT TEST",
  "description": "FOMOPAY UAT TEST",
  "backUrl": "https://fomopay.com/",
  "returnUrl": "https://fomopay.com/",
  "notifyUrl": "http://localhost:443",
  "currencyCode": "SGD",
  "amount": "12.34",
  "sourceOfFund": "CARD",
  "transactionOptions": {
    "timeout": 300,
    "txnType": "RECURRING",
    "ip": "167.163.152.53",
    "threeDSecure": "disabled",
    "merchantInitiated": true,
    "merchantInitiatedReason": "NO_SHOW",
    "token": {
      "id": "c1FbwzRxQ6xMj3EWvydzkV0SkA"
    },
    "originalId": "100510020231010227133206"
  }
}

[16] Please find the allowed payerType below.

payerTypeComment
INDIVIDUALFields applicable for individual payers.
BUSINESSFields applicable for business payers.

[17] payer fields based on payerType.

payer
See Appendix 6 - TIndividual
See Appendix 6 - TBusiness

9.6 Data Types

TPaymentAddress

KeyField TypeRequiredComments
citystringMName of city or town
countrystringMCountry code in ISO-3166-1 alpha-2
dependentLocalitystringMName of dependent locality or sublocality within a city
organizationstringMName of the organization
phonestringMTelephone number of the recipient or contact person
postalCodestringMPostal code
recipientstringMName of the recipient, purchaser, or contact person at the payment address
regionstringMTop level administrative subdivision of the country, for example a state, province, oblast, or prefecture
addressLinestring[]MAn array of string providing each line of the address

TPaymentItem

KeyField TypeRequiredComments
labelstringMName of the item
amountobjectMPrice of items
[Note 1]
skustringMStock-keeping unit
quantitynumberMNumber of items

[1] Please see below for amount format.

KeyField NameField TypeRequiredComments
currencyCurrency codestringMISO 4217 currency code
e.g. SGD
Must use the same currency code as in order
valueAmountstringMTo lowest currency unit
e.g. 10.00 for SGD, 10 for JPY

TBusiness

KeyField TypeRequiredComments
namestringMName of the business
idobjectMSee Appendix 6 - TBusinessID
addressobjectMSee Appendix 6 - TBusinessAddress
placeOfIncorporationstringMPlace of incorporation

TBusinessID

KeyField TypeRequiredComments
typestringM"LEI","REGISTRATION_ID"
valuestringM
countryOfIssuestringMCountry code in ISO-3166-1 alpha-2

TBusinessAddress

KeyField TypeRequiredComments
citystringMName of city or town
countrystringMCountry code in ISO-3166-1 alpha-2
dependentLocalitystringOName of dependent locality or sublocality within a city
postalCodestringMPostal code
regionstringOTop level administrative subdivision of the country, for example a state, province, oblast, or prefecture
addressLinestring[]MAn array of string providing each line of the address

TIndividual

KeyField TypeRequiredComments
namestringMName
idobjectMSee Appendix 6 - TIndividualID
addressobjectMSee Appendix 6 - TIndividualAddress
dateOfBirthstringMe.g. 2012-12-01
placeOfBirthstringM

TIndividualID

KeyField TypeRequiredComments
typestringM"ID_CARD","PASSPORT"
valuestringM
countryOfIssuestringMCountry code in ISO-3166-1 alpha-2

TIndividualAddress

KeyField TypeRequiredComments
citystringMName of city or town
countrystringMCountry code in ISO-3166-1 alpha-2
dependentLocalitystringOName of dependent locality or sublocality within a city
postalCodestringMPostal code
regionstringOTop level administrative subdivision of the country, for example a state, province, oblast, or prefecture
addressLinestring[]MAn array of string providing each line of the address

9.7 PayerUserAgent

Payer's http user-agent.

e.g.

"Mozilla/5.0 (iPhone; CPU iPhone OS 17_6_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.6 Mobile/15E148 Safari/604.1"

9.8 returnUrl

The returnUrl parameter behaves differently for WeChatPay's JSAPI and MWEB integration modes.

1. JSAPI Mode:Optional

  • If provided:
    FOMO Pay will host a payment landing page. After the user completes the payment on this page, they will be redirected to the specified returnUrl.
  • If not provided:
    FOMO Pay will directly return the necessary parameters (TPayReqJsapi) for initiating the payment through WeChat's JSAPI. Merchants need to handle the payment flow using these parameters.

2. MWEB Mode:Not Supported

  • The returnUrl parameter cannot be passed in MWEB mode. If provided, the request will be rejected.

For other sources of fund, returnUrl in request should be included if url in Response Fields is mandatory or conditional. See appendix 9.5.

On this page