Amplify
  • Amplify Documentation
  • Español
    • Introducción
    • GUIAS
      • [GUIA] Integración básica Amplify SDK (Tienda única)
      • [GUIA] Leyendo balances (Tienda única)
    • Creando una cuenta
    • Configurando tu cuenta
    • Obteniendo tus API Key
    • Obteniendo tokens de prueba
    • SDK
      • Instalacion
      • Propiedades
      • Eventos
      • Personalización
      • Interfaces
    • API
      • Intención de pago
      • Balances
      • Retiros
      • Webhooks
      • Links de Pago
      • Reembolsos
  • English
    • Introduction
    • Creating an account
    • Setting up your account
    • Getting your API Keys
    • Faucet
    • SDK
      • Installation
      • Props
      • Events
      • Customization
      • Interfaces
    • API
      • Payment intents
      • Balances
      • Withdraws
      • Webhooks
      • Refunds
Con tecnología de GitBook
En esta página
  1. English
  2. API

Webhooks

AnteriorWithdrawsSiguienteRefunds

Última actualización hace 9 meses

Webhooks

Webhooks are an essential part of the integration process as it is the way your application is notified when different actions are processed within Amplify.

Setup

To set up your webhooks, you need to create an . Once inside your profile, you can configure the URL where we will send the information at:

Integration

The information will be sent via an HTTP POST Request to the URL you have configured in the administration panel.

Here is a basic example of integrating with Node and Express:

// routes.js
app.post('/api/amplify/webhook', (req, res) => {
    AmplifyController.webhook(req, res);
})
// AmplifyController.js
function webhook(req, res) {
  const { body } = req;
  const { topic, transaction } = body;

  console.log('TOPIC', topic)
  console.log('TRANSACTION', transaction);
}

Interfaces

PAYMENT_INTENT_CREATED

This webhook is triggered when a user executes a payment intent, which means that the SDK was rendered correctly within your integration.

Response

{
    topic: 'PAYMENT_INTENT_CREATED',
    transaction: {
        paymentIntentId: "123...abc",
        receiverId: "123...abc",
        status: "CREATED",
        metadata: { randomKey: "randomValue"}
    }
}

PAYMENT_CREATED

This webhook is triggered when a payment is processed successfully.

Response

{
    topic: 'PAYMENT_CREATED',
    transaction: {
        paymentId: "123...abc",
        receiverId: "123...abc",
        amount: "1.0",
        token: "USDC",
        chain: "mumbai",
        metadata: { randomKey: "randomValue"},
        symbol: "USDC"
    }
}

Currently, there are two types of webhooks in Amplify: and , which have the following interfaces:

PAYMENT_INTENT_CREATED
PAYMENT_CREATED
Amplify user
https://getamplify.app/plataforma/webhooks