> ## 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.

# Create shipping/delivery profile (V2 format)

> Creates a new Shopify delivery profile with custom shipping zones, rates, and methods. Delivery profiles control which shipping options are available to customers at checkout for subscription orders.

**What is a Delivery Profile?**
A delivery profile defines shipping configurations (zones, rates, methods) for specific products or locations. Subscription memberships can have dedicated delivery profiles with custom shipping pricing (free shipping for VIPs, regional rates, express delivery options, etc.).

**Request Body Structure (CreateShippingProfileRequestV2):**
```json
{
  "profileName": "VIP Membership Free Shipping",
  "locationInfos": [
    {
      "locationId": "gid://shopify/Location/12345",
      "countryInfos": [
        {
          "countryCode": "US",
          "provinceCodeInfoList": ["CA", "NY", "TX"],
          "deliveryMethodInfo": [
            {
              "name": "Standard Shipping",
              "amount": 0.00,
              "currencyCode": "USD",
              "minWeight": null,
              "maxWeight": null,
              "description": "Free for members"
            },
            {
              "name": "Express Shipping",
              "amount": 9.99,
              "currencyCode": "USD",
              "description": "2-day delivery"
            }
          ]
        }
      ]
    }
  ]
}
```

**Field Explanations:**

**profileName** (string, required):
- Unique name for the delivery profile
- Visible in Shopify admin
- Examples: "Premium Member Shipping", "International Free Shipping", "Express Delivery Profile"
- Max length: 255 characters

**locationInfos** (array, required):
- Array of store locations this profile applies to
- Get location IDs via Shopify Admin API or `/data/locations` endpoint
- Can configure different shipping for each warehouse/store
- **locationId** format: `gid://shopify/Location/{numeric_id}`

**countryInfos** (array, required):
- Shipping configuration per country
- **countryCode**: ISO 3166-1 alpha-2 code ("US", "CA", "GB", etc.)
- **provinceCodeInfoList**: Optional state/province filtering (e.g., ["CA", "NY"] for US states)
  - Omit to include all provinces/states
  - Use ISO 3166-2 province codes (e.g., "CA" for California, "ON" for Ontario)

**deliveryMethodInfo** (array, required):
- Shipping methods available for this zone
- **name**: Method display name ("Standard", "Express", "Overnight")
- **amount**: Shipping cost (0.00 for free shipping)
- **currencyCode**: Auto-set to shop currency (do not manually specify)
- **minWeight** / **maxWeight**: Optional weight restrictions in grams
- **description**: Optional customer-facing description

**Common Use Cases & Examples:**

**1. Free Shipping for VIP Members**
```json
{
  "profileName": "VIP Free Shipping",
  "locationInfos": [{
    "locationId": "gid://shopify/Location/67890",
    "countryInfos": [{
      "countryCode": "US",
      "deliveryMethodInfo": [{
        "name": "Free Standard Shipping",
        "amount": 0.00,
        "description": "Included with VIP membership"
      }]
    }]
  }]
}
```

**2. Regional Pricing (Different Rates per State)**
```json
{
  "profileName": "Regional Shipping",
  "locationInfos": [{
    "locationId": "gid://shopify/Location/12345",
    "countryInfos": [
      {
        "countryCode": "US",
        "provinceCodeInfoList": ["CA", "OR", "WA"],
        "deliveryMethodInfo": [{
          "name": "West Coast Shipping",
          "amount": 4.99
        }]
      },
      {
        "countryCode": "US",
        "provinceCodeInfoList": ["NY", "NJ", "CT"],
        "deliveryMethodInfo": [{
          "name": "East Coast Shipping",
          "amount": 5.99
        }]
      }
    ]
  }]
}
```

**3. Tiered Shipping (Standard + Express)**
```json
{
  "profileName": "Multi-Speed Shipping",
  "locationInfos": [{
    "locationId": "gid://shopify/Location/12345",
    "countryInfos": [{
      "countryCode": "US",
      "deliveryMethodInfo": [
        {
          "name": "Standard (5-7 days)",
          "amount": 0.00,
          "description": "Free standard shipping"
        },
        {
          "name": "Express (2-3 days)",
          "amount": 9.99,
          "description": "Faster delivery"
        },
        {
          "name": "Overnight",
          "amount": 24.99,
          "description": "Next business day"
        }
      ]
    }]
  }]
}
```

**Validation Rules:**
- **profileName**: Required, non-empty, max 255 characters
- **locationInfos**: Must contain at least 1 location
- **countryCode**: Must be valid ISO 3166-1 alpha-2 code
- **provinceCodeInfoList**: Optional, must be valid province codes for the country
- **deliveryMethodInfo**: Must have at least 1 method per country
- **amount**: Must be >= 0 (cannot be negative)
- **locationId**: Must exist in Shopify and be active

**Common Errors:**

**400 - Invalid Country Code:**
```json
{"error": "Invalid country code 'USA'. Use 'US' instead (ISO 3166-1 alpha-2)"}
```
Solution: Use 2-letter codes (US, CA, GB, AU, etc.)

**400 - Invalid Location ID:**
```json
{"error": "Location not found: gid://shopify/Location/99999"}
```
Solution: Verify location exists via `/data/locations` endpoint

**400 - Missing Delivery Methods:**
```json
{"error": "Country US has no delivery methods configured"}
```
Solution: Add at least one delivery method to each country

**400 - Invalid Province Code:**
```json
{"error": "Province code 'California' invalid for US. Use 'CA'"}
```
Solution: Use 2-letter state codes (CA, NY, TX), not full names

**500 - Shopify API Error:**
Shopify's delivery profile API rejected the request. Common reasons:
- Duplicate profile name
- Missing required Shopify permissions
- Shopify API rate limit exceeded
- Invalid zone configuration

**Response (DeliveryProfileDTO):**
Returns created profile with:
- `id`: Shopify delivery profile ID
- `profileName`: Confirmed profile name
- `active`: Whether profile is active (true by default)
- `locationGroupId`: Shopify internal location group ID

**How to Get Location IDs:**
```
GET /api/data/locations
Response:
{
  "locations": {
    "nodes": [
      {
        "id": "gid://shopify/Location/12345",
        "name": "Main Warehouse"
      }
    ]
  }
}
```

**Best Practices:**
1. **Test with One Country First**: Start with single country, add more after validation
2. **Use Descriptive Names**: "VIP Free Shipping" better than "Profile 1"
3. **Verify Location IDs**: Always fetch current locations before creating profile
4. **Set Reasonable Rates**: Research competitor shipping prices
5. **Provide Descriptions**: Help customers understand shipping options
6. **Weight Limits**: Use for heavy items requiring freight shipping

**Authentication:** Requires API key authentication via X-API-Key header or api_key parameter



## OpenAPI

````yaml /memberships/admin-api-swagger.json post /api/external/v2/delivery-profiles/v2/create-shipping-profile
openapi: 3.0.1
info:
  description: >-
    Comprehensive API documentation for managing memberships, payments, and
    related operations. These APIs allow you to programmatically manage
    membership lifecycles, handle payments, configure products, and integrate
    membership functionality into your applications.
  title: Admin APIs
  version: 0.0.1
servers:
  - url: https://membership-admin.appstle.com
security: []
tags:
  - description: >-
      APIs for managing Shopify delivery profiles, shipping rates, zones, and
      free shipping configuration for subscription memberships
    name: Shipping & Delivery Profiles
  - description: >-
      APIs for retrieving historical discount code usage and redemption
      information for membership contracts
    name: Customer Discount History
  - description: >-
      APIs for managing membership cancellation flow settings including
      retention offers, survey questions, and cancel confirmation screens
    name: Cancellation Flow Configuration
  - description: >-
      APIs for managing membership billing attempts, recurring orders, payment
      retries, order history, and order skipping
    name: Billing & Orders
  - description: >-
      APIs for managing one-time product additions to upcoming subscription
      orders, including adding, retrieving, and removing one-off items
    name: One-Time Add-Ons
  - description: >-
      APIs for managing membership/subscription plan groups, including creating
      plans, configuring discounts, billing intervals, and assigning products to
      plans
    name: Membership Plans
  - description: >-
      APIs for managing subscription product bundles, bundle configurations,
      item grouping, and bundle-specific discount codes
    name: Product Bundles
  - description: >-
      APIs for retrieving custom CSS styles applied to subscription widgets and
      customer portal for theme customization
    name: Custom CSS Styling
  - description: >-
      APIs for managing customer portal settings including UI customization,
      text labels, feature toggles, and branding options for the member
      self-service portal
    name: Customer Portal Configuration
  - description: >-
      APIs for managing membership/subscription contracts including creation,
      updates, status changes, line items, discounts, and billing operations
    name: Membership Contracts
  - description: >-
      APIs for managing subscription bundle configuration settings including
      bundle behavior, pricing rules, and display options
    name: Bundle Settings
  - description: >-
      APIs for managing customer payment methods, payment tokens, and payment
      method retrieval for subscriptions
    name: Customer Payment Methods
  - description: >-
      APIs for retrieving product swap/substitution options allowing members to
      exchange subscription items based on configured swap rules and variant
      groups
    name: Product Swap Rules
  - description: >-
      APIs for retrieving product catalog, variants, pricing, and inventory
      information for subscription memberships.
    name: Product & Inventory Data
  - description: >-
      APIs for managing shop-level membership settings, configuration, and
      general store information.
    name: Shop Settings
  - description: >-
      APIs for performing bulk/mass operations on multiple membership contracts
      including status updates, product replacements, and billing date changes.
    name: Bulk Operations
paths:
  /api/external/v2/delivery-profiles/v2/create-shipping-profile:
    post:
      tags:
        - Shipping & Delivery Profiles
      summary: Create shipping/delivery profile (V2 format)
      description: >-
        Creates a new Shopify delivery profile with custom shipping zones,
        rates, and methods. Delivery profiles control which shipping options are
        available to customers at checkout for subscription orders.


        **What is a Delivery Profile?**

        A delivery profile defines shipping configurations (zones, rates,
        methods) for specific products or locations. Subscription memberships
        can have dedicated delivery profiles with custom shipping pricing (free
        shipping for VIPs, regional rates, express delivery options, etc.).


        **Request Body Structure (CreateShippingProfileRequestV2):**

        ```json

        {
          "profileName": "VIP Membership Free Shipping",
          "locationInfos": [
            {
              "locationId": "gid://shopify/Location/12345",
              "countryInfos": [
                {
                  "countryCode": "US",
                  "provinceCodeInfoList": ["CA", "NY", "TX"],
                  "deliveryMethodInfo": [
                    {
                      "name": "Standard Shipping",
                      "amount": 0.00,
                      "currencyCode": "USD",
                      "minWeight": null,
                      "maxWeight": null,
                      "description": "Free for members"
                    },
                    {
                      "name": "Express Shipping",
                      "amount": 9.99,
                      "currencyCode": "USD",
                      "description": "2-day delivery"
                    }
                  ]
                }
              ]
            }
          ]
        }

        ```


        **Field Explanations:**


        **profileName** (string, required):

        - Unique name for the delivery profile

        - Visible in Shopify admin

        - Examples: "Premium Member Shipping", "International Free Shipping",
        "Express Delivery Profile"

        - Max length: 255 characters


        **locationInfos** (array, required):

        - Array of store locations this profile applies to

        - Get location IDs via Shopify Admin API or `/data/locations` endpoint

        - Can configure different shipping for each warehouse/store

        - **locationId** format: `gid://shopify/Location/{numeric_id}`


        **countryInfos** (array, required):

        - Shipping configuration per country

        - **countryCode**: ISO 3166-1 alpha-2 code ("US", "CA", "GB", etc.)

        - **provinceCodeInfoList**: Optional state/province filtering (e.g.,
        ["CA", "NY"] for US states)
          - Omit to include all provinces/states
          - Use ISO 3166-2 province codes (e.g., "CA" for California, "ON" for Ontario)

        **deliveryMethodInfo** (array, required):

        - Shipping methods available for this zone

        - **name**: Method display name ("Standard", "Express", "Overnight")

        - **amount**: Shipping cost (0.00 for free shipping)

        - **currencyCode**: Auto-set to shop currency (do not manually specify)

        - **minWeight** / **maxWeight**: Optional weight restrictions in grams

        - **description**: Optional customer-facing description


        **Common Use Cases & Examples:**


        **1. Free Shipping for VIP Members**

        ```json

        {
          "profileName": "VIP Free Shipping",
          "locationInfos": [{
            "locationId": "gid://shopify/Location/67890",
            "countryInfos": [{
              "countryCode": "US",
              "deliveryMethodInfo": [{
                "name": "Free Standard Shipping",
                "amount": 0.00,
                "description": "Included with VIP membership"
              }]
            }]
          }]
        }

        ```


        **2. Regional Pricing (Different Rates per State)**

        ```json

        {
          "profileName": "Regional Shipping",
          "locationInfos": [{
            "locationId": "gid://shopify/Location/12345",
            "countryInfos": [
              {
                "countryCode": "US",
                "provinceCodeInfoList": ["CA", "OR", "WA"],
                "deliveryMethodInfo": [{
                  "name": "West Coast Shipping",
                  "amount": 4.99
                }]
              },
              {
                "countryCode": "US",
                "provinceCodeInfoList": ["NY", "NJ", "CT"],
                "deliveryMethodInfo": [{
                  "name": "East Coast Shipping",
                  "amount": 5.99
                }]
              }
            ]
          }]
        }

        ```


        **3. Tiered Shipping (Standard + Express)**

        ```json

        {
          "profileName": "Multi-Speed Shipping",
          "locationInfos": [{
            "locationId": "gid://shopify/Location/12345",
            "countryInfos": [{
              "countryCode": "US",
              "deliveryMethodInfo": [
                {
                  "name": "Standard (5-7 days)",
                  "amount": 0.00,
                  "description": "Free standard shipping"
                },
                {
                  "name": "Express (2-3 days)",
                  "amount": 9.99,
                  "description": "Faster delivery"
                },
                {
                  "name": "Overnight",
                  "amount": 24.99,
                  "description": "Next business day"
                }
              ]
            }]
          }]
        }

        ```


        **Validation Rules:**

        - **profileName**: Required, non-empty, max 255 characters

        - **locationInfos**: Must contain at least 1 location

        - **countryCode**: Must be valid ISO 3166-1 alpha-2 code

        - **provinceCodeInfoList**: Optional, must be valid province codes for
        the country

        - **deliveryMethodInfo**: Must have at least 1 method per country

        - **amount**: Must be >= 0 (cannot be negative)

        - **locationId**: Must exist in Shopify and be active


        **Common Errors:**


        **400 - Invalid Country Code:**

        ```json

        {"error": "Invalid country code 'USA'. Use 'US' instead (ISO 3166-1
        alpha-2)"}

        ```

        Solution: Use 2-letter codes (US, CA, GB, AU, etc.)


        **400 - Invalid Location ID:**

        ```json

        {"error": "Location not found: gid://shopify/Location/99999"}

        ```

        Solution: Verify location exists via `/data/locations` endpoint


        **400 - Missing Delivery Methods:**

        ```json

        {"error": "Country US has no delivery methods configured"}

        ```

        Solution: Add at least one delivery method to each country


        **400 - Invalid Province Code:**

        ```json

        {"error": "Province code 'California' invalid for US. Use 'CA'"}

        ```

        Solution: Use 2-letter state codes (CA, NY, TX), not full names


        **500 - Shopify API Error:**

        Shopify's delivery profile API rejected the request. Common reasons:

        - Duplicate profile name

        - Missing required Shopify permissions

        - Shopify API rate limit exceeded

        - Invalid zone configuration


        **Response (DeliveryProfileDTO):**

        Returns created profile with:

        - `id`: Shopify delivery profile ID

        - `profileName`: Confirmed profile name

        - `active`: Whether profile is active (true by default)

        - `locationGroupId`: Shopify internal location group ID


        **How to Get Location IDs:**

        ```

        GET /api/data/locations

        Response:

        {
          "locations": {
            "nodes": [
              {
                "id": "gid://shopify/Location/12345",
                "name": "Main Warehouse"
              }
            ]
          }
        }

        ```


        **Best Practices:**

        1. **Test with One Country First**: Start with single country, add more
        after validation

        2. **Use Descriptive Names**: "VIP Free Shipping" better than "Profile
        1"

        3. **Verify Location IDs**: Always fetch current locations before
        creating profile

        4. **Set Reasonable Rates**: Research competitor shipping prices

        5. **Provide Descriptions**: Help customers understand shipping options

        6. **Weight Limits**: Use for heavy items requiring freight shipping


        **Authentication:** Requires API key authentication via X-API-Key header
        or api_key parameter
      operationId: createShippingProfileV2External
      parameters:
        - 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
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateShippingProfileRequestV2'
        description: >-
          Delivery profile configuration with locations, zones, and shipping
          methods
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeliveryProfileDTO'
          description: >-
            Delivery profile successfully created in Shopify. Returns
            DeliveryProfileDTO with profile ID and configuration.
        '400':
          content:
            application/json:
              example:
                detail: >-
                  Invalid delivery profile configuration: Country code 'USA' is
                  invalid. Use ISO 3166-1 alpha-2 format (e.g., 'US')
                errorKey: validation_error
                status: 400
                title: Bad Request
          description: >-
            Invalid request - validation failed. Common reasons: invalid
            country/province codes, missing delivery methods, negative amounts,
            invalid location ID format.
        '401':
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/DeliveryProfileDTO'
          description: Authentication required - invalid or missing API key
        '500':
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/DeliveryProfileDTO'
          description: >-
            Shopify API error during profile creation - possible causes:
            duplicate profile name, insufficient API permissions, rate limits,
            or Shopify service unavailable
components:
  schemas:
    CreateShippingProfileRequestV2:
      properties:
        locationInfos:
          items:
            $ref: '#/components/schemas/LocationInfo'
          type: array
        name:
          type: string
      type: object
    DeliveryProfileDTO:
      properties:
        deliveryProfileId:
          description: Shopify delivery profile ID
          type: string
        id:
          description: Unique identifier of the delivery profile
          example: 201
          format: int64
          type: integer
        name:
          description: Display name of the delivery profile
          example: Standard Shipping
          type: string
        sellerGroupIds:
          description: Set of selling plan group IDs associated with this delivery profile
          items:
            description: >-
              Set of selling plan group IDs associated with this delivery
              profile
            type: string
          type: array
          uniqueItems: true
        shop:
          description: Shop domain identifier
          example: my-store.myshopify.com
          type: string
      required:
        - deliveryProfileId
        - shop
      type: object
    LocationInfo:
      properties:
        countryInfos:
          items:
            $ref: '#/components/schemas/CountryInfo'
          type: array
        locationId:
          type: string
      type: object
    CountryInfo:
      properties:
        code:
          type: string
        deliveryMethodInfo:
          items:
            $ref: '#/components/schemas/DeliveryMethodInfo'
          type: array
        provinceCode:
          type: string
        restOfWorld:
          type: boolean
        shouldIncludeAllProvince:
          type: boolean
      type: object
    DeliveryMethodInfo:
      properties:
        amount:
          format: double
          type: number
        carrierServiceId:
          type: string
        currencyCode:
          enum:
            - USD
            - EUR
            - GBP
            - CAD
            - AFN
            - ALL
            - DZD
            - AOA
            - ARS
            - AMD
            - AWG
            - AUD
            - BBD
            - AZN
            - BDT
            - BSD
            - BHD
            - BIF
            - BYN
            - BZD
            - BMD
            - BTN
            - BAM
            - BRL
            - BOB
            - BWP
            - BND
            - BGN
            - MMK
            - KHR
            - CVE
            - KYD
            - XAF
            - CLP
            - CNY
            - COP
            - KMF
            - CDF
            - CRC
            - HRK
            - CZK
            - DKK
            - DJF
            - DOP
            - XCD
            - EGP
            - ERN
            - ETB
            - FKP
            - XPF
            - FJD
            - GIP
            - GMD
            - GHS
            - GTQ
            - GYD
            - GEL
            - GNF
            - HTG
            - HNL
            - HKD
            - HUF
            - ISK
            - INR
            - IDR
            - ILS
            - IRR
            - IQD
            - JMD
            - JPY
            - JEP
            - JOD
            - KZT
            - KES
            - KID
            - KWD
            - KGS
            - LAK
            - LVL
            - LBP
            - LSL
            - LRD
            - LYD
            - LTL
            - MGA
            - MKD
            - MOP
            - MWK
            - MVR
            - MRU
            - MXN
            - MYR
            - MUR
            - MDL
            - MAD
            - MNT
            - MZN
            - NAD
            - NPR
            - ANG
            - NZD
            - NIO
            - NGN
            - NOK
            - OMR
            - PAB
            - PKR
            - PGK
            - PYG
            - PEN
            - PHP
            - PLN
            - QAR
            - RON
            - RUB
            - RWF
            - WST
            - SHP
            - SAR
            - RSD
            - SCR
            - SLL
            - SGD
            - SDG
            - SOS
            - SYP
            - ZAR
            - KRW
            - SSP
            - SBD
            - LKR
            - SRD
            - SZL
            - SEK
            - CHF
            - TWD
            - THB
            - TJS
            - TZS
            - TOP
            - TTD
            - TND
            - TRY
            - TMT
            - UGX
            - UAH
            - AED
            - UYU
            - UZS
            - VUV
            - VES
            - VND
            - XOF
            - YER
            - ZMW
            - USDC
            - BYR
            - STD
            - STN
            - VED
            - VEF
            - XXX
            - $UNKNOWN
          type: string
        name:
          type: string
        priceConditions:
          items:
            $ref: '#/components/schemas/PriceCondition'
          type: array
        weightConditions:
          items:
            $ref: '#/components/schemas/WeightCondition'
          type: array
      type: object
    PriceCondition:
      properties:
        amount:
          format: double
          type: number
        deliverCondtion:
          type: string
      type: object
    WeightCondition:
      properties:
        deliveryCondition:
          type: string
        weight:
          format: double
          type: number
        weightUnit:
          type: string
      type: object

````