var data = {
"secret": "ZjAzZWZhOGU2Nm.....2ZjAxYTk1NGQ4MzE0NTE4ZTU0NjcyNTQ2OTA=",
"merchantId": "d4967653-3c5d-4abe-bde5-b1414a6c890d",
"terminal": "Terminal-BNCR-Colones",
"userId": "Guide example",
"description": "subscription guide example",
"currency": "USD",
"tokens": [
"968212cb-7481-414c-a504-ccaf76696d08"
],
"initialPayment": {
"amount": 100,
"description": "Guide initial payment"
},
"subscription": [{
"startDate": 1536991200000,
"endDate": 1544853600000,
"amount": 10,
"cadence": {
"mode": "EVERY",
"unit": "MONTH",
"every": 1
}
}]
}
req.headers({
"cache-control": "no-cache",
"Content-Type": "application/json"
});
req.type("json");
req.send(data);
req.end(function(res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});