Order Webhook Events

POSThttps://your-server.com/webhooks/easyflow

Listen to order events to keep your integration always synchronized.

Webhooks are the safest and most reliable way to stay updated in real time. Your application receives a notification whenever the status of an order changes.

When an order has items from more than one business, each business receives its own notification, and items contains only the items of that business. The totals (valueInCents, taxInCents, netValueInCents) and payments are of the whole order in every notification.

Order Events

  • order.created — Order created.
  • order.updated — Order updated.
  • order.paid — Order fully paid.
  • order.partiallyPaid — Order partially paid.
  • order.canceled — Order canceled.
  • order.refunded — Order refunded.
  • order.chargeback — Order chargeback received.

Subscription of the item

Every item of every order event brings subscription: { "id": "..." } when the item has a subscription, and null when it has none. The key is always present, and it brings only the id of the subscription.

null means that no subscription was linked to the item when the event was sent. It does not mean that the order is not a subscription order:

  • order.created always comes with null, because the subscription is created after the order.
  • order.paid of the order of the first cycle can come with null when the order is created already paid, for example a free recurring offer, when the subscription is completed by a recovery routine after the order is paid, and, rarely, when the payment is confirmed before the subscription is recorded.

In these cases, orderId of subscription.created and the following events of the same order bring the link between the order and the subscription.

Events

  • order.created
  • order.updated
  • order.paid
  • order.partiallyPaid
  • order.canceled
  • order.refunded
  • order.chargeback

Easyflow sends an HTTP request with this payload to the URL registered for your webhook.

Payloadrequired

Webhook payload received by your server in the event of an event.

Content typeapplication/jsonobject

  • eventstring

    Name of the event received.

    Possible values:order.createdorder.updatedorder.paidorder.partiallyPaidorder.canceledorder.refundedorder.chargeback

  • occurredAtstring · date-time

    Date and time when the notification was sent, in UTC.

  • payloadobject

    Complete event data.

    Show child attributesHide child attributes
    • idstring · uuid
    • createdAtstring · date-time
    • updatedAtstring · date-time
    • statusstring

      Possible values:pendingawating-paymentpaidpartially-paidcanceledreversedrefundedcharged-back

    • paidAtstring · date-timenullable

      Date and time when the order was paid.

    • valueInCentsinteger

      Sum of the unit value times the quantity of every item of the whole order, including the items of other businesses that are not in items.

    • taxInCentsinteger

      Sum of the taxInCents of every commission of the whole order, of all the businesses that receive a part of it, not only of the business of this notification.

    • netValueInCentsinteger

      Sum of the netValueInCents of every commission of the whole order, of all the businesses that receive a part of it, not only of the business of this notification.

    • shippingobject
      Show child attributesHide child attributes
      • valueInCentsinteger
    • metadataarray of objects

      Key and value pairs saved with the order. Empty when the order has no metadata.

      Show child attributesHide child attributes
      • keystring
      • valuestring
    • buyerobject
      Show child attributesHide child attributes
      • namestring
      • emailstring
      • documentobject
        Show child attributesHide child attributes
        • typestring
        • numberstring
      • phoneobject
        Show child attributesHide child attributes
        • dddstring
        • numberstring
        • areaCodestring
        • isMobileboolean
      • addressobject
        Show child attributesHide child attributes
        • streetstring
        • neighborhoodstring
        • numberstring
        • citystring
        • statestring
        • zipCodestring
        • complementstring
      • deliveryAddressobject
        Show child attributesHide child attributes
        • streetstring
        • neighborhoodstring
        • numberstring
        • citystring
        • statestring
        • zipCodestring
        • complementstring
    • businessobject

      Business that receives this notification.

      Show child attributesHide child attributes
      • idstring
      • namestring
    • couponobject

      Coupon applied to the order. The object is always present, also when the order has no coupon.

      Show child attributesHide child attributes
      • codestringnullable
      • discountobjectnullable
        Show child attributesHide child attributes
        • percentagenumber
        • valueInCentsinteger
      • discountedValueInCentsinteger

        Total discount applied to the order by the coupon, in cents. 0 when the order has no coupon or the coupon brings no discount value. It is never the value of the order, which is in valueInCents.

    • itemsarray of objects
      Show child attributesHide child attributes
      • idstring
      • namestring
      • descriptionstring
      • valueInCentsinteger

        Unit value of the item.

      • amountinteger

        Quantity of the item.

      • productobject
        Show child attributesHide child attributes
        • idstring
        • namestring

          Name of the product. When the item has no product, or the product has no name, it is the name of the item.

      • offerobject
        Show child attributesHide child attributes
        • idstring
        • namestring
      • paymentLinkobject
        Show child attributesHide child attributes
        • idstring
        • namestring
      • subscriptionobjectnullable

        Subscription of the item, with only its id. null when no subscription is linked to the item when the event is sent. Always null in order.created. The key is always present.

        Show child attributesHide child attributes
        • idstring · uuidrequired
      • participantsarray of objects
        Show child attributesHide child attributes
        • businessobject
          Show child attributesHide child attributes
          • idstring
          • namestring
    • paymentsarray of objects

      Payments of the order. In order events, pix, bankBillet and creditCard always come as objects, also for the methods that the payment did not use. The object of a method that was not used comes with all its fields null.

      Show child attributesHide child attributes
      • idstring
      • paymentMethodstring

        Payment method, such as credit-card, pix or bank-billet.

      • statusstring

        Possible values:pendingin-processingauthorizedpaidpartially-paidrefusedabortedcanceledcharged-backchargeback-in-disputeunpaidaccepteddeniedreversedrefunded

      • valueInCentsinteger
      • valuePaidInCentsinteger
      • fineValueInCentsinteger
      • interestValueInCentsinteger
      • installmentsinteger
      • pixobjectnullable
        Show child attributesHide child attributes
        • copyAndPasteCodestringnullable
        • qrCodestringnullable
        • expireAtstring · date-timenullable
      • bankBilletobjectnullable
        Show child attributesHide child attributes
        • expireAtstring · date-timenullable
        • barCodestringnullable
        • linkstringnullable
        • linestringnullable
      • creditCardobjectnullable

        Card used in the payment. Only these display fields are sent. The card token and the card number are never sent.

        Show child attributesHide child attributes
        • last4Numbersstring
        • flagstring

          Possible values:visamastercardamerican-expressdiners-clubdiscoverjcbunionpaymaestromirelohiperhipercard

        • expiresAtYearinteger
        • expiresAtMonthinteger
        • holderNamestring
        • nicknamestring
      • refuseobjectnullable

        Reason why the payment was refused.

        Show child attributesHide child attributes
        • rawDescriptionstring
        • typestringnullable