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.
Request Query Params
Attribute | Type | Description |
---|---|---|
item_id | string | Filter by a specific your charge/order ID. |
cash_in_id | string | Filter by a specific Marlim cash-in ID. |
date_created | dateTime | Filter by date created. |
date_updated | dateTime | Filter by date updated. |
status | string | Filter by status. Accepted values: paid and failed . |
customer_document_number | string | Filter by document CPF of a paying customer. |
count | int32 | Returns n cash-in 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/chash-in" \
-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 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 offset of pages. |
offset | int32 | Total pages for count divided by total of 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 cash-in operation, an empty array is returned.
Property | Type | Description |
---|---|---|
status | string | Represents the current state of the cash-in. Possible values: paid , failed , cancelled , and expired . |
cash_in_id | string | Marlim operation identifier number. |
item_id | string | Charge/Order ID on your platform. |
date_created | dateTime | Operation creation date in ISODateTime format. |
date_updated | dateTime | Operation status updated date in ISODateTime format. |
amount | int32 || float | Amount to be charged to the paying customer. |
paid_amount | int32 || float | Amount paid by the paying customer. |
customer_name | string | Paying customer name. |
customer_document_number | string | Paying customer document number. |
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
- Last 10 cash-in operations
curl -X GET -G "https://api.bet.marlim.co/v1/chash-in" \
-H "Content-Type: application/json" \
-H "api_key: api_key_value" \
{
"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": "..."
}
]
}