---
schema_version: "1"
id: f0acd826f80d505c7cc988e4d7ada17a7c1c40de2f988bc2b4466fbad7629263
title: Schedule Adhoc Promotion Calculation
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/retail_api/cgtpm_schedule_adhoc_promotion_calc.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.retail_api.meta/retail_api/cgtpm_schedule_adhoc_promotion_calc.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: cb44c07e238b50aace8763b29d025bbc2c748a3cdb85052a5ea1c2aa3b349609
description: Schedules one promotion for off-platform calculation in an ad-hoc transaction.
---
# Schedule Adhoc Promotion Calculation

Schedules one promotion for off-platform calculation in an ad-hoc transaction.

You must first register a transaction using the BEGIN\_JOB\_SCHEDULING\_TRANSACTION request to schedule off-platform calculations.

## Resource

SCHEDULE\_ADHOC\_PROMOTION\_CALCULATION

## Available version

55.0

## Request Parameters

| Name | Type | Description | Required or Optional |
| --- | --- | --- | --- |
| adhocTransactionId | String | ID of the adhoc transaction record. | Required |
| salesOrg | String | ID of the sales org. | Required |
| promotion | Object | Promotion object. | Required |

## Apex Request Example

// name of the salesorg for which the promotion belongs to
String salesOrg = '0001';
// Adhoc Transaction Id obtained from previous call
String adhocTransactionId = 'xxxx-xxxx-xxxxxxxx-xxxx-xxxx';
// Promotion id
String promotionId = 'xxx000000000001';
<namespace>.OffPlatformCallout callout = new <namespace>.OffPlatformCallout(
      'SCHEDULE\_ADHOC\_PROMOTION\_CALCULATION',
      salesOrg
);
// Do request
<namespace>.OffplatformCalloutResponse response = callout.execute(
    txId,
    new Map<String, String\> { 'promotionId' => promotionId },
    JSON.serialize(new Map<String, Object\> {
       'adhoctransactionid' => adhocTransactionId,
       'salesorg' => salesOrg,
       'promotion' => new <namespace>.PromotionWebServiceCall.WSRequestBodyV1(....)
    })
);
if (response.status != 200) {
    // Handle error
}