Skip to main content

Create Instance

The instance needs to identify the strategy that the data sent on it will fill the flow to be executed.

InformationDataDescription
URL-Provided by boltPay squad.
Endpoint/execution-instance-
MethodPOST-
Bodyapplication/jsondescription: Some instance description
strategyId: The strategy flow that will be used
startDate: The date that the instance execution events will start
attributes: key, value of the attributes that will be used to fill the Strategy described services executions.

Request example

POST {url}/execution-instance

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

{
"description": "Description example",
"strategyId": "00000000-ffff-a1b2-c3d4-123qwe456rty",
"startDate": "2024-06-29T12:00:00.000Z",
"attributes": {
"recurringId": "REC1234",
"quoteId": "QUOTE1234",
"orderId": "ORDER1234",
"leadId": "LEAD1234",
"productId": "PRD1234",
"policyNumber": "PLICY1234"
}
}

Response

{
"executionInstance": {
"nextEvent": {
"date": "2024-06-29T12:00:00.000Z",
"sid": "143894d1-412b-4ee7-84ef-5768ae1eb60a"
},
"attributes": {
"recurringId": "REC1234",
"quoteId": "QUOTE1234",
"orderId": "ORDER1234",
"leadId": "LEAD1234",
"productId": "PRD1234",
"policyNumber": "PLICY1234"
},
"executionDay": 29,
"executionDate": "2024-06-29T12:00:00.000Z",
"startDate": "2024-06-29T12:00:00.000Z",
"cycle": 1,
"status": "ACTIVE",
"strategyId": "00000000-ffff-a1b2-c3d4-123qwe456rty",
"description": "Description example",
"sid": "9ae5f1ff-8739-4fc6-a8d2-7643270b4a23",
"updatedAt": "2024-05-29T14:27:23.899Z",
"createdAt": "2024-05-29T14:27:23.513Z"
},
"createdEvents": {
"onCreateEvents": [],
"mainEvent": {
"attempt": 1,
"createdCycle": 1,
"date": "2024-06-29T12:00:00.000Z",
"task": "execute-flow",
"afterCancellation": false,
"main": true,
"status": "PENDING",
"strategySid": "00000000-ffff-a1b2-c3d4-123qwe456rty",
"instanceSid": "9ae5f1ff-8739-4fc6-a8d2-7643270b4a23",
"sid": "143894d1-412b-4ee7-84ef-5768ae1eb60a",
"createdAt": "2024-05-29T14:27:23.706Z"
},
"leadingUpEvents": []
}
}