The HTTP POST call method supports the use of XML format requests. The XML request/response format follows standard XML syntax conventions. For additional information, refer to XML Syntax Rules.
<GetItemRequest xmlns="urn:ebay:apis:eBLBaseComponents"> <ItemID>1**********2</ItemID> </GetItemRequest>
The call response for XML requests is in XML format only.
Gateways
Send all Trading API requests to either the Sandbox or Production Gateway for the API using the appropriate URI:
- Sandbox Gateway URI:
https://api.sandbox.ebay.com/ws/api.dll
- Production Gateway URI:
https://api.ebay.com/ws/api.dll
eBay requires that you use HTTPS/SSL when you execute calls in the Production environment. This ensures that data can be transferred securely between your application and the eBay platform. Although Sandbox data is simulated, you also need to use HTTPS/SSL when you execute calls in the Sandbox.
Refer to Understand the Sandbox and Production environments for general information about working in the Sandbox and Production environments.
HTTP headers
Refer to the following table for HTTP header information that must be passed in to properly route an XML API request to the appropriate destination within eBay:
Name | Required? | Description |
---|---|---|
X-EBAY-API-IAF-TOKEN
|
Conditionally |
Required if an eBay Authentication token is not supplied using the This header supports the use of OAuth tokens for user authorization. To authorize the request, supply a valid User access token for the value of this header. For information about User access tokens, refer to OAuth access tokens. |
X-EBAY-API-COMPATIBILITY-LEVEL
|
Always | The eBay release version that an application supports. |
X-EBAY-API-DEV-NAME
|
Conditionally |
The Developer ID (DevID) as registered with the eBay Developers Program. The developer ID is unique to each licensed developer (or company). This value is required only for the following calls that set up and retrieve a user's authentication token: In all other calls, this value is ignored. If these keys are lost, they can be retrieved using the View Keys link on the My Account page or by visiting the Application Keys page. Note: Access to the Application Keys page requres the user to sign in. |
X-EBAY-API-APP-NAME
|
Conditionally |
The application ID (AppID) as registered with the eBay Developers Program. The application ID is unique to each application created by a developer. The application ID and certificate ID are issued in pairs. Multiple application/certificate ID pairs can be issued for a single developer ID. This value is required only for the following call that sets up and retrieves a user's authentication token: This value is ignored for all other calls. Do not specify this value in an AddItem call or any other call that list items. |
X-EBAY-API-CERT-NAME
|
Conditionally |
The certificate ID (CertID) as registered with the eBay Developers Program. The certificate ID is unique to each application created by the developer. This value is required only for the following call that sets up and retrieves a user's authentication token: This value is ignored for all other calls. Do not specify this value in an AddItem call or any other call that list items. |
X-EBAY-API-CALL-NAME
|
Always |
Canonical name of the call you are using (e.g., AddItem). To be routed correctly, the value must match the request name. For example, when using |
X-EBAY-API-SITEID
|
Always |
The eBay site to which the request is to be sent. Note: Refer to SiteCodeType for a list of valid site ID values. Depending on the purpose of a call, this is usually the eBay site on which an item is listed or a user is registered. Refer to Specify the target site to understand how site ID may affect
For calls such as AddItem, the site that is passed in the body of the request must be consistent with this header. Important! AddItem calls specifiy the 2-letter site code. This header specifies the numeric site ID. |
Content-Type
|
Recommended |
Specify Note: If you use a library that sets the |
Content-Length
|
Recommended | The length of the XML request string that is being sent. This is used by eBay to determine how much data to read from the stream. |
Specify the schema version
The version of the schema being used must be specified for each request using the X-EBAY-API-COMPATIBILITY-LEVEL
HTTP header.
eBay returns the version of the schema used in the response's Version
field. This allows developers to confirm that the version in use is the version that is expected.
Each response also contains a Build
field. This refers to the specific software build that eBay used when processing the request and generating the response. Developer Support may request the build information when helping to resolve technical issues.
Download a schema file
Specific release versions of ebaySvc.xsd
may be downloaded by navigating to the following location:
https://developer.ebay.com/webservices/{VERSION}/ebaysvc.xsd
where {VERSION}
is:
-
A numeric value (e.g.,
1131
)This is the version/release number of the specific schema file that is to be downloaded.
-
latest
Use the following URL to download the current/most recent schema release.
https://developer.ebay.com/webservices/latest/ebaysvc.xsd
All releases have odd version numbers. Older versions are periodically deprecated, which means they are no longer supported.
Each time a new version of the eBay schema/WSDL is released:
- A new directory is added and named for the new version number
- The target of the
latest
indicator is updated to point to this newly-created version's directory.
If you are using the XML schema and you do not plan to update your application each time a new version becomes available, use the URL with the numbered version identifier. If you plan to always retrieve the latest changes available, it may be more convenient to use the URL with the latest
version identifier.