Skip to main content

Web component for sale

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.

ParameterTypeRequiredDescription
amountnumberNoThe sale amount
maxAmountnumberNoThe max amount allowed
clientUsernamestringNoClient username/identifier
salesmanIdentifierstringNoSalesman reference identifier
storeIdstringNoStore ID (external or internal)
descriptionstringNoOptional sale description
externalIdstringNoOptional external reference ID
ticketstringNoOptional ticket/reference
callbackUristringNoOptional redirect after flow finished

Response

{
"link": "https://checkout.zazpay.mx/...",
"token": "<checkout_token>"
}

Embedding guidance

  • Use a standard iframe without deprecated attributes like frameborder.
  • 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 callbackUri when generating the sale link.

Exceptions

Error CodeDescription
SALE-COMPONENT-01Client not found
SALE-COMPONENT-02Store not found
SALE-COMPONENT-03Minimum amount not reached
SALE-COMPONENT-04Client credit line insufficient
SALE-COMPONENT-05Salesman not found
SALE-COMPONENT-06Sale link not found
SALE-COMPONENT-07Too many client searches
SALE-COMPONENT-08Sale link already used
SALE-COMPONENT-09Sale link CANCELED
SALE-COMPONENT-10Sale link rejected
SALE-COMPONENT-11Sale link expired
SALE-COMPONENT-12Max amount exceeded
STORE-NOT-BELONG-TO-COMPANYStore 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

  1. Iframe: Embed the payment interface directly in your web application
  2. Webview: Use in mobile applications or desktop apps
  3. 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>

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.