Decode QR code

Overview

This endpoint allows you to decode the extracted EMVCo string from a QR Code and return structured information required to initiate a payment including amount, key details, merchant information, taxes, and channel indicators.

QR Codes Types

The supported types are: Dynamic and Static QR codes.

Endpoint Details

Definition

Description

Endpoint

https://api.paas-sandbox.co.passportfintech.com/v1/qrcodes/decode

Method

POST

Headers

Content-Type: application/json, Authorization

Authentication

Access Token (Bearer Token)

Request Body

Parameter

Type

Required

Description

customer_id

String

Yes

The unique identifier of the customer (merchant) initiating the transaction.

qr_code_data

String

Yes

The EMVCo-compliant QR string to be decoded.

Example Request

curl --location --request POST 'https://api.paas.sandbox.co.passportfintech.com/v1/qrcodes/decode' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \ --data '{ "customer_id": "050e8ba8-e079-46bd-a052-427a38f35ef0", "qr_code_data": "00020101021226330015CO.COM.VISI.LLA0210370222232949270015CO.COM.VISI.RED0104VISI52040412530317054130000014907.005802CO5914Merchant OW3BX6011Bucaramanga610610101062250808PURCHASE100911414310480290017CO.COM.VISI.CANAL0104MPOS81260016CO.COM.VISI.CIVA01020282240015CO.COM.VISI.IVA0101083250016CO.COM.VISI.BASE0101084260016CO.COM.VISI.CINC01020285240015CO.COM.VISI.INC0101090310017CO.COM.VISI.TRXID0106P1490791870015CO.COM.VISI.SEC0164474ba16e2433a928a69b7a6eb54efbabecba7c0aef862d39fca7b379d057ba1b63045B27" }'

Response Body

  • HTTP Status Code: 200 OK.

Example of Response

{ "amount": { "currency": "COP", "value": "14907" }, "additional_info": { "transaction_purpose": "PURCHASE" }, "inc": { "inc_type": "FIXED", "inc_value": "0" }, "key": { "key_value": "3702222329", "key_type": "PHONE" }, "qr_code_data": "00020101021226330015CO.COM.VISI.LLA02103702222329...63045B27", "status": "ACTIVE", "acquirer_network_identifier": "VISI", "merchant": { "merchant_category_code": "0412", "merchant_country": "CO", "merchant_name": "Merchant OW3BX", "merchant_city": "Bucaramanga", "merchant_post_code": "101010" }, "channel": "MPOS", "vat": { "vat_type": "FIXED", "vat_value": "0", "vat_base_value": "0" }, "qr_code_reference": "14907", "type": "DYNAMIC" }
Important

The decoding does not create the qr_code_image parameter

Common Errors and Handling

HTTP Status Code

Meaning

Description

400 Bad Request

Invalid Data

Missing or malformed customer_id or qr_code_data.

401 Unauthorized

Expired Token

The access token is invalid or has expired.

403 Forbidden

Access Denied

The request is not authorized to validate the entity.

500 Internal Server Error

Server Error

An unexpected error occurred while validating the entity.

Best Practices

  • Validate input: Ensure qr_code_data is properly formatted before sending the request.