Consulta de Operaciones por Operador
2 min
Listado y Búsqueda de Transacciones
Mediante la siguiente API se puede obtener un listado de operaciones en Suga y ejecutar diferentes filtros sobre ellas.
GET
https://api.sugaway.com/p/operator/coupons?page={page}&limit={limit}
Query Parameters
- pageIntegerrequiredDescription
- limitIntegerDescription
- statusNumberDescription
- currencyStringDescription
- created_fromstringDescription
- created_tostringDescription
- textstringDescription
- referencestringDescription
- testBooleanDescription
- contextstringDescription
- updated_fromstringDescription
- updated_tostringDescription
Header Parameters
- x-api-keystringrequiredDescription
- x-access-tokenstringrequiredDescription
javascript
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function() {
if(this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("GET", "https://api.sugaway.com/p/operator/coupons?page=0&limit=20&reference=my_mobbex_reference&context=plugin.value.checkout:web,plugin.value.payment_order:web,&test=true");
xhr.setRequestHeader("x-api-key", "zJ8LFTBX6Ba8D611e9io13fDZAwj0QmKO1Hn1yIj");
xhr.setRequestHeader("x-access-token", "d31f0721-2f85-44e7-bcc6-15e19d1a53cc");
xhr.send();php
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.sugaway.com/p/operator/coupons?page=0&limit=20&reference=my_mobbex_reference&context=plugin.value.checkout:web,plugin.value.payment_order:web&test=true',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
'x-api-key: zJ8LFTBX6Ba8D611e9io13fDZAwj0QmKO1Hn1yIj',
'x-access-token: d31f0721-2f85-44e7-bcc6-15e19d1a53cc'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
200
{
"result": true,
"data": {
"docs": [
{
"_id": "66cfdb58979aeb558e130005",
"uid": "SDJFAKLSDJFASLDKJFASLK",
"operation": "payment.v2",
"intentToken": {
"_id": "99999999999999",
"data": {
"total": "12.50",
"currency": "ARS",
"reference": "Reference test",
"description": "Venta Test Venta POS DX1111",
"deviceExtras": {
"os": "android",
"osVersion": 29,
"manufacturer": "ingenico",
"model": "DX1111",
"serialNumber": "ING:000000",
"bundleId": "com.sugaway.pos",
"buildNumber": "1021",
"appVersion": "1.1.0",
"romVersion": "1.8.0",
"kernelVersion": "4.9.217"
},
"timeout": 15,
"pos": "K6Y3SHXZQ759YTTTTT",
"device": "W8QV5Y8LS2ILTTTTT"
}
},
"status": "200",
"status_message": "Transacción Aprobada",
"entity": {
"_id": "6699263b113153ed78aeeb3a",
"uid": "arg.TEST",
"name": "Sucursal",
"tax_id": "99999999999"
},
"creator": {
"_id": "2222222222222",
"email": "[email protected]",
"name": "Test Name"
},
"sourceReference": "visa",
"sourceName": "Visa",
"sourceType": "card",
"sourceAction": "cashin",
"total": 12.5,
"currency": "ARS",
"card_number": "47045500****1008",
"ticketNo": "8695",
"authorizationCode": "010457",
"description": "Venta Test POS DX8000",
"installment_count": 1,
"installment_amount": 12.5,
"handler": "TEST",
"user": {
"name": ""
},
"authMethod": "none",
"threeDSAuth": "none",
"updated": "2024-08-29T02:22:18.087Z",
"created": "2024-08-29T02:22:16.950Z",
"totals": {
"total": 12.5,
"user_charges": 0,
"entity_charges": {
"source": 0,
"installment": 0,
"service": 0.5
},
"currency": "ARS",
"installment_amount": 12.5,
"financial": {
"percentage": 0,
"amount": 0
},
"requested": {
"total": 12.5,
"currency": "ARS"
},
"currency_data": {
"value": "ARS",
"label": "Peso Argentino",
"symbol": "$",
"locale": "es-AR",
"isoCode": "032",
"exponent": 2,
"hidden": false
},
"installment": {
"amount": 12.5,
"count": 1
},
"financialData": {
"isOperated": true,
"service": {
"_id": "64c7c84c34718e222222",
"uid": "QQX7SWLRXZIV11111",
"name": "Defecto",
"operator": "64c1718f31csasdd7ce782f",
"percentage": 4,
"fixed_amount": 0,
"user_percentage": 0,
"user_fixed_amount": 0,
"paymentDelay": -1,
"isDefault": false,
"chargeOverTotal": true,
"modifiers": [],
"__v": 0,
"owner": "64c1718f31csasdd7cesss2f",
"type": "simple",
"isOperated": true,
"paymentDelayType": "inactive",
"useTiers": false
},
"user": {
"percentage": 0,
"fixed_amount": 0,
"installment": 0,
"service": {
"percentage": 0,
"fixed_amount": 0
}
},
"entity": {
"percentage": 0,
"fixed_amount": 0,
"installment": 0,
"service": {
"percentage": 4,
"fixed_amount": 0
}
}
}
},
"riskQualityLevel": 0,
"statusUpdatedAt": "2024-08-29T02:22:18.087Z",
"metadata": {
"serviceCosts": {
"percentage": 4,
"fixed_amount": 0,
"paymentDelayType": "inactive",
"paymentDelay": -1,
"uid": "QQX7SWLRXZIVN1D333",
"tierUid": null
},
"serviceData": {
"_id": "64c7c84c34718ea7883e219a",
"uid": "QQX7SWLRXZIVN1D333",
"name": "Defecto",
"operator": "64c1718f31c7b53ad7ce782f",
"percentage": 4,
"fixed_amount": 0,
"user_percentage": 0,
"user_fixed_amount": 0,
"paymentDelay": -1,
"isDefault": false,
"chargeOverTotal": true,
"modifiers": [],
"__v": 0,
"owner": "64c1718f31c7b53ad7ce333",
"type": "simple",
"isOperated": true,
"paymentDelayType": "inactive",
"useTiers": false
}
},
"context": {
"value": "plugin.value.pos:mobile.pos",
"name": "SmartPOS"
},
"intent": {
"value": "payment.v2",
"name": "Pago"
},
"source": {
"name": "Visa",
"reference": "visa"
},
"sign": "+",
"riskQuality": {
"level": 0,
"band": 0
},
"hasChilds": false,
"deviceData": {
"os": "android",
"manufacturer": "ingenico",
"model": "DX1111",
"serialNumber": "ING:000000",
"buildNumber": "1021",
"appVersion": "1.1.0"
}
}
],
"page": 1,
"prevPage": -1,
"nextPage": -1,
"limit": 1
}
}Ejemplos del nodo text:
- Filtrar por ID de operación:
https://api.sugaway.com/operator/coupons?page=0&limit=20&text=HJBKL2123KLFJJJJ
Ejemplos del nodo reference:
- Filtrar por referencia de operación:
https://api.sugaway.com/operator/coupons?page=0&limit=20&reference=Tm1234
Estados de la Transacción:
Para mayor información sobre los posibles estados de una transacción para su filtrado, remitirse a Estados y Tipos de Transacción. Es muy importante revisar la documentación sobre estados y tipos de transacción ya que el manejo de los mismos será utilizado durante la homologación del comercio.