Operations
This route can be used to read all Cash-In and Cash-out operations using some specific filter.
If no filter is passed, it returns an array of objects containing your last 10 operations performed with Marlim.
Request Query Params
| Attribute | Type | Description | 
|---|---|---|
| date_created | dateTime | Filter by date created. | 
| date_updated | dateTime | Filter by date updated. | 
| customer_document_number | string | Filter by CPF document number of a customer. | 
| count | int32 | Returns noperation objects. Maximum of 1,000 and default of 10. | 
| page | int32 | Useful for implementing a pagination of results. | 
The date_created and date_updated property can be used to filter date range searches using the following attributes:
| Attribute | Description | 
|---|---|
| < | less than | 
| > | greater than | 
| <= | less than or equal to | 
| >= | greater than or equal to | 
curl -X GET -G "https://api.bet.marlim.co/v1/operations" \
-H "Content-Type: application/json" \
-H "api_key: api_key_value" \
-d date_created=">=1620086400000" \ 
-d date_created="<=1620172799000"
Date filtering uses unixTimeStamp in milliseconds to represent it. To generate the unixTimeStamp of a date, you can use the Google Chrome console with the following code in Javascript: new Date("2023-01-01T00:00:00.000Z").getTime() which will return 1672531200000.
Response Object
When fetching Cash-In and Cash-Out operations, returns an object with 4 properties: total, page, offset, and operations.
| Attribute | Type | Description | 
|---|---|---|
| total | int32 | Total operations that meet the filter passed in the query. | 
| page | int32 | Current page referring to offsetof pages. | 
| offset | int32 | Total pages for countdivided bytotalof handled operations in the queries. | 
| operations | array | Array of objects containing cash-in data. | 
Operations Array
If the query response is greater than or equal to 1, inside the operations property, this is the array of objects you receive as a response. If the filter using does not find any operation, an empty array is returned.
| Property | Type | Operation | Description | 
|---|---|---|---|
| status | string | cash-in || cash-out | Represents the current state of the operation. | 
| cash_out_id | string | cash-out | Marlim operation identifier number. | 
| item_id | string | cash-in || cash-out | Charge/Order ID on your platform. | 
| status_description | string | cash-out | Description to clarify about the status of the transfer. | 
| cash_in_id | string | cash-in | Marlim cash-in identifier number. | 
| date_created | dateTime | cash-in || cash-out | Operation creation date in ISODateTime format. | 
| date_updated | dateTime | cash-in || cash-out | Operation status updated date in ISODateTime format. | 
| amount | int32 || float | cash-in || cash-out | Amount to be charged or transferred to the customer. | 
| paid_amount | int32 || float | cash-in | Amount paid by the paying customer. | 
| paid_off_amount | int32 || float | cash-out | Final amount transferred to the customer's account according to the current status. | 
| customer_name | string | cash-in || cash-out | Customer name. | 
| customer_document_number | string | cash-in || cash-out | Paying customer document number. | 
Samples
- Last 10 operations
curl -X GET -G "https://api.bet.marlim.co/v1/operations" \
-H "Content-Type: application/json" \
-H "api_key: api_key_value" \
{
  "total": 300,
  "page": 1,
  "offset": 30,
  "operations": [
    {
      "status": "active",
      "cash_in_id": "os7WT0bCGbWxAjAv2eT6",
      "item_id": "123456789",
      "date_created": "2023-09-11T12:30:28.819Z",
      "date_updated": "2023-09-11T12:30:28.819Z",
      "amount": 10,
      "paid_amount": 0,
      "customer_name": "Luke Skywalker",
      "customer_document_number": "00099988877"
    },
    {
      "status": "processing",
      "status_description": "The transfer is being processed.",
      "cash_out_id": "BksUV4Bg0BOX3kEqlOsH",
      "item_id": "123456789",
      "date_created": "2023-09-11T12:30:28.819Z",
      "date_updated": "2023-09-11T12:30:28.819Z",
      "amount": 100,
      "paid_off_amount": 0,
      "customer_name": "Luke Skywalker",
      "customer_document_number": "00099988877"
    },
    {
      "status": "paid",
      "cash_in_id": "rGcsz08YXVpjWu9908w3",
      "item_id": "987654321",
      "date_created": "2023-09-11T12:30:28.819Z",
      "date_updated": "2023-09-11T12:30:28.819Z",
      "amount": 100,
      "paid_amount": 100,
      "customer_name": "Leia S. O. Solo",
      "customer_document_number": "99988877766"
    },
    {
      "status": "pending",
      "status_description": "Transfer created successfully and processed and is pending finalization.",
      "cash_out_id": "a25AwZmhvMagXV6DduCP",
      "item_id": "234567890",
      "date_created": "2023-09-11T12:30:28.819Z",
      "date_updated": "2023-09-11T12:30:28.819Z",
      "amount": 1000.5,
      "paid_off_amount": 0,
      "customer_name": "Lord Darth Vader",
      "customer_document_number": "00066699966"
    },
    {
      "status": "expired",
      "cash_in_id": "NiKhnskL91jWu3vzmugd",
      "item_id": "129834765",
      "date_created": "2023-09-11T12:30:28.819Z",
      "date_updated": "2023-09-11T12:30:28.819Z",
      "amount": 199.25,
      "paid_amount": 0,
      "customer_name": "Lord Darth Vader",
      "customer_document_number": "00066699966"
    },
    {
      "status": "fulfilled",
      "status_description": "Transfer completed successfully and the amount was transferred to the customer's account.",
      "cash_out_id": "1xC3EH9OKNLk9GH5FfA1",
      "item_id": "345678901",
      "date_created": "2023-09-11T12:30:28.819Z",
      "date_updated": "2023-09-11T12:30:28.819Z",
      "amount": 250,
      "paid_off_amount": 250,
      "customer_name": "Leia S. O. Solo",
      "customer_document_number": "99988877766"
    },
    {
      "status": "failed",
      "status_description": "The bank informed us that there was a failure during the transfer.",
      "cash_out_id": "xRNlaNykjED2WU1tkVqo",
      "item_id": "456789012",
      "date_created": "2023-09-11T12:30:28.819Z",
      "date_updated": "2023-09-11T12:30:28.819Z",
      "amount": 250,
      "paid_off_amount": 0,
      "customer_name": "Wookiee Chewbacca",
      "customer_document_number": "66600066699"
    },
    {
      "+3n": "..."
    }
  ]
}