> ## Documentation Index
> Fetch the complete documentation index at: https://developers.appstle.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Sync the delivery price of a subscription contract from Shopify

> Recalculates the delivery price of a subscription contract from your Shopify shipping rates. This is the same
sync as the Sync button in the Delivery Information section of the subscription in the merchant portal.

The request is accepted at once and the sync runs in the background. A 202 response means that the sync was
accepted, not that it is done. The contract's current delivery price does not show whether the sync is done,
because a finished sync can leave the price as it was. Most results show in the activity log
(`GET /api/external/v2/activity-logs?entityId.equals=<contractId>&eventType.equals=SYSTEM_UPDATED_DELIVERY_PRICE`).
A sync that is still waiting when the app restarts does not run.

**Limit:** each shop gets one accepted request every 10 seconds, for all of its API keys and contracts. The other
requests in that time get 429 with a `Retry-After` header.

**Not synced (400):**
- The contract uses a custom delivery price (`allowDeliveryPriceOverride` is true). To sync it, first turn this off
  with `PUT /api/external/v2/subscription-contracts-update-delivery-price-override`.
- "Use custom shipping rates (instead of Shopify calculations)" is on in Shop Settings.

Authentication is enforced via the X-API-Key header (the 'api_key' parameter is deprecated). Read-only API keys get 403.




## OpenAPI

````yaml /subscription/admin-api-swagger.json put /api/external/v2/subscription-contracts-sync-shipping-price
openapi: 3.0.1
info:
  description: >-
    Comprehensive API documentation for managing subscriptions, payments, and
    related operations. These APIs allow you to programmatically manage
    subscription lifecycles, handle payments, configure products, and integrate
    subscription functionality into your applications.
  title: Admin APIs
  version: 0.0.1
servers:
  - url: https://subscription-admin.appstle.com
security: []
tags:
  - description: >-
      Core APIs for managing the complete subscription lifecycle including
      creation, updates, pausing, resuming, and cancellation of subscriptions.
    name: Subscription Management
  - description: >-
      APIs for managing subscription payment methods, processing payments,
      handling payment retries, and updating billing information.
    name: Subscription Payments
  - description: >-
      APIs for managing subscription contracts including delivery schedules,
      pricing, order notes, billing cycles, and shipping addresses.
    name: Subscription Contracts
  - description: >-
      APIs for managing products within subscriptions including adding,
      removing, updating quantities, and swapping products.
    name: Subscription Products
  - description: >-
      APIs for handling billing operations, payment processing, and financial
      transactions related to subscriptions.
    name: Billing & Payments
  - description: >-
      APIs for managing discounts and promotional codes applied to
      subscriptions.
    name: Subscription Discounts
  - description: >-
      APIs for managing one-time add-on products that can be purchased alongside
      recurring subscription items.
    name: Subscription One-Time Products
  - description: >-
      APIs for managing subscription plans, pricing tiers, and plan
      configurations.
    name: Subscription Plans
  - description: >-
      APIs for managing customizable product boxes and bundles where customers
      can select multiple items.
    name: Build-a-Box & Bundles
  - description: >-
      APIs for managing the product catalog including product information,
      variants, and inventory.
    name: Product Catalog
  - description: >-
      APIs for managing operational settings, configurations, and administrative
      functions.
    name: Operations & Settings
  - description: >-
      APIs powering the customer-facing portal where subscribers can manage
      their own subscriptions.
    name: Customer Portal
  - description: APIs for managing customer information, profiles, and account details.
    name: Customers
  - description: >-
      APIs for retrieving aggregated subscription data, customer subscription
      history, and account-level subscription information.
    name: Subscription Data
  - description: >-
      APIs for managing delivery profiles, shipping rates, free shipping
      configuration, and delivery method options on subscriptions.
    name: Delivery & Shipping
  - description: >-
      APIs for managing storefront customization including custom CSS, theme
      settings, label translations, and merchant-defined widget configuration.
    name: Customization
  - description: >-
      APIs for configuring cancellation flows, retention offers, cancellation
      reason management, and win-back automation.
    name: Customer Retention
paths:
  /api/external/v2/subscription-contracts-sync-shipping-price:
    put:
      tags:
        - Subscription Management
        - Subscription Contracts
      summary: Sync the delivery price of a subscription contract from Shopify
      description: >
        Recalculates the delivery price of a subscription contract from your
        Shopify shipping rates. This is the same

        sync as the Sync button in the Delivery Information section of the
        subscription in the merchant portal.


        The request is accepted at once and the sync runs in the background. A
        202 response means that the sync was

        accepted, not that it is done. The contract's current delivery price
        does not show whether the sync is done,

        because a finished sync can leave the price as it was. Most results show
        in the activity log

        (`GET
        /api/external/v2/activity-logs?entityId.equals=<contractId>&eventType.equals=SYSTEM_UPDATED_DELIVERY_PRICE`).

        A sync that is still waiting when the app restarts does not run.


        **Limit:** each shop gets one accepted request every 10 seconds, for all
        of its API keys and contracts. The other

        requests in that time get 429 with a `Retry-After` header.


        **Not synced (400):**

        - The contract uses a custom delivery price
        (`allowDeliveryPriceOverride` is true). To sync it, first turn this off
          with `PUT /api/external/v2/subscription-contracts-update-delivery-price-override`.
        - "Use custom shipping rates (instead of Shopify calculations)" is on in
        Shop Settings.


        Authentication is enforced via the X-API-Key header (the 'api_key'
        parameter is deprecated). Read-only API keys get 403.
      operationId: syncDeliveryPriceV2
      parameters:
        - description: Contract ID
          example: 123456789
          in: query
          name: contractId
          required: true
          schema:
            format: int64
            type: integer
        - description: API Key (Deprecated - Use Header X-API-Key instead)
          in: query
          name: api_key
          required: false
          schema:
            type: string
        - in: header
          name: X-API-Key
          required: false
          schema:
            type: string
      responses:
        '202':
          content:
            application/json:
              example:
                contractId: 123456789
                status: accepted
          description: Sync accepted. It runs in the background.
        '400':
          content:
            '*/*':
              schema:
                additionalProperties:
                  type: object
                type: object
          description: >-
            The contract does not belong to this shop, it uses a custom delivery
            price, or "Use custom shipping rates (instead of Shopify
            calculations)" is on in Shop Settings. Nothing is synced.
        '401':
          content:
            '*/*':
              schema:
                additionalProperties:
                  type: object
                type: object
          description: Authentication required
        '403':
          content:
            '*/*':
              schema:
                additionalProperties:
                  type: object
                type: object
          description: Read-only API key or insufficient permissions
        '429':
          content:
            '*/*':
              schema:
                additionalProperties:
                  type: object
                type: object
          description: >-
            This shop had a sync accepted less than 10 seconds ago, or it
            reached the general API rate limit. Retry after the seconds in the
            Retry-After header.
        '503':
          content:
            '*/*':
              schema:
                additionalProperties:
                  type: object
                type: object
          description: >-
            The sync cannot be accepted now. Retry after the seconds in the
            Retry-After header.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.