### Client Search API Request (GET) Source: https://api.moonflow.ai/raw/SjPQavd4 Example of a GET request to search for a client (B2C and B2B) using the Moonflow API. This endpoint requires a page parameter for pagination. ```json { "method": "GET", "header": [], "url": { "raw": "{{MOONFLOW_HOST}}/client/list?page=", "host": [ "{{MOONFLOW_HOST}}" ], "query": [ { "key": "page", "value": "" } ] } } ``` -------------------------------- ### Webhook Setup and Verification Source: https://api.moonflow.ai/raw/SjPQavd4 Guides users on how to set up and verify webhooks in Moonflow for real-time notifications. It covers obtaining signature keys, processing notifications, and comparing signatures for security. ```APIDOC # Webhook Setup and Verification Webhooks are a powerful tool offered by Moonflow to automate responses to significant events within our platform. By configuring a webhook, you can establish a direct connection between Moonflow and your system or application, allowing you to receive automatic real-time notifications about specific events and communications, as well as their status updates. ## Setting up a Webhook To set up your webhook, follow these steps in the Moonflow platform: 1. **Access Integrations Section**: Navigate to the Integrations section in your Moonflow dashboard. 2. **Set Connection URL**: Provide the URL of your server where you will receive webhook notifications. 3. **Save Changes**: Click the save button. ## Verifying Webhook Signature To ensure the security and integrity of data received via webhooks, it is crucial to verify the signature of each notification. Follow these steps to perform the verification: ### 1. Obtain the Signature Key - In Moonflow, go to Settings > Integrations. - Locate and select the option "View webhook signature key" to get your unique signature key. ### 2. Process the Webhook Notification - Upon receiving a webhook notification, take the content (ensuring it is in plain text format). ### 3. Encrypt the Content - Use the HMAC_SHA256 algorithm to encrypt the notification content. - Employ the signature key obtained in step 1 as your secret key. - Encode the encryption result in Base64. ### 4. Compare the Signature - Compare the result of your encryption (step 3) with the value of the `moonflow-signature` header received in the webhook notification. #### Generating a New Signature Key - If you need to generate a new signature key, you can do so from the same integrations settings section by selecting "View webhook signature key" again. This process ensures that only authentic and unaltered notifications are processed by your system. If the signature comparison is successful, you can confidently proceed with handling the received data. ### Webhook Notifications The configured webhook will notify about two main types of interactions: - **Communication Records**: Include notifications about outgoing messages (from channels such as WhatsApp, Email, SMS, Call, Field Management), as well as updates on the statuses of these communications (Sent, Delivered, Opened, Read, Failed). - **Event Records**: Comprise notifications about specific actions taken on a payment order, such as Payment, Payment to Verify, Payment Commitment, Payment Cancellation. ``` -------------------------------- ### API Batch Process Status Check (GET) Source: https://api.moonflow.ai/raw/SjPQavd4 This GET request retrieves the status of an API batch process. It requires an `apiBatchProcessId` as a query parameter to identify the specific process. The base URL is defined by the `{{MOONFLOW_HOST}}` environment variable. ```http GET {{MOONFLOW_HOST}}/batch/process?apiBatchProcessId= ``` -------------------------------- ### API Message Object Example (JSON) Source: https://api.moonflow.ai/raw/SjPQavd4 This snippet shows an example of a message object as used in the Moonflow AI API. It includes fields for status, event date, advisor user ID, interaction ID, message type, the message content, and send time. The message content describes the atomic bomb. ```json { "status": "", "eventDate": "", "adviserBoUserId": "", "interactionId": "922d3813-bba1-4870-80dd-a2afc4c6983e", "type": "Entrante", "message": "La bomba atómica es un dispositivo explosivo basado en la fisión nuclear, donde núcleos de átomos pesados como el uranio o plutonio se dividen al ser bombardeados por neutrones, liberando una enorme cantidad de energía en forma de explosión. Este proceso desencadena una reacción en cadena que amplif...", "sentTime": "16:32" } ``` -------------------------------- ### Auxiliary Variables Configuration and Examples (Moonflow API) Source: https://api.moonflow.ai/raw/SjPQavd4 This section describes how to configure and use custom 'Auxiliary Variables' for client records in Moonflow API. These variables allow for custom data fields and can be either alphanumeric strings (up to 400 characters) or numeric values (Integer, Double). Examples demonstrate the JSON structure for both string and numeric auxiliary variables. ```JSON { "TEXT_EXAMP_1" : "Lorem ipsum dolor sit amet", "TEXT_EXAMP_2" : "https://www.moonflow.ai/es", "TEXT_EXAMP_3" : "AB13155C1" } ``` ```JSON { "NUM__EXAMP" : -150.99 } ``` -------------------------------- ### Auxiliary Variables - Numeric Type Example Source: https://api.moonflow.ai/raw/SjPQavd4 Provides an example of custom numeric auxiliary variables, which can be of Integer or Double types. ```json { "NUM__EXAMP": -150.99 } ``` -------------------------------- ### API Contact Information Object Example (JSON) Source: https://api.moonflow.ai/raw/SjPQavd4 This snippet illustrates a data structure representing contact information within the Moonflow AI API. It includes fields for send date, document type and number, name, last name, and communication channel. It also contains fields for currency, payment method, status, event date, advisor user ID, interaction ID, message type, message content, and send time. ```json { "sendDate": "11/09/2024", "documentTypeId": 100, "documentNumber": "10203046", "name": "Olinda Antonieta", "lastName": "Zavaleta Monja", "businessLegalName": "", "businessTradeName": "", "originName": "", "template": "", "channel": "Correo", "currency": "", "paymentMethod": "", "status": "", "eventDate": "", "adviserBoUserId": "", "interactionId": "276e87cc-ac73-4ee4-a8cd-b700a4b87884", "type": "Entrante", "message": "La bomba atómica es un dispositivo explosivo basado en la fisión nuclear, donde núcleos de átomos pesados como el uranio o plutonio se dividen al ser bombardeados por neutrones, liberando una enorme cantidad de energía en forma de explosión. Este proceso desencadena una reacción en cadena que amplif...", "sentTime": "16:32" } ``` -------------------------------- ### Moonflow AI Payment Order Batch Creation (POST) Source: https://api.moonflow.ai/raw/SjPQavd4 Example of a POST request to the Moonflow AI API for batch creation, update, or deletion of payment order records. It includes sending an email notification and an array of payment order data. The API validates document type and code against configured settings. ```json { "sendEmail": true, "data": [ { "documentTypeId": 400, "documentNumber": "987654321", "paymentCode": "987654321-1", "currency": "USD", "amount": 10, "dueDate": "2023-05-01", "productName": null, "feesAndPenalties": 1, "discount": 2, "externalClientId": "987654321", "quota": 3, "issuedDate": "2022-05-01", "attachment1": null, "attachment2": null, "description": "Lorem ipsum dolor sit amet, consectetur adipiscing elit", "deleted": false, "externalOrderId": null, "customVariables" : {}, "advanceOrUnappliedPayment" : null }, { "documentTypeId": 400, "documentNumber": "987654321", "paymentCode": "987654321-1", "currency": "USD", "amount": 15, "dueDate": "2023-06-01", "productName": null, "feesAndPenalties": 1, "discount": 2, "externalClientId": "987654321", "quota": 4, "issuedDate": "2022-06-01", "attachment1": null, "attachment2": null, "description": "Lorem ipsum dolor sit amet, consectetur adipiscing elit", "deleted": false, "externalOrderId": null, "customVariables" : {}, "advanceOrUnappliedPayment" : null } ] } ``` -------------------------------- ### GET /paymentorder/list Source: https://api.moonflow.ai/raw/SjPQavd4 Retrieves a consolidated list of payment orders, organized by status (Pending, Paid, Cancelled) and then by due date. Supports pagination for efficient handling of large datasets. ```APIDOC ## GET /paymentorder/list ### Description This endpoint retrieves a consolidated list of payment orders. The results are organized first by status (Pending, Paid, Cancelled) and then sorted by due date from oldest to newest. Pagination is supported to manage large volumes of data. ### Method GET ### Endpoint /paymentorder/list ### Parameters #### Query Parameters - **since** (string) - Optional - Start date for filtering (yyyy-MM-dd). - **until** (string) - Optional - End date for filtering (yyyy-MM-dd). - **page** (integer) - Optional - Specifies the page number for pagination. ### Response #### Success Response (200) - **last** (boolean) - Indicates if this is the last page. - **totalPages** (integer) - The total number of pages. - **numberOfElements** (integer) - The number of records in the current response. - **content** (array) - An array of payment orders, each containing client information. #### Response Example ```json { "last": false, "totalPages": 10, "numberOfElements": 100, "content": [ { "orderId": "PO12345", "status": "Pending", "dueDate": "2023-12-31", "clientInfo": { "clientId": "C67890", "clientName": "Example Client" } } // ... more payment orders ] } ``` ``` -------------------------------- ### GET /client/list Source: https://api.moonflow.ai/raw/SjPQavd4 Retrieves a list of clients, supporting both B2C and B2B client types. This endpoint is useful for fetching client data in a paginated manner. ```APIDOC ## GET /client/list ### Description Retrieves a list of clients, supporting both B2C and B2B client types. This endpoint is useful for fetching client data in a paginated manner. ### Method GET ### Endpoint `{{MOONFLOW_HOST}}/client/list?page=` ### Query Parameters - **page** (integer) - Required - The page number for pagination. ``` -------------------------------- ### GET /event/list Source: https://api.moonflow.ai/raw/SjPQavd4 Retrieves a list of recorded events. This endpoint supports filtering by date range and pagination. ```APIDOC ## GET /event/list ### Description Retrieves a list of recorded events. This endpoint supports filtering by date range and pagination. ### Method GET ### Endpoint /event/list ### Parameters #### Query Parameters - **since** (string) - Optional - Filters events registered on or after this date. Format: yyyy-MM-dd. - **until** (string) - Optional - Filters events registered on or before this date. Format: yyyy-MM-dd. - **page** (integer) - Optional - Specifies the page number for pagination. Defaults to 1. - **documentTypeId** (string) - Optional - Filters events by the customer's document type. ### Response #### Success Response (200) - **events** (Array of Event Objects) - A list of event objects matching the query parameters. #### Event Object Structure: - **id** (string) - Unique identifier for the event. - **documentTypeId** (string) - The customer's document type. - **documentNumber** (string) - The customer's document number. - **eventType** (string) - The type of event recorded. - **amount** (number) - The amount associated with the event, if applicable. - **paymentMethodCode** (integer) - The code for the payment method, if applicable. - **creationDate** (string) - The date and time the event was created. #### Response Example ```json { "events": [ { "id": "evt_a1b2c3d4e5f6", "documentTypeId": "CC", "documentNumber": "123456789", "eventType": "Pago", "amount": 100.50, "paymentMethodCode": 993, "creationDate": "2023-10-27T10:05:00Z" }, { "id": "evt_f6e5d4c3b2a1", "documentTypeId": "NIT", "documentNumber": "987654321", "eventType": "Evento tipo ajuste", "amount": 50.00, "paymentMethodCode": 990, "creationDate": "2023-10-27T10:10:00Z" } ] } ``` ``` -------------------------------- ### GET /interaction/list Source: https://api.moonflow.ai/raw/SjPQavd4 This endpoint allows for the batch retrieval and filtering of interactions. You can fetch up to 100 records at a time and apply various optional parameters to refine your search. ```APIDOC ## GET /interaction/list ### Description Lists interactions with optional filtering parameters. Supports fetching records in batches of up to 100. ### Method GET ### Endpoint /interaction/list ### Parameters #### Query Parameters - **`page`** (integer) - Optional - Page number for results, starting at 0. - **`since`** (string) - Optional - Start date for the search interval (format: yyyy-MM-dd). - **`until`** (string) - Optional - End date for the search interval (format: yyyy-MM-dd). - **`actionType`** (string) - Optional - Comma-separated list of action types (e.g., "Compromiso De Pago,Pago"). Possible values: Compromiso De Pago, Pago, Pago A Verificar, Anulación, Ajuste. - **`documentNumber`** (string) - Optional - Document number. Use in conjunction with `documentType`. - **`documentType`** (string) - Optional - Document type. Use in conjunction with `documentNumber`. - **`channel`** (string) - Optional - Comma-separated list of channels (e.g., "Correo,Whatsapp"). Possible values: Correo, Email, Whatsapp, Sms, Llamada, Gestión De Campo, Whatsapp Cloud Api, Carga Masiva - Dashboard, Web De Cobranza, Carga Masiva - Sftp, Conciliación De Pagos, Notas. - **`processes`** (string) - Optional - Comma-separated list of processes (e.g., "Activación de créditos"). Possible values: Activación de créditos. - **`type`** (string) - Optional - Comma-separated list of communication types (e.g., "Entrante,Saliente"). Possible values: Entrante, Saliente. ### Response #### Success Response (200) - **`last`** (boolean) - Indicates if this is the last page. - **`totalPages`** (integer) - Total number of pages. - **`numberOfElements`** (integer) - Number of records returned. - **`content`** (WebhookRequest[]) - List of interactions matching the applied filters. #### Response Example ```json { "last": false, "totalPages": 10, "numberOfElements": 100, "content": [ { "id": "interaction_id_1", "timestamp": "2023-10-27T10:00:00Z", "actionType": "Pago", "documentNumber": "DOC12345", "documentType": "Invoice", "channel": "Email", "process": "Activación de créditos", "communicationType": "Entrante" } // ... more interaction objects ] } ``` ``` -------------------------------- ### Create, Update, or Delete Payment Order (JSON) Source: https://api.moonflow.ai/raw/SjPQavd4 Example JSON payload for interacting with the Moonflow AI payment order API. This structure includes details for document type, identifiers, payment information, and optional fields like attachments and custom variables. The 'deleted' field can be used to mark records for deletion or revert an annulment. ```json { "documentTypeId": 400, "documentNumber": "987654321", "paymentCode": "987654321-1", "currency": "USD", "amount": 10, "dueDate": "2023-05-01", "productName": null, "feesAndPenalties": 1, "discount" : 2, "externalClientId": "987654321", "quota": 3, "issuedDate" : "2022-05-01", "attachment1" : null, "attachment2" : null, "description" : "Lorem ipsum dolor sit amet, consectetur adipiscing elit", "deleted" : false, "externalOrderId" : null, "customVariables" : {}, "advanceOrUnappliedPayment" : null } ``` -------------------------------- ### Gestión Masiva de Órdenes de Pago (POST /event) Source: https://api.moonflow.ai/raw/SjPQavd4 Permite la creación, actualización o eliminación masiva de registros de órdenes de pago. Soporta operaciones asíncronas para procesar múltiples órdenes de pago a la vez, ideal para cronogramas de créditos, facturas o documentos por cobrar. ```APIDOC ## Crear, actualizar o eliminar registros de órdenes de pago masivamente Esta API permite la gestión de órdenes de pago (B2C y B2B) de forma masiva, facilitando la creación, actualización y eliminación de estas. La API soporta la ejecución de procesos asíncronos (API Batch) para procesar múltiples órdenes de pago simultáneamente. ### Método POST ### Endpoint `{{MOONFLOW_HOST}}/event` ### Parámetros #### Request Body - **data** (array[object]) - Requerido - Listado de órdenes de pago a procesar. Máximo 5000 registros por solicitud. Cada objeto dentro del array representa una orden de pago individual y debe contener los siguientes campos: - **documentTypeId** (integer) - Requerido - El identificador del tipo de documento asociado al cliente. - **documentNumber** (string) - Requerido - El número de documento del cliente. - **paymentCode** (string) - Requerido - Un código único asignado a la orden de pago. - **currency** (string) - Opcional - La moneda de la orden de pago (ej. "USD"). - **amount** (number) - Opcional - El monto de la orden de pago. - **paymentDate** (string) - Opcional - La fecha de pago en formato YYYY-MM-DD. - **externalClientId** (string) - Opcional - Identificador externo del cliente. - **paymentMethodId** (any) - Opcional - ID del método de pago. - **eventType** (string) - Opcional - Tipo de evento (ej. "Pago"). - **quota** (any) - Opcional - Cuota asociada. - **reference** (string) - Opcional - Referencia de la orden de pago. - **sendEmail** (boolean) - Requerido - Indica si se debe enviar un correo electrónico al finalizar la ejecución del proceso batch. ### Request Example ```json { "data": [ { "documentTypeId": 400, "documentNumber": "987654321", "paymentCode": "987654321-1", "currency": "USD", "amount": 4, "paymentDate": "2023-04-01", "externalClientId": "987654321", "paymentMethodId" : null, "eventType" : "Pago", "quota": null, "reference" : "MI REFERENCIA" } ], "sendEmail": true } ``` ### Response #### Success Response (200 OK) - **id** (string) - Código único del proceso API Batch ejecutado. - **registerDate** (Date) - Fecha de creación del proceso API Batch. - **errors** (array[string]) - Lista de posibles errores ocurridos durante la ejecución del proceso API Batch. #### Response Example ```json { "id": "process-12345abc", "registerDate": "2023-10-27T10:00:00Z", "errors": [] } ``` **Nota:** El `id` retornado puede ser utilizado para consultar el estado del proceso posteriormente mediante la opción "Visualizar estado de proceso" dentro de "API Batch". ``` -------------------------------- ### POST /event/batch Source: https://api.moonflow.ai/raw/SjPQavd4 Allows for the creation of multiple payment order events in a B2C and B2B context. This is an asynchronous batch process designed for efficiency when handling numerous event records. ```APIDOC ## POST /event/batch ### Description Allows for the creation of multiple payment order events in a B2C and B2B context. This is an asynchronous batch process designed for efficiency when handling numerous event records. ### Method POST ### Endpoint /event/batch ### Parameters #### Request Body - **data** (Event[]) - Required - A list of events (up to 5000 records). Each event object should conform to the individual event record structure. - **sendEmail** (boolean) - Required - Indicates whether to send an email notification upon completion of the batch process. #### Event Object Structure (within data array) - **documentTypeId** (string) - Required - Identifier for the customer's document type. - **documentNumber** (string) - Required - The customer's document number. - **eventType** (string) - Required - The type of event to record. Accepted values: 'Pago', 'Pago a Verificar', 'Compromiso de Pago', 'Evento tipo ajuste', 'Anulación de Pago'. - **amount** (number) - Optional - The amount associated with the event. Required for 'Pago' and 'Evento tipo ajuste'. - **paymentMethodCode** (integer) - Optional - The code for the payment method used. Required for 'Pago' and 'Evento tipo ajuste'. Accepted codes for 'Evento tipo ajuste': 993 (Efectivo), 994 (Transferencia bancaria), 990 (Descuento), 991 (Crédito), 999 (Otros). ### Request Example ```json { "data": [ { "documentTypeId": "CC", "documentNumber": "123456789", "eventType": "Pago", "amount": 100.50, "paymentMethodCode": 993 }, { "documentTypeId": "NIT", "documentNumber": "987654321", "eventType": "Evento tipo ajuste", "amount": 50.00, "paymentMethodCode": 990 } ], "sendEmail": true } ``` ### Response #### Success Response (200) - **id** (String) - The code of the executed batch API process. - **registerDate** (Date) - The creation date of the batch API process. - **errors** (String[]) - Any errors encountered during the execution of the batch process. #### Response Example ```json { "id": "proc_123abc456def", "registerDate": "2023-10-27T10:00:00Z", "errors": [] } ``` ``` -------------------------------- ### Listar Eventos de Pago Moonflow AI Source: https://api.moonflow.ai/raw/SjPQavd4 Permite obtener un listado consolidado de eventos de pago, facilitando la revisión y seguimiento. Los registros se recuperan en grupos de hasta 100 y se ordenan cronológicamente por fecha de vencimiento. Se recomienda usar paginación y filtros para gestionar grandes volúmenes de datos. ```bash GET {{MOONFLOW_HOST}}/event/list?since=&until=&page= ``` -------------------------------- ### GET /batch/process Source: https://api.moonflow.ai/raw/SjPQavd4 Retrieves the status of a batch process using its ID. This endpoint is useful for monitoring the progress and completion of asynchronous batch operations. ```APIDOC ## GET /batch/process ### Description Retrieves the status of a batch process using its ID. This endpoint is useful for monitoring the progress and completion of asynchronous batch operations. ### Method GET ### Endpoint /batch/process #### Query Parameters - **apiBatchProcessId** (string) - Required - The unique identifier for the batch process whose status needs to be retrieved. ### Request Example ``` GET https://{{MOONFLOW_HOST}}/batch/process?apiBatchProcessId=YOUR_PROCESS_ID ``` ### Response #### Success Response (200) - **status** (string) - The current status of the batch process (e.g., PENDING, PROCESSING, COMPLETED, FAILED). - **completionPercentage** (number) - The percentage of the batch process that has been completed. - **message** (string) - A detailed message about the current status or any errors encountered. #### Response Example ```json { "status": "PROCESSING", "completionPercentage": 75, "message": "Batch process is currently executing." } ``` ``` -------------------------------- ### GET /websites/api_moonflow_ai Source: https://api.moonflow.ai/raw/SjPQavd4 Retrieves user profile information. This endpoint allows fetching details such as gender, birthdate, and various phone numbers associated with a user. ```APIDOC ## GET /websites/api_moonflow_ai ### Description Retrieves user profile information. This endpoint allows fetching details such as gender, birthdate, and various phone numbers associated with a user. ### Method GET ### Endpoint /websites/api_moonflow_ai ### Parameters #### Query Parameters - **userId** (string) - Required - The unique identifier for the user whose profile is being requested. ### Request Example ``` GET /websites/api_moonflow_ai?userId=12345 ``` ### Response #### Success Response (200) - **gender** (string) - The gender code of the account (F: Female, M: Male, O: Other). - **birthdate** (string) - The date of birth in YYYY-MM-DD format. - **cellphone1CountryCode** (string) - The country code for the primary cellphone number. Null indicates the project's default country code. - **cellphone1** (string) - The primary cellphone number. - **cellphone2CountryCode** (string) - The country code for the secondary cellphone number. Null indicates the project's default country code. - **cellphone2** (string) - The secondary cellphone number. - **cellphone3CountryCode** (string) - The country code for the tertiary cellphone number. Null indicates the project's default country code. - **cellphone3** (string) - The tertiary cellphone number. - **cellphone4CountryCode** (string) - The country code for the fourth cellphone number. Null indicates the project's default country code. - **cellphone4** (string) - The fourth cellphone number. - **cellphone5CountryCode** (string) - The country code for the fifth cellphone number. Null indicates the project's default country code. - **cellphone5** (string) - The fifth cellphone number. #### Response Example ```json { "gender": "F", "birthdate": "1990-05-15", "cellphone1CountryCode": "+1", "cellphone1": "5551234567", "cellphone2CountryCode": null, "cellphone2": "5559876543", "cellphone3CountryCode": "+44", "cellphone3": "02071234567", "cellphone4CountryCode": null, "cellphone4": "", "cellphone5CountryCode": null, "cellphone5": "" } ``` ``` -------------------------------- ### Supported Currencies Source: https://api.moonflow.ai/raw/SjPQavd4 This section details the currencies supported by the platform, including their ISO codes and symbols, for global transaction ease. ```APIDOC ## Supported Currencies This endpoint provides a list of currencies supported by the platform, along with their ISO codes and symbols. ### Response #### Success Response (200) - **currencies** (array) - A list of supported currencies. - **name** (string) - The name of the currency. - **isoCode** (string) - The ISO 4217 code for the currency. - **symbol** (string) - The symbol used for the currency. ### Response Example ```json { "currencies": [ { "name": "Dólar estadounidense", "isoCode": "USD", "symbol": "$" }, { "name": "Euros", "isoCode": "EUR", "symbol": "€" }, { "name": "Pesos argentinos", "isoCode": "ARS", "symbol": "$" } ] } ``` ``` -------------------------------- ### Auxiliary Variables - String Type Example Source: https://api.moonflow.ai/raw/SjPQavd4 Illustrates the structure for custom string-based auxiliary variables. These variables can hold alphanumeric values up to 400 characters. ```json { "TEXT_EXAMP_1": "Lorem ipsum dolor sit amet", "TEXT_EXAMP_2": "https://www.moonflow.ai/es", "TEXT_EXAMP_3": "AB13155C1" } ``` -------------------------------- ### Guarantor Information Structure Source: https://api.moonflow.ai/raw/SjPQavd4 Outlines the required fields for providing guarantor information in client records. Includes name, last name, country code, phone number, and email. ```json { "name": "String", "lastName": "String", "cellphoneCountryCode": "String", "cellphone": "String", "email": "String" } ``` -------------------------------- ### GET /websites/api_moonflow_ai Source: https://api.moonflow.ai/raw/SjPQavd4 This endpoint retrieves information related to websites managed by Moonflow AI. It supports filtering by various criteria such as date ranges, document types, and channels. ```APIDOC ## GET /websites/api_moonflow_ai ### Description Retrieves website data with optional filtering parameters. ### Method GET ### Endpoint /websites/api_moonflow_ai ### Parameters #### Query Parameters - **from** (string) - Optional - Start date for filtering (yyyy-MM-dd). - **until** (string) - Optional - End date for filtering (yyyy-MM-dd). - **actionType** (string) - Optional - Filter by action type. - **documentNumber** (string) - Optional - Filter by document number. - **documentType** (string) - Optional - Filter by document type. - **channel** (string) - Optional - Filter by channel. - **type** (string) - Optional - Filter by type (e.g., 'Saliente'). ### Request Example ```json GET /websites/api_moonflow_ai?from=2024-01-01&until=2024-01-31&type=Saliente ``` ### Response #### Success Response (200) - **status** (string) - The status of the response (e.g., 'OK'). - **code** (integer) - The HTTP status code. - **header** (array) - An array of response headers. - **cookie** (array) - An array of response cookies. #### Response Example ```json { "status": "OK", "code": 200, "_postman_previewlanguage": "json", "header": [ { "key": "Content-Type", "value": "application/json" }, { "key": "Content-Length", "value": "61671" }, { "key": "Connection", "value": "keep-alive" }, { "key": "Date", "value": "Fri, 13 Sep 2024 14:55:32 GMT" }, { "key": "x-amzn-Remapped-Date", "value": "Fri, 13 Sep 2024 14:55:32 GMT" }, { "key": "x-amzn-RequestId", "value": "51590f3e-6140-457d-9d84-c1cdad67d7ee" }, { "key": "X-XSS-Protection", "value": "1; mode=block" }, { "key": "X-Frame-Options", "value": "DENY" }, { "key": "x-amzn-Remapped-Connection", "value": "keep-alive" }, { "key": "x-amz-apigw-id", "value": "eDHO-FpMIAMEkaA=" }, { "key": "Vary", "value": "Origin" }, { "key": "Vary", "value": "Access-Control-Request-Method" }, { "key": "Vary", "value": "Access-Control-Request-Headers" }, { "key": "Cache-Control", "value": "no-cache, no-store, max-age=0, must-revalidate" }, { "key": "Expires", "value": "0" }, { "key": "X-Content-Type-Options", "value": "nosniff" }, { "key": "Pragma", "value": "no-cache" }, { "key": "X-Cache", "value": "Miss from cloudfront" }, { "key": "Via", "value": "1.1 1adfba9b4405a3449a5b09ed0c6cf6ca.cloudfront.net (CloudFront)" }, { "key": "X-Amz-Cf-Pop", "value": "EZE50-P5" }, { "key": "X-Amz-Cf-Id", "value": "rnYY2lbV-hTDLP2B8rmH0Zai3Fx4XWWOH4gWlBLiUgLx4BCyPPjPog==" } ], "cookie": [] } ``` ``` -------------------------------- ### POST /paymentorder/batch Source: https://api.moonflow.ai/raw/SjPQavd4 Creates, updates, or deletes payment order records in batch for both B2C and B2B clients. This endpoint allows for bulk processing of payment order data, including details like currency, amount, due dates, and custom variables. ```APIDOC ## POST /paymentorder/batch ### Description Creates, updates, or deletes payment order records in batch (B2C and B2B). ### Method POST ### Endpoint `{{MOONFLOW_HOST}}/paymentorder/batch` ### Parameters #### Request Body - **sendEmail** (boolean) - Required - Indicates if an email should be sent. - **data** (array) - Required - An array of payment order objects. - **documentTypeId** (integer) - Required - Type of the document. - **documentNumber** (string) - Required - Number of the document. - **paymentCode** (string) - Required - Unique payment code. - **currency** (string) - Required - Currency of the payment (e.g., "USD"). - **amount** (number) - Required - The payment amount. - **dueDate** (string) - Required - The due date in YYYY-MM-DD format. - **productName** (string) - Optional - Name of the product. - **feesAndPenalties** (number) - Optional - Fees and penalties amount. - **discount** (number) - Optional - Discount amount. - **externalClientId** (string) - Required - External client identifier. - **quota** (integer) - Optional - Payment quota number. - **issuedDate** (string) - Required - The issue date in YYYY-MM-DD format. - **attachment1** (string) - Optional - URL or identifier for attachment 1. - **attachment2** (string) - Optional - URL or identifier for attachment 2. - **description** (string) - Optional - Description of the payment order. - **deleted** (boolean) - Required - Flag to indicate if the record is deleted. - **externalOrderId** (string) - Optional - External order identifier. - **customVariables** (object) - Optional - Key-value pairs for custom variables. - **advanceOrUnappliedPayment** (object) - Optional - Details for advance or unapplied payments. ### Request Example ```json { "sendEmail": true, "data": [ { "documentTypeId": 400, "documentNumber": "987654321", "paymentCode": "987654321-1", "currency": "USD", "amount": 10, "dueDate": "2023-05-01", "productName": null, "feesAndPenalties": 1, "discount": 2, "externalClientId": "987654321", "quota": 3, "issuedDate": "2022-05-01", "attachment1": null, "attachment2": null, "description": "Lorem ipsum dolor sit amet, consectetur adipiscing elit", "deleted": false, "externalOrderId": null, "customVariables" : {}, "advanceOrUnappliedPayment" : null } ] } ``` ### Response #### Success Response (200) (Response details not provided in the source text) #### Response Example (Response example not provided in the source text) ``` -------------------------------- ### GET /api/batch/process/status Source: https://api.moonflow.ai/raw/SjPQavd4 Retrieve the status of an API Batch process using its ID. This endpoint allows you to monitor the progress and outcome of batch operations, such as client creation or payment order processing. ```APIDOC ## GET /api/batch/process/status ### Description This endpoint allows you to visualize the status of an API Batch process that you have created using the API. By providing the process ID, you can view details such as creation date, start and finish dates, errors, status, and type of the batch process. ### Method GET ### Endpoint /api/batch/process/status #### Query Parameters - **apiBatchProcessId** (String) - Required - The ID of an API Batch process. ### Response #### Success Response (200) - **id** (String) - Code of the executed API Batch process. - **registerDate** (Date) - Creation date of the API Batch process. - **startDate** (Date) - Start date of the API Batch process. - **finishDate** (Date) - Finish date of the API Batch process. - **errors** (String[]) - Potential errors during the execution of the API Batch process. - **status** (Character) - Status of the API Batch process (E: Executed with errors, F: Failed, P: Pending, R: Running, S: Successful). - **type** (Character) - Type of the API Batch process (C: Clients, P: Payment orders, R: Events, I: External communications). #### Response Example ```json { "id": "batch_process_123", "registerDate": "2023-10-27T10:00:00Z", "startDate": "2023-10-27T10:05:00Z", "finishDate": "2023-10-27T10:15:00Z", "errors": [], "status": "S", "type": "C" } ``` ``` -------------------------------- ### 1.1.6 Create, Update, or Delete B2B Client Records Batch Source: https://api.moonflow.ai/raw/SjPQavd4 This endpoint facilitates the batch creation, updating, or deletion of B2B client records. It allows for efficient management of multiple client entries simultaneously. ```APIDOC ## POST /websites/api_moonflow_ai ### Description This endpoint allows for the batch creation, updating, or deletion of B2B client records. It is designed for efficient management of multiple client entries simultaneously. ### Method POST ### Endpoint /websites/api_moonflow_ai ### Parameters #### Request Body - **document_type** (string) - Required - The type of document associated with the client. - **document_number** (string) - Required - The unique identification number of the document. - **name** (string) - Required - The name of the client. - **business_name** (string) - Required - The official business name of the client. - **country_phone_code** (integer) - Optional - The international phone code for the client's country. - **phone_number** (integer) - Optional - The client's phone number. - **email** (string) - Optional - The client's email address. - **level** (integer) - Optional - The client's contact level (1, 2, or 3). ### Request Example ```json { "document_type": "string", "document_number": "string", "name": "string", "business_name": "string", "country_phone_code": 123, "phone_number": 123456789, "email": "string", "level": 1 } ``` ### Response #### Success Response (200) - **message** (string) - Description of the operation's success. #### Response Example ```json { "message": "Client records processed successfully." } ``` ``` -------------------------------- ### List Clients (B2C and B2B) Source: https://api.moonflow.ai/raw/SjPQavd4 This operation allows searching for client information for both individuals (B2C) and businesses (B2B) in batches of up to 100 records. Results are sorted by document type and then by document number. This function is useful for obtaining general views or performing mass operations. ```APIDOC ## GET /client/list ### Description Retrieves a paginated list of clients (B2C and B2B), sorted by document type and number. ### Method GET ### Endpoint /client/list #### Query Parameters - **page** (integer) - Required - The page number of the results to retrieve (0-indexed). ### Response #### Success Response (200) - **last** (boolean) - Indicates if this is the last page of results. - **totalPages** (integer) - The total number of pages available. - **numberOfElements** (integer) - The number of elements on the current page. - **content** (array) - An array of client objects (ClienteB2C[] or ClienteB2B[]). #### Response Example { "last": false, "totalPages": 10, "numberOfElements": 100, "content": [ { "documentTypeId": "CC", "documentNumber": "1000000001", "name": "Juan Perez", "lastName": "Perez", "type": "B2C" } ] } ```