AI resources

Mercado Pago integration for websites

This model lets you offer Apple Pay on your website without managing payment certificates or decrypting tokens on your server. Mercado Pago handles validation with Apple and returns a token ready to create the payment.

You can integrate in two ways: using the Mercado Pago JavaScript SDK (JS SDK) to display the button in the frontend (Via SDK), or implementing the flow directly with the APIs in your backend (Via API). In both cases, the payment is created in your backend with the Orders API.

This integration method uses our JS SDK in the frontend to display the Apple Pay button. Mercado Pago validates the session with Apple and returns a token ready to create the payment in your backend. Follow the steps to integrate.

sequenceDiagram
    participant C as Buyer
    participant V as Website (frontend)
    participant B as Your backend
    participant MP as Mercado Pago
    participant A as Apple
    V->>MP: Initialize Apple Pay
    MP->>A: Validate merchant and domain
    A-->>V: Apple Pay button available
    C->>V: Click the Apple Pay button
    V->>A: Payment request (Touch ID/Face ID)
    A-->>V: Encrypted payment data
    V->>MP: Tokenize the payment (SDK)
    MP-->>V: Mercado Pago token (callback)
    V->>B: Send the token
    B->>MP: Create the order (token + data)
    MP-->>B: Order response
    B-->>V: Payment result