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
Input
Resource URI
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 clipboardRequest fields
Input container/field | Type | Description |
---|---|---|
shipFromAddress | CreateAddressPreferenceRequestData | This container is used to specify the address details used to create an address. Occurrence: Required |
shipFromAddress.city | string | The city code of the address. Occurrence: Required |
shipFromAddress.company | string | The company name associated with the address. Occurrence: Required |
shipFromAddress.contact | string | The name of the contact person associated with the address. Occurrence: Required |
shipFromAddress.countryCode | string | The two-letter country code of the address.
Occurrence: Required |
shipFromAddress.district | string | The district code of the address. Occurrence: Required |
shipFromAddress.name | string | The name of the address. Occurrence: Required |
shipFromAddress.phone | string | The phone number associated with the address. Occurrence: Required |
shipFromAddress.postcode | string | The postal code of the address. Occurrence: Required |
shipFromAddress.province | string | The province code of the address. Occurrence: Required |
shipFromAddress.street1 | string | The first line of the street address of the address. Occurrence: Required |
shipFromAddress.street2 | string | The second line, if applicable, of the street address of the address. Occurrence: Optional |
shipFromAddress.street3 | string | The third line, if applicable, of the street address of the address. Occurrence: Optional |
shipFromAddress.type | AddressTypeEnum | The address type of the address being created.
Occurrence: Required |
Output
HTTP response headers
This call has no response headers.
Response payload
Response fields
Output container/field | Type | Description |
---|---|---|
shipFromAddressId | CreateAddressPreferenceResponsesData | This container specifies the unique identifier of the newly created address. Occurrence: Always |
shipFromAddressId.addressId | string | The unique identifier of the newly-created address. 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.
Status | Meaning |
---|---|
201 | Created |
400 | Bad Request |
401 | Unauthorized |
404 | Not found |
500 | Internal Server Error |
Error codes
For more on errors, plus the codes of other common errors, see Handling errors.
Code | Domain | Category | Meaning |
---|---|---|---|
355000 | API_EDIS | APPLICATION | There was a problem with an eBay internal system or process. Contact eBay developer support for assistance. |
355002 | API_EDIS | REQUEST | Length of street can not be greater than 50. Please revise it. |
355049 | API_EDIS | APPLICATION | Connection failed with logistic service provider system. Please wait and retry. |
355072 | API_EDIS | REQUEST | Invalid input value for countrycode. Please revise it. |
355073 | API_EDIS | REQUEST | Invalid input value for province. Please revise it. |
355074 | API_EDIS | REQUEST | Invalid input value for city. Please revise it. |
355075 | API_EDIS | REQUEST | Invalid input value for district. Please revise it. |
355400 | API_EDIS | REQUEST | The 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.