Network access for [Shopify Functions](/docs/apps/build/functions) allows you to configure HTTP requests for your functions to use data from an external service as an input to your function logic. It's available primarily for merchants on [Shopify for enterprises](https://www.shopify.com/enterprise).

This guide introduces how Network access for Shopify Functions works and provides examples.

## Availability of network access for functions

| Function | Availability |
| --- | --- |
| [Cart and Checkout Validation](/docs/api/functions/reference/cart-checkout-validation) | [Shopify for enterprises](https://www.shopify.com/enterprise) with custom apps |
| [Local Pickup Delivery Option Generator](/docs/api/functions/reference/local-pickup-delivery-option-generator) | [Shopify for enterprises](https://www.shopify.com/enterprise) with custom apps (Early access) |
| [Pickup Point Delivery Option Generator](/docs/api/functions/reference/pickup-point-delivery-option-generator) | [Shopify Plus](https://www.shopify.com/plus) with custom apps (Early access) |

Network access for functions needs to be enabled by Shopify, as it's currently not available on development stores or in a developer preview. Contact [Support](https://help.shopify.com) for more information about the available Shopify Functions that support network access.

## How it works

Network Access for Shopify Functions enables you to define your HTTP request using the fetch target of the function. When your function is executed, Shopify performs the HTTP request and includes the response in the input of the run target.

The following diagram shows the different requests that occur with a function that has network access:

<figure class="figure"><img src="https://cdn.shopify.com/shopifycloud/shopify_dev/assets/api/functions/network/function-with-network-access-bf31e90ff6daacec9785dd32930a17203dfdabec8ff0014515e61ee5154d0bc1.png" class="lazyload" alt="An overview of the requests associated with a function that has network access" width="70%" height="1646"></figure>

1. The `fetch` function target defines an HTTP request based on the existing function [input query](/docs/apps/build/functions/input-output/metafields-for-input-queries).
2. The outcome of `FunctionFetchResult` conveys an `HttpRequest` to be executed.
3. Shopify schedules the request with optimizations.

    Read more about network request caching in the [Performance](/docs/apps/build/functions/input-output/network-access/performance-and-resilience) page.

4. Shopify executes network calls to the external service.
5. The `run` function target contains the main logic and has access to the HTTP response through the input query.
6. The outcome of `FunctionRunResult` conveys the function’s final output.

## Alternatives to network access

Instead of fetching data with an external network call, consider retrieving the data from a metafield in your functions. Most objects support metafields, including products, locations, and customers.

Fetching data from metafields during checkout is more efficient as it doesn't involve an external network call. This lets you to depend on Shopify for the uptime, scalability, and durability of the data storage.

Use the GraphQL [Admin](/docs/api/admin-graphql) or [Storefront](/docs/api/storefront) APIs to write [metafields](/docs/api/admin-graphql/latest/objects/metafield) on the store before a buyer reaches checkout.

## Developer tools and resources

Explore the following developer tools and resources to learn more about network access for Shopify Functions.

<div class="resource-card-grid">
  <div>
  <a class="resource-card" href="/docs/apps/functions/input-output/network-access/using-network-access" data-theme-mode="">
    <div class="resource-card__indicator-container"><img
     src="/assets/resource-cards/growth"
     data-alt-src="/assets/resource-cards/growth-dark"
     aria-hidden="true"
     class="resource-card__icon themed-image"></div>
    <h3 class="resource-card__title">
      Using network access
    </h3>
    <p class="resource-card__description">Learn how to create and handle a network request.</p>
  </a>
</div>

<div>
  <a class="resource-card" href="/docs/apps/functions/input-output/network-access/graphql" data-theme-mode="">
    <div class="resource-card__indicator-container"><img
     src="/assets/resource-cards/graphql"
     data-alt-src="/assets/resource-cards/graphql-dark"
     aria-hidden="true"
     class="resource-card__icon themed-image"></div>
    <h3 class="resource-card__title">
      GraphQL reference
    </h3>
    <p class="resource-card__description">Consult the network access GraphQL schema reference for Functions.</p>
  </a>
</div>

<div>
  <a class="resource-card" href="/docs/apps/functions/input-output/network-access/performance" data-theme-mode="">
    <div class="resource-card__indicator-container"><img
     src="/assets/resource-cards/blocks"
     data-alt-src="/assets/resource-cards/blocks-dark"
     aria-hidden="true"
     class="resource-card__icon themed-image"></div>
    <h3 class="resource-card__title">
      Performance and resilience
    </h3>
    <p class="resource-card__description">Learn how how to optimize your app with timeouts, caches and error management.</p>
  </a>
</div>

</div>


## Next steps

- Learn how to [use network access](/docs/apps/build/functions/input-output/network-access/use-network-access).