Skip to main content

Read Cash-In by Filters

This route will be used to fetch cash-in operations, this endpoint returns an array containing cash-in objects, sorted from the most recently performed cash-in.

If no filter is passed, it returns an array of objects containing your last 10 operations performed with Marlim.

GETv1/chash-in

Request Query Params

AttributeTypeDescription
item_idstringFilter by a specific your charge/order ID.
cash_in_idstringFilter by a specific Marlim cash-in ID.
date_createddateTimeFilter by date created.
date_updateddateTimeFilter by date updated.
statusstringFilter by status.

Accepted values: paid and failed.
customer_document_numberstringFilter by document CPF of a paying customer.
countint32Returns n cash-in 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/chash-in" \
-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 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 cash-in operation, an empty array is returned.

PropertyTypeDescription
statusstringRepresents the current state of the cash-in.

Possible values: paid, failed, cancelled, and expired.
cash_in_idstringMarlim operation identifier number.
item_idstringCharge/Order ID on your platform.
date_createddateTimeOperation creation date in ISODateTime format.
date_updateddateTimeOperation status updated date in ISODateTime format.
amountint32 || floatAmount to be charged to the paying customer.
paid_amountint32 || floatAmount paid by the paying customer.
customer_namestringPaying customer name.
customer_document_numberstringPaying customer document number.
info

When a response is returned using the above filters, the pix_copy_paste and pix_image_base64 fields are not returned in the response payload, because they are very large strings. To obtain this data, it will be necessary to make a new request to the GET endpoint using the Cash-In ID, which we describe on the page Read Cash-In by ID.

Samples

Request
curl -X GET -G "https://api.bet.marlim.co/v1/chash-in" \
-H "Content-Type: application/json" \
-H "api_key: api_key_value" \
Response200
{
"total": 150,
"page": 1,
"offset": 15,
"operations": [
{
"status": "active",
"cash_in_id": "os7WT0bCGbWxAjAv2eT6",
"item_id": "123456789",
"date_created": "2023-09-11T12:30:28.765Z",
"date_updated": "2023-09-11T12:30:28.765Z",
"amount": 10,
"paid_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.765Z",
"date_updated": "2023-09-11T12:30:28.765Z",
"amount": 100,
"paid_amount": 100,
"customer_name": "Leia S. O. Solo",
"customer_document_number": "99988877766"
},
{
"status": "expired",
"cash_in_id": "NiKhnskL91jWu3vzmugd",
"item_id": "129834765",
"date_created": "2023-09-11T12:30:28.765Z",
"date_updated": "2023-09-11T12:30:28.765Z",
"amount": 199.25,
"paid_amount": 0,
"customer_name": "Lord Darth Vader",
"customer_document_number": "00066699966"
},
{
"+7n": "..."
}
]
}