# Shipping choice extension point

The Digital River app provides an extension point for setting additional details for the [shipping choice](https://docs.digitalriver.com/digital-river-api/integration-options/checkouts/creating-checkouts/shipping-choice) element such as `serviceLevel` and `description` based on the client’s business requirements. The checkout request sends this information, if provided, to Digital River.

{% hint style="warning" %}
**Important:** It is required that you configure the shipping choice extension point if you are selling physical products.
{% endhint %}

The Digital River app provides a [configuration ](https://docs.digitalriver.com/salesforce-lightning/salesforce-lightning-b2b-commerce-app-1.4/integrate-the-salesforce-lightning-app/step-2-configure-the-digital-river-app)called Shipping Choice Info - Provider Name.

If this configuration is empty (default setting), the application will not send `serviceLevel` and `description` information in the shipping choice element of the checkout request.

You can implement an Apex interface that Digital River Application delivers as part of the `DRB2B_ShippingChoiceProvider` package.

You can specify the Apex class that implements this interface as a provider of Shipping Choice information for the checkout flow.

An example of such a class is `customShippingChoiceProvider`.

The following example provides sample code for this class:

```json
global class customShippingChoiceProvider implements digitalriverv3.DRB2B_ShippingChoiceProvider {
    global digitalriverv3.DRB2B_ShippingChoiceInfo getShippingChoiceInfo(digitalriverv3.DRB2B_CheckoutContext context) {
        Id cartId = context.cartId;
        Id deliveryMethodId = [SELECT DeliveryMethodId FROM CartDeliveryGroup where CartId =:cartId WITH SECURITY_ENFORCED][0].DeliveryMethodId;
        OrderDeliveryMethod orderDeliveryRec = [SELECT Description,Carrier FROM OrderDeliveryMethod where Id =: deliveryMethodId];
        digitalriverv3.DRB2B_ShippingChoiceInfo shippingChoiceInfo = new digitalriverv3.DRB2B_ShippingChoiceInfo();
        shippingChoiceInfo.serviceLevel = orderDeliveryRec.Carrier;
        shippingChoiceInfo.description = orderDeliveryRec.Description;       
        return shippingChoiceInfo; 
```

{% hint style="info" %}
If the value for either `serviceLevel` or `description` is missing for a specific Delivery Method, the checkout request will omit the field.
{% endhint %}


---

# 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.4/extend-the-salesforce-lightning-app/shipping-choice-extension-point.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.
