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

# Update delivery method

> Updates a delivery method. Only the attributes sent change.

**Required scope:** `write_settings` (for API-key authentication).



## OpenAPI

````yaml /api-reference/admin.yaml patch /api/v3/admin/delivery_methods/{id}
openapi: 3.0.3
info:
  title: Admin API
  contact:
    name: Spree Commerce
    url: https://spreecommerce.org
    email: hello@spreecommerce.org
  description: >
    Spree Admin API v3 - Administrative API for managing products, orders, and
    store settings.


    ## Authentication


    The Admin API requires a secret API key passed in the `x-spree-api-key`
    header.

    Secret API keys can be generated in the Spree admin dashboard.


    ## Response Format


    All responses are JSON. List endpoints return paginated responses with
    `data` and `meta` keys.

    Single resource endpoints return a flat JSON object.


    ## Resource IDs


    Every resource is identified by an opaque string ID (e.g. `prod_86Rf07xd4z`,

    `variant_k5nR8xLq`, `or_UkLWZg9DAJ`). Use these IDs everywhere — URL paths,

    request bodies, and Ransack filters all accept them directly.


    ## Error Handling


    Errors return a consistent format:

    ```json

    {
      "error": {
        "code": "validation_error",
        "message": "Validation failed",
        "details": { "name": ["can't be blank"] }
      }
    }

    ```
  version: v3
servers:
  - url: http://{defaultHost}
    variables:
      defaultHost:
        default: localhost:3000
security: []
tags:
  - name: Authentication
    description: Admin user login, logout, token refresh, and current user profile
  - name: Allowed Origins
    description: CORS allowlist for storefront and admin client origins
  - name: API Keys
    description: Secret and publishable API keys
  - name: Categories
    description: >-
      Hierarchical product categories — tree management, repositioning, and
      product assignments
  - name: Channels
    description: >-
      Sales channels, product publication across channels, and per-channel order
      routing rules
  - name: Custom Fields
    description: >-
      Custom field definitions for products, variants, customers, and other
      resources
  - name: Customer Groups
    description: >-
      Customer groups for segmenting customers (e.g. wholesale, VIP) used by
      pricing and promotions
  - name: Customers
    description: Customer profiles, addresses, credit cards, and store credits
  - name: Email Templates
    description: >-
      Customer email templates, the email layout and shared partials: drafts,
      previews, publishing and history
  - name: Exports
    description: Async CSV exports of admin resources
  - name: Files
    description: Uploading the files that product media, imports, logos and documents use
  - name: Fulfillments
    description: Order fulfillments — shipments, fulfill, cancel, resume, split
  - name: Gift Cards
    description: Gift cards and gift card batches
  - name: Imports
    description: >-
      Async CSV imports of admin resources, with per-row status and failed-row
      retry
  - name: Markets
    description: >-
      Markets — geographic groupings of countries used for pricing, tax, and
      fulfillment rules
  - name: Option Types
    description: >-
      Option types and option values used to build product variants (e.g. Size,
      Color)
  - name: Orders
    description: Orders, order items, applied gift cards, and applied store credits
  - name: Payment Methods
    description: Configured payment providers and their available types
  - name: Payments
    description: Order payments — list, capture, void
  - name: Pricing
    description: >-
      Prices and price lists for currency-, market-, and customer-group-specific
      pricing
  - name: Products
    description: >-
      Products, taxons/categories, product custom field values, and bulk product
      operations
  - name: Policies
    description: The store's legal documents — terms of service, privacy, returns, shipping
  - name: Reasons
    description: >-
      Merchant-owned vocabularies for why a return, claim, refund, cancellation
      or tax exemption happened
  - name: Promotions
    description: Promotions, promotion rules, promotion actions, and coupon codes
  - name: Refunds
    description: Order refunds
  - name: Settings
    description: Store-level settings — store profile, tags, and configuration
  - name: Staff
    description: Admin users, roles, and invitations to the store
  - name: Stock Locations
    description: Warehouses and physical fulfillment locations
  - name: Store Credits
    description: Prepaid customer balances across all customers, and each balance's ledger
  - name: Variants
    description: >-
      Product variants — the individual SKUs (size/color combinations) sold
      under a product
  - name: Webhooks
    description: Webhook endpoints and webhook delivery history
paths:
  /api/v3/admin/delivery_methods/{id}:
    patch:
      tags:
        - Delivery
      summary: Update delivery method
      description: |-
        Updates a delivery method. Only the attributes sent change.

        **Required scope:** `write_settings` (for API-key authentication).
      parameters:
        - name: x-spree-api-key
          in: header
          required: true
          schema:
            type: string
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
        - name: id
          in: path
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DeliveryMethodUpdateParams'
        required: true
      responses:
        '200':
          description: delivery method updated
          content:
            application/json:
              example:
                id: dm_UkLWZg9DAJ
                name: UPS Express
                code: UPS_GROUND_12
                estimated_transit_business_days_min: 1
                estimated_transit_business_days_max: 2
                digital: false
                pickup: false
                pickup_point: false
                admin_name: null
                storefront_visible: true
                tracking_url: null
                available_to_sellers: false
                created_at: '2026-01-15T12:00:00.000Z'
                updated_at: '2026-01-15T12:00:00.000Z'
                deleted_at: null
                markup_flat: '0.00'
                markup_percent: '0'
                seller_id: null
                seller_name: null
                services: []
                rules: []
                tax_category_id: null
                delivery_profile_id: fp_UkLWZg9DAJ
                delivery_origin_group_id: og_UkLWZg9DAJ
                delivery_zone_id: null
                stock_location_ids: []
                fulfillment_provider: manual
                pickup_point_provider: null
                rate_provider: null
                calculator:
                  type: flat_rate
                  preferences:
                    amounts: {}
                    amount: '10.00'
                    currency: USD
      security:
        - api_key: []
          bearer_auth: []
      x-codeSamples:
        - lang: javascript
          label: Spree Admin SDK
          source: >-
            import { createAdminClient } from '@spree/admin-sdk'


            const client = createAdminClient({
              baseUrl: 'https://your-store.com',
              secretKey: 'sk_xxx',
            })


            const deliveryMethod = await
            client.deliveryMethods.update('dm_UkLWZg9DAJ', {
              name: 'UPS Express',
              estimated_transit_business_days_min: 1,
              estimated_transit_business_days_max: 2,
            })
        - lang: bash
          label: Spree CLI
          source: >-
            spree api patch /delivery_methods/{id} -d '{"name":"UPS
            Express","estimated_transit_business_days_min":1,"estimated_transit_business_days_max":2}'
components:
  schemas:
    DeliveryMethodUpdateParams:
      type: object
      properties:
        name:
          type: string
          example: Express
        admin_name:
          type: string
          nullable: true
        code:
          type: string
          nullable: true
        fulfillment_provider:
          type: string
          description: >-
            Fulfillment provider shorthand (see the fulfillment providers
            endpoint), e.g. `manual`.
          example: manual
        pickup_point_provider:
          type: string
          nullable: true
        rate_provider:
          type: string
          description: >-
            Rate provider shorthand (see the rate providers endpoint), e.g.
            `easy_post`. Omit or send null for the built-in provider, which
            prices through the method's calculator.
          nullable: true
        storefront_visible:
          type: boolean
        available_to_sellers:
          type: boolean
          description: >-
            Marketplace only: whether a seller's packages may be quoted by this
            method. Off by default, and refused on a method that belongs to a
            seller.
        tracking_url:
          type: string
          nullable: true
        estimated_transit_business_days_min:
          type: integer
          nullable: true
        estimated_transit_business_days_max:
          type: integer
          nullable: true
        tax_category_id:
          type: string
          description: Prefixed tax category ID (`taxcat_...`), or null to clear.
          nullable: true
        markup_flat:
          type: string
          format: decimal
          pattern: ^-?\d+(\.\d+)?$
          description: >-
            Method-level flat handling fee added on top of provider-quoted
            rates.
          nullable: true
        markup_percent:
          type: string
          format: decimal
          pattern: ^-?\d+(\.\d+)?$
          description: >-
            Method-level percentage handling fee added on top of provider-quoted
            rates. Ignored for calculator-priced methods.
          nullable: true
        delivery_profile_id:
          type: string
          description: >-
            Delivery profile this method belongs to (`fp_...`); defaults to the
            store default profile.
          example: fp_86Rf07xd4z
        delivery_origin_group_id:
          type: string
          description: >-
            Origin group offering this method (`og_...`); defaults to the zone's
            group, else the profile's default group.
        delivery_zone_id:
          type: string
          description: >-
            Delivery zone narrowing destinations (`dz_...`), or null for no
            restriction. Must belong to the method's profile.
          nullable: true
        stock_location_ids:
          type: array
          items:
            type: string
          description: Pickup locations (`sloc_...`); replaces the full set.
        calculator:
          type: object
          properties:
            type:
              type: string
              example: flat_rate
            preferences:
              type: object
              additionalProperties: true
              example:
                amount: '12.5'
          description: >-
            How the method prices a shipment: a type from the calculators
            endpoint and its preferences, matching that type's `schema`.
        rules:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
              type:
                type: string
                description: A rule kind from the delivery method rule types endpoint.
              active:
                type: boolean
              preferences:
                type: object
                additionalProperties: true
              product_ids:
                type: array
                items:
                  type: string
                description: >-
                  Products an association-backed rule (`excluded_products_rule`)
                  applies to.
          description: 'Eligibility rules. Replaces the full set: omitted rules are removed.'
        services:
          type: array
          items:
            $ref: '#/components/schemas/DeliveryMethodServiceParams'
          description: >-
            Carrier service rows: which provider services this method offers.
            Replaces the full set: omitted rows are removed; no rows means every
            service the provider returns is offered.
    DeliveryMethodServiceParams:
      type: object
      properties:
        id:
          type: string
          description: Prefixed row ID (`dms_...`) when updating an existing row.
        carrier:
          type: string
          description: Carrier identifier as the provider's API knows it.
          example: UPS
        service:
          type: string
          description: Service identifier as the provider's API knows it.
          example: Ground
        label:
          type: string
          description: >-
            Display label shown to customers instead of the carrier-derived
            name.
          nullable: true
        markup_flat:
          type: string
          format: decimal
          pattern: ^-?\d+(\.\d+)?$
          description: Overrides the method-level flat markup for this service.
          nullable: true
        markup_percent:
          type: string
          format: decimal
          pattern: ^-?\d+(\.\d+)?$
          description: Overrides the method-level percentage markup for this service.
          nullable: true
        position:
          type: integer
      required:
        - carrier
        - service
  securitySchemes:
    api_key:
      type: apiKey
      name: x-spree-api-key
      in: header
      description: Secret API key for admin access
    bearer_auth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: JWT token for admin user authentication

````

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