QR Ph API

How do I integrate QR Ph into my online checkout? How do I generate QR Ph codes for in-store use?

🚧

Account configuration is required before development

We need to configure your account before your developers can start testing and integration. Kindly message [email protected] to request for key configuration.

Overview

QR Ph is the Philippine's QR code standard supervised by the BSP and aims to provide a quick and secure way to accept payments from multiple banks and e-wallets, all using one QR Ph code.


Supported Banks, E-Wallets, Issuers

BankE-Wallets & Other Issuers
Asia United Bank Corporation (AUB)GCash (G-Xchange, Inc.)
Bank of the Philippine Islands (BPI)Maya Philippines, Inc.
BDO Unibank IncShopeePay Philippines, Inc.
Metropolitan Bank and Trust Company (MetroBank)GrabPay (Gpay Network PH, Inc.)
Philippine National Bank (PNB)PPS-PEPP Financial Services Corporation
Rizal Commercial Banking Corporation (RCBC)Starpay Corporation
Robinsons Bank CorporationTayoCash, Inc.
Security Bank CorporationTraxion Pay, Inc.
Union Bank of the Philippines (UBP)USSC Money Services, Inc.
China Banking CorporationZybi Tech, Inc.
Land Bank of the PhilippinesCIS Bayad Center, Inc.
AllBank (A Thrift Bank), Inc.DCPAY Philippines, Inc.
Queen City Development Bank, Inc. or QueenBank, A Thrift Bank
Sterling Bank of Asia, Inc. (A Savings Bank)
Philippine Savings Bank
Cebuana Lhuillier Rural Bank, Inc.
Rural Bank of Guinobatan, Inc.
SeaBank Philippines Inc. (A Rural Bank)
GoTyme Bank Corporation

Integrating QR Ph through the Payment Intent Workflow

The payment intent workflow is the main workflow used to make payments via PayMongo. Before getting started with integrating QR Ph, make sure that you are familiar with the payment intent workflow. To enable QR Ph, a few additional steps just needs to be added to the existing workflow.

Enabling QR Ph as a payment method for online use-case

1. Create a Payment Intent and include qrph under the payment_method_allowed array.

{
     "data": {
          "attributes": {
               "amount": 10000,
               "payment_method_allowed": [
                    "card",
                    "dob",
                    "paymaya",
                    "qrph" # add this

               ],
               # ...
          }
     }

  • In this step, set qrph as type in the request body. When using qrph, you only need to provide the address, name, email, and phone (optional) under billing .

3. Attach the payment method to the created payment intent as normal. Once the Payment Method is attached, the Payment Intent status transitions to awaiting_next_action .

4. Display the dynamic QRPH code on your front-end or checkout. The QRPH image is available on the /attach response under next_action.

{  
    "data": {  
        "id": "pi_uv6817kG7JbbvqJnSwE2uXsc",  
        "type": "payment_intent",  
        "attributes": {  
            "amount": 100000,  
            # ...  
            "payment_method_allowed": [  
                "qrph"  
            ],  
            "payments": \[],  
            "next_action": {  
                "code": {  
                    "id": "code_UKixJpQNzEfMm9T7NahbcXNe",  
                    "amount": 100000,  
                    "image_url": "data:image/png;base64,iVBORw0KG...CYII=",  
                    "label": "Test Paymongo"  
                },  
                "type": "consume_qr"  
            },  
            # ...  
        }  
    }  
}

5. Finish

  • To determine if the QR Ph payment has already been paid, a webhook call will be made to the nominated and registered webhook endpoint subscribed to the payment.paid event.
  • You may refer to our Webhook API to learn more.

🚧

QR Ph codes generated using the Payment Intent flow and not paid within 10 minutes will expire and should not be used anymore. These QR Ph codes are also designed to be one-time use only.



Generating Reusable QR Ph Codes

📘

Currently only supports the generation of Static QR Ph Codes. For Static QR Ph codes, customers input the payment amount after scanning the QR Ph code. These reusable QR Ph Codes can be used primarily for in-store use and displayed at your store's point of purchase in the form of a standee or digital display.

QR Ph Code Resource

{
    "data": {
        "id": "code_rmDbeEY1oxyPRU9zuKHEEX5y", #unique ID assigned to each QR Ph code
        "type": "code",
        "attributes": {
            "mobile_number": "+639191234567",
            "qr_image": "data:image/png;base64,iVB...mCC",
            "name": "Paymongo Test"
        }
    }
}
AttributeDescription
qr_imageBase64-encoded, data/image URL of the QR image generated using the generated QR string.
mobile_numberRecipient of the SMS notification we send out for every payment made using the code
nameStore name that will appear when scanning the QRPH code. Applies to all providers

Creating a Static QR Ph Code

Generates QR Ph codes and creates a code record for it via API.

1. Call the API Endpoint using your Live API Keys, which can be found on your PayMongo dashboard once activated.

  • It's important to note that each QR Code will have a unique QR Code ID which can be used to reference each generated QR Code.

Payload

{
    "data": {
        "attributes": {
            "kind": "instore",
            "mobile_number": "+639191234567"
        }
    }
ParameterDescriptionValidationValue
mobile_numberMobile number that will receive the SMS confirmation on a successful paymentRequired
mobile_number
+639191234567
kindKind of QRPH code to generateRequired'instore'
notesAdditional notes to be used to identify the generated code (for your internal use, does not get displayed to the customer)Optional
String
'Main Branch'
'Cashier 1'

2. Convert the Base-64-encoded string from the API response into an image.

  • The QR Ph image will be in the API response under data.attributes.qr_image as a Base64-encoded string. You can use any Base-64 to Image Converter to convert the QR Image string into an actual image.

{
    "data": {
        "id": "code_Yk3HN6HvWddSrNwhM3dKkYeA",
        "type": "code",
        "attributes": {
            "mobile_number": "+639191234567",
            "qr_image": "data:image/png;base64,iVBO...ggg==", #This is the base-64-enconded string
            "name": "Paymongo Test"
        }
    }
}


3. Start accepting payments with your static QR Ph code!

  • Once you have converted the string into an image, you can now print out or display this QR Ph code in your store.

4. Finish

  • To determine if the QR Ph payment has already been paid, a webhook call will be made to the nominated and registered webhook endpoint subscribed to the payment.paid event.

What’s Next