# GetShippingAddresses API Operation (/archive/adaptive-payments/api/get-shipping-addresses)



> **Note:** **Important:** Adaptive Payments is not available for new integrations. PayPal provides this documentation to support existing integrations. If you're starting an integration, [we recommend our latest solutions](https://www.paypal.com/us/business/accept-payments).

Shows the selected shipping address. You must have created the payment or preapproval key that identifies the account holder whose shipping address you want to obtain, or be the primary receiver of the payment or one of the parallel receivers of the payment. The shipping address is available only if it was provided during the embedded payment flow.

## GetShippingAddressesRequest Message [#getshippingaddressesrequest-message]

### GetShippingAddressesRequest Fields [#getshippingaddressesrequest-fields]

You must specify a value for the `key` field, which uses the payKey to identify the account holder.

| Field<br />             | Description<br />                                                                                                                                                                                                                                                                                  |
| ----------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `key`<br />             | `xs:string`<br /&#x3E; &#x2A;(Required)* The payment paykey that identifies the account holder for whom you want to obtain the selected shipping address.<br />  > **Note:** &#x2A;*Note:** Shipping information can only be retrieved through the payment payKey; not through the preapprovalKey. |
| `requestEnvelope`<br /> | `common:requestEnvelope`<br /&#x3E; &#x2A;(Required)* Information common to each API operation, such as the language in which an error message is returned.<br />                                                                                                                                  |

### RequestEnvelope Fields [#requestenvelope-fields]

| Field<br />           | Description<br />                                                                                                                                                                                                       |
| --------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `detailLevel`<br />   | `common:DetailLevelCode`<br /&#x3E; &#x2A;(Optional)* Level of detail required by the client application for components. Value is:<br /> `ReturnAll` — This value provides the maximum level of detail (default).<br /> |
| `errorLanguage`<br /> | `xs:string`<br /&#x3E; &#x2A;(Required)* RFC 3066 language in which error messages are returned; by default it is `en_US`, which is the only language currently supported.<br />                                        |

## GetShippingAddressesResponse Message [#getshippingaddressesresponse-message]

### GetShippingAddressesResponse Fields [#getshippingaddressesresponse-fields]

| Field<br />              | Description<br />                                                                                                                |
| ------------------------ | -------------------------------------------------------------------------------------------------------------------------------- |
| `selectedAddress`<br />  | `ap:Address`<br /> Any number of available shipping addresses. The first address selected in the embedded payment flow.<br />    |
| `responseEnvelope`<br /> | `common:ResponseEnvelope`<br /> Common response information, including a timestamp and the response acknowledgment status.<br /> |

### Address Fields [#address-fields]

| Field<br />           | Description<br />                                             |
| --------------------- | ------------------------------------------------------------- |
| `addresseeName`<br /> | `xs:string`<br /> The name associated with the address.<br /> |
| `baseAddress`<br />   | `common:BaseAddress`<br /> Street address.<br />              |
| `addressId`<br />     | `xs:string`<br /> The ID associated with the address.<br />   |

### BaseAddress Fields [#baseaddress-fields]

| Field<br />         | Description<br />                                             |
| ------------------- | ------------------------------------------------------------- |
| `city`<br />        | `xs:string`<br /> The city of the address.<br />              |
| `countryCode`<br /> | `xs:string`<br /> The country code of the address.<br />      |
| `line1`<br />       | `xs:string`<br /> The first line of the address.<br />        |
| `line2`<br />       | `xs:string`<br /> An second line of the street address.<br /> |
| `postalCode`<br />  | `xs:string`<br /> The postal code of the address.<br />       |
| `state`<br />       | `xs:string`<br /> The state for the address<br />             |
| `type`<br />        | `xs:string`.<br /> The type of address.<br />                 |

### ResponseEnvelope Fields [#responseenvelope-fields]

| Field<br />           | Description<br />                                                                                                                                                                                                                                                                                                                                     |
| --------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `ack`<br />           | `common:AckCode`<br /> Acknowledgment code. Value is:<br /> `Success` — The operation completed successfully.<br />`Failure` — The operation failed.<br />`SuccessWithWarning` — The operation completed successfully; however, there is a warning message.<br />`FailureWithWarning `— The operation failed with a warning message.<br />            |
| `build`<br />         | `xs:string`<br /> Build number. It is used only by PayPal Merchant Technical Support.<br />                                                                                                                                                                                                                                                           |
| `correlationId`<br /> | `xs:string`<br /> Correlation identifier. It is a 13-character, alphanumeric string (for example, `db87c705a910e`) that is used only by PayPal Merchant Technical Support.<br />  &#x2A;*Note:** You must log and store this data for every response you receive. PayPal Technical Support uses the information to assist with reported issues.<br /> |
| `timestamp`<br />     | `xs:datetime`<br /> Date on which the response was sent, for example:<br /> `2012-04-02T22:33:35.774-07:00`<br />  &#x2A;*Note:** You must log and store this data for every response you receive. PayPal Technical Support uses the information to assist with reported issues.<br />                                                                |

## PPFault Message [#ppfault-message]

The `PPFaultMessage` returns `ErrorData` and the `ResponseEnvelope` information to your application if an error occurs.

### FaultMessage Fields [#faultmessage-fields]

| Field<br />              | Description<br />                                                                                                                |
| ------------------------ | -------------------------------------------------------------------------------------------------------------------------------- |
| `error`<br />            | `common:ErrorData`<br /> Detailed error information.<br />                                                                       |
| `responseEnvelope`<br /> | `common:ResponseEnvelope`<br /> Common response information, including a timestamp and the response acknowledgment status.<br /> |

### ErrorData Fields [#errordata-fields]

| Field<br />         | Description<br />                                                                                                                                                                                                                                                 |
| ------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `category`<br />    | `common:ErrorCategory`<br /> The location where the error occurred.<br /> Value is:<br /> `System` — The system encountered errors; try again<br />`Application` — The application encountered errors; try again<br />`Request` — The request was incorrect<br /> |
| `domain`<br />      | `xs:string`<br /> The domain to which this service belongs.<br />                                                                                                                                                                                                 |
| `errorId`<br />     | `xs:long`<br /> A 6-digit number that uniquely identifies a particular error.<br />                                                                                                                                                                               |
| `exceptionID`<br /> | This field is not used.<br />                                                                                                                                                                                                                                     |
| `message`<br />     | `xs:string`<br /> A description of the error.<br />                                                                                                                                                                                                               |
| `parameter`<br />   | `common:ErrorParameter`<br /> Represents contextual information about the error.<br />                                                                                                                                                                            |
| `severity`<br />    | `common:ErrorSeverity`<br /> The severity of the error encountered.<br /> Value is:<br /> `Error` — Processing of the request was interrupted<br />`Warning` — Processing of the request was completed<br />                                                      |
| `subdomain`<br />   | This field is not used.<br />                                                                                                                                                                                                                                     |

### ResponseEnvelope Fields [#responseenvelope-fields-1]

| Field<br />           | Description<br />                                                                                                                                                                                                                                                                                                                                           |
| --------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `ack`<br />           | `common:AckCode`<br /> Acknowledgment code. Value is:<br /> `Success` — The operation completed successfully.<br />`Failure` — The operation failed.<br />`SuccessWithWarning` — The operation completed successfully; however, there is a warning message.<br />`FailureWithWarning `— The operation failed with a warning message.<br />                  |
| `build`<br />         | `xs:string`<br /> Build number. It is used only by PayPal Merchant Technical Support.<br />                                                                                                                                                                                                                                                                 |
| `correlationId`<br /> | `xs:string`<br /> Correlation identifier. It is a 13-character, alphanumeric string (for example, `db87c705a910e`) that is used only by PayPal Merchant Technical Support.<br />  > **Note:** &#x2A;*Note:** You must log and store this data for every response you receive. PayPal Technical Support uses the information to assist with reported issues. |
| `timestamp`<br />     | `xs:datetime`<br /> Date on which the response was sent, for example:<br /> `2012-04-02T22:33:35.774-07:00`<br />  > **Note:** &#x2A;*Note:** You must log and store this data for every response you receive. PayPal Technical Support uses the information to assist with reported issues.                                                                |

## GetShippingAddresses Errors [#getshippingaddresses-errors]

| Code<br />   | Message<br />                                                                                                                                   | Additional Information<br /> |
| ------------ | ----------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------- |
| 520002       | Internal erro                                                                                                                                   |                              |
| 520003<br /> | Authentication failed. API credentials are incorrect.<br />                                                                                     | Since 1.6.0<br />            |
| 540031<br /> | Operation is not permitted because the credentials do not match those of the initial operation<br />                                            | Since 1.6.0<br />            |
| 550001<br /> | User is not allowed to perform this action.<br />You are not allowed to get the addresses for this key<br />                                    | Since 1.6.0<br />            |
| 580001       | Invalid request: \<value>                                                                                                                       | Since 1.6.0<br />            |
| 580022<br /> | Invalid request parameter: \<value><br />Invalid request parameter: payKey with value \<value><br />No sender is associated with this key<br /> | Since 1.6.0<br />            |
| 580029       | A pay key, transaction ID, or tracking ID is missing                                                                                            | Since 1.6.0                  |
| 580030<br /> | This transaction cannot be processed at this time. Please try again later.                                                                      | Since 1.3.0                  |
