webhookIntegrated Webhooks: Mercado Pago with SprintHub

This integration with Mercado Pago aims to bring the buyer's registration data into SprintHub. In this example, we will bring only the credit card name and the email.

triangle-exclamation

Integration flowchart.

For a better understanding of this step-by-step, watch the video above.

Step 1:

Register and access the Mercado Pago Developers area:

https://www.mercadopago.com.br/developers/panel/apparrow-up-right

On the Apps screen, create a new app “Create application”.

Step 2:

In SprintHub, under Custom Fields, create the fields you want to bring from Mercado Pago. In this tutorial example, besides the Client ID and Merchant Order, I am bringing only the Order ID field.

https://YOUR_INSTANCE.sprinthub.app/sh/fields/panel/lead

Keep the Client ID as the unique identifier.

Step 3:

Go to Integration Webhooks and create a new Passive webhook.

https://YOUR_INSTANCE.sprinthub.app/sh/advwebhooks/panel?

Do the automatic mapping, but then create a new field called ID because what comes in production with real sales is different from what comes in the test send during mapping.

Extra Actions: Create an extra action to “Send integration webhook”. This step only after you create active webhooks 02 and 03 according to the video and the screens below.

Configure the token as below. Watch the video to know where to get the token.

Automatic Lead Creation: Update and automatically create the Lead by mapping these fields.

Step 04:

Create an Active Webhook called 02 - MP - Fetch Order ID

Map as above. This is what we will fetch at this endpoint:

Destination URL:

https://api.mercadopago.com/merchant_orders/{contactfield=mp_merchant_orderarrow-up-right}

In the Array configuration, I am fetching only id and status, but you can fetch other data within the payment object.

Return validation: In the example, I want to bring only those with status approved.

Extra Actions: I am adding the payment ID to the field MP - Order ID.

I am calling webhook 03, where I will pass the Payment ID to retrieve the buyer's data.

Step 05:

Create a new active webhook, called 03 - MP - Fetch Payment Data with Order ID

Destination URL: https://api.mercadopago.com/v1/payments/{contactfield=order_idarrow-up-right}

Extra Actions: This call will update the Contact fields, Name and Email.

Last updated

Was this helpful?