Skip to main content

Simulate Strategy Execution

This endpoint is used to simulate the Strategy execution. Simulating the data of a fictitious instance, but executing everything without the instance attributes.

InformationDataDescription
URL-Provided by boltPay squad
Endpoint/execution-strategy/{strategySid}/simulate-executionstrategySid": The strategy SID generated after the created strategy request.
MethodPOST-
Bodyapplication/jsoncycles: Quantity of cycles to be simulated
startDate: Date to start the simulation
dateFormat: Execution startDate format. (Optional) (default: LLLL)

Request

POST {url}/execution-strategy/00000000-ffff-a1b2-c3d4-123qwe456rty/simulate-execution

Headers: { Content-Type: application/json, Strategy-Secret: asdxcv123asdzxcv, Authorization: Bearer asd123asdfd123.asdasd123.asda13213 }

{
"cycles": 2,
"startDate": "2022-01-01T12:00:00.000Z",
"dateFormat": "LLLL"
}

Response

{
"startDate": "Saturday, January 1, 2022 8:00 PM",
"simulatedCycles": 2,
"timezone": "Asia/Manila",
"cycleEvents": [
{
"cycle": 1,
"events": {
"onCreateEvents": [
{
"date": "Saturday, January 1, 2022 8:05 PM",
"task": "on-creation",
"status": "PENDING"
},
{
"date": "Saturday, January 1, 2022 9:00 PM",
"task": "c2p-reminder",
"status": "PENDING",
"callback": "(instance) => { return lodash.get(instance, 'attributes.hasC2P', false) }"
},
{
"date": "Sunday, January 2, 2022 8:00 PM",
"task": "c2p-expiration",
"status": "PENDING",
"callback": "(instance) => { return lodash.get(instance, 'attributes.hasC2P', false) }"
},
{
"date": "Sunday, January 2, 2022 8:00 PM",
"task": "c2p-test-failed",
"status": "ONHOLD",
"callback": "(instance) => { return lodash.get(instance, 'attributes.hasC2P', false) }"
}
],
"mainEvent": {
"date": "Friday, January 21, 2022 12:00 PM",
"task": "execute-installment",
"status": "PENDING"
}
}
},
{
"cycle": 2,
"events": {
"mainEvent": {
"date": "Monday, February 21, 2022 12:00 PM",
"task": "execute-installment",
"status": "PENDING"
}
}
}
]
}