Skip to main content

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.

GETv1/operations

Request Query Params

AttributeTypeDescription
date_createddateTimeFilter by date created.
date_updateddateTimeFilter by date updated.
customer_document_numberstringFilter by CPF document number of a customer.
countint32Returns n operation objects. Maximum of 1,000 and default of 10.
pageint32Useful for implementing a pagination of results.
Tip

The date_created and date_updated property can be used to filter date range searches using the following attributes:

AttributeDescription
<less than
>greater than
<=less than or equal to
>=greater than or equal to
Request
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"
Heads Up!

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.

AttributeTypeDescription
totalint32Total operations that meet the filter passed in the query.
pageint32Current page referring to offset of pages.
offsetint32Total pages for count divided by total of handled operations in the queries.
operationsarrayArray 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.

PropertyTypeOperationDescription
statusstringcash-in || cash-outRepresents the current state of the operation.
cash_out_idstringcash-outMarlim operation identifier number.
item_idstringcash-in || cash-outCharge/Order ID on your platform.
status_descriptionstringcash-outDescription to clarify about the status of the transfer.
cash_in_idstringcash-inMarlim cash-in identifier number.
date_createddateTimecash-in || cash-outOperation creation date in ISODateTime format.
date_updateddateTimecash-in || cash-outOperation status updated date in ISODateTime format.
amountint32 || floatcash-in || cash-outAmount to be charged or transferred to the customer.
paid_amountint32 || floatcash-inAmount paid by the paying customer.
paid_off_amountint32 || floatcash-outFinal amount transferred to the customer's account according to the current status.
customer_namestringcash-in || cash-outCustomer name.
customer_document_numberstringcash-in || cash-outPaying customer document number.

Samples

Request
curl -X GET -G "https://api.bet.marlim.co/v1/operations" \
-H "Content-Type: application/json" \
-H "api_key: api_key_value" \
Response200
{
"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": "..."
}
]
}