# Extend the Ship From address

The current version of the Salesforce Lightning app provides an extension point for setting the **Ship From Address** (warehouse location) based on the client’s business requirements. After implementation, this extension point will override the **Ship From Address** attributes specified in the Digital River App settings.

The Digital River app provides a [configuration ](/salesforce-lightning/salesforce-lightning-b2b-commerce-app-1.2/integrate-the-salesforce-lightning-app/step-2-configure-the-digital-river-app.md)called the **Ship From Address - Provider Name**. If this configuration is empty (that is, the Default setting), the application uses the Ship From Address static configuration defined in other fields of the Digital River app.

An administrator has the ability to implement an Apex interface that the Digital River application delivers as part of the package, `DRB2B_CheckoutFromAddressProvider`.

The Apex class that implements this interface can be specified as a provider of Ship from Address information for the checkout flow.

An example of such a class is `CustomCheckoutShipFromAddressProvider`.

## Sample code for this class

```
global class CustomCheckoutShipFromAddressProvider implements 
digitalriverv3.DRB2B_CheckoutFromAddressProvider {
    global digitalriverv3.DRB2B_Address 
    getAddress(digitalriverv3.DRB2B_CheckoutContext context) {
        digitalriverv3.DRB2B_Address address = new 
        digitalriverv3.DRB2B_Address ();
 
  Id cartId = context.cartId;

        // Add business logic
        address.country = 'US';
        address.state = 'NY';
        address.postalCode = '31232';
        address.city = 'New York';
        address. line1 = '123 Main St.';
 
        return address;
    }
}
```

The `getAddress` (context) method takes in a checkout context as input as shown above.

Currently, the `CartId` is passed in the Checkout context. The `Cartid` is obtained by using `context.cartId`.

The name of the class can be specified in the `Ship from Address - Provider Name` field of the Digital River App configuration.

![](/files/Lui04vHjsEhmdhyyYjZi)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.digitalriver.com/salesforce-lightning/salesforce-lightning-b2b-commerce-app-1.2/extend-the-salesforce-lightning-app/extend-the-ship-from-address.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
