Read Transactions
This route will be used to fetch transactions, this endpoint returns an array containing transaction objects, sorted from the most recently performed transaction.
If no filter is passed, it returns an array of objects containing the last 10 Western Union Global transactions performed with Marlim.
Request Query Params
Attribute | Type | Description |
---|---|---|
transaction_id | string | Filter by a Specific Transaction ID. |
date_created | dateTime | Filter by Transaction Date Created. |
date_updated | dateTime | Filter by Transaction Updated Date. |
status | string | Filter by Transaction Status: Accepted values: paid , authorized , refused , canceled , refunded , and chargeback . |
payment_method | string | Payment Method Filter: Accepted Values: credit and debit . |
count | int32 | Returns n transaction objects. Maximum of 1,000 and default of 10. |
page | int32 | Useful for implementing a pagination of results. |
info
As mentioned on the WU Custom Parameters Authorization Page, new filters can be added according to the WU's need. These parameters are still in the alignment phase between Marlim and WU teams.
Tip
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.wu.global.marlim.co/v2/installments" \
-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("2022-01-01T00:00:00.000Z").getTime()
which will return 1640995200000.
Response Object
When fetching transactions, returns an object with 4 properties: total
, page
, offset
and transactions
.
Attribute | Type | Description |
---|---|---|
total | int32 | Total transactions 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 transactions in the queries. |
transactions | array | Array of objects containing transaction data. |
Transactions Array
If the query response is greater than or equal to 1, inside the transactions property, this is the array of objects you receive as a response. If the filter using does not find any transactions, an empty array is returned.
Property | Type | Description |
---|---|---|
status | string | Represents the current state of the transaction. Possible values: paid , authorized , refused , canceled , refunded , and chargeback . |
authorization_code | string | Authorization code returned by the issuing bank. |
nsu | string | Code that identifies the transaction in the acquirer. |
order_id | string | Transaction ID on WU platform. |
payment_method | string | Payment method. Possible values: credit , and debit . |
wu_payment_type | string | Specific Western Union Payment Type. Possible values: MT (Money Transfer) and FX (Stars). |
date_created | dateTime | Transaction creation date in ISODateTime format. |
date_updated | dateTime | Transaction status updated date in ISODateTime format. |
net_value | int32 | Amount in cents to be charged without acquiring fees. |
authorized_amount | int32 | Amount in cents authorized in transaction. |
paid_amount | int32 | Amount in cents captured in the transaction. |
refunded_amount | int32 | Amount in cents reversed in transaction. |
installments | string | Number of installments the customer paid for. |
transaction_id | string | Transaction identifier number. |
card_holder_name | string | Name of cardholder used for payment. |
card_brand | string | Brand of the card used for the payment. Possible values: visa , mastercard , amex , hypercard and elo . |
card_first_digits | string | First 6 digits of the card used for payment. |
card_last_digits | string | Last 4 digits of the card used for payment. |
acquirer_status_code | string | Issuing Bank response identifier code. |
Samples
- Last 10 transactions
- Filter by ID
- Multiple Filters
curl -X GET -G "https://api.wu.global.marlim.co/v1/transactions" \
-H "Content-Type: application/json" \
-H "api_key: api_key_value" \
{
"total": 150,
"page": 1,
"offset": 15,
"transactions": [
{
"acquirer_status_code": "0000",
"status": "authorized",
"authorization_code": "068194",
"nsu": "987654321",
"order_id": "123456789",
"date_created": "2024-04-29T17:55:12.816Z",
"date_updated": "2024-04-29T17:55:12.816Z",
"net_value": 100000,
"authorized_amount": 104330,
"paid_amount": 0,
"refunded_amount": 0,
"installments": "1",
"transaction_id": "12345678912345",
"card_holder_name": "Luke Skywalker",
"card_brand": "visa",
"card_first_digits": "4444555",
"card_last_digits": "2222",
"wu_payment_type": "MT",
"payment_method": "credit"
},
{
"acquirer_status_code": "0000",
"status": "paid",
"authorization_code": "124356",
"nsu": "987654321",
"order_id": "2345678910",
"date_created": "2024-04-29T17:55:12.816Z",
"date_updated": "2024-04-29T17:55:12.816Z",
"net_value": 100000,
"authorized_amount": 104330,
"paid_amount": 104330,
"refunded_amount": 0,
"installments": "1",
"transaction_id": "12345678912346",
"card_holder_name": "Luke Skywalker",
"card_brand": "visa",
"card_first_digits": "4444555",
"card_last_digits": "2222",
"wu_payment_type": "MT",
"payment_method": "debit"
},
{
"acquirer_status_code": "1830",
"status": "refused",
"authorization_code": null,
"nsu": "987654321",
"order_id": "34567891011",
"date_created": "2024-04-29T17:55:12.816Z",
"date_updated": "2024-04-29T17:55:12.816Z",
"net_value": 100000,
"authorized_amount": 0,
"paid_amount": 0,
"refunded_amount": 0,
"installments": "1",
"transaction_id": "12345678912347",
"card_holder_name": "Leia S. O. Solo",
"card_brand": "mastercard",
"card_first_digits": "555544",
"card_last_digits": "3333",
"wu_payment_type": "MT",
"payment_method": "debit"
},
{
"acquirer_status_code": "0000",
"status": "refunded",
"authorization_code": "243567",
"nsu": "987654323",
"order_id": "456789101112",
"date_created": "2024-04-29T17:55:12.816Z",
"date_updated": "2024-04-29T17:55:12.816Z",
"net_value": 100000,
"authorized_amount": 104330,
"paid_amount": 0,
"refunded_amount": 104330,
"installments": "1",
"transaction_id": "12345678912348",
"card_holder_name": "Lord Darth Vader",
"card_brand": "amex",
"card_first_digits": "777",
"card_last_digits": "9999",
"wu_payment_type": "MT",
"payment_method": "credit"
},
{
"+6n": "..."
}
]
}
curl -X GET -G "https://api.wu.global.marlim.co/v1/transactions" \
-H "Content-Type: application/json" \
-H "api_key: api_key_value" \
-d transaction_id="12344321"
{
"total": 1,
"page": 1,
"offset": 1,
"transactions": [
{
"acquirer_status_code": "0000",
"status": "authorized",
"authorization_code": "068194",
"nsu": "987654321",
"order_id": "5678910111213",
"date_created": "2024-04-29T17:55:12.816Z",
"date_updated": "2024-04-29T17:55:12.816Z",
"net_value": 100000,
"authorized_amount": 104330,
"paid_amount": 0,
"refunded_amount": 0,
"installments": "1",
"transaction_id": "12344321",
"card_holder_name": "Luke Skywalker",
"card_brand": "visa",
"card_first_digits": "4444555",
"card_last_digits": "2222"
}
]
}
curl -X GET -G "https://api.wu.global.marlim.co/v1/transactions" \
-H "Content-Type: application/json" \
-H "api_key: api_key_value" \
-d date_created=">=1651622400000" \
-d date_created="<=1651708799999" \
-d status="paid" \
-d count=100
{
"total": 300,
"page": 1,
"offset": 3,
"transactions": [
{
"acquirer_status_code": "0000",
"status": "paid",
"authorization_code": "068194",
"nsu": "987654321",
"order_id": "67891011121314",
"date_created": "2024-04-29T17:55:12.816Z",
"date_updated": "2024-04-29T17:55:12.816Z",
"net_value": 100000,
"authorized_amount": 104330,
"paid_amount": 104330,
"refunded_amount": 0,
"installments": "1",
"transaction_id": "12345678912345",
"card_holder_name": "Luke Skywalker",
"card_brand": "visa",
"card_first_digits": "4444555",
"card_last_digits": "2222"
},
{
"acquirer_status_code": "0000",
"status": "paid",
"authorization_code": "068195",
"nsu": "987654322",
"order_id": "789101112131415",
"date_created": "2024-04-29T17:55:12.816Z",
"date_updated": "2024-04-29T17:55:12.816Z",
"net_value": 100000,
"authorized_amount": 104330,
"paid_amount": 104330,
"refunded_amount": 0,
"installments": "1",
"transaction_id": "12345678912346",
"card_holder_name": "Leia S. O. Solo",
"card_brand": "mastercard",
"card_first_digits": "555544",
"card_last_digits": "3333"
},
{
"acquirer_status_code": "0000",
"status": "paid",
"authorization_code": "068196",
"nsu": "987654322",
"order_id": "8910111213141516",
"date_created": "2024-04-29T17:55:12.816Z",
"date_updated": "2024-04-29T17:55:12.816Z",
"net_value": 100000,
"authorized_amount": 104330,
"paid_amount": 104330,
"refunded_amount": 0,
"installments": "1",
"transaction_id": "12345678912347",
"card_holder_name": "Lord Darth Vader",
"card_brand": "amex",
"card_first_digits": "777",
"card_last_digits": "9999"
},
{
"+97n": "..."
}
]
}