### GET /api/interaction/list Source: https://documenter.getpostman.com/view/50551729/2sB3dPSWDa/index This section of the documentation guides you through the process of searching and retrieving interactions stored in our system. The interaction search functionality is designed to provide an efficient and flexible way to access the specific records you need, using various filters to refine the results. ```APIDOC ## GET /api/interaction/list ### Description This endpoint allows you to search and retrieve interactions stored in the system. It is designed to offer an efficient and flexible way to access specific records using various filters. ### Method GET ### Endpoint https://api.moonflow.ai/api/interaction/list ### Parameters #### Query Parameters - **filter1** (string) - Optional - Description of filter 1 - **filter2** (string) - Optional - Description of filter 2 ### Request Example (No request body for GET requests) ### Response #### Success Response (200) - **interactions** (array) - A list of interaction objects. - **interactionId** (string) - The unique identifier for the interaction. - **timestamp** (string) - The date and time the interaction occurred. - **details** (object) - Contains specific details about the interaction. #### Response Example ```json { "interactions": [ { "interactionId": "int_12345", "timestamp": "2023-10-27T10:00:00Z", "details": { "type": "call", "duration": "00:05:30" } }, { "interactionId": "int_67890", "timestamp": "2023-10-27T11:30:00Z", "details": { "type": "email", "subject": "Follow-up regarding your inquiry" } } ] } ``` ``` -------------------------------- ### Example Interaction List Response (JSON) Source: https://documenter.getpostman.com/view/50551729/2sB3dPSWDa/index This JSON object represents a successful response from the interaction listing endpoint. It includes pagination details and a list of interaction objects, each containing details like send date, document information, customer names, and message content. ```json { "last": true, "totalPages": 1, "numberOfElements": 6, "content": [ { "sendDate": "13/09/2024", "documentTypeId": 100, "documentNumber": "10203043", "name": "Christian Joel", "lastName": "Mendoza Villarreal", "businessLegalName": "", "businessTradeName": "", "originName": "Gestión intensiva (Promesa rota)", "template": "3 días vencido", "channel": "Correo", "currency": "", "paymentMethod": "", "status": "Abierto", "eventDate": "", "adviserBoUserId": "", "interactionId": "d05fca6e-de6d-4e4f-8529-3daa51b51558", "type": "Saliente", "message": "Hola Christian Joel, tu cuota ha vencido hace 3 días, el saldo a pagar es de S/ 800.00. Paga hoy y evita generar intereses moratorios y cargos por atraso. Encuentra más información y la ayuda que necesitas en intelcore.dev.moonflow.xyz. Saludos, El equipo de Intel Core", "sentTime": "09:05" }, { "sendDate": "13/09/2024", "documentTypeId": 100, "documentNumber": "10203043", "name": "Christian Joel", "lastName": "Mendoza Villarreal", "businessLegalName": "", "businessTradeName": "", "originName": "Gestión intensiva (Promesa rota)", "template": "5 días vencido", "channel": "Whatsapp", "currency": "", "paymentMethod": "", "status": "Abierto", "eventDate": "", "adviserBoUserId": "", "interactionId": "b27670e6-fed3-4555-a34f-90cf41c25a18", "type": "Saliente", "message": "Hola Christian Joel, tienes 3 días de atraso, contáctanos ☎️. Tu saldo es de S/ 800.00. Evita cargos por atraso intelcore.dev.moonflow.xyz. Saludos, El equipo de Intel Core", "sentTime": "09:05" }, { "sendDate": "13/09/2024", "documentTypeId": 100, "documentNumber": "10203043", "name": "Christian Joel", "lastName": "Mendoza Villarreal", "businessLegalName": "", "businessTradeName": "", "originName": "Gestión intensiva (Promesa rota)", "template": "3 días vencido", "channel": "Sms", "currency": "", "paymentMethod": "", "status": "", "eventDate": "", "adviserBoUserId": "", "interactionId": "7fc6829d-ed85-4578-9b91-79988869b51e", "type": "Saliente", "message": "Christian Joel, tienes 3 días atraso. El saldo es de S/ 800.00. Visítanos en intelcore.dev.moonflow.xyz. Intel Core", "sentTime": "09:05" }, { "sendDate": "13/09/2024", "documentTypeId": 100, "documentNumber": "10203043", "name": "Christian Joel", "lastName": "Mendoza Villarreal", "businessLegalName": "", "businessTradeName": "", "originName": "Gestión intensiva (Promesa rota)", "template": "Llamada de mora temprana", "channel": "Llamada", "currency": "", "paymentMethod": "", "status": "Por gestionar", "eventDate": "", "adviserBoUserId": "", "interactionId": "028edf38-c1ce-42a6-9d50-45500b637a97", "type": "Saliente", "message": "Hola Christian Joel, tienes 3 días de atraso⛔. Tu saldo es de S/ 800.00. Evita cargos por atraso.", "sentTime": "09:05" }, { "sendDate": "13/09/2024", "documentTypeId": 100, "documentNumber": "10203042", "name": "Yhoel Nicolas", "lastName": "Figueroa Choque", "businessLegalName": "", "businessTradeName": "", "originName": "Gestión intensiva (Promesa rota)", "template": "Llamada", "channel": "Llamada", "currency": "", "paymentMethod": "", "status": "Por gestionar", "eventDate": "", "adviserBoUserId": "", "interactionId": "d370b410-36f2-4e09-849e-6f5e296ccf9d", "type": "Saliente", "sentTime": "08:00" }, { "sendDate": "12/09/2024", "documentTypeId": 100, "documentNumber": "10203046", "name": "Olinda Antonieta", "lastName": "Zavaleta Monja", "businessLegalName": "", "businessTradeName": "", "originName": "", "template": "", "channel": "Whatsapp", "currency": "", "paymentMethod": "", "status": "", "eventDate": "", "adviserBoUserId": "", "interactionId": "", "type": "", "message": "", "sentTime": "" } ] } ``` -------------------------------- ### JSON Data Structure Example Source: https://documenter.getpostman.com/view/50551729/2sB3dPSWDa/index This snippet illustrates a common JSON structure used for storing message data, including sender information, timestamps, and message content. It is language-agnostic in its representation. ```json { "sendDate": "11/09/2024", "documentTypeId": 100, "documentNumber": "10203066", "name": "Jesus Elias", "lastName": "Moran Martinez", "businessLegalName": "", "businessTradeName": "", "originName": "", "template": "", "channel": "Correo", "currency": "", "paymentMethod": "", "status": "", "eventDate": "", "adviserBoUserId": "", "interactionId": "0b203003-1740-45a1-b553-351ef497b611", "type": "Entrante", "message": "El Tesla Model 3 es un sedán eléctrico de alto rendimiento con un diseño elegante y moderno. Ofrece una aceleración impresionante, con una velocidad de 0 a 100 km/h en solo 3.1 segundos en la versión Performance. Su autonomía supera los 500 km con una sola carga, gracias a su batería de alta capacid...", "sentTime": "15:35" } ``` -------------------------------- ### GET /api/batch/process Source: https://documenter.getpostman.com/view/50551729/2sB3dPSWDa/index Retrieves the status of an API Batch process. This endpoint is useful for checking the progress and outcome of batch operations, such as client creation. ```APIDOC ## GET /api/batch/process ### Description Retrieves the status of an API Batch process. This endpoint is useful for checking the progress and outcome of batch operations, such as client creation. ### Method GET ### Endpoint https://api.moonflow.ai/api/batch/process ### Query Parameters - **apiBatchProcessId** (string) - Required - 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[]) - Possible 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 = In progress, S = Successful). - **type** (character) - Type of the API Batch process (C = Clients, P = Payment Orders, R = Events, I = External Communications). ### Request Example ```curl curl --location 'https://api.moonflow.ai/api/batch/process?apiBatchProcessId=' ``` ### Response Example ```json { "id": "string", "registerDate": "Date", "startDate": "Date", "finishDate": "Date", "errors": [ "string" ], "status": "character", "type": "character" } ``` ``` -------------------------------- ### GET /interactions Source: https://documenter.getpostman.com/view/50551729/2sB3dPSWDa/index Retrieves a list of interactions with optional filtering capabilities. You can specify page number, date ranges, action types, document details, channels, processes, and communication types to narrow down the results. The API returns interactions in batches of up to 100 records. ```APIDOC ## List Interactions This functionality allows for the search and retrieval of interactions in batches of up to 100 records. Records can be filtered using a set of optional parameters to suit your specific information needs. ### Method GET ### Endpoint /interactions ### Parameters #### Query Parameters - **`page`** (integer) - Optional - Page number of the results, starting from 0. This parameter allows you to navigate through multiple pages of records. - **`since`** (string: `yyyy-MM-dd`) - Optional - Start date of the search interval. Useful for limiting the search to interactions that occurred after a specific date. - **`until`** (string: `yyyy-MM-dd`) - Optional - End date of the search interval. Allows restricting the search to interactions that occurred before a specific date. - **`actionType`** (array of strings) - Optional - List of action types related to the interaction. Values should be comma-separated. Possible values include: `Compromiso De Pago`, `Pago`, `Pago A Verificar`, `Anulación`, `Ajuste`. - **`documentNumber`** (string) - Optional - Document number. Must be used in conjunction with `documentType`. - **`documentType`** (string) - Optional - Document type. Must be used in conjunction with `documentNumber`. - **`channel`** (array of strings) - Optional - List of channels through which the interaction occurred. Values should be comma-separated. Available options are: `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`** (array of strings) - Optional - List of processes for which the interaction was performed. Values should be comma-separated. Available options are: `Activación de créditos`. - **`type`** (array of strings) - Optional - List of communication types. Values should be comma-separated. Available options are: `Entrante`, `Saliente`. ### Request Example ``` GET /interactions?page=0&since=2023-01-01&until=2023-12-31&actionType=Pago,Anulación&channel=Email,Sms ``` ### Response #### Success Response (200) - **`interactions`** (array of objects) - A list of interaction objects matching the query criteria. - **`id`** (string) - The unique identifier of the interaction. - **`timestamp`** (string) - The date and time of the interaction. - **`actionType`** (string) - The type of action performed. - **`channel`** (string) - The channel through which the interaction occurred. - **`document`** (object) - Information about the document related to the interaction. - **`number`** (string) - The document number. - **`type`** (string) - The document type. - **`process`** (string) - The process associated with the interaction. - **`communicationType`** (string) - The type of communication. #### Response Example ```json { "interactions": [ { "id": "int_abc123", "timestamp": "2023-10-27T10:00:00Z", "actionType": "Pago", "channel": "Email", "document": { "number": "DOC456", "type": "Factura" }, "process": "Activación de créditos", "communicationType": "Saliente" } ] } ``` ``` -------------------------------- ### 1.5.1 Listar interacciones Source: https://documenter.getpostman.com/view/50551729/2sB3dPSWDa/index This endpoint allows you to list interactions with various optional filters such as date ranges, document types, and channels. It supports pagination and returns a list of interactions along with pagination details. ```APIDOC ## GET /api/interaction/list ### Description Lists interactions with optional filters for date range, document type, channel, and more. Supports pagination. ### Method GET ### Endpoint https://api.moonflow.ai/api/interaction/list ### Parameters #### Query Parameters - **page** (Integer) - Optional - The page number to retrieve. - **since** (String) - Optional (yyyy-MM-dd) - Start date for filtering interactions. - **until** (String) - Optional (yyyy-MM-dd) - End date for filtering interactions. - **actionType** (String) - Optional - Filter by action type (e.g., Anulacion). - **documentNumber** (String) - Optional - Filter by document number. - **documentType** (String) - Optional - Filter by document type. - **channel** (String) - Optional - Filter by channel (e.g., Correo, Whatsapp). - **type** (String) - Optional - Filter by interaction type. ### Request Example ```bash curl --location 'https://api.moonflow.ai/api/interaction/list?page=0&since=2024-01-01&until=2024-12-31' ``` ### 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 returned in this response. - **content** (Array) - A list of webhook requests (interactions) matching the applied filters. Each item in the array has the following structure: - **sendDate** (String) - The date the interaction was sent. - **documentTypeId** (Integer) - The ID of the document type. - **documentNumber** (String) - The document number. - **name** (String) - The name of the recipient. - **lastName** (String) - The last name of the recipient. - **businessLegalName** (String) - The legal name of the business (if applicable). - **businessTradeName** (String) - The trade name of the business (if applicable). - **originName** (String) - The origin of the interaction (e.g., 'Gestión intensiva (Promesa rota)'). - **template** (String) - The template used for the interaction. - **channel** (String) - The channel through which the interaction was sent (e.g., 'Correo', 'Whatsapp'). - **currency** (String) - The currency of the transaction (if applicable). - **paymentMethod** (String) - The payment method used (if applicable). - **status** (String) - The status of the interaction (e.g., 'Abierto', 'Por gestionar'). - **eventDate** (String) - The date of the event related to the interaction. - **adviserBoUserId** (String) - The ID of the adviser user. - **interactionId** (String) - The unique identifier for the interaction. - **type** (String) - The type of interaction (e.g., 'Saliente'). - **message** (String) - The content of the interaction message. - **sentTime** (String) - The time the interaction was sent. #### Response Example ```json { "last": false, "totalPages": 10, "numberOfElements": 5, "content": [ { "sendDate": "13/09/2024", "documentTypeId": 100, "documentNumber": "10203043", "name": "Christian Joel", "lastName": "Mendoza Villarreal", "businessLegalName": "", "businessTradeName": "", "originName": "Gestión intensiva (Promesa rota)", "template": "3 días vencido", "channel": "Correo", "currency": "", "paymentMethod": "", "status": "Abierto", "eventDate": "", "adviserBoUserId": "", "interactionId": "d05fca6e-de6d-4e4f-8529-3daa51b51558", "type": "Saliente", "message": "Hola Christian Joel, tu cuota ha vencido hace 3 días, el saldo a pagar es de S/ 800.00. Paga hoy y evita generar intereses moratorios y cargos por atraso. Encuentra más información y la ayuda que necesitas en intelcore.dev.moonflow.xyz. Saludos, El equipo de Intel Core", "sentTime": "09:05" } ] } ``` ``` -------------------------------- ### Webhook Verification Source: https://documenter.getpostman.com/view/50551729/2sB3dPSWDa/index Explains the importance of webhook verification to ensure secure and efficient integration by confirming the correct server reception of webhook notifications. ```APIDOC ## Webhook Verification ### Description This verification process is fundamental to ensure that webhook notifications are received by the correct server and that the integration functions securely and efficiently. Correct configuration and response to the verification request establish a solid foundation for effective and secure communication via webhooks. ### Method GET (or as specified by Moonflow during setup) ### Endpoint /webhook/verify (example endpoint) ### Parameters #### Query Parameters - **challenge** (string) - Required - A unique token provided by Moonflow for verification. ### Request Example (No request body, typically a GET request with a query parameter) ### Response #### Success Response (200) - **challengeResponse** (string) - The verification token echoed back to Moonflow. #### Response Example ```json { "challengeResponse": "" } ``` ``` -------------------------------- ### Currencies Source: https://documenter.getpostman.com/view/50551729/2sB3dPSWDa/index Our platform supports a wide range of international currencies, allowing you to operate in markets worldwide with ease. Below is our catalog of accepted currencies, including the currency, its ISO code, and the symbol used. ```APIDOC ## Currencies In our platform, we understand the importance of diversity and globalization of financial transactions. That is why we offer broad support for a variety of international currencies, allowing you to operate in markets worldwide with ease. Below you will find our catalog of accepted currencies, where each entry includes the currency, its corresponding ISO code, and the symbol used. This list ensures that you can correctly identify and use currencies for all your transaction needs. | Currency | ISO Code | Symbol | |------------------------------|----------|--------| | Dólar estadounidense | USD | $ | | Euros | EUR | € | | Pesos argentinos | ARS | $ | | Boliviano | BOB | Bs. | | Peso uruguayo | UYU | $ | | Real brasileño | BRL | R$ | | Guaraní | PYG | ₲ | | Dólar canadiense | CAD | $ | | Pesos mexicanos | MXN | $ | | Pesos colombianos | COP | $ | | Colones costarricenses | CRC | ₡ | | Soles peruanos | PEN | S/ | | Pesos cubanos | CUP | $ | | Bolívares venezolanos | VEN | Bs. | | Lempiras | HNL | L | | Balboas | PAB | B/ | | Córdobas | NIO | C$ | | Pesos dominicanos | DOP | $ | | Gourde haitiano | HTG | G | | Dólar jamaicano | JMD | $ | | Dólar beliceño | BZD | $ | | Dólar surinamés | SRD | $ | | Dólar del caribe oriental | XCD | $ | | Dólar bahameño | BSD | $ | | Dólar barbadense | BBD | $ | | Florín | AWG | ƒ | | Florín de las antillas neerlandesas | ANG | ƒ | | Dólar trinitense | TTD | $ | ``` -------------------------------- ### List Interactions using cURL Source: https://documenter.getpostman.com/view/50551729/2sB3dPSWDa/index This snippet demonstrates how to call the Moonflow API to list interactions using cURL. It shows the endpoint URL and implicitly assumes API Key authorization is handled via collection configuration. ```shell curl --location 'https://api.moonflow.ai/api/interaction/list' ``` -------------------------------- ### Visualize Batch Process Status Source: https://documenter.getpostman.com/view/50551729/2sB3dPSWDa/index This endpoint allows you to retrieve the status and details of a batch process initiated via the API. It requires the `apiBatchProcessId` as a query parameter. The response includes information such as the process ID, creation and completion dates, errors, status, and type. ```bash curl --location 'https://api.moonflow.ai/api/batch/process?apiBatchProcessId=' ``` -------------------------------- ### Webhook Configuration and Verification Source: https://documenter.getpostman.com/view/50551729/2sB3dPSWDa/index Moonflow's webhook feature allows for automated real-time notifications about significant events within the platform. This section details how to configure and secure these webhooks. ```APIDOC ## Webhook Configuration and Verification ### Description Moonflow's webhook feature allows for automated real-time notifications about significant events within the platform. This section details how to configure and secure these webhooks. ### Configuration Steps 1. **Access Integrations Section**: Navigate to the Integrations section in your Moonflow dashboard. 2. **Set Connection URL**: Provide the URL of your server where webhook notifications will be received. 3. **Save Changes**: Click the save button. ### Webhook Signature Verification To ensure the security and integrity of webhook data, verify the signature of each notification using the following steps: #### 1. Obtain Signature Key - In Moonflow, go to Configurations > Integrations. - Select "View webhook signature key" to retrieve your unique signature key. #### 2. Process Webhook Notification - Upon receiving a webhook notification, take the content (ensure it's in plain text format). #### 3. Encrypt Content - Use the HMAC_SHA256 algorithm to encrypt the notification content. - Use the signature key obtained in step 1 as your secret key. - Base64 encode the encryption result. #### 4. Compare Signature - Compare your encrypted result (step 3) with the value in the "moonflow-signature" header received with 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 configuration section by selecting "View webhook signature key" again. ### Notifiable Events Configured webhooks will notify about two main types of interactions: - **Communication Records**: Notifications about outgoing messages (from channels like WhatsApp, Email, SMS, Call, Field Management) and updates on their statuses (Sent, Delivered, Opened, Read, Failed). - **Event Records**: Notifications about specific actions taken on a payment order, such as Payment, Payment to Verify, Payment Commitment, Payment Cancellation. ``` -------------------------------- ### Notification Structure Source: https://documenter.getpostman.com/view/50551729/2sB3dPSWDa/index This section details the structure of a notification object, including all available fields, their data types, and descriptions. It covers information such as sending dates, recipient details (for both B2C and B2B), communication channel, payment-related fields, and event specifics. ```APIDOC ## Notification Object Structure ### Description This describes the structure of a notification object, including fields for sending details, recipient information, communication parameters, payment data, and event specifics. ### Method N/A (This is a data structure definition, not an API endpoint) ### Endpoint N/A ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body (This describes the fields within a notification object) - **sentDate** (String) - Required - Date of sending (Format YYYY-MM-DD) - **sentTime** (String) - Required - Time of sending (Format HH:mm) - **documentTypeId** (Integer) - Required - Numeric value referenced to the document type by the country defined in "Account Settings" - **documentNumber** (String) - Required - Identity document number - **name** (String) - Optional - Customer name (B2C only) - **lastName** (String) - Optional - Customer last name (B2C only) - **businessLegalName** (String) - Optional - Company's legal name or legal name (B2B only) - **businessTradeName** (String) - Optional - Name by which the customer is known (B2B only) - **externalClientId** (String) - Optional - External customer ID - **originName** (String) - Optional - Name of the flow, campaign, or event - **template** (String) - Optional - Name of the communication template - **channel** (String) - Required - Communication/event channel (e.g., Email, SMS, Whatsapp, Call, Field Management, Collection Web, Mass Upload - Dashboard, Mass Upload - SFTP, Dashboard, Payment Reconciliation) - **currency** (String) - Optional - ISO currency code - **eventAmount** (Double) - Optional - Event amount - **paymentMethod** (String) - Optional - Payment method - **status** (String) - Optional - Communication/event status - **paymentCode** (String) - Optional - Payment order code - **quota** (Integer) - Optional - Installment identifier - **paymentCodeAmount** (Double) - Optional - Pending amount for the payment order - **feesAndPenalties** (Double) - Optional - Charges and penalties - **notes** (String) - Optional - Interaction notes - **eventDate** (String) - Optional - Event date (Format YYYY-MM-DD HH:mm) - **attachment** (String) - Optional - Links to attached files - **attachment1Url** (String) - Optional - Attachment 1 for the payment order - **attachment2Url** (String) - Optional - Attachment 2 for the payment order - **issuedDate** (String) - Optional - Issuance date (Format YYYY-MM-DD) - **description** (String) - Optional - Payment order description - **discount** (Double) - Optional - Payment order discount - **externalOrderId** (String) - Optional - External order code - **reference** (String) - Optional - Transaction reference code - **phonecallFileUrl** (String) - Optional - Call file URL - **userProjectCode** (String) - Optional - User code in the system - **adviserBoUserId** (String) - Optional - User ID - **failedReason** (String) - Optional - Reason for failure description - **interactionId** (String) - Optional - Interaction identifier - **paymentOrderReference** (String[]) - Optional - List of reference payment codes - **recoveryCampaignReference** (String[]) - Optional - List of reference campaign codes - **eventOriginChannel** (String) - Optional - Origin channel identifier - **verificationProcessId** (Integer) - Optional - Verification process identifier - **destination** (String) - Optional - Communication destination - **destinations** (DestinationData[]) - Optional - Communication destinations (array of DestinationData objects) - **lastPaymentActionId** (String) - Optional - ID of the last registered event - **lastPaymentActionType** (String) - Optional - Type of the last registered event - **lastPaymentActionDate** (String) - Optional - Date of the last registered event - **lastCommunicationId** (String) - Optional - ID of the last communication sent - **lastCommunicationChannelType** (String) - Optional - Channel type of the last communication sent - **lastCommunicationStatus** (String) - Optional - Status of the last communication sent - **type** (String) - Optional - Interaction type (Incoming, Outgoing) - **communicationId** (String) - Optional - Communication ID - **eventAdviser** (String) - Optional - Event adviser identifier - **message** (String) - Optional - Communication content - **communicationPaymentCodes** (String[]) - Optional - List of payment codes with the installment ### DestinationData Object Structure - **destination** (String) - Required - Communication destination - **contactLevel** (Integer) - Optional - Contact level - **recipientType** (String) - Optional - Recipient type (C = Customer, R = References, G = Guarantor) ### Request Example ```json { "sentDate": "2023-10-27", "sentTime": "10:30", "documentTypeId": 1, "documentNumber": "123456789", "name": "John", "lastName": "Doe", "businessLegalName": null, "businessTradeName": null, "externalClientId": "ext-123", "originName": "Onboarding", "template": "WelcomeEmail", "channel": "Email", "currency": "USD", "eventAmount": 100.50, "paymentMethod": "CreditCard", "status": "Sent", "paymentCode": "PC-9876", "quota": 1, "paymentCodeAmount": 90.00, "feesAndPenalties": 5.50, "notes": "First contact", "eventDate": "2023-10-27 10:35", "attachment": null, "attachment1Url": null, "attachment2Url": null, "issuedDate": "2023-10-26", "description": "Invoice for services", "discount": 0.00, "externalOrderId": "ext-order-456", "reference": "ref-txn-789", "phonecallFileUrl": null, "userProjectCode": "PROJ-A", "adviserBoUserId": "user-101", "failedReason": null, "interactionId": "int-abc", "paymentOrderReference": [], "recoveryCampaignReference": [], "eventOriginChannel": "Web", "verificationProcessId": 123, "destination": "john.doe@example.com", "destinations": [ { "destination": "john.doe@example.com", "contactLevel": 1, "recipientType": "C" } ], "lastPaymentActionId": "pa-001", "lastPaymentActionType": "Payment", "lastPaymentActionDate": "2023-10-27 11:00", "lastCommunicationId": "comm-001", "lastCommunicationChannelType": "Email", "lastCommunicationStatus": "Delivered", "type": "Outgoing", "communicationId": "comm-002", "eventAdviser": "advisor-xyz", "message": "Your invoice is attached.", "communicationPaymentCodes": ["PC-9876"] } ``` ### Response #### Success Response (200) (N/A - This is a data structure definition) #### Response Example (N/A - This is a data structure definition) ``` -------------------------------- ### Verify Webhook Signature Source: https://documenter.getpostman.com/view/50551729/2sB3dPSWDa/index This code snippet demonstrates how to verify the signature of an incoming webhook notification to ensure data integrity and authenticity. It involves obtaining a signing key from Moonflow, encrypting the notification content using HMAC_SHA256, and comparing the resulting Base64 encoded signature with the `moonflow-signature` header. ```python import hmac import hashlib import base64 def verify_signature(payload, signature, signing_key): """Verifies the webhook signature.""" message = payload.encode('utf-8') key = signing_key.encode('utf-8') generated_signature = hmac.new(key, message, hashlib.sha256).digest() encoded_signature = base64.b64encode(generated_signature).decode('utf-8') return hmac.compare_digest(encoded_signature, signature) # Example Usage: # webhook_payload = request.data.decode('utf-8') # webhook_signature = request.headers.get('moonflow-signature') # moonflow_signing_key = "YOUR_SIGNING_KEY_FROM_MOONFLOW" # if verify_signature(webhook_payload, webhook_signature, moonflow_signing_key): # print("Signature verified. Process the payload.") # else: # print("Invalid signature. Drop the payload.") ``` -------------------------------- ### API Batch Process Type Source: https://documenter.getpostman.com/view/50551729/2sB3dPSWDa/index When interacting with the visualization of API Batch process states, you will receive a character reflecting the type of that process. The following details the codes used by our API and their meaning. ```APIDOC ## API Batch Process Type When interacting with the visualization of API Batch process states, you will receive a character reflecting the type of that process. Below are the codes used by our API, along with an explanation of their meaning in the context of our operations: | Code | Description | |------|---------------------------------| | `C` | Clients - The process is a client load. | | `P` | Payment Orders - The process is a payment order load. | | `R` | Events - The process is an event load. | ``` -------------------------------- ### API Batch Process Status Source: https://documenter.getpostman.com/view/50551729/2sB3dPSWDa/index When interacting with the visualization of API Batch process states, you will receive a character reflecting that status. The following details the codes used by our API and their meaning. ```APIDOC ## API Batch Process Status When interacting with the visualization of API Batch process states, you will receive a character reflecting that status. Below are the codes used by our API, along with an explanation of their meaning in the context of our operations: | Code | Description | |------|-------------------------------| | `S` | **Success** - The process finished successfully. | | `R` | **Running** - The process is still running. | | `P` | **Pending** - The process is pending. | | `F` | **Failed** - The process failed. | | `E` | **Success with errors** - The process executed successfully but encountered errors. | ``` -------------------------------- ### Document Types Source: https://documenter.getpostman.com/view/50551729/2sB3dPSWDa/index When interacting with the API, especially for searches or transactions related to clients or payment orders, it is essential to correctly specify both the document number (documentNumber) and the document type (documentTypeId) in your requests. ```APIDOC ## Document Types When interacting with our API, especially when performing searches or transactions related to clients or payment orders, it is essential to correctly specify both the document number (`documentNumber`) and the document type (`documentTypeId`) in your requests. This ensures that operations are performed accurately, based on the exact identification of the individual or entity in question. In the "Clients" section, we will delve deeper into how to interact with client information through our API. | Country | Document Type | |---------------|--------------------------------------------------| | Argentina | 600 DNI | | | 601 Cédula de identidad | | | 602 CUIT/CUIL | | | 603 Licencia de conducir | | | 604 Pasaporte | | | 605 Otro | | Chile | 500 Cédula de identidad | | | 501 Registro único tributario | | | 502 Licencia de conducir | | | 503 Pasaporte | | | 599 Otro | | Colombia | 400 Cédula de ciudadanía | | | 401 Documento de identidad | | | 402 Cédula de extranjería | | | 403 Número de identificación personal | | | 404 Pasaporte | | | 405 Permiso especial de permanencia | | | 406 Permiso de protección temporal | | | 407 Número de identificación tributaria | | | 499 Otro | | Panamá | 300 CIP | | | 301 RUC | | | 302 Pasaporte | | | 399 Otro | | México | 200 RFC | | | 201 CURP | | | 202 Identificador Fiscal | | | 203 Pasaporte | | | 204 Licencia de conducir | | | 205 Referencia | | | 299 Otro | | Perú | 100 DNI - Documento Nacional de identidad | | | 101 CE - Carné de extranjería | | | 102 RUC | | | 103 Pasaporte | | | 104 Licencia de conducir | | | 199 Otro | | Otros paises | 900 Documento de identidad | | | 901 Licencia de conducir | | | 902 Pasaporte | | | 903 Otros | | | 904 Referencia | | | 905 Identificador fiscal | | | 906 Cédula de identificación policial | | | 907 Registro único del contribuyente | ``` -------------------------------- ### Incoming Webhook Notifications Source: https://documenter.getpostman.com/view/50551729/2sB3dPSWDa/index Details how Moonflow sends automatic POST notifications to your configured webhook URL upon relevant events, including the expected JSON structure and response requirements. ```APIDOC ## Incoming Webhook Notifications ### Description Once your webhook is correctly configured and verified, Moonflow will send automatic notifications to inform you about relevant events and communications. These notifications are sent as POST requests to your webhook URL, containing JSON data detailing the event's nature. ### Method POST ### Endpoint [Your configured Webhook URL] ### Parameters #### Request Body - **event_type** (string) - Required - The type of event that triggered the notification. - **data** (object) - Required - Contains specific information related to the event. - **timestamp** (string) - Required - The time the event occurred. ### Request Example ```json { "event_type": "user_created", "data": { "user_id": "123e4567-e89b-12d3-a456-426614174000", "email": "test@example.com" }, "timestamp": "2023-10-27T10:00:00Z" } ``` ### Response #### Success Response (200) - Acknowledges successful receipt of the notification. #### Error Response - Any other HTTP status code indicates failure. ### Response Handling It is crucial that your platform responds to each notification with an HTTP status code of 200 to confirm successful reception. If an HTTP 200 response is not received, Moonflow will automatically attempt to resend the notification every 60 seconds. A total of two additional attempts will be made. If, after three attempts (the initial plus two retries), a successful HTTP 200 response is not obtained, Moonflow will cease retry attempts for that specific notification. ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.