# Easyflow

This is the API documentation and must be used by everyone who wants to integrate with the Easyflow platform.
- [Pixel SDK](https://www.npmjs.com/package/@easyflow/pixel)
- [Web SDK](https://www.npmjs.com/package/@easyflow/javascript-sdk)


Easyflow API Document

Version: 1.0
License: 

## Servers

Production environment URL
```
https://9iq81tsdy4.execute-api.sa-east-1.amazonaws.com
```

## Security

### token

Type: http
Scheme: bearer

## Download OpenAPI description

[Easyflow](https://docs.easyflow.digital/_bundle/openapi.yaml)

## Businesses

### Get balance

 - [GET /business/balance](https://docs.easyflow.digital/openapi/businesses/business/balance.md): Api to retreive balance from business.

### List businesses by owner

 - [GET /business/list-businesses-by-owner](https://docs.easyflow.digital/openapi/businesses/get-business-list-business-by-owner.md): Returns all businesses associated with the owner

## Refunds

### List order revert request

 - [GET /order-revert-requests/list](https://docs.easyflow.digital/openapi/refunds/get-order-revert-requests-list.md): Returns a list of refunds.

## Sales

### Filter sales

 - [POST /sales/filter](https://docs.easyflow.digital/openapi/sales/post-sales-list.md): Returns a list of sales.

## Subscriptions

### Filter subscription

 - [POST /subscriptions/filter](https://docs.easyflow.digital/openapi/subscriptions/post-subscriptions-list.md): Returns a list of subscriptions.

### Get subscription

 - [GET /subscriptions/{subscriptionId}](https://docs.easyflow.digital/openapi/subscriptions/get-subscriptions-:subscriptionid.md): Use it to get subscription

## Financials

### Filter withdraw request

 - [POST /withdraw-requests/filter](https://docs.easyflow.digital/openapi/financials/post-withdraw-requests-list.md): Returns a list of withdraw requests.

### Filter movement

 - [POST /movement/filter](https://docs.easyflow.digital/openapi/financials/post-movement-list.md): Returns a list of movements.

### List commissions

 - [GET /commissions/list](https://docs.easyflow.digital/openapi/financials/get-commissions-list.md): Returns a list of commissions.

## Products

### Filter products

 - [POST /products/filter](https://docs.easyflow.digital/openapi/products/post-products-list.md): Returns a list of products.

### List offers by product id

 - [GET /offers/list-by-product/{productId}](https://docs.easyflow.digital/openapi/products/get-offers-list-by-product-:productid.md): Returns a list of offers.

## Orders

### Get order

 - [GET /orders/{orderId}](https://docs.easyflow.digital/openapi/orders/get-orders-:orderid.md): Use it to get order

### Create charge

 - [POST /orders/create-charge](https://docs.easyflow.digital/openapi/orders/get-orders-charge.md): route to create charge

## Customers

### List customers

 - [GET /customers/list](https://docs.easyflow.digital/openapi/customers/get-customers-list.md): Returns a list of customers.

### Get customers

 - [GET /customers/{customerId}](https://docs.easyflow.digital/openapi/customers/get-customers-customerid.md): Use it to get order

### Remove customer

 - [DELETE /customers/remove/{customerId}](https://docs.easyflow.digital/openapi/customers/remove-customer.md): Use it to remove customer

### Create customer

 - [POST /customers](https://docs.easyflow.digital/openapi/customers/create-customers.md): Route to create customer

### Update customer

 - [PATCH /customers/update/{customerId}](https://docs.easyflow.digital/openapi/customers/patch-customers-update-customerid.md)

## Webhooks

### Create webhook

 - [POST /webhooks](https://docs.easyflow.digital/openapi/webhooks/post-webhook.md): Registers a new webhook for event notifications.

### List webhooks

 - [GET /webhooks/list/{businessId}](https://docs.easyflow.digital/openapi/webhooks/get-webhook-list.md): Returns a paginated list of registered webhooks for a given business, filtered by status, events and date range.

### Get webhook queue details

 - [GET /webhooks/dynamic-queues/{webhookId}](https://docs.easyflow.digital/openapi/webhooks/get-webhook-queue-details.md): Retrieves the details of the dedicated dynamic queue associated with a specific webhook ID. This queue is used to temporarily store failed event notifications for subsequent retry attempts, ensuring delivery resilience.

### Delete a webhook

 - [DELETE /webhooks/delete/{webhookId}](https://docs.easyflow.digital/openapi/webhooks/delete-webhook-01.md): Permanently deletes a webhook identified by its unique ID, stopping all future event notification deliveries and removing its configuration.

### Deactivate a webhook

 - [PATCH /webhooks/deactivate/{webhookId}](https://docs.easyflow.digital/openapi/webhooks/patch-webhook-deactivate.md): Sets the status of a specific webhook to 'inactive', immediately stopping the delivery of event notifications to its configured dispatchers.

### Activate a webhook

 - [PATCH /webhooks/activate/{webhookId}](https://docs.easyflow.digital/openapi/webhooks/patch-webhook-activate.md): Sets the status of a specific webhook to 'active', enabling the delivery of event notifications to its configured dispatchers.

### Get webhook

 - [GET /webhooks/details/{webhookId}](https://docs.easyflow.digital/openapi/webhooks/get-webhook-details.md): Retrieves the complete configuration and current status details for a single webhook identified by its unique ID.

### Flush webhook pending queue

 - [PATCH /webhooks/flush/{webhookId}](https://docs.easyflow.digital/openapi/webhooks/patch-webhook-flush-queue.md): Clears all pending event notifications currently queued for a specific webhook. This action discards all failed attempts that are waiting for re-execution.

### Resume webhook pending queue processing

 - [PATCH /webhooks/resume/{webhookId}](https://docs.easyflow.digital/openapi/webhooks/patch-webhook-resume-queue.md): Triggers the re-execution process for all pending event notifications currently queued for a specific webhook, attempting delivery again.

### Update webhook configuration

 - [PATCH /webhooks/{webhookId}](https://docs.easyflow.digital/openapi/webhooks/patch-webhook-update.md): Updates the configuration details of an existing webhook, including subscribed events, name, notification failure settings, and HTTP dispatcher configuration.

## Payment Link

### Create payment link

 - [POST /payment-links](https://docs.easyflow.digital/openapi/payment-link/post-payment-links.md): Route to create payment link

### Update payment link

 - [PATCH /payment-links/{paymentLinkId}](https://docs.easyflow.digital/openapi/payment-link/get-payment-links-paymentlinkid.md): Route to update payment link.

⚠️ Note: It will not be possible to update the payment link if there is a sale.

### List payments link

 - [GET /payment-links/list](https://docs.easyflow.digital/openapi/payment-link/get-payments-link-list.md): Returns a list of payment links.

### Get payment link

 - [GET /payment-links/details/{paymentLinkId}](https://docs.easyflow.digital/openapi/payment-link/get-payment-links-details-paymentlinkid.md): Use it to get order

### Active payment link

 - [PATCH /payment-links/publish/{paymentLinkId}](https://docs.easyflow.digital/openapi/payment-link/get-payment-links-publish-paymentlinkid.md): Activate a payment link

### Inactive payment link

 - [PATCH /payment-links/unpublish/{paymentLinkId}](https://docs.easyflow.digital/openapi/payment-link/get-payment-links-unpublish-paymentlinkid.md): Inactive a payment link

### Delete payment link

 - [DELETE /payment-links/delete/{paymentLinkId}](https://docs.easyflow.digital/openapi/payment-link/get-payment-links-delete-paymentlinkid.md): Delete a payment link

### Upload image payment link

 - [PATCH /payment-links/upload-image/{paymentLinkId}](https://docs.easyflow.digital/openapi/payment-link/get-payment-links-upload-image-paymentlinkid.md): Add an image to the payment link.

⚠️ Note: File upload may not work here due to documentation limitations.
Try using Postman or curl to test it properly.

⚠️ Note: It will not be possible to update the image if there is a sale on the payment link

## Pixel

### Create pixel

 - [POST /pixels](https://docs.easyflow.digital/openapi/pixel/post-pixels.md): This route allows you to create a tracking pixel linked to your account, with support for Google and Meta platforms. After creation, the pixel must be integrated into your website or application using our official SDK to ensure proper event sending and tracking.

👉 Access the SDK and usage instructions: SDK

### Update pixel

 - [PATCH /pixels/{pixelId}](https://docs.easyflow.digital/openapi/pixel/patch-pixels-id.md): Route to update pixel.

### List pixels

 - [GET /pixels/list](https://docs.easyflow.digital/openapi/pixel/get-pixels-list.md): Returns a list of pixels.

### Get pixel

 - [GET /pixels/details/{pixelId}](https://docs.easyflow.digital/openapi/pixel/get-pixels-details-pixelid.md): returns the details of a pixel

### Delete pixel

 - [DELETE /pixels/delete/{pixelId}](https://docs.easyflow.digital/openapi/pixel/delete-pixels-pixelid.md): route to delete pixel

## Vouchers

### Get voucher by code

 - [GET /vouchers/voucher-code/{code}](https://docs.easyflow.digital/openapi/vouchers/get-voucher-by-code.md): Retrieves a voucher using its unique voucher code. This endpoint is typically used by customers or integrations to validate or display voucher information.

### Redeem voucher

 - [PATCH /vouchers/redeem/{voucherId}](https://docs.easyflow.digital/openapi/vouchers/patch-redeem-voucher.md): Redeems a voucher using its unique identifier. Once redeemed, the voucher cannot be used again.

### Cancel voucher redemption

 - [PATCH /vouchers/cancel-redeem/{voucherId}](https://docs.easyflow.digital/openapi/vouchers/patch-cancel-voucher-redemption.md): Cancels a previously redeemed voucher. This operation is intended for cases where the redemption happened by mistake. The redemption can only be reverted within 15 minutes after it was performed.

## Event

### Get event by external reference ID

 - [GET /event/{externalReferenceId}](https://docs.easyflow.digital/openapi/event/get-event-by-external-reference-id.md): Retrieves detailed information about an event using its external reference ID. This is an authenticated route and requires valid API credentials.

## Participants

### Participant check-in

 - [POST /participants/check-in](https://docs.easyflow.digital/openapi/participants/post-participant-check-in.md): Performs the check-in of a participant for a specific event day. This is an authenticated route. The referenceDate is optional and can be used to inform a custom check-in date and time. If not provided, the current date will be used.

### Participant check-out

 - [POST /participants/check-out](https://docs.easyflow.digital/openapi/participants/post-participant-check-out.md): Performs the check-out of a participant for a specific event day. This is an authenticated route. The referenceDate is optional and can be used to inform a custom check-out date and time. If not provided, the current date will be used.

### Filter participants

 - [POST /participants/filter](https://docs.easyflow.digital/openapi/participants/post-filter-participants.md): Retrieves a paginated list of participants based on filters. This is an authenticated route. It supports filtering by batches, zones, event days, ticket status, and a search field that matches participant name, email, document, or ticket code.

### Get participant by ticket code

 - [GET /participants/ticket-code/{code}](https://docs.easyflow.digital/openapi/participants/get-participant-by-ticket-code.md): Retrieves participant and ticket information using the ticket code. This is an authenticated route.

## Events

### Order Webhook Events

 - [POST Order Event](https://docs.easyflow.digital/openapi/events/paths/order%20event/post.md): 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 will receive a notification whenever the status of a order changes.

## Order Events
- ORDER_CREATED — Order created.
- ORDER_UPDATED — Order updated.
- ORDER_PAID — Order fully paid.
- ORDER_PARTIALLY_PAID — Order partially paid.
- ORDER_CANCELED — Order canceled.
- ORDER_REFUNDED — Order refunded.
- ORDER_CHARGEDBACK — Order chargeback received.

### Subscription Webhook Events

 - [POST Subscription Event](https://docs.easyflow.digital/openapi/events/paths/subscription%20event/post.md): Listen to subscription events to keep your integration always synchronized.

Webhooks are the safest and most reliable way to stay updated in real time.  
Your application will receive a notification whenever the status of a subscription changes.

## Subscription Events
- subscription.created — Subscription created.
- subscription.updated — Subscription updated.
- subscription.activated — Subscription activated.
- subscription.canceled — Subscription canceled.
- subscription.deactivated — Subscription deactivated.
- subscription.expired — Subscription expired.
- subscription.inactivated — Subscription inactivated.

### Subscription Recurrence Webhook Events

 - [POST Subsctiption Recurrence Event](https://docs.easyflow.digital/openapi/events/paths/subsctiption%20recurrence%20event/post.md): Listen to subscription recurrence events to keep your integration always synchronized.

Your application will receive a notification whenever the status of an individual recurrence (payment attempt) within a subscription changes.

## Recurrence Events
- subscriptionRecurrence.canceled — Recurrence payment canceled.
- subscriptionRecurrence.delayed — Recurrence payment delayed.
- subscriptionRecurrence.failed — Recurrence payment failed.
- subscriptionRecurrence.paid — Recurrence payment successfully paid.

### Payment Webhook Events

 - [POST Payment Event](https://docs.easyflow.digital/openapi/events/paths/payment%20event/post.md): 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 will receive a notification whenever the status of a payment.

## Payment Events
- PAYMENT_CANCELED — Payment canceled.
- PAYMENT_AUTHORIZED — Payment authorized.
- PAYMENT_CHARGEDBACK — Payment chargedback.
- PAYMENT_REFUNDED — Payment refunded.
- PAYMENT_PAID — Payment paid.

