Skip to main content

POST/address_preference

Important! This method is only available for Greater-China based sellers with an active eDIS account.


This method can be used to create an address on your eDIS account.

The following types of addresses can be created through this method:
  • SHIP_FROM_ADDRESS
  • RETURN_ADDRESS
The address information for the address, including location details, contact information, and address type, must be provided in the shipFromAddress container. If the call is successful, the addressId for the newly created address will be returned. This identifier can then be used when creating a package to specify the address to use for the shipment.

Input

Resource URI

POST https://api.ebay.com/sell/edelivery_international_shipping/v1/address_preference

This method is supported in Sandbox environment. To access the endpoint, just replace the api.ebay.com root URI with api.sandbox.ebay.com

URI parameters

This method has no URI parameters.

HTTP request headers

All requests made to eBay REST operations require you to provide the Authorization HTTP header for authentication authorization.

OAuth scope

This request requires an access token created with the authorization code grant flow, using one or more scopes from the following list (please check your Application Keys page for a list of OAuth scopes available to your application):

https://api.ebay.com/oauth/scope/sell.edelivery

See OAuth access tokens for more information.

Request payload

Copy complete valid JSON to clipboard

Request fields

Input container/fieldTypeDescription
shipFromAddressCreateAddressPreferenceRequestData

This container is used to specify the address details used to create an address.

Occurrence: Required

shipFromAddress.citystring

The city code of the address.

See 商户API地址编码主数据 for valid city codes.

Occurrence: Required

shipFromAddress.companystring

The company name associated with the address.

Max length: 50 characters

Occurrence: Required

shipFromAddress.contactstring

The name of the contact person associated with the address.

Max length: 50 characters

Occurrence: Required

shipFromAddress.countryCodestring

The two-letter country code of the address.

Valid values:

  • CN
  • HK

Occurrence: Required

shipFromAddress.districtstring

The district code of the address.

See 商户API地址编码主数据 for valid district codes.

Occurrence: Required

shipFromAddress.namestring

The name of the address.

Max length: 50 characters

Occurrence: Required

shipFromAddress.phonestring

The phone number associated with the address.

Occurrence: Required

shipFromAddress.postcodestring

The postal code of the address.

Occurrence: Required

shipFromAddress.provincestring

The province code of the address.

See 商户API地址编码主数据 for valid province codes.

Occurrence: Required

shipFromAddress.street1string

The first line of the street address of the address.

Max length: 50 characters

Occurrence: Required

shipFromAddress.street2string

The second line, if applicable, of the street address of the address.

Max length: 50 characters

Occurrence: Optional

shipFromAddress.street3string

The third line, if applicable, of the street address of the address.

Max length: 50 characters

Occurrence: Optional

shipFromAddress.typeAddressTypeEnum

The address type of the address being created.

Valid values:

  • SHIP_FROM_ADDRESS
  • RETURN_ADRESS

Occurrence: Required

Output

HTTP response headers

This call has no response headers.

Response payload

Response fields

Output container/fieldTypeDescription
shipFromAddressIdCreateAddressPreferenceResponsesData

This container specifies the unique identifier of the newly created address.

Occurrence: Always

shipFromAddressId.addressIdstring

The unique identifier of the newly-created address.

This ID value can be used when creating a package through the createPackage method to specify the ship-from or return address associated with the package.

Occurrence: Always

HTTP status codes

This call can return one of the following HTTP status codes. For an overview of the status codes, see HTTP status codes in Using eBay RESTful APIs.

StatusMeaning
201Created
400Bad Request
401Unauthorized
404Not found
500Internal Server Error

Error codes

For more on errors, plus the codes of other common errors, see Handling errors.

CodeDomainCategoryMeaning
355000API_EDISAPPLICATIONThere was a problem with an eBay internal system or process. Contact eBay developer support for assistance.
355002API_EDISREQUESTLength of street can not be greater than 50. Please revise it.
355049API_EDISAPPLICATIONConnection failed with logistic service provider system. Please wait and retry.
355072API_EDISREQUESTInvalid input value for countrycode. Please revise it.
355073API_EDISREQUESTInvalid input value for province. Please revise it.
355074API_EDISREQUESTInvalid input value for city. Please revise it.
355075API_EDISREQUESTInvalid input value for district. Please revise it.
355400API_EDISREQUESTThe access token provided in the Authorization header is not for an eBay user account that is currently allowed to call this API. Please go to account settings to add to your account list.

Warnings

This call has no warnings.

Samples

New to making API calls? Please see Making a Call.

Note: Identifiers, such as order IDs or user IDs, and personal data in these samples might be anonymized or may no longer be active on eBay. If necessary, substitute current, relevant eBay data in your requests.

Sample 1: Create a ship-from address

This method can be used to create a ship-from address on a user's account.

Input

When using this method, the address and contact information for the address is required to be passed in the shipFromAddress container. In addition, the address type (type) must also be indicated in this container.

In this sample, a ship-from address is being created.

POSThttps://api.ebay.com/sell/edelivery_international_shipping/v1/address_preference

Output

If the call is successful, HTTP status code 201 Created is returned, alongside the unique identifier of the newly-created address.