---
schema_version: "1"
id: 52441b95c8db222bcb935be34d9b9533935b9f57cdb5b4312e11fc67b627c8e5
title: ServiceContract
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/object_reference/sforce_api_objects_servicecontract.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_servicecontract.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: d5303ea43fa1f3b2de5e4fb69d9769a44e3449c7ea124f10d348022a5621383d
description: Represents a customer support contract (business agreement). This object is available in API version 18.0 and later.
---
# ServiceContract

Represents a customer support contract (business agreement). This object is available in API version 18.0 and later.

## Supported Calls

create(), delete(), describeLayout(), describeSObjects(), getDeleted(), getUpdated(), query(), retrieve(), search(), undelete(), update(), upsert()

## Fields

| Field | Details |
| --- | --- |
| AccountId | 
Type

reference

Properties

Filter, Group, Nillable, Sort

Description

ID of the account associated with the service contract.



 |
| ActivationDate | 

Type

dateTime

Properties

Filter, Nillable, Sort

Description

The initial day the service contract went into effect (whereas StartDate may include a renewal date).



 |
| AdditionalDiscount | 

Type

percent

Properties

Create, Filter, Nillable, Sort, Update

Description

Extra discount percentage for the service contract. Available in API version 55.0 and later.



 |
| ApprovalStatus | 

Type

picklist

Properties

Defaulted on create, Filter, Group, Nillable, Sort

Description

Approval status of the service contract.



 |
| BillingAddress (beta) | 

Type

address

Properties

Filter, Nillable

Description

The compound form of the billing address. Read-only. See [Address Compound Fields](https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/compound_fields_address.htm "Standard addresses—addresses built into standard objects in Salesforce—are accessible in the SOAP API and REST API as an Address, a structured compound data type, as well as individual address elements. If you enabled Custom Address Fields, you can also add custom fields that mimic the standard address field behavior.") for details on compound address fields.



 |
| BillingCity | 

Type

string

Properties

Filter, Group, Nillable, Sort

Description

Details for the billing address. Maximum size is 40 characters.



 |
| BillingCountry | 

Type

string

Properties

Filter, Group, Nillable, Sort

Description

Details for the billing address. Maximum size is 40 characters.



 |
| BillingCountryCode | 

Type

picklist

Properties

Create, Filter, Group, Nillable, Sort, Update

Description

The ISO country code for the service contract’s billing address.



 |
| BillingLatitude | 

Type

double

Properties

Create, Filter, Nillable, Sort, Update

Description

Used with BillingLongitude to specify the precise geolocation of a billing address. Acceptable values are numbers between –90 and 90 with up to 15 decimal places.



 |
| BillingLongitude | 

Type

double

Properties

Create, Filter, Nillable, Sort, Update

Description

Used with BillingLatitude to specify the precise geolocation of a billing address. Acceptable values are numbers between –180 and 180 with up to 15 decimal places.



 |
| BillingPostalCode | 

Type

string

Properties

Filter, Group, Nillable, Sort

Description

Details for the billing address. Maximum size is 20 characters.



 |
| BillingState | 

Type

string

Properties

Group, Sort, Filter, Nillable

Description

Details for the billing address. Maximum size is 20 characters.



 |
| BillingStateCode | 

Type

picklist

Properties

Create, Filter, Group, Nillable, Sort, Update

Description

The ISO state code for the service contract’s billing address.



 |
| BillingStreet | 

Type

textarea

Properties

Filter, Group, Nillable, Sort

Description

Street address for the billing address.



 |
| ContactId | 

Type

reference

Properties

Filter, Group, Nillable, Sort

Description

Required. ID of the Contact associated with the service contract. Must be a valid ID.



 |
| ContractNumber | 

Type

string

Properties

Autonumber, Defaulted on create, Filter, Sort

Description

Unique number automatically assigned to the service contract.



 |
| Description | 

Type

textarea

Properties

Nillable

Description

Description of the service contract.



 |
| Discount | 

Type

percent

Properties

Filter, Nillable, Sort

Description

Discount percentage for the service contract.





 |
| EndDate | 

Type

date

Properties

Filter, Group, Nillable, Sort

Description

The last day the service contract is in effect.



 |
| GrandTotal | 

Type

currency

Properties

Filter, Nillable, Sort

Description

Total price of the service contract plus shipping and taxes.



 |
| IsDeleted | 

Type

boolean

Properties

Defaulted on create, Filter

Description

Indicates whether the object has been moved to the Recycle Bin (true) or not (false). Label is **Deleted**.



 |
| LastReferencedDate | 

Type

date

Properties

Filter, Nillable, Sort, Update

Description

The timestamp when the current user last interacted with this record, directly or indirectly. Some sample scenarios are:



 |
| LastViewedDate | 

Type

date

Properties

Filter, Nillable, Sort, Update

Description

The timestamp when the current user last viewed this record or list view. If this value is null, it’s possible that the user only accessed this record or list view (LastReferencedDate), but not viewed it.



 |
| LineItemCount | 

Type

int

Properties

Filter, Nillable, Group, Sort

Description

Number of ContractLineItem records associated with the service contract.



 |
| Name | 

Type

string

Properties

Create, Filter, Group, Sort, Update

Description

Name of the service contract.



 |
| OwnerId | 

Type

reference

Properties

Create, Defaulted on create, Filter, Group, Sort, Update

Description

The ID of the user who currently owns the service contract.



 |
| ParentServiceContractId | 

Type

reference

Properties

Create, Filter, Group, Nillable, Sort, Update

Description

The service contract’s parent service contract, if it has one.



 |
| Pricebook2Id | 

Type

reference

Properties

Create, Filter, Group, Nillable, Sort, Update

Description

ID of the Pricebook2 associated with the service contract. Must be a valid ID.



 |
| RootServiceContractId | 

Type

reference

Properties

Filter, Group, Nillable, Sort

Description

(Read only) The top-level service contract in a service contract hierarchy. Depending on where a service contract lies in the hierarchy, its root could be the same as its parent.



 |
| ShippingAddress (beta) | 

Type

address

Properties

Filter, Nillable

Description

The compound form of the shipping address. Read-only. See [Address Compound Fields](https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/compound_fields_address.htm "Standard addresses—addresses built into standard objects in Salesforce—are accessible in the SOAP API and REST API as an Address, a structured compound data type, as well as individual address elements. If you enabled Custom Address Fields, you can also add custom fields that mimic the standard address field behavior.") for details on compound address fields.



 |
| ShippingCity | 

Type

string

Properties

Filter, Group, Nillable, Sort

Description

Details of the shipping address. Maximum size is 40 characters.



 |
| ShippingCountry | 

Type

string

Properties

Filter, Group, Nillable, Sort

Description

Details of the shipping address. Country maximum size is 40 characters.



 |
| ShippingCountryCode | 

Type

picklist

Properties

Create, Filter, Group, Nillable, Sort, Update

Description

The ISO country code for the service contract’s shipping address.



 |
| ShippingLatitude | 

Type

double

Properties

Create, Filter, Nillable, Sort, Update

Description

Used with ShippingLongitude to specify the precise geolocation of a shipping address. Acceptable values are numbers between –90 and 90 with up to 15 decimal places.



 |
| ShippingLongitude | 

Type

double

Properties

Create, Filter, Nillable, Sort, Update

Description

Used with ShippingLatitude to specify the precise geolocation of an address. Acceptable values are numbers between –180 and 180 with up to 15 decimal places.



 |
| ShippingPostalCode | 

Type

string

Properties

Create, Filter, Nillable, Update

Description

Details of the shipping address. Postal code maximum size is 20 characters.



 |
| ShippingState | 

Type

string

Properties

Create, Filter, Nillable, Update

Description

Details of the shipping address. State maximum size is 20 characters.



 |
| ShippingStateCode | 

Type

picklist

Properties

Create, Filter, Group, Nillable, Sort, Update

Description

The ISO state code for the service contract’s shipping address.



 |
| ShippingStreet | 

Type

textarea

Properties

Create, Filter, Nillable, Update

Description

The street address of the shipping address. Maximum of 255 characters.



 |
| SpecialTerms | 

Type

textarea

Properties

Create, Nillable, Update

Description

Any terms specifically agreed to and tracked in the service contract.



 |
| StartDate | 

Type

date

Properties

Create, Filter, Nillable, Update

Description

The first day the service contract is in effect.



 |
| Status | 

Type

picklist

Properties

Filter, Nillable

Description

The status of the service contract, such as Inactive.



 |
| Subtotal | 

Type

currency

Properties

Filter, Nillable

Description

Total of the service contract line items (products) before discounts, taxes, and shipping are applied.



 |
| Tax | 

Type

currency

Properties

Create, Filter, Nillable, Update

Description

Total taxes for the service contract.



 |
| Term | 

Type

int

Properties

Create, Filter, Nillable, Update

Description

Number of months that the service contract is valid.



 |
| TotalPrice | 

Type

currency

Properties

Filter, Nillable

Description

Total of the contract line items (products) after discounts and before taxes and shipping.



 |

## Associated Objects

This object has the following associated objects. If the API version isn’t specified, they’re available in the same API versions as this object. Otherwise, they’re available in the specified API version and later.

[ServiceContractChangeEvent](https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_associated_objects_change_event.htm "A ChangeEvent object is available for each object that supports Change Data Capture. You can subscribe to a stream of change events using Change Data Capture to receive data tied to record changes in Salesforce. Changes include record creation, updates to an existing record, deletion of a record, and undeletion of a record. A change event isn’t a Salesforce object—it doesn’t support CRUD operations or queries. It’s included in the object reference so you can discover which Salesforce objects support change events.") (API version 44.0)

Change events are available for the object.

[ServiceContractFeed](https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_associated_objects_feed.htm "StandardObjectNameFeed is the model for all feed objects associated with standard objects. These objects represent the posts and feed-tracked changes of a standard object.") (API version 23.0)

Feed tracking is available for the object.

[ServiceContractHistory](https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_associated_objects_history.htm "StandardObjectNameHistory is the model for all history objects associated with standard objects. These objects represent the history of changes to the values in the fields of a standard object.")

History is available for tracked fields of the object.

[ServiceContractOwnerSharingRule](https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_associated_objects_ownersharingrule.htm "StandardObjectNameOwnerSharingRule is the model for all owner sharing rule objects associated with standard objects. These objects represent a rule for sharing a standard object with users other than the owner.")

Sharing rules are available for the object.

[ServiceContractShare](https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_associated_objects_share.htm "StandardObjectNameShare is the model for all share objects associated with standard objects. These objects represent a sharing entry on the standard object.")

Sharing is available for the object.

#### See Also

- [ServiceContractOwnerSharingRule](https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_servicecontractownersharingrule.htm "Represents the rules for sharing a ServiceContract (customer service agreement) with users other than the owner. This object is available in API version 18.0 and later.")