Skip to main content

Update Strategy

This endpoint is used to update the strategy settings. In that case, all the setting objects must be in the request even if it wasn’t changed.

You can also update the strategy’s secret and description, but we advise you to do it carefully.

This action requires the Strategy-Secret header.

The result will return a resume information with the current version of the strategy. You can check the strategy historic version using another endpoint.

InformationDataDescription
URL-Provided by boltPay squad
Endpointexecution-strategy/{strategySid}strategySid: The strategy SID generated after the created strategy request
MethodPATCH-
Bodyapplication/jsonAlmost the same creation body (raw)

Request

PATCH /execution-strategy/00000000-ffff-a1b2-c3d4-123qwe456rty

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

{
"description": "Updated Strategy",
"secret": "NewSecretNonEncoded",
"settings": {
"config": {
"timezone": "Asia/Manila"
},
"onCreateTasks": [
{
"task": "on-creation",
"delayBy": {
"unit": "minutes",
"amount": 5
}
},
...
],
"onCancelTasks": [
{
"task": "on-cancellation"
}
],
"schedule": {
"initialDelay": {
...
},
"calendars": [
...
]
},
"services": [
...
],
"tasks": [
{
"key": "on-creation",
"steps": [
...
],
"initialStep": "validate-product-step"
},
{
"key": "on-cancellation",
"steps": [
...
],
"initialStep": "validate-product-step"
},
{
"key": "execute-installment",
"steps": [
...
],
"initialStep": "validate-product-step"
},
...
],
"actions": [
...
]
}
}

Response

{
"version": 2,
"sid": "00000000-ffff-a1b2-c3d4-123qwe456rty",
"name": "v3-strategy",
"description": "Updated Strategy",
"createdAt": "2021-09-07T17:44:10.456Z",
"updatedAt": "2024-05-27T09:27:55.393Z"
}