### Moonflow API Authentication Example (cURL) Source: https://app.swaggerhub.com/apis-docs/d-041/Moonflow/1.0/index Example demonstrating how to make a GET request to the Moonflow API, including the necessary authorization token in the request header. This ensures secure and authenticated access to API resources. ```bash --location --request GET 'https://api.moonflow.ai/api/paymentorder/searchbydocument?documentTypeId=&documentNumber=&code=a=' --header 'moonflow-authorization: tu_API_Key_aquí;' ``` -------------------------------- ### Webhook Setup and Verification Source: https://app.swaggerhub.com/apis-docs/d-041/Moonflow/1.0/index Guides you through setting up and verifying webhooks in Moonflow for automated responses to significant events. This ensures secure communication between Moonflow and your server. ```APIDOC ## Webhook Configuration and Verification ### Description Guides you through setting up and verifying webhooks in Moonflow for automated responses to significant events. This ensures secure communication between Moonflow and your server. ### Setup 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. ### Signature Verification Steps 1. **Obtain Signature Key**: Go to Settings > Integrations > "View webhook signature key" in Moonflow. 2. **Process Notification Content**: Receive the webhook notification content in plain text. 3. **Encrypt Content**: Use HMAC_SHA256 with the signature key and Base64 encode the result. 4. **Compare Signature**: Compare the encrypted result with the "moonflow-signature" header. ### Generating a New Signature Key - You can generate a new signature key from the same integrations settings section by selecting "View webhook signature key" again. ### Notified Interactions - **Communication Records**: Outgoing messages and their statuses (Sent, Delivered, Opened, Read, Failed). - **Event Records**: Actions on payment orders (Payment, Payment to Verify, Payment Commitment, Payment Cancellation). ### Importance of Verification - Ensures webhook notifications are received by the correct server and that the integration functions securely and efficiently. ### Request Example (Webhook POST) ```json { "event_type": "communication_status_update", "data": { "message_id": "msg_98765", "status": "delivered", "timestamp": "2023-10-27T11:00:00Z" } } ``` ### Response Example (from your server) ```json { "received": true, "message": "Webhook processed successfully" } ``` ``` -------------------------------- ### Batch Process API Source: https://app.swaggerhub.com/apis-docs/d-041/Moonflow/1.0/index Retrieves the status of batch processes stored in the system. This section guides you through the process of searching and retrieving API Batch processes. ```APIDOC ## GET /batch/process ### Description Retrieves the status of batch processes stored in the system. This section guides you through the process of searching and retrieving API Batch processes. ### Method GET ### Endpoint /batch/process ### Parameters #### Query Parameters - **processId** (string) - Optional - The ID of the batch process to query. ### Request Example ``` GET /batch/process?processId=batch_abcde ``` ### Response #### Success Response (200) - **status** (string) - The current status of the batch process (e.g., "running", "completed", "failed"). - **progress** (integer) - The percentage of completion for the batch process. #### Response Example ```json { "status": "completed", "progress": 100 } ``` ``` -------------------------------- ### Supported Currencies Source: https://app.swaggerhub.com/apis-docs/d-041/Moonflow/1.0/index Our platform supports a wide variety of international currencies, allowing you to operate in markets worldwide with ease. Below is our catalog of accepted currencies, with each entry including the currency, its corresponding ISO code, and the symbol used. ```APIDOC ## Currencies In our platform, we understand the importance of diversity and globalization of financial transactions. That's 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 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 | $ | ``` -------------------------------- ### Moonflow API Authentication Source: https://app.swaggerhub.com/apis-docs/d-041/Moonflow/1.0/index Explains how to authenticate with the Moonflow API using an API Key and the required authorization header. ```APIDOC ## Moonflow API Authentication ### Description Moonflow API uses token-based authentication. Each request must include a valid authorization token in the header. ### Obtaining Your Authorization Token 1. Log in to the Moonflow dashboard. 2. Navigate to `Settings > Integrations`. 3. Locate and copy your `API Key` from the `API Key` field. If none exists, create one. ### Using the Authorization Token Include your token in the `moonflow-authorization` header for all API requests. ### Request Example ```bash curl --location --request GET 'https://api.moonflow.ai/api/paymentorder/searchbydocument?documentTypeId=&documentNumber=&code=a=' --header 'moonflow-authorization: tu_API_Key_aquí;' ``` ### Important Considerations - Keep your `API Key` confidential. - If compromised, generate a new `API Key` immediately. - Requests without a valid token will result in an authentication failure. ``` -------------------------------- ### Interaction API Source: https://app.swaggerhub.com/apis-docs/d-041/Moonflow/1.0/index APIs for retrieving interaction history. ```APIDOC ## GET /interaction/list ### Description Retrieves a list of client interactions. ### Method GET ### Endpoint /interaction/list ### Parameters #### Query Parameters - **clientId** (string) - Optional - Filter interactions by client ID. - **limit** (integer) - Optional - The maximum number of interactions to return. - **offset** (integer) - Optional - The number of interactions to skip. ### Response #### Success Response (200) - **interactions** (array) - A list of interaction objects. - **interactionId** (string) - The unique identifier for the interaction. - **clientId** (string) - The ID of the client involved. - **type** (string) - The type of interaction (e.g., "call", "email", "meeting"). - **timestamp** (string) - The date and time of the interaction. - **summary** (string) - A brief summary of the interaction. #### Response Example { "interactions": [ { "interactionId": "int_abc", "clientId": "cl_123", "type": "call", "timestamp": "2023-10-26T09:00:00Z", "summary": "Discussed project requirements." } ] } ``` -------------------------------- ### Client Management API Source: https://app.swaggerhub.com/apis-docs/d-041/Moonflow/1.0/index APIs for managing client information, supporting both individual (B2C) and business (B2B) accounts. ```APIDOC ## GET /client/list ### Description Retrieves a list of clients, supporting both B2C and B2B accounts. ### Method GET ### Endpoint /client/list ### Parameters #### Query Parameters - **type** (string) - Optional - Filter by client type (B2C or B2B). ### Response #### Success Response (200) - **clients** (array) - A list of client objects. - **clientId** (string) - The unique identifier for the client. - **name** (string) - The name of the client. - **type** (string) - The type of client (B2C or B2B). #### Response Example { "clients": [ { "clientId": "cl_123", "name": "John Doe", "type": "B2C" }, { "clientId": "cl_456", "name": "Acme Corp", "type": "B2B" } ] } ## GET /client/search ### Description Searches for individual client information, supporting both B2C and B2B accounts. ### Method GET ### Endpoint /client/search ### Parameters #### Query Parameters - **query** (string) - Required - The search query string. - **type** (string) - Optional - Filter by client type (B2C or B2B). ### Response #### Success Response (200) - **clients** (array) - A list of client objects matching the search query. - **clientId** (string) - The unique identifier for the client. - **name** (string) - The name of the client. - **type** (string) - The type of client (B2C or B2B). #### Response Example { "clients": [ { "clientId": "cl_789", "name": "Jane Smith", "type": "B2C" } ] } ## POST /client ### Description Creates, updates, or deletes client records for B2C accounts. ### Method POST ### Endpoint /client ### Parameters #### Request Body - **operation** (string) - Required - The operation to perform (e.g., "create", "update", "delete"). - **clientData** (object) - Required - The data for the client record. - **clientId** (string) - Optional - The client ID (required for update/delete). - **name** (string) - Required - The name of the client. - **email** (string) - Optional - The client's email address. ### Request Example { "operation": "create", "clientData": { "name": "New Client", "email": "new@example.com" } } ### Response #### Success Response (200) - **status** (string) - The status of the operation (e.g., "success", "failed"). - **message** (string) - A message detailing the result of the operation. #### Response Example { "status": "success", "message": "Client record created successfully." } ## POST /client/batch ### Description Performs batch operations (create, update, delete) for B2C client records. ### Method POST ### Endpoint /client/batch ### Parameters #### Request Body - **operations** (array) - Required - An array of client operations. - Each object in the array should have an "operation" and "clientData" field similar to the `/client` endpoint. ### Request Example { "operations": [ { "operation": "create", "clientData": { "name": "Batch Client 1" } }, { "operation": "update", "clientData": { "clientId": "cl_123", "name": "Updated Client Name" } } ] } ### Response #### Success Response (200) - **results** (array) - An array of results for each batch operation. #### Response Example { "results": [ { "status": "success", "message": "Client record created." }, { "status": "success", "message": "Client record updated." } ] } ## POST /client/business ### Description Creates, updates, or deletes client records for B2B accounts. ### Method POST ### Endpoint /client/business ### Parameters #### Request Body - **operation** (string) - Required - The operation to perform (e.g., "create", "update", "delete"). - **clientData** (object) - Required - The data for the B2B client record. - **clientId** (string) - Optional - The client ID (required for update/delete). - **businessName** (string) - Required - The name of the business. - **contactPerson** (string) - Optional - The primary contact person. ### Request Example { "operation": "create", "clientData": { "businessName": "Business Inc.", "contactPerson": "John Smith" } } ### Response #### Success Response (200) - **status** (string) - The status of the operation. - **message** (string) - A message detailing the result. #### Response Example { "status": "success", "message": "B2B client record created successfully." } ## POST /client/business/batch ### Description Performs batch operations (create, update, delete) for B2B client records. ### Method POST ### Endpoint /client/business/batch ### Parameters #### Request Body - **operations** (array) - Required - An array of B2B client operations. - Each object in the array should have an "operation" and "clientData" field similar to the `/client/business` endpoint. ### Request Example { "operations": [ { "operation": "create", "clientData": { "businessName": "Another Business" } } ] } ### Response #### Success Response (200) - **results** (array) - An array of results for each batch operation. #### Response Example { "results": [ { "status": "success", "message": "B2B client record created." } ] } ``` -------------------------------- ### API Batch Process Types Source: https://app.swaggerhub.com/apis-docs/d-041/Moonflow/1.0/index When interacting with the visualization of API Batch process statuses, you will receive a character reflecting the type of that process. The codes used by our API are detailed below, along with an explanation of their meaning in the context of our operations. ```APIDOC ## API Batch Process Types When interacting with the visualization of API Batch process statuses, you will receive a character that reflects 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` | **Clientes** - The process is a client load. | | `P` | **Ordenes de pago** - The process is a payment order load. | | `R` | **Eventos** - The process is an event load. | ``` -------------------------------- ### API Batch Process Status Source: https://app.swaggerhub.com/apis-docs/d-041/Moonflow/1.0/index When interacting with the visualization of API Batch process statuses, you will receive a character reflecting that status. The codes used by our API are detailed below, along with an explanation of their meaning in the context of our operations. ```APIDOC ## API Batch Process Status When interacting with the visualization of API Batch process statuses, you will receive a character that reflects the 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 completed 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. | ``` -------------------------------- ### Payment Order Search API Source: https://app.swaggerhub.com/apis-docs/d-041/Moonflow/1.0/index Allows searching for payment orders based on document type, document number, and a specific code. ```APIDOC ## GET /api/paymentorder/searchbydocument ### Description This endpoint allows you to search for payment orders by providing document type, document number, and a code. ### Method GET ### Endpoint `https://api.moonflow.ai/api/paymentorder/searchbydocument` ### Query Parameters - **documentTypeId** (string) - Optional - The ID of the document type to filter by. - **documentNumber** (string) - Optional - The number of the document to filter by. - **code** (string) - Optional - A specific code to filter payment orders. ### Request Example ```bash curl --location --request GET 'https://api.moonflow.ai/api/paymentorder/searchbydocument?documentTypeId=&documentNumber=&code=a=' --header 'moonflow-authorization: YOUR_API_KEY;' ``` ### Response #### Success Response (200) - The response body will contain a list of payment orders matching the search criteria. #### Response Example ```json { "paymentOrders": [ { "id": "string", "documentTypeId": "string", "documentNumber": "string", "code": "string", "status": "string" } ] } ``` ``` -------------------------------- ### Batch Process Status API Source: https://app.swaggerhub.com/apis-docs/d-041/Moonflow/1.0/index API to check the status of batch processes. ```APIDOC ## GET /batch/process ### Description Visualizes the status of a batch process. ### Method GET ### Endpoint /batch/process ### Parameters #### Query Parameters - **processId** (string) - Required - The unique identifier of the batch process. ### Response #### Success Response (200) - **status** (string) - The current status of the batch process (e.g., "running", "completed", "failed"). - **progress** (integer) - The completion progress in percentage (0-100). - **message** (string) - A message providing details about the process status. #### Response Example { "status": "completed", "progress": 100, "message": "Batch process finished successfully." } ``` -------------------------------- ### API Response Codes Source: https://app.swaggerhub.com/apis-docs/d-041/Moonflow/1.0/index Details the standard HTTP status codes used by the Moonflow API to indicate the result of client requests. ```APIDOC ## API Response Codes ### Description The Moonflow API uses standard HTTP status codes to indicate the outcome of requests. ### Common Status Codes - **200** - **Success**: The requested content is available in the response body. - **400** - **Bad Request Error**: The request returned an error. Details are provided in the response content. - **401** - **Unauthorized**: The provided Moonflow credentials are not valid. - **403** - **Forbidden**: You do not have the necessary permissions to perform this action. - **422** - **Unprocessable Entity**: The request returned an error. Details are provided in the response content. - **500** - **Internal Server Error**: The details of the error are available in the response body. ``` -------------------------------- ### Document Types by Country Source: https://app.swaggerhub.com/apis-docs/d-041/Moonflow/1.0/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`). This ensures operations are performed accurately based on the exact identification of the individual or entity. ```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. ### 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 ``` -------------------------------- ### List Interactions Source: https://app.swaggerhub.com/apis-docs/d-041/Moonflow/1.0/index Retrieves a list of stored interactions from the system. This endpoint allows for efficient and flexible access to specific records using various filters to refine results. ```APIDOC ## GET /interaction/list ### Description Retrieves a list of stored interactions from the system. This endpoint allows for efficient and flexible access to specific records using various filters to refine results. ### Method GET ### Endpoint /interaction/list ### Parameters #### Query Parameters - **filter1** (string) - Optional - Description of filter 1 - **filter2** (string) - Optional - Description of filter 2 ### Request Example ``` GET /interaction/list?filter1=value1&filter2=value2 ``` ### Response #### Success Response (200) - **interactions** (array) - A list of interaction objects. - **interactionId** (string) - The unique identifier for the interaction. - **timestamp** (string) - The timestamp when the interaction occurred. - **details** (object) - Contains details about the interaction. #### Response Example ```json { "interactions": [ { "interactionId": "int_12345", "timestamp": "2023-10-27T10:00:00Z", "details": { "type": "message", "content": "Hello there!" } } ] } ``` ``` -------------------------------- ### External Communication API Source: https://app.swaggerhub.com/apis-docs/d-041/Moonflow/1.0/index APIs for managing external communications with clients. ```APIDOC ## POST /communication ### Description Creates a record for an external communication. ### Method POST ### Endpoint /communication ### Parameters #### Request Body - **communicationData** (object) - Required - Data for the external communication. - **clientId** (string) - Required - The ID of the client involved. - **type** (string) - Required - The type of communication (e.g., "email", "phone_call", "sms"). - **subject** (string) - Optional - The subject of the communication. - **content** (string) - Optional - The body or details of the communication. - **timestamp** (string) - Required - The date and time of the communication (ISO 8601 format). ### Request Example { "communicationData": { "clientId": "cl_123", "type": "email", "subject": "Inquiry Follow-up", "content": "Following up on your recent inquiry.", "timestamp": "2023-10-27T14:30:00Z" } } ### Response #### Success Response (200) - **status** (string) - The status of the operation. - **message** (string) - A message detailing the result. #### Response Example { "status": "success", "message": "External communication record created successfully." } ## POST /communication/batch ### Description Performs batch creation of external communication records. ### Method POST ### Endpoint /communication/batch ### Parameters #### Request Body - **communications** (array) - Required - An array of communication data objects, each similar to the `/communication` endpoint's `communicationData`. ### Request Example { "communications": [ { "clientId": "cl_456", "type": "phone_call", "timestamp": "2023-10-27T15:00:00Z" }, { "clientId": "cl_789", "type": "sms", "content": "Reminder: Your payment is due.", "timestamp": "2023-10-27T16:00:00Z" } ] } ### Response #### Success Response (200) - **results** (array) - An array of results for each batch communication creation. #### Response Example { "results": [ { "status": "success", "message": "Communication record created." }, { "status": "success", "message": "Communication record created." } ] } ## POST /communication/status ### Description Updates the status of an external communication. ### Method POST ### Endpoint /communication/status ### Parameters #### Request Body - **updateData** (object) - Required - Data for updating the communication status. - **communicationId** (string) - Required - The ID of the communication to update. - **newStatus** (string) - Required - The new status (e.g., "sent", "delivered", "opened", "failed"). ### Request Example { "updateData": { "communicationId": "comm_xyz", "newStatus": "delivered" } } ### Response #### Success Response (200) - **status** (string) - The status of the operation. - **message** (string) - A message detailing the result. #### Response Example { "status": "success", "message": "Communication status updated successfully." } ``` -------------------------------- ### Event Management API Source: https://app.swaggerhub.com/apis-docs/d-041/Moonflow/1.0/index APIs for managing events related to payment orders, applicable to both B2C and B2B clients. ```APIDOC ## POST /event ### Description Creates event records related to payment orders (B2C and B2B). ### Method POST ### Endpoint /event ### Parameters #### Request Body - **eventData** (object) - Required - The data for the event. - **orderId** (string) - Required - The ID of the associated payment order. - **eventType** (string) - Required - The type of event (e.g., "payment_made", "verification_required", "payment_committed", "payment_cancelled"). - **timestamp** (string) - Required - The date and time the event occurred (ISO 8601 format). - **details** (object) - Optional - Additional details about the event. ### Request Example { "eventData": { "orderId": "po_abc", "eventType": "payment_made", "timestamp": "2023-10-27T10:00:00Z", "details": { "transactionId": "txn_xyz" } } } ### Response #### Success Response (200) - **status** (string) - The status of the operation. - **message** (string) - A message detailing the result. #### Response Example { "status": "success", "message": "Event record created successfully." } ## POST /event/batch ### Description Performs batch creation of event records related to payment orders (B2C and B2B). ### Method POST ### Endpoint /event/batch ### Parameters #### Request Body - **events** (array) - Required - An array of event data objects, each similar to the `/event` endpoint's `eventData`. ### Request Example { "events": [ { "orderId": "po_def", "eventType": "payment_verified", "timestamp": "2023-10-27T11:00:00Z" }, { "orderId": "po_ghi", "eventType": "payment_failed", "timestamp": "2023-10-27T12:00:00Z" } ] } ### Response #### Success Response (200) - **results** (array) - An array of results for each batch event creation. #### Response Example { "results": [ { "status": "success", "message": "Event record created." }, { "status": "success", "message": "Event record created." } ] } ## GET /event/list ### Description Retrieves a list of events related to payment orders. ### Method GET ### Endpoint /event/list ### Parameters #### Query Parameters - **orderId** (string) - Optional - Filter events by payment order ID. - **eventType** (string) - Optional - Filter events by type. ### Response #### Success Response (200) - **events** (array) - A list of event objects. - **eventId** (string) - The unique identifier for the event. - **orderId** (string) - The ID of the associated payment order. - **eventType** (string) - The type of event. - **timestamp** (string) - The date and time the event occurred. #### Response Example { "events": [ { "eventId": "evt_123", "orderId": "po_abc", "eventType": "payment_made", "timestamp": "2023-10-27T10:00:00Z" } ] } ``` -------------------------------- ### Notification JSON Structure Source: https://app.swaggerhub.com/apis-docs/d-041/Moonflow/1.0/index Details the general structure of the JSON payload for notifications sent by Moonflow, including various fields and their types. ```APIDOC ## Notification Payload Structure ### Description This section details the general structure of the JSON payload that Moonflow sends for each notification. The fields included may vary based on the type of interaction being notified. ### Data Structure #### Notification Fields - **sentDate** (string) - The date the notification was sent (Format: YYYY-MM-DD). - **sentTime** (string) - The time the notification was sent (Format: HH:mm). - **documentTypeId** (integer) - A numeric value referencing the document type defined by the country in 'Account Settings'. - **documentNumber** (string) - The identification document number. - **name** (string) - The client's name (for B2C). - **lastName** (string) - The client's last name (for B2C). - **businessLegalName** (string) - The client's legal business name (for B2B). - **businessTradeName** (string) - The client's trade name (for B2B). - **externalClientId** (string) - The external client ID. - **originName** (string) - The name of the flow, campaign, or event. - **template** (string) - The name of the communication template. - **channel** (string) - The communication channel (e.g., Email, Sms, Whatsapp, Call, Field Management, Collection Web, Bulk Upload - dashboard, Bulk Upload - SFTP, Dashboard, Payment Reconciliation). - **currency** (string) - The ISO currency code. - **eventAmount** (double) - The amount of the event. - **paymentMethod** (string) - The payment method used. - **status** (string) - The status of the communication/event. - **paymentCode** (string) - The payment order code. - **quota** (integer) - The installment identifier. - **paymentCodeAmount** (double) - The outstanding amount for the payment order. - **feesAndPenalties** (double) - Fees and penalties associated with the event. - **notes** (string) - Notes related to the interaction. - **eventDate** (string) - The date of the event (Format: YYYY-MM-DD HH:mm). - **attachment** (string) - Links to attached files. - **attachment1Url** (string) - URL for attachment 1 of the payment order. - **attachment2Url** (string) - URL for attachment 2 of the payment order. - **issuedDate** (string) - The date of issue (Format: YYYY-MM-DD). - **description** (string) - Description of the payment order. - **discount** (double) - Discount applied to the payment order. - **externalOrderId** (string) - External order code. - **reference** (string) - Transaction reference code. - **phonecallFileUrl** (string) - URL for the phone call file. - **userProjectCode** (string) - User code in the system. - **adviserBoUserId** (string) - Advisor's user ID. - **failedReason** (string) - Description of the reason for failure. - **interactionId** (string) - The interaction identifier. - **paymentOrderReference** (string[]) - An array of reference payment order codes. - **recoveryCampaignReference** (string[]) - An array of reference campaign codes. - **eventOriginChannel** (string) - The origin channel identifier for the event. - **verificationProcessId** (integer) - The verification process identifier. - **destination** (string) - The destination of the communication. - **destinations** (DestinationData[]) - An array of communication destinations. - **lastPaymentActionId** (string) - The ID of the last recorded payment action. - **lastPaymentActionType** (string) - The type of the last recorded payment action. - **lastPaymentActionDate** (string) - The date of the last recorded payment action. - **lastCommunicationId** (string) - The ID of the last communication sent. - **lastCommunicationChannelType** (string) - The channel type of the last communication sent. - **lastCommunicationStatus** (string) - The status of the last communication sent. - **type** (string) - The type of interaction (Entrante or Saliente). - **communicationId** (string) - The communication identifier. - **eventAdviser** (string) - The identifier of the event advisor. - **message** (string) - The content of the communication. - **communicationPaymentCodes** (string[]) - An array of payment codes associated with the installment. #### DestinationData Fields - **destination** (string) - The destination of the communication. - **contactLevel** (integer) - The contact level. - **recipientType** (string) - The type of recipient (C = Client, R = References, G = Guarantor). ### Request Example ```json { "sentDate": "2023-10-27", "sentTime": "10:30", "documentTypeId": 1, "documentNumber": "12345678Z", "name": "John", "lastName": "Doe", "externalClientId": "EXT123", "originName": "Welcome Campaign", "template": "WelcomeEmail", "channel": "Email", "currency": "USD", "eventAmount": 100.50, "paymentMethod": "Credit Card", "status": "Sent", "paymentCode": "PAY456", "quota": 1, "paymentCodeAmount": 90.00, "feesAndPenalties": 5.00, "notes": "First payment reminder.", "eventDate": "2023-10-27 10:30", "attachment": "http://example.com/attachment.pdf", "attachment1Url": "http://example.com/attach1.pdf", "attachment2Url": "http://example.com/attach2.pdf", "issuedDate": "2023-10-20", "description": "Payment for invoice INV789", "discount": 10.00, "externalOrderId": "ORD987", "reference": "REF654", "phonecallFileUrl": "http://example.com/call.mp3", "userProjectCode": "PROJ001", "adviserBoUserId": "USR567", "failedReason": null, "interactionId": "INT1122", "paymentOrderReference": ["PAY456"], "recoveryCampaignReference": [], "eventOriginChannel": "API", "verificationProcessId": 101, "destination": "john.doe@example.com", "destinations": [ { "destination": "john.doe@example.com", "contactLevel": 1, "recipientType": "C" } ], "lastPaymentActionId": "ACT001", "lastPaymentActionType": "Payment", "lastPaymentActionDate": "2023-10-27 11:00", "lastCommunicationId": "COM001", "lastCommunicationChannelType": "Email", "lastCommunicationStatus": "Delivered", "type": "Saliente", "communicationId": "COM002", "eventAdviser": "USR567", "message": "Your payment is due.", "communicationPaymentCodes": ["PAY456"] } ``` ``` -------------------------------- ### Payment Order Management API Source: https://app.swaggerhub.com/apis-docs/d-041/Moonflow/1.0/index APIs for managing payment orders, supporting both B2C and B2B transactions. ```APIDOC ## GET /paymentorder/searchbydocument ### Description Searches for a payment order by its document identifier. ### Method GET ### Endpoint /paymentorder/searchbydocument ### Parameters #### Query Parameters - **documentId** (string) - Required - The identifier of the document associated with the payment order. ### Response #### Success Response (200) - **paymentOrder** (object) - The payment order details. - **orderId** (string) - The unique identifier for the payment order. - **amount** (number) - The amount of the payment order. - **status** (string) - The current status of the payment order. #### Response Example { "paymentOrder": { "orderId": "po_abc", "amount": 100.50, "status": "pending" } } ## GET /paymentorder/list ### Description Retrieves a list of payment orders. ### Method GET ### Endpoint /paymentorder/list ### Parameters #### Query Parameters - **clientId** (string) - Optional - Filter by client ID. - **status** (string) - Optional - Filter by payment order status. ### Response #### Success Response (200) - **paymentOrders** (array) - A list of payment order objects. - **orderId** (string) - The unique identifier for the payment order. - **amount** (number) - The amount of the payment order. - **status** (string) - The current status of the payment order. #### Response Example { "paymentOrders": [ { "orderId": "po_def", "amount": 250.00, "status": "completed" } ] } ## POST /paymentorder ### Description Creates, updates, or deletes payment order records for both B2C and B2B accounts. ### Method POST ### Endpoint /paymentorder ### Parameters #### Request Body - **operation** (string) - Required - The operation to perform (e.g., "create", "update", "delete"). - **paymentOrderData** (object) - Required - The data for the payment order. - **orderId** (string) - Optional - The order ID (required for update/delete). - **clientId** (string) - Required - The ID of the client associated with the order. - **amount** (number) - Required - The payment amount. - **currency** (string) - Required - The currency of the payment. ### Request Example { "operation": "create", "paymentOrderData": { "clientId": "cl_123", "amount": 75.20, "currency": "USD" } } ### Response #### Success Response (200) - **status** (string) - The status of the operation. - **message** (string) - A message detailing the result. #### Response Example { "status": "success", "message": "Payment order created successfully." } ## POST /paymentorder/batch ### Description Performs batch operations (create, update, delete) for payment order records (B2C and B2B). ### Method POST ### Endpoint /paymentorder/batch ### Parameters #### Request Body - **operations** (array) - Required - An array of payment order operations. - Each object in the array should have an "operation" and "paymentOrderData" field similar to the `/paymentorder` endpoint. ### Request Example { "operations": [ { "operation": "create", "paymentOrderData": { "clientId": "cl_456", "amount": 150.00, "currency": "EUR" } } ] } ### Response #### Success Response (200) - **results** (array) - An array of results for each batch operation. #### Response Example { "results": [ { "status": "success", "message": "Payment order created." } ] } ``` -------------------------------- ### Notification Response Source: https://app.swaggerhub.com/apis-docs/d-041/Moonflow/1.0/index Moonflow requires a 200 HTTP status code to confirm successful receipt of notifications. If a 200 response is not received, Moonflow will attempt to resend the notification. ```APIDOC ## POST /notifications/response ### Description This endpoint is used to acknowledge receipt of a notification sent by Moonflow. A successful response with an HTTP 200 status code confirms that the notification has been received and processed. ### Method POST ### Endpoint /notifications/response ### Parameters #### Query Parameters - **notificationId** (string) - Required - The unique identifier for the notification that was received. ### Request Body This endpoint does not require a request body. The confirmation is done via the HTTP status code. ### Response #### Success Response (200) - **message** (string) - Indicates that the notification was successfully received. #### Response Example ``` HTTP/1.1 200 OK Content-Type: application/json { "message": "Notification received successfully." } ``` #### Error Response (e.g., 400, 500) - **error** (string) - Describes the error that occurred during the confirmation process. #### Response Example ``` HTTP/1.1 400 Bad Request Content-Type: application/json { "error": "Invalid notification ID provided." } ``` ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.