Sales Campaign

The sales campaign record exposes a sales campaign to REST web services.

This record:

For more information about working with sales campaigns in the UI, see Sales Campaigns.

For information about using the REST API Browser, see The REST API Browser.

Record ID

The record ID for a sales campaign REST record is salescampaign.

Prerequisites

You must enable the Marketing Automation and Sales Campaigns features before you can use this record through REST web services. For more information, see Marketing Automation Overview and Sales Campaigns.

To use all the fields on this record, you must enable: Promotion Codes, Subscription Categories, and Mail Merge. For more information, see Selling with Promotion Codes, Campaign Subscription Categories, and Working with Mail Merge.

Additional Details

Consider the following when working with the sales campaign record:

  • The following fields in the Statistics tab are read-only and automatically computed with REST services: totalRevenue, roi, profit, costPerCustomer, convCostPerCustomer, conversions, leadsGenerated, and uniqueVisitors.

  • The Cost field is automatically computed based on costs for associated events.

  • The campaignId field is read-only and generated after the record is created.

  • The defaultEvent sublist is read-only and generated after the record is created.

Code Samples

The following samples show common actions for a sales campaign.

POST Request

              POST /services/rest/record/v1/salescampaign HTTP/1.1
Host: 3619616.suitetalk.api.netsuite.com
Content-Type: application/json
Authorization: OAuth realm="3619616",oauth_consumer_key="",oauth_token="",oauth_signature_method="",oauth_timestamp="",oauth_nonce="",oauth_version="1.0",oauth_signature=""
Content-Length: 2684
{
   "audience": { "id": "1" },
     "baseCost": 5.0,
"campaignDirectMail": {
"items": [
{
"campaignGroup": { "id": "237" },
"channel": { "id": "-3" },
"cost": 3.0,
"dateScheduled": "2025-10-13",
"description": "descr",
"promoCode": { "id": "1" },
"status": { "id": "NOTSTART" },
"subscription": { "id": "4" },
"template": { "id": "12" }
}
]
},
"campaignDrip": {
"items": [
{
"channel": { "id": "-7" },
"cost": 1.0,
"description": "Stuff for sale for our staf",
"promoCode": { "id": "3" },
"subscription": { "id": "2" },
"template": { "id": "28"}
}
]
},
"campaignEmail": {
"items": [
{
"campaignGroup": { "id": "234" },
"channel": { "id": "-2" },
"cost": 2.0,
"dateScheduled": "2025-10-13",
"description": "Stuff for sale for our staf",
"promoCode": { "id": "2" },
"status": { "id": "NOTSTART" },
"subscription": { "id": "1" },
"template": { "id": "28" },
"timeScheduled": "04:00"
}
]
},
"campaignEvent": {
"items": [
{
"campaignGroup": { "id": "220" },
"channel": { "id": "-6" },
"cost": 4.0,
"dateScheduled": "2025-10-13",
"description": "descr",
"promoCode": { "id": "2" },
"status": { "id": "NOTSTART" },
"subscription": { "id": "3" }
}
]
},
"category": { "id": "-11" },
"endDate": "2025-08-30",
"expectedRevenue": 1.0,
"family": { "id": "1" },
"isDefaultLeadSource": false,
"isInactive": false,
"item": {
"items": [
{
"id": "67"
}
]
},
"keyword": "campaign",
"message": "Test sales campaign",
"offer": { "id": "1" },
"owner": { "id": "-5" },
"promotionCode": { "id": "1" },
"searchEngine": { "id": "2" },
"startDate": "2025-08-01",
"title": "Test title",
"url": "https://myurl.com/coolcampaign",
"vertical": { "id": "1" }
} 

            

PATCH Request

              PATCH /services/rest/record/v1/campaign/1 HTTP/1.1
Host: 3619616.suitetalk.api.netsuite.com
Content-Type: application/json
Authorization: OAuth realm="3619616",oauth_consumer_key="",oauth_token="",oauth_signature_method="",oauth_timestamp="",oauth_nonce="",oauth_version="1.0",oauth_signature=""
Content-Length: 105
{
"audience": { "id": "3" },
"baseCost": 6.0,
"campaignDirectMail": {
"items": [
{
"campaignGroup": { "id": "300" },
"channel": { "id": "-3" },
"cost": 4.0,
"dateScheduled": "2025-10-13",
"description": "updated",
"promoCode": { "id": "2" },
"status": { "id": "PROGRESS" },
"subscription": { "id": "3" },
"template": { "id": "13" }
}
]
},
"campaignDrip": {
"items": [
{
"channel": { "id": "-7" },
"cost": 5.0,
"description": "updated",
"promoCode": { "id": "2" },
"subscription": { "id": "3" },
"template": { "id": "28"}
}
]
},
"campaignEmail": {
"items": [
{
"campaignGroup": { "id": "234" },
"channel": { "id": "-2" },
"cost": 3.0,
"dateScheduled": "2025-10-13",
"description": "updated",
"promoCode": { "id": "3" },
"status": { "id": "PROGRESS" },
"subscription": { "id": "5" },
"template": { "id": "28" },
"timeScheduled": "05:00"
}
]
},
"campaignEvent": {
"items": [
{
"campaignGroup": { "id": "226" },
"channel": { "id": "-4" },
"cost": 1.0,
"dateScheduled": "2025-10-13",
"description": "updated",
"promoCode": { "id": "1" },
"status": { "id": "PROGRESS" },
"subscription": { "id": "1" }
}
]
},
"category": { "id": "-10" },
"endDate": "2025-08-13",
"expectedRevenue": 2.0,
"family": { "id": "2" },
"isDefaultLeadSource": false,
"isInactive": true,
"item": {
"items": [
{
"id": "70"
}
]
},
"keyword": "Campaign updated",
"message": "Test message updated",
"offer": { "id": "2" },
"owner": { "id": "281" },
"profit": -19.0,
"promotionCode": { "id": "2" },
"searchEngine": { "id": "1" },
"startDate": "2025-12-28",
"title": "Test Title Updated",
"url": "https://myurl.com/updated",
"vertical": { "id": "2" }
} 

            

Related Topics

General Notices