Web component for sale
Create Sale Link
POST /sale-link/generate
Creates a sale link for web component integration. This endpoint allows merchants to generate a payment link that can be embedded in their POS system using an iframe or webview.
Input Parameters
All parameters are optional. If not specified, the web component will prompt for the values in the UI.
| Parameter | Type | Required | Description |
|---|---|---|---|
amount | number | No | The sale amount |
maxAmount | number | No | The max amount allowed |
clientUsername | string | No | Client username/identifier |
salesmanIdentifier | string | No | Salesman reference identifier |
storeId | string | No | Store ID (external or internal) |
description | string | No | Optional sale description |
externalId | string | No | Optional external reference ID |
ticket | string | No | Optional ticket/reference |
callbackUri | string | No | Optional redirect after flow finished |
Response
{
"link": "https://checkout.zazpay.mx/...",
"token": "<checkout_token>"
}
Embedding guidance
- Use a standard
iframewithout deprecated attributes likeframeborder. - Example:
<iframe
src="https://checkout.zazpay.mx/?token=<checkout_token>"
allow="payment"
style="width:100%; height:680px; border:0"
></iframe>
- Always use HTTPS URLs.
- For redirection at the end of the flow, set
callbackUriwhen generating the sale link.
Exceptions
| Error Code | Description |
|---|---|
SALE-COMPONENT-01 | Client not found |
SALE-COMPONENT-02 | Store not found |
SALE-COMPONENT-03 | Minimum amount not reached |
SALE-COMPONENT-04 | Client credit line insufficient |
SALE-COMPONENT-05 | Salesman not found |
SALE-COMPONENT-06 | Sale link not found |
SALE-COMPONENT-07 | Too many client searches |
SALE-COMPONENT-08 | Sale link already used |
SALE-COMPONENT-09 | Sale link CANCELED |
SALE-COMPONENT-10 | Sale link rejected |
SALE-COMPONENT-11 | Sale link expired |
SALE-COMPONENT-12 | Max amount exceeded |
STORE-NOT-BELONG-TO-COMPANY | Store does not belong to your company |
Web component
The web component is a payment interface that can be integrated into your POS system or application. After creating a sale link using the previous endpoint, you can embed it in your application using one of the following methods:
Integration Methods
- Iframe: Embed the payment interface directly in your web application
- Webview: Use in mobile applications or desktop apps
- Browser: Open the link in a new browser window/tab
Implementation Example
<!-- Iframe integration -->
<iframe
src="https://your-sale-link-url"
width="100%"
height="600px"
frameborder="0"
>
</iframe>
Recommended Configuration
Callback URI: It's highly recommended to specify a callbackUri parameter when creating the sale link. This allows your application to receive a redirect after the payment flow is completed, enabling you to:
- Update your POS system with the payment status
- Show confirmation messages to users
- Redirect users back to your application
- Handle success/failure scenarios
Webhook Integration
For real-time payment status updates, implement the "sale status change" webhook. This webhook will notify your application whenever the payment status changes, providing immediate updates without requiring user interaction or page refreshes.
The webhook ensures your POS system stays synchronized with the payment status, even if users don't complete the callback flow.