How to integrate QR attended model
To charge with a QR attended model, you’ll have to create and order and then associate it with a Point of Sale.
Model flow
We explain how the attended model works:
- The point of sale registers an order (1a) and creates an order assigned to a checkout (1b). At this moment the order is available to be scanned (2).
- When the customer scans the QR (3) with the order and makes the payment (5), an IPN notification (4a and 6b) is received to the seller's server. With these data, the status of the order (7a) is obtained, to validate that it is closed or is still open, pending payment.
Create an order
curl
curl -X PUT \
-H 'Authorization: Bearer ACCESS_TOKEN' \
https://api.mercadopago.com/instore/qr/seller/collectors/USER_ID/stores/EXTERNAL_STORE_ID/pos/EXTERNAL_POS_ID/orders \
-d \
{
"external_reference": "order-id-1234",
"title": "Title",
"description": "Mercado Pago",
"notification_url": "www.yourserver.com",
"expiration_date": "2023-08-22T16:34:56.559-04:00",
"total_amount": 100.0,
"items": [
{
"sku_number": "KS955RUR",
"category": "FOOD",
"title": "Item1",
"description": "Item1 Mercado Pago",
"unit_price": 20,
"quantity": 5,
"unit_measure": "unit",
"total_amount": 100
}
],
"sponsor": {
"id": 446566691
}
}
Obtain more information in our API Reference.
Once the order is created, it is available to be scanned and paid.
Eliminate an order
To delete a QR associated order before it’s closed or expires, you can use this following method:
curl
curl -X DELETE \
-H 'Authorization: Bearer ACCESS_TOKEN' \
https://api.mercadopago.com/instore/qr/seller/collectors/USER_ID/pos/EXTERNAL_POS_ID/orders
Answer will be HTTP 204 No Content
.
Receive notifications of your orders
IPN notifications are an automatic way of receiving notifications for order creation and status updates. I.e.: when orders are approved, rejected or pending.
Implement IPN merchant_order
with an order search by external_reference
as a contingency method.