The Shipping Discount API enables you to create a new type of discount that's applied to one or more shipping rates at checkout. ## Example use cases - Free shipping. - A discount on shipping. For example, 20% off shipping or $5 off shipping. - A discount on specific shipping rates. For example, 50% off Standard shipping. ## Developer tools and resources
## Migrating from scripts to functions If you want to migrate an existing [shipping script](https://help.shopify.com/en/manual/checkout-settings/script-editor/shopify-scripts) to Shopify Functions, then you can use the following mapping: | Shopify Scripts method | Description | Shopify Functions object | | ------------ | ----------- | -------------- | | `apply_discount` | Applies a discount to a shipping rate | [Shipping discounts](/docs/api/functions/reference/shipping-discounts/graphql/functionrunresult) | ## Next steps - Learn how to use Shopify Functions by [building a discounts experience](/docs/apps/build/discounts).