curl --request POST \
--url https://omnicommerce.sg/api/v1/campaigns/{campaignId}/actions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"expectedRevision": 123
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({expectedRevision: 123})
};
fetch('https://omnicommerce.sg/api/v1/campaigns/{campaignId}/actions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://omnicommerce.sg/api/v1/campaigns/{campaignId}/actions"
payload = { "expectedRevision": 123 }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"campaign": {
"id": "<string>",
"organizationId": "<string>",
"revision": 0,
"stage": "draft",
"approval": {
"revision": 0,
"userId": "<string>",
"approvedAt": "<string>"
},
"runId": "<string>",
"startedAt": "<string>",
"endedAt": "<string>",
"createdAt": "<string>",
"updatedAt": "<string>",
"plan": {
"brief": {
"name": "<string>",
"ownerId": "<string>",
"approverId": "<string>",
"timezone": "<string>",
"objective": "",
"brand": "",
"stores": [],
"serviceRequest": "",
"priority": "standard",
"documentIds": [],
"reviewDueAt": "2023-11-07T05:31:56Z",
"sourceCurrency": "<string>",
"sourceMarketplace": "shopee",
"sourceCountry": "<string>",
"cleanupNotes": ""
},
"windows": [],
"offers": [
{
"id": "<string>",
"windowId": "<string>",
"promotion": {
"name": "<string>",
"description": "<string>",
"kind": "product_discount",
"salesChannels": [
"pdp"
],
"discountType": "percentage",
"discountValue": 1,
"storeDiscounts": [
{
"storeKey": "<string>",
"discountType": "percentage",
"discountValue": 1
}
],
"targetStores": [
{
"marketplace": "lazada",
"country": "<string>",
"storeId": "<string>"
}
],
"minSalePrice": 1,
"maxDiscountAmount": 1,
"minSpend": 1,
"voucherCode": "<string>",
"claimStartsAt": "2023-11-07T05:31:56Z",
"totalUsageLimit": 4503599627370495,
"perBuyerLimit": 4503599627370495,
"mechanicConfig": {
"voucherType": "shopee_shop",
"browserAutomation": {
"aopId": "<string>",
"variableValues": {},
"instructions": "<string>"
},
"voucherScope": "products",
"voucherReward": "discount",
"voucherAudience": "general",
"repeatPurchaseMinCount": 500,
"repeatPurchaseLookbackDays": 183,
"smartVoucher": true,
"followPrizeExpiryDays": 15,
"videoDisplayMode": "shopee_video",
"exclusiveCreatorUsernames": [
"<string>"
],
"exclusiveStreamerUsernames": [
"<string>"
],
"voucherDisplayChannels": [
"all"
],
"bundlePriceType": "discount",
"bundleTiers": [
{
"minimumQuantity": 1501,
"discountValue": 123
}
],
"thresholdType": "item_quantity",
"thresholdValue": 123,
"giftType": "gift",
"giftQuantity": 123,
"gifts": [
{
"productId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"totalClaimLimit": 50000,
"variantId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
],
"buyQuantity": 123,
"getQuantity": 123,
"benefitProductIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"benefitType": "free",
"benefitValue": 1,
"maxApplicationsPerOrder": 123,
"bundleMinimumQuantity": 1501,
"shippingDeliveryOption": "<string>",
"shippingBudget": 123
}
},
"promotionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"productIds": [],
"reviewNotes": "",
"excludedReason": "",
"source": {
"sheet": "<string>",
"rows": [
123
],
"headers": [
"<string>"
],
"values": [
[
"<string>"
]
]
}
}
]
},
"pendingChange": {
"version": 0,
"plan": {
"brief": {
"name": "<string>",
"ownerId": "<string>",
"approverId": "<string>",
"timezone": "<string>",
"objective": "",
"brand": "",
"stores": [],
"serviceRequest": "",
"priority": "standard",
"documentIds": [],
"reviewDueAt": "2023-11-07T05:31:56Z",
"sourceCurrency": "<string>",
"sourceMarketplace": "shopee",
"sourceCountry": "<string>",
"cleanupNotes": ""
},
"windows": [],
"offers": [
{
"id": "<string>",
"windowId": "<string>",
"promotion": {
"name": "<string>",
"description": "<string>",
"kind": "product_discount",
"salesChannels": [
"pdp"
],
"discountType": "percentage",
"discountValue": 1,
"storeDiscounts": [
{
"storeKey": "<string>",
"discountType": "percentage",
"discountValue": 1
}
],
"targetStores": [
{
"marketplace": "lazada",
"country": "<string>",
"storeId": "<string>"
}
],
"minSalePrice": 1,
"maxDiscountAmount": 1,
"minSpend": 1,
"voucherCode": "<string>",
"claimStartsAt": "2023-11-07T05:31:56Z",
"totalUsageLimit": 4503599627370495,
"perBuyerLimit": 4503599627370495,
"mechanicConfig": {
"voucherType": "shopee_shop",
"browserAutomation": {
"aopId": "<string>",
"variableValues": {},
"instructions": "<string>"
},
"voucherScope": "products",
"voucherReward": "discount",
"voucherAudience": "general",
"repeatPurchaseMinCount": 500,
"repeatPurchaseLookbackDays": 183,
"smartVoucher": true,
"followPrizeExpiryDays": 15,
"videoDisplayMode": "shopee_video",
"exclusiveCreatorUsernames": [
"<string>"
],
"exclusiveStreamerUsernames": [
"<string>"
],
"voucherDisplayChannels": [
"all"
],
"bundlePriceType": "discount",
"bundleTiers": [
{
"minimumQuantity": 1501,
"discountValue": 123
}
],
"thresholdType": "item_quantity",
"thresholdValue": 123,
"giftType": "gift",
"giftQuantity": 123,
"gifts": [
{
"productId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"totalClaimLimit": 50000,
"variantId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
],
"buyQuantity": 123,
"getQuantity": 123,
"benefitProductIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"benefitType": "free",
"benefitValue": 1,
"maxApplicationsPerOrder": 123,
"bundleMinimumQuantity": 1501,
"shippingDeliveryOption": "<string>",
"shippingBudget": 123
}
},
"promotionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"productIds": [],
"reviewNotes": "",
"excludedReason": "",
"source": {
"sheet": "<string>",
"rows": [
123
],
"headers": [
"<string>"
],
"values": [
[
"<string>"
]
]
}
}
]
},
"proposedBy": "<string>",
"proposedAt": "<string>"
}
},
"executions": [
{
"offerId": "<string>",
"windowId": "<string>",
"promotionId": "<string>",
"state": "draft",
"error": "<string>",
"evidence": "<unknown>",
"termsRevision": 0
}
],
"audit": [
{
"id": "<string>",
"action": "<string>",
"actorId": "<string>",
"actorName": "<string>",
"createdAt": "<string>",
"details": {},
"summary": "<string>",
"items": [
{
"kind": "brief",
"action": "add",
"id": "<string>",
"name": "<string>",
"changes": [
{
"field": "<string>",
"label": "<string>",
"from": "<string>",
"to": "<string>"
}
]
}
],
"hiddenCount": 4503599627370495
}
],
"readiness": [
"<string>"
],
"pendingChangeIssues": [
"<string>"
],
"pendingScheduleCount": 4503599627370495,
"failedScheduleCount": 4503599627370495,
"waitingBrowserJobCount": 4503599627370495,
"scheduling": {
"queued": 4503599627370495,
"pending": true
},
"scheduleIssues": [
{
"windowId": "<string>",
"phase": "prepare",
"kind": "overdue"
}
],
"recovery": [
{
"windowId": "<string>",
"phase": "prepare",
"state": "<string>",
"attempt": 0,
"nextRetryAt": "<string>",
"error": "<string>"
}
],
"cleanupFailed": true,
"progress": {
"asOf": "<string>",
"title": "<string>",
"description": "<string>",
"total": 4503599627370495,
"counts": {
"waiting": 4503599627370495,
"preparing": 4503599627370495,
"prepared": 4503599627370495,
"live": 4503599627370495,
"ending": 4503599627370495,
"ended": 4503599627370495,
"cancelled": 4503599627370495,
"failed": 4503599627370495
},
"issues": [
{
"offerId": "<string>",
"name": "<string>",
"error": "<string>"
}
],
"scheduleIssues": [
{
"windowId": "<string>",
"phase": "prepare",
"kind": "overdue",
"name": "<string>",
"message": "<string>"
}
],
"blockers": [
"<string>"
],
"nextWindow": {
"id": "<string>",
"name": "<string>",
"preparesAt": "<string>",
"startsAt": "<string>",
"endsAt": "<string>"
}
}
}Act on Campaign
Approve, start, end, resume, retry, or decide a proposed live change. Approve, run, resume, and approving a change must be called by the named approver. Requires promotions:write.
curl --request POST \
--url https://omnicommerce.sg/api/v1/campaigns/{campaignId}/actions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"expectedRevision": 123
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({expectedRevision: 123})
};
fetch('https://omnicommerce.sg/api/v1/campaigns/{campaignId}/actions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://omnicommerce.sg/api/v1/campaigns/{campaignId}/actions"
payload = { "expectedRevision": 123 }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"campaign": {
"id": "<string>",
"organizationId": "<string>",
"revision": 0,
"stage": "draft",
"approval": {
"revision": 0,
"userId": "<string>",
"approvedAt": "<string>"
},
"runId": "<string>",
"startedAt": "<string>",
"endedAt": "<string>",
"createdAt": "<string>",
"updatedAt": "<string>",
"plan": {
"brief": {
"name": "<string>",
"ownerId": "<string>",
"approverId": "<string>",
"timezone": "<string>",
"objective": "",
"brand": "",
"stores": [],
"serviceRequest": "",
"priority": "standard",
"documentIds": [],
"reviewDueAt": "2023-11-07T05:31:56Z",
"sourceCurrency": "<string>",
"sourceMarketplace": "shopee",
"sourceCountry": "<string>",
"cleanupNotes": ""
},
"windows": [],
"offers": [
{
"id": "<string>",
"windowId": "<string>",
"promotion": {
"name": "<string>",
"description": "<string>",
"kind": "product_discount",
"salesChannels": [
"pdp"
],
"discountType": "percentage",
"discountValue": 1,
"storeDiscounts": [
{
"storeKey": "<string>",
"discountType": "percentage",
"discountValue": 1
}
],
"targetStores": [
{
"marketplace": "lazada",
"country": "<string>",
"storeId": "<string>"
}
],
"minSalePrice": 1,
"maxDiscountAmount": 1,
"minSpend": 1,
"voucherCode": "<string>",
"claimStartsAt": "2023-11-07T05:31:56Z",
"totalUsageLimit": 4503599627370495,
"perBuyerLimit": 4503599627370495,
"mechanicConfig": {
"voucherType": "shopee_shop",
"browserAutomation": {
"aopId": "<string>",
"variableValues": {},
"instructions": "<string>"
},
"voucherScope": "products",
"voucherReward": "discount",
"voucherAudience": "general",
"repeatPurchaseMinCount": 500,
"repeatPurchaseLookbackDays": 183,
"smartVoucher": true,
"followPrizeExpiryDays": 15,
"videoDisplayMode": "shopee_video",
"exclusiveCreatorUsernames": [
"<string>"
],
"exclusiveStreamerUsernames": [
"<string>"
],
"voucherDisplayChannels": [
"all"
],
"bundlePriceType": "discount",
"bundleTiers": [
{
"minimumQuantity": 1501,
"discountValue": 123
}
],
"thresholdType": "item_quantity",
"thresholdValue": 123,
"giftType": "gift",
"giftQuantity": 123,
"gifts": [
{
"productId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"totalClaimLimit": 50000,
"variantId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
],
"buyQuantity": 123,
"getQuantity": 123,
"benefitProductIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"benefitType": "free",
"benefitValue": 1,
"maxApplicationsPerOrder": 123,
"bundleMinimumQuantity": 1501,
"shippingDeliveryOption": "<string>",
"shippingBudget": 123
}
},
"promotionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"productIds": [],
"reviewNotes": "",
"excludedReason": "",
"source": {
"sheet": "<string>",
"rows": [
123
],
"headers": [
"<string>"
],
"values": [
[
"<string>"
]
]
}
}
]
},
"pendingChange": {
"version": 0,
"plan": {
"brief": {
"name": "<string>",
"ownerId": "<string>",
"approverId": "<string>",
"timezone": "<string>",
"objective": "",
"brand": "",
"stores": [],
"serviceRequest": "",
"priority": "standard",
"documentIds": [],
"reviewDueAt": "2023-11-07T05:31:56Z",
"sourceCurrency": "<string>",
"sourceMarketplace": "shopee",
"sourceCountry": "<string>",
"cleanupNotes": ""
},
"windows": [],
"offers": [
{
"id": "<string>",
"windowId": "<string>",
"promotion": {
"name": "<string>",
"description": "<string>",
"kind": "product_discount",
"salesChannels": [
"pdp"
],
"discountType": "percentage",
"discountValue": 1,
"storeDiscounts": [
{
"storeKey": "<string>",
"discountType": "percentage",
"discountValue": 1
}
],
"targetStores": [
{
"marketplace": "lazada",
"country": "<string>",
"storeId": "<string>"
}
],
"minSalePrice": 1,
"maxDiscountAmount": 1,
"minSpend": 1,
"voucherCode": "<string>",
"claimStartsAt": "2023-11-07T05:31:56Z",
"totalUsageLimit": 4503599627370495,
"perBuyerLimit": 4503599627370495,
"mechanicConfig": {
"voucherType": "shopee_shop",
"browserAutomation": {
"aopId": "<string>",
"variableValues": {},
"instructions": "<string>"
},
"voucherScope": "products",
"voucherReward": "discount",
"voucherAudience": "general",
"repeatPurchaseMinCount": 500,
"repeatPurchaseLookbackDays": 183,
"smartVoucher": true,
"followPrizeExpiryDays": 15,
"videoDisplayMode": "shopee_video",
"exclusiveCreatorUsernames": [
"<string>"
],
"exclusiveStreamerUsernames": [
"<string>"
],
"voucherDisplayChannels": [
"all"
],
"bundlePriceType": "discount",
"bundleTiers": [
{
"minimumQuantity": 1501,
"discountValue": 123
}
],
"thresholdType": "item_quantity",
"thresholdValue": 123,
"giftType": "gift",
"giftQuantity": 123,
"gifts": [
{
"productId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"totalClaimLimit": 50000,
"variantId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
],
"buyQuantity": 123,
"getQuantity": 123,
"benefitProductIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"benefitType": "free",
"benefitValue": 1,
"maxApplicationsPerOrder": 123,
"bundleMinimumQuantity": 1501,
"shippingDeliveryOption": "<string>",
"shippingBudget": 123
}
},
"promotionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"productIds": [],
"reviewNotes": "",
"excludedReason": "",
"source": {
"sheet": "<string>",
"rows": [
123
],
"headers": [
"<string>"
],
"values": [
[
"<string>"
]
]
}
}
]
},
"proposedBy": "<string>",
"proposedAt": "<string>"
}
},
"executions": [
{
"offerId": "<string>",
"windowId": "<string>",
"promotionId": "<string>",
"state": "draft",
"error": "<string>",
"evidence": "<unknown>",
"termsRevision": 0
}
],
"audit": [
{
"id": "<string>",
"action": "<string>",
"actorId": "<string>",
"actorName": "<string>",
"createdAt": "<string>",
"details": {},
"summary": "<string>",
"items": [
{
"kind": "brief",
"action": "add",
"id": "<string>",
"name": "<string>",
"changes": [
{
"field": "<string>",
"label": "<string>",
"from": "<string>",
"to": "<string>"
}
]
}
],
"hiddenCount": 4503599627370495
}
],
"readiness": [
"<string>"
],
"pendingChangeIssues": [
"<string>"
],
"pendingScheduleCount": 4503599627370495,
"failedScheduleCount": 4503599627370495,
"waitingBrowserJobCount": 4503599627370495,
"scheduling": {
"queued": 4503599627370495,
"pending": true
},
"scheduleIssues": [
{
"windowId": "<string>",
"phase": "prepare",
"kind": "overdue"
}
],
"recovery": [
{
"windowId": "<string>",
"phase": "prepare",
"state": "<string>",
"attempt": 0,
"nextRetryAt": "<string>",
"error": "<string>"
}
],
"cleanupFailed": true,
"progress": {
"asOf": "<string>",
"title": "<string>",
"description": "<string>",
"total": 4503599627370495,
"counts": {
"waiting": 4503599627370495,
"preparing": 4503599627370495,
"prepared": 4503599627370495,
"live": 4503599627370495,
"ending": 4503599627370495,
"ended": 4503599627370495,
"cancelled": 4503599627370495,
"failed": 4503599627370495
},
"issues": [
{
"offerId": "<string>",
"name": "<string>",
"error": "<string>"
}
],
"scheduleIssues": [
{
"windowId": "<string>",
"phase": "prepare",
"kind": "overdue",
"name": "<string>",
"message": "<string>"
}
],
"blockers": [
"<string>"
],
"nextWindow": {
"id": "<string>",
"name": "<string>",
"preparesAt": "<string>",
"startsAt": "<string>",
"endsAt": "<string>"
}
}
}Authorizations
Bearer API key for server-to-server access. Session auth is also supported in first-party UI flows.
Path Parameters
Body
approve, run, approve_and_run, end, resume, retry, approve_change, discard_change x <= 9007199254740991x <= 9007199254740991Required for session auth. Optional for an API key, which already identifies the organization.
1 - 120Response
Campaign detail after the action, plus the scheduling result.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Issues that block approving or running the current plan.
Issues that block approving the proposed live change.
0 <= x <= 90071992547409910 <= x <= 90071992547409910 <= x <= 9007199254740991pending is true when the schedule was saved but not yet acknowledged; retry the action to confirm.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes