MeridianoSoft Integration Documentation

website·Indexed 30 days ago

https://docs.meridianosoft.com.ar

Documentation for integrating management systems with MeridianoSoft via DLL or REST API. Includes guides on sending and retrieving data, required database tables for modules (such as clients, products, and brands), and technical specifications for the AppSyncHelper and Operations classes.

Tokens
16.7K
Snippets
82
Records
108
Agent score
48%

What's inside MeridianoSoft

  1. Overview of MeridianoSoft App capabilities

    The MeridianoSoft application is an integrated solution designed to optimize field sales, collections, and GPS tracking. It enables users to manage orders, process collections, register new customers, and view real-time system information to ensure data accuracy and operational efficiency.
  2. Understand the payment_collections_methods response schema

    The payment_collections_methods object in the REST API response provides details about the specific payment method used for a collection. It includes identifiers for the payment and the associated collection, the payment method code, and conditional fields based on the payment type (e.g., bank details for transfers or dates for checks).
    {
      "payment_collection_method_id": 123, // Integer: Unique payment ID
      "payment_collection_id": 456,       // Integer: ID of the associated collection
      "payment_method_code": "wire_transfer", // String: cash, wire_transfer, securities, others
      "bank_id": 789,                     // Integer: Bank ID (for wire_transfer, securities)
      "bank_account_id": 101,             // Integer: Bank account ID (for wire_transfer)
      "check_issuance_date": "2023-01-01", // String: ISO 8601 (for securities)
      "check_expiration_date": "2023-02-01", // String: ISO 8601 (for securities)
      "identification": "REF12345",      // String: Check number or transfer reference
      "wire_date": "2023-01-05",         // String: ISO 8601 (for wire_transfer)
      "description": "Payment note",     // String: Used for 'others'
      "amount": 1500.50,                  // Number: Payment amount
      "observations": "Additional info"  // String: Additional notes
    }
  3. Understand the `new_clients` object structure in process operations

    The new_clients object contains detailed information about a newly created customer. When processing this data, note the following conditional logic:

    • Legal Person vs. Physical Person: If is_a_legal_person is true, the first_name and last_name fields will be empty strings; use legal_name instead. If is_a_legal_person is false, legal_name is automatically generated from the first and last names.
    • Identification: The identification field contains the CUIT (without hyphens) for legal persons and the DNI for physical persons.
    • Tax Conditions: The tax_condition_code field uses one of the following values: iva_responsable_inscripto, iva_responsable_monotributo, iva_sujeto_exento, or consumidor_final.
    • Address: The address field is a combination of street_address and street_number.
    • Phone: The phone field is the complete number, composed of phone_country_code, phone_prefix, and phone_line_number.
    {
      "new_client_id": 123,
      "created_by_sales_agent_id": 456,
      "first_name": "John",
      "last_name": "Doe",
      "legal_name": "John Doe",
      "tax_condition_code": "iva_responsable_inscripto",
      "is_a_legal_person": false,
      "identification": "12345678",
      "state_id": 1,
      "state": "Buenos Aires",
      "locality_id": 10,
      "locality": "City",
      "postal_code": "1000",
      "street_address": "Main St",
      "street_number": "123",
      "address": "Main St 123",
      "phone_country_code": "54",
      "phone_prefix": "11",
      "phone_line_number": "12345678",
      "phone": "+54 11 12345678",
      "first_opening_time": "08:00",
      "first_closing_time": "12:00",
      "second_opening_time": "14:00",
      "second_closing_time": "18:00",
      "email": "client@example.com",
      "discount": 10.5,
      "sales_agent_id": 456,
      "price_list_id": 789,
      "payment_term_id": 101,
      "zone_id": 202,
      "observations": "Note here",
      "created_at": "2023-10-27T10:00:00Z"
    }
  4. Register the MeridianoSoft DLL using RegAsm

    Because the DLL is developed in .NET, you must use regasm instead of regsvr32.

    1. Open a Command Prompt (CMD) with Administrator privileges.
    2. Navigate to the regasm.exe directory based on the system architecture:
      • 32-bit: C:\Windows\Microsoft.NET\Framework\v4.0.30319
      • 64-bit: C:\Windows\Microsoft.NET\Framework64\v4.0.30319
    3. Execute the registration command with the /codebase flag.
    RegAsm.exe /codebase "C:/path/to/MeridianoSoftApp.dll"
  5. Understand the `orders_items` response structure

    The orders_items array contains details about individual items within an order. Note that the observations field is disabled by default in the App.
    {
      "order_item_id": 123, // Integer: Unique ID of the order item
      "order_id": 456, // Integer: Unique ID of the parent order
      "product_id": 789, // Integer: Unique ID of the associated product
      "quantity": 2, // Number: Selected quantity
      "discount": 10.0, // Number: Discount percentage
      "price_list_id": 10, // Integer: Unique ID of the applied price list
      "price_multiplier": 1.0, // Number: Price multiplier
      "unit_price_with_iva": 116.0, // Number: Unit price including VAT
      "unit_price_without_iva": 100.0, // Number: Unit price excluding VAT
      "final_price_with_iva": 232.0, // Number: Final price including VAT
      "final_price_without_iva": 200.0, // Number: Final price excluding VAT
      "observations": "Example note" // String: Additional observations
    }
  6. Connect to the Meridianosoft REST API

    All API requests must be sent to the following base URL: https://api.meridianosoft.com.ar/api/v1. The API returns responses in JSON format, including a success field to indicate if the request was successful.
    GET https://api.meridianosoft.com.ar/api/v1/...
  7. Integrate Meridianosoft base modules using boilerplates

    Meridianosoft provides boilerplates containing the base code, fundamental structure, and examples of method/class usage and error handling to streamline integration. These templates are available for VB 6.0, VB .NET, and Delphi. To implement the integration, download the provided .RAR archive and integrate the following base modules into your project: AppRecordsUpdater.bas and AppOperationsRetriever.bas.
  8. Understand the REST API operations response structure

    When querying operations via the REST API, the server returns a JSON object containing several arrays. These arrays categorize different types of operations that need to be processed: new_clients, orders, orders_items, payment_collections, payment_collections_debts, and payment_collections_methods.
    {
      "new_clients": [],
      "orders": [],
      "orders_items": [],
      "payment_collections": [],
      "payment_collections_debts": [],
      "payment_collections_methods": []
    }
  9. Identify required tables by module

    Depending on the module being used, different tables must be sent to the server. It is not mandatory to send all tables; those not in use can be omitted or sent as an empty array.
    - Orders Module: clients, payment_terms, prices, prices_lists, products, brands (opt), categories (opt), groups (opt), sub_groups (opt), unit_types, sales_agents
    - Collections Module: clients, clients_debts, banks (opt), banks_accounts (opt), collections_agents
    - New Client Module: clients, price_lists, zones (opt), localities (opt), states (opt), sales_agents
  10. Install .NET Framework requirements for VB.NET DLLs

    To use the provided DLLs (which are implemented in VB.NET for Visual Basic compatibility), .NET Framework 4.5.2 or a higher version must be installed on every machine where the DLL is deployed.

    Supported Operating Systems:

    • Windows XP, Vista, 7, 8, 10, and 11.

    Note: Windows 10 and newer versions come with a compatible version of .NET Framework pre-installed. The product installer will automatically check for a compatible version and offer to download it if not found.

  11. Retrieve new operations from Meridianosoft

    To retrieve new operations (defined as new clients, orders, or payment collections generated in the mobile app or website) that have occurred since the last query, follow this workflow:

    1. Perform a GET request to the /combined_updates endpoint with your authentication token in the header.
    2. Process the returned operations using the appropriate business logic.
    3. Perform a POST request to mark the operations as processed.
    GET https://api.meridianosoft.com.ar/api/v1/combined_updates
  12. Retrieve and process operations from the mobile app or website

    Operations represent new clients, orders, or payment collections generated externally. To process them:

    1. Use GetUpdates(token) to retrieve the operations object.
    2. Check HasOperations to verify if there is data to process.
    3. Iterate through the specific operation collections (e.g., newClientsCount and GetNewClientByIndex).
    4. After processing the data into your local database, call MarkAsProcessed(token, operations) to update the status on the server and avoid duplicate processing.
    Dim AppSyncHelper As New MeridianoSoftApp.AppSyncHelper
    Dim operations As New MeridianoSoftApp.operations
    Dim I As Long
    
    Dim newClient As New MeridianoSoftApp.newClient
    Dim token As String
    token = "su-token-privado"
    
    Public Sub RetrieveAppOperations()
      On Error GoTo ErrorHandler
    
      ' Retrieve new operations
      Set operations = AppSyncHelper.GetUpdates(token)
      
      ' Check if there are operations to process
      If operations.HasOperations = False Then
        MsgBox "No existen nuevas operaciones.", vbExclamation
        Exit Sub
      End If
    
      ' Iterate through new clients
      For I = 0 To operations.newClientsCount - 1
        Set newClient = operations.GetNewClientByIndex(I)
        ' Insert into your database here
        MsgBox "Nuevo cliente: " & newClient.legalName
      Next
    
      ' Note: Repeat iteration for orders and payment collections
    
      ' Mark operations as "Processed" on the server
      Call AppSyncHelper.MarkAsProcessed(token, operations)
    
      Exit Sub
    
    ErrorHandler:
      MsgBox "Ha ocurrido un error: " & Err.Description, vbExclamation
    End Sub