Payment via a store
This tutorial will guide you step by step to generate store payment references, in order to receive payments through convenience stores.
Notice: You can get notifications minutes after your customer makes the payment.
Process to make store charges:
Steps:
- Customer completes the buying by selecting store charge as payment method
- Send a store charge request to Openpay
- Create a payment order for your customer with the returned information
- Customer goes to store and pays for the order
- Openpay receives and validates the payment
- Openpay notifies the payment to your server
This tutorial you can see steps 2 and 3, for step 6 details please check notifications section
Create a charge (Step 2)
To receive a payment in a store you need to generate a barcode with the reference with which your customer can pay at the store.
To do this you must make a request to our API as follows:
Note: The maximum amount allowed for such charges is $ 9,999.00 COP
If the request is successful you will receive an answer with the reference number generated and the barcode URL so you can create your receipt.
Response:
{
"id": "trgklldjutbqv9gqzyn9",
"authorization": null,
"operation_type": "in",
"method": "store",
"transaction_type": "charge",
"status": "in_progress",
"conciliated": false,
"iva": "16",
"creation_date": "2019-11-04T11:13:16-06:00",
"operation_date": "2019-11-04T11:13:16-06:00",
"description": "Cargo inicial a mi cuenta de store",
"error_message": null,
"order_id": "oid-20191104111316",
"payment_method": {
"type": "store",
"reference": "1010101389264548",
"barcode_url": "https://sandbox-api.openpay.co/barcode/1010101389264548?width=1&height=45&text=false"
},
"currency": "COP",
"amount": 226,
"customer": {
"name": "Ambrosio",
"last_name": "Medina",
"email": "ambrosio.medina@company.co",
"phone_number": "571983873734",
"address": null,
"creation_date": "2019-11-04T11:13:16-06:00",
"external_id": null,
"customer_address": {
"department": "Medellín",
"city": "Antioquia",
"additional": "Avenida 7r bis #144-28 Apartamento 423",
"country": "CO"
},
"clabe": null
}
}
Sandbox: You can simulate the payment from the dashboard, so you can get a payment notification on your system via a Webhook.
Production: The payment notification is done in real time, that is when your customer makes the payment at the store you will receive a Webhook and the balance in your account will be increased.
For more information see the charges reference
Create a payment receipt (Step 3)
Openpay offers the possibility of obtaining a payment receipt with the necessary information so that your client can make the payment in store, to reach it, it is enough to structure a compound route as follows:
{DASHBOARD_PATH}/paynet-pdf/{MERCHANT_ID}/{REFERENCE}
Sandbox:
{DASHBOARD_PATH}
= https://sandbox-dashboard.openpay.co
Producción:
{DASHBOARD_PATH}
= https://dashboard.openpay.co
{MERCHANT_ID}
= your merchant id
{TRANSACTION_ID}
= value of payment_method.reference
field, that the transaction object returned when the charge was created
Create Custom Payment Receipt (Step 3.1 Optional)
Basically you can create your receipt with any design and colors, but it should include:
- Name of the service to pay
- Store Payment
- Reference:
- Value of the
reference
field
- Value of the
- Barcode:
- Image of the
barcode_url
field
- Image of the
- Amount Due:
- Value of the
amount
field
- Value of the
Notes:
Make sure your integration meets the version compatibility requirements more info
- Implement Notifications to know the status of payments in real time