API Reference

Webhook

We send a webhook notification when the order changes to the statuses AUTHORIZED, CANCELED, and EXPIRED.

  • AUTHORIZED: The order is authorized for payment creation by the merchant.
  • CANCELED: The order was canceled by the consumer.
  • EXPIRED: The order has expired.

Format and Request

The webhook will be triggered via a REST request using the POST method to the URL provided in the webhook_url field during checkout creation, with the following body:

{
  "id": "aae11abd-1f51-4854-b58b-473f83b2319f",
  "amount": 20000,
  "metadata": {
    "anyData": "XPTO"
  },
  "orderReference": "23423hshd3",
  "reference": "ASLKDFH28RY2E28938EHFEWJKF",
  "state": "AUTHORIZED",
  "type": "split"
}

Field Description

Field NameTypeDescription
idstringCheckout ID generated by the Pagaleve API /checkouts.
amountnumberOrder amount in cents, provided during checkout creation in order.amount.
metadataobjectMetadata object provided at the time of order creation.
orderReferencestringOrder ID used by the merchant, provided in the order.reference field during checkout creation.
referencestringOrder ID used in the merchant’s sales platform.
stateenumOrder status: <br> - **AUTHORIZED** – Authorized, customer confirmed payment of the first installment. <br> - **RELEASED** – Released, returned when the order was released in case the payment was created as an authorization type. <br> - **CANCELED** – Canceled, for orders canceled by user action. <br> - **EXPIRED** – Expired, for expired orders.
typeenumPayment type: <br> - **split** – Installments <br> - **upfront** – One-time payment <br> - **declined** – Declined