#
About this guideIn this guide we will describe the step-by-step process for you to accept online payments with PicPay, as well as the basic flow of a payment with QR Code and the payment lifecycle.
#
PrerequisitesBefore starting your onboarding, you must have valid credentials. You can check how to obtain your credentials in this article.
#
How does it work?#
AuthenticationPicPay provides two integration keys: x-picpay-token
and x-seller-token
. For this operation, you should use the x-picpay-token
in your requests.
#
Basic operationPicPay operates as an asynchronous payment method. This means a payment intent is generated through our payment API and remains in the pending
status until the user completes the payment using the PicPay app. Below is the basic flow of QR Code payments.
Step 1: The customer selects PicPay as the payment method on your e-commerce platform;
Step 2: Your e-commerce platform must make a server-side call to our payment API (/payments), generating a payment intent with a pending status within PicPay;
Example of request: The e-commerce creates a payment intent of 10 reais on PicPay for the customer João dos Testes.
Step 3: PicPay returns the QR Code in the API payments callback response (URL for redirection in paymentUrl and encoded image in qrcode.base64);
Example response to step 3 request.
Step 4: In your e-commerce, you display the QR code to your customer by either redirecting to the URL or showing the QR code directly;
Image 2 - Example using redirection
Image 3 - Example using the QR code on the page
Step 5: If we identify that your customer is also a PicPay user, we will send a notification within the PicPay app informing them about the pending payment. In all cases, we will also send a pending payment email containing the link to our checkout page. At this point, there will be a payment intent with a pending status (learn more about the payment lifecycle here).
Step 6: The customer makes the payment through the PicPay app (using either their balance or a credit card).
Information
If the customer does not make the payment by the expiration date (sent at the time of creation), the payment will move to the status expired.
Step 7: If the payment is successful, PicPay sends a notification to the e-commerce via POST to the callback URL provided in the payment request as callbackUrl.
Your e-commerce should be prepared to receive a POST at the endpoint /callback, using the x-seller-token
in the header for authentication of the request. To confirm the receipt of the callback, your e-commerce must respond with HTTP Status 200.
Example of notification that PicPay sends to the e-commerce.
Information
However, for security reasons, we will not disclose the new status in this request. Therefore, your store (upon receiving our notification) should query our order status endpoint.
Attention
If the callback does not arrive within the time determined by you, we recommend that a direct status check of the order be performed (step 8). This is applicable in cases that require instant confirmations (such as in-store purchases or vending machines, for example).
Learn more about the notifications that PicPay sends in this article.
Step 8: Your e-commerce should perform a GET request using the referenceId sent in the notification to obtain the payment status.
Example of notification that PicPay sends to the e-commerce.
Step 9: If the payment is confirmed, display confirmation on your e-commerce site.
#
Next steps- Understand the possible statuses of a payment;
- Understand how to request a full cancellation;
- Learn more about the notifications that PicPay sends;
#
Getting helpWe hope this article has been helpful! If you have any remaining questions, you can check our FAQ or contact us via email at relacionamento-negocios@picpay.com.