Rentlz Billing Management API

Created by Moveinsync Help, Modified on Wed, 14 May at 2:41 AM by Moveinsync Help

POSTRaw Invoice Data

https://api.moveinsync.com/integration/{{Client BUID}}/rentlz/booking/raw-invoicing-data

This API is used to submit raw invoicing data associated with a specific booking. The data includes trip information such as the distance traveled, time taken, and driver-related information like the number of driver day and night batches.

Explanation of Request Body Fields:

  • bookingId: Unique identifier for the booking (e.g., B230411-Z8MA).

  • tripKm: Total distance of the trip in kilometers.

  • tripHr: Total time of the trip in hours.

  • driverDayBataCount: Number of driver day batches (per day).

  • driverNightBataCount: Number of driver night batches.

  • garageToPickupKm: Distance in kilometers from the garage to the pickup point.

  • dropToGarageKm: Distance in kilometers from the drop-off point to the garage.

  • garageHr: Number of hours spent at the garage.

  • waitingTime: Waiting time in hours.

  • escortFareApplicable: Boolean flag indicating if an escort fare is applicable.

  • numberOfDays: Total number of days for the trip.

  • legs: Array of legs, each representing a segment of the trip. Each leg contains:

    • legDistance: Distance of the leg in kilometers.

    • legStartTime: Start time of the leg in milliseconds (Unix epoch time).

    • legEndTime: End time of the leg in milliseconds (Unix epoch time).

HEADERS
Authorization

Bearer {{access_token}}

Bodyraw (json)
{
  "bookingId": "{{booking_id}}",
  "tripKm": {{trip_km}},
  "tripHr": {{trip_hr}},
  "driverDayBataCount": {{driver_day_bata_count}},
  "driverNightBataCount": {{driver_night_bata_count}},
  "garageToPickupKm": {{garage_to_pickup_km}},
  "dropToGarageKm": {{drop_to_garage_km}},
  "garageHr": {{garage_hr}},
  "waitingTime": {{waiting_time}},
  "escortFareApplicable": {{escort_fare_applicable}},
  "numberOfDays": {{number_of_days}},
  "legs": [
    {
      "legDistance": {{leg_1_distance}},
      "legStartTime": {{leg_1_start_time}},
      "legEndTime": {{leg_1_end_time}}
    },
    {
      "legDistance": {{leg_2_distance}},
      "legStartTime": {{leg_2_start_time}},
      "legEndTime": {{leg_2_end_time}}
    }
  ]
}



POSTProcessed Invoice Data

https://api.moveinsync.com/integration/{{Client BUID}}/rentlz/booking/invoice

This API handles the processed invoice data related to a booking. It includes the booking ID, the invoice ID (if available), file extension type, an array of file data (possibly the raw binary content of the file), and the invoice date in epoch format.

Field Details:

  • bookingId: A unique identifier for the booking associated with the invoice. This is required to link the invoice to the relevant booking.

    • Example: "B230411-Z8MA"
  • invoiceId: The identifier for the invoice, if available. This can be useful for referencing or retrieving the invoice from the invoicing system.

    • Example: "invoice_id_if_available"
  • extension: The file extension of the invoice file, which indicates the file type (e.g., PDF).

    • Example: "pdf"
  • file: An array of integers representing the raw data of the invoice file, possibly in binary format. The content may represent a base64-encoded PDF file or another file type.

    • Example: [60, 63, 120, 109]
  • invoiceDate: The date the invoice was generated, provided in epoch milliseconds format. This allows the system to correctly interpret the date and time when the invoice was created.

    • Example: 1735546470000 (represents a specific date and time in milliseconds since the Unix epoch).

Notes:

  • Invoice ID: The invoiceId is optional and may not be available for all invoices.

  • File Format: Ensure the file array represents the actual binary data or base64 encoding of the file content.

  • Date Format: The invoiceDate should be provided in epoch milliseconds format for consistency and easier conversion across different systems.

HEADERS
Authorization

Bearer {{access_token}}

Bodyraw (json)
{
  "bookingId": "{{booking_id}}",
  "invoiceId": "{{invoice_id}}",
  "extension": "{{file_extension}}",
  "file": [
    {{file_1}},
    {{file_2}},
    {{file_3}},
    {{file_4}}
  ],
  "invoiceDate": {{invoice_date}}
}



POSTMilestones

https://api.moveinsync.com/integration/{{Client BUID}}/rentlz/booking/milestones

This API is used to report the vehicle's milestone data (like position, speed, direction, etc.) during a trip. The data is sent in packets, with each packet containing multiple milestone records. These records represent the vehicle's movement, either when dispatched or arrived at a particular point in time.

Field Details:

  • bookingId: A unique identifier for the booking. This helps associate the milestones with the correct booking.

  • isLastPacket: A boolean flag to indicate if this is the last packet:

    • true: This packet is the last one.

    • false: This packet is not the last one (only for intermediate packets).

    • If there is only one packet, this flag should be set to true.

  • milestones: A list of milestones containing location, speed, and other tracking details. Each milestone contains:

    • mBearing: The bearing (direction) of the vehicle in degrees (0-360).

    • mSpeed: The speed of the vehicle in km/h (or another relevant unit).

    • mStep: The current step or phase of the trip (like "dispatch", "arrived", etc.).

    • mAccuracy: The accuracy of the recorded location in meters.

    • type: A string that indicates the type of milestone, which can be one of:

      • dispatch: Driver starts from the garage to reach the pickup point.

      • arrived: Cab has arrived at the pickup location.

      • pickup: Ongoing trip between pickup and drop point.

      • drop: Cab has reached the final drop/destination.

    • time: The timestamp of the milestone in epoch milliseconds (e.g., 1637194200000).

    • latitude: The latitude of the vehicle’s location.

    • longitude: The longitude of the vehicle’s location.

Guidelines:

  • Maximum Elements per Packet:

    Each packet must contain no more than 2000 milestones.

  • Multiple Packets:

    • In case there are multiple packets, the flag isLastPacket should be set to false for all packets except the last one.

    • The last packet must have isLastPacket set to true.

    • If there is only one packet, set isLastPacket to true.

  • Time Gap Between Packets:

    If multiple packets are being sent:

    • Ensure that there is a time gap of at least 15 seconds between sending consecutive packets.
  • Single Packet:

    If only one packet is sent, it should have isLastPacket set to true.

Notes:

  • Time Format: Time should be in epoch milliseconds format, ensuring the accurate representation of time.

  • Coordinates: The latitude and longitude values should be in decimal degrees.

  • Type Values: "dispatch" and "arrived" should be used appropriately, depending on the status of the vehicle.

  • Packet Limits: Ensure that no packet exceeds the 2000 milestone limit.

  • Gap Between Packets: If sending multiple packets, make sure the time between consecutive packets is at least 15 seconds to avoid overwhelming the system.

HEADERS
Authorization

Bearer {{access_token}}

Bodyraw (json)
{
  "bookingId": "{{booking_id}}",
  "isLastPacket": true,
  "milestones": [
    {
      "mBearing": {{m_bearing}},
      "mSpeed": {{m_speed}},
      "mStep": {{m_step}},
      "mAccuracy": {{m_accuracy}},
      "type": "{{type}}",
      "time": {{time}},
      "latitude": {{latitude}},
      "longitude": {{longitude}}
    },
    {
      "mBearing": {{m_bearing}},
      "mSpeed": {{m_speed}},
      "mStep": {{m_step}},
      "mAccuracy": {{m_accuracy}},
      "type": "{{type}}",
      "time": {{time}},
      "latitude": {{latitude}},
      "longitude": {{longitude}}
    }
  ]
}



GETGet Expense Types

https://api.moveinsync.com/integration/{{Client BUID}}/rentlz/booking/expense-types

This API retrieves a list of expense types. The response includes the expense types along with their unique IDs, names, associated business unit IDs (buid), and user IDs (if applicable).

HEADERS
Authorization

Bearer {{access_token}}



POSTExpense: CRUD

https://api.moveinsync.com/integration/{{Client BUID}}/rentlz/booking/expense

This API allows the creation, updating, or deletion of expense records. The behavior of the API depends on whether an id is provided in the request. If the id is provided, it will update the existing expense record. If state = INACTIVE is provided, the expense will be deactivated (i.e., deleted in the system).

Request Fields:

  • id:

    • Optional. If null, this request creates a new expense. If an id is provided, the API will update the existing expense.
  • typeId:

    • Required. The unique identifier for the expense type (e.g., "Sound").
  • typeName:

    • Required. The name of the expense type (e.g., "Sound").
  • docUrl:

    • Optional. The URL of the document supporting the expense, if available. Can be null.
  • bookingId:

    • Required. The booking ID associated with this expense (e.g., "B230411-Z8MA").
  • approvalStatus:

    • Required. The approval status of the expense (e.g., "PENDING", "APPROVED", "REJECTED").
  • state:

    • Required. The state of the expense. It can be:

      • ACTIVE: The expense is currently active.

      • INACTIVE: The expense is deactivated (effectively deleted).

  • channel:

    • Required. The channel through which the expense was submitted (e.g., "RENTLZ").
  • amount:

    • Required. The total amount for the expense (e.g., 12345).
  • expenseDate:

    • Required. The date when the expense occurred, represented as an epoch time in milliseconds.
  • extension:

    • Required. The file extension of the uploaded document (e.g., "pdf").
  • file:

    • Required. The file data as an array of integers (file bytes) representing the uploaded document (e.g., [60, 63, 120, 109]).
  • userId:

    • Required. The user associated with the expense (e.g., "dheeraj.theegela@moveinsync.com").
  • newFile:

    • Required. Boolean value to indicate if the expense has a new file attached. (true or false).
  • comment:

    • Optional. Any additional comments regarding the expense (e.g., "Payload Testing").
  • vendorId:

    • Optional. Vendor ID associated with the expense, can be null.

Behavior:

  • Create Expense:

    If the id is null, a new expense record will be created.

  • Update Expense:

    If an id is provided, the API will update the existing expense record with the new information.

  • Delete Expense (Deactivate):

    To deactivate (delete) an expense, set the state to INACTIVE. The expense will no longer be active in the system.

HEADERS
Authorization

Bearer {{access_token}}

Bodyraw (json)
[
    {
        "id": {{id}},
        "typeId": "{{type_id}}",
        "typeName": "{{type_name}}",
        "docUrl": {{doc_url}},
        "bookingId": "{{booking_id}}",
        "approvalStatus": "{{approval_status}}",
        "state": "{{state}}",
        "channel": "{{channel}}",
        "amount": {{amount}},
        "expenseDate": {{expense_date}},
        "extension": "{{file_extension}}",
        "file": [
            {{file_1}},
            {{file_2}},
            {{file_3}},
            {{file_4}}
        ],
        "userId": "{{user_id}}",
        "newFile": {{new_file}},
        "comment": "{{comment}}",
        "vendorId": {{vendor_id}}
    }
]



GETGet Expenses

https://api.moveinsync.com/integration/{{Client BUID}}/rentlz/booking/expense/{{MoveInSync Booking ID}}

This API allows you to retrieve all expenses associated with a specific booking for a client. The expenses returned may be in various states and include information such as the expense type, amount, and status.

HEADERS
Authorization

Bearer {{access_token}}


Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article