---
schema_version: "1"
id: 3f9ec0f935bc51457e86716d9bc9dd00e21ce6bbd43c0f6da14e69775e902f30
title: Schedule Promotion Calculation
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/retail_api/cgtpm_schedule_promotion_calc.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.retail_api.meta/retail_api/cgtpm_schedule_promotion_calc.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 61523478cfce5c7364f969e55d95c9e5eed21c594561c21da8de7e204a138c90
description: Enqueues promotion jobs for batch calculation based on the promotion IDs.
---
# Schedule Promotion Calculation

Enqueues promotion jobs for batch calculation based on the promotion IDs.

Soft limits:

- Maximum number of promotions in a promotion loader based on PromotionLoaderMaxNumberOfPromotions. Default value is 1000.

## Resource

SCHEDULE\_PROMOTION\_CALCULATION

## Available version

55.0

## Request Parameters

| Name | Type | Description | Required or Optional |
| --- | --- | --- | --- |
| jobname | String | Name of the job. | Required |
| salesorg | String | Sales Organization name. | Required |
| promotionids | List<Id> | List of promotion IDs to calculate. | Required |
| batchchain | String | Unique batch chain name. | Required |
| jobthreads | Number | Number of parallel workers. Default: 5. Maximum: 25 (production and full copy sandbox) / 3 (other sandboxes). Recommended: 25. | Optional (but strongly recommended) |

## Apex Request Example

// Endpoint name
String endpointName = 'SCHEDULE\_PROMOTION\_CALCULATION';
// Sales Organization name
String salesOrg = '0001';
// 
String jobName = '<PromotionCalculationJobName>';
Set<Id> promosIds = new Set<Id>{'<promotionId\_1>', '<promotionId\_2>'};
<namespace>.OffPlatformCallout callout = new <namespace>.OffPlatformCallout(
    endpointName,
    salesOrg
);
<namespace>.OffPlatformCalloutResponse response = callout.execute(
    <namespace>.TransactionHandler.getTransactionIdentifier(),
    new Map<String, String\>(),
    JSON.serialize(
        new Map<String, Object\> {
            'jobname' => jobName,
            'salesorg' => salesOrg,
            'promotionids' => promosIds,
            'batchchain' => String.format(
                'Promotion\_Batch\_Transaction\_{0}',
                new List<String\>{
                    <namespace>.TransactionHandler.getTransactionIdentifier()
                }
            ),
            'jobthreads' => 25  // ⚡ ADD: Number of parallel workers (default: 5, max: 25 on production/full copy sandbox, 3 on other sandboxes)
        }
    )
);
if (response.status != 200) {
   // Handle error
}