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

# Update order note for billing attempt

> Updates the order note/instructions for a specific upcoming billing attempt. These notes are stored with the billing attempt and will appear on the Shopify order when it's created. Order notes are visible to merchants in Shopify admin and can be printed on packing slips.

**How It Works:**
1. Accepts a billing attempt ID and new order note text
2. Updates the billing attempt record immediately
3. Note will be included when the order is created during billing
4. Previous order note (if any) is completely replaced
5. Empty string will clear the existing order note

**Important Timing Considerations:**
- Can only update billing attempts with status: `QUEUED` or `SCHEDULED`
- Cannot update billing attempts that have already been processed (`SUCCESS` or `FAILED`)
- Changes apply to the next billing cycle only (does not affect past orders)
- For recurring notes across all future orders, use subscription contract order notes instead

**Character Limits & Validation:**
- **Maximum Length**: 5000 characters (Shopify's order note limit)
- **Encoding**: Supports UTF-8 (emojis, international characters allowed)
- **HTML**: Not rendered - plain text only, HTML tags will display as text
- **Line Breaks**: Preserved using `\n` characters
- **Special Characters**: Quotes, apostrophes automatically escaped

**Common Use Cases:**
- **Delivery Instructions**: "Please leave package at side door" or "Ring doorbell twice"
- **Special Handling**: "Fragile items - handle with care" or "Refrigerate immediately"
- **Gift Messages**: "Happy Birthday! Love, Sarah" (for gift subscriptions)
- **Custom Requests**: "Include extra ice packs" or "No substitutions please"
- **One-Time Changes**: "Skip broccoli this week, double the carrots instead"
- **Fulfillment Notes**: "Use expedited shipping" or "Pack items separately"

**Order Note vs Contract Note:**
- **Billing Attempt Note** (this endpoint): Applies to ONE specific upcoming order only
- **Contract Note** (`/subscription-contracts-update-order-note`): Applies to ALL future orders
- If both exist, they are concatenated in the final Shopify order

**Example Workflows:**
```
Scenario 1: One-time delivery instruction
1. Customer going on vacation next week
2. Call this endpoint to add "Deliver to neighbor at #123" for next billing attempt
3. Following orders resume normal delivery (no note)

Scenario 2: Clearing unwanted notes
1. Previous note says "Call before delivery"
2. Customer requests removal
3. Call this endpoint with orderNote="" (empty string)
4. Note cleared from next order

Scenario 3: Gift message for specific order
1. Customer's subscription ships to recipient monthly
2. Special occasion (birthday) on next delivery
3. Add gift message to next billing attempt only
4. Regular shipments continue without message
```

**Integration Tips:**
- Fetch upcoming billing attempts via `/subscription-billing-attempts` endpoint first
- Check `status` field to ensure billing attempt can be modified
- Display character counter in UI (5000 char limit)
- Sanitize input to prevent injection attacks
- Consider validating against profanity/spam filters

**Error Handling:**
- **404**: Billing attempt ID doesn't exist or belongs to different shop
- **400**: Billing attempt already processed (status is SUCCESS/FAILED)
- **400**: Order note exceeds 5000 character limit
- **401**: Invalid or missing API key

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



## OpenAPI

````yaml /memberships/admin-api-swagger.json put /api/external/v2/subscription-billing-attempts-update-order-note/{id}
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/subscription-billing-attempts-update-order-note/{id}:
    put:
      tags:
        - Billing & Orders
      summary: Update order note for billing attempt
      description: >-
        Updates the order note/instructions for a specific upcoming billing
        attempt. These notes are stored with the billing attempt and will appear
        on the Shopify order when it's created. Order notes are visible to
        merchants in Shopify admin and can be printed on packing slips.


        **How It Works:**

        1. Accepts a billing attempt ID and new order note text

        2. Updates the billing attempt record immediately

        3. Note will be included when the order is created during billing

        4. Previous order note (if any) is completely replaced

        5. Empty string will clear the existing order note


        **Important Timing Considerations:**

        - Can only update billing attempts with status: `QUEUED` or `SCHEDULED`

        - Cannot update billing attempts that have already been processed
        (`SUCCESS` or `FAILED`)

        - Changes apply to the next billing cycle only (does not affect past
        orders)

        - For recurring notes across all future orders, use subscription
        contract order notes instead


        **Character Limits & Validation:**

        - **Maximum Length**: 5000 characters (Shopify's order note limit)

        - **Encoding**: Supports UTF-8 (emojis, international characters
        allowed)

        - **HTML**: Not rendered - plain text only, HTML tags will display as
        text

        - **Line Breaks**: Preserved using `\n` characters

        - **Special Characters**: Quotes, apostrophes automatically escaped


        **Common Use Cases:**

        - **Delivery Instructions**: "Please leave package at side door" or
        "Ring doorbell twice"

        - **Special Handling**: "Fragile items - handle with care" or
        "Refrigerate immediately"

        - **Gift Messages**: "Happy Birthday! Love, Sarah" (for gift
        subscriptions)

        - **Custom Requests**: "Include extra ice packs" or "No substitutions
        please"

        - **One-Time Changes**: "Skip broccoli this week, double the carrots
        instead"

        - **Fulfillment Notes**: "Use expedited shipping" or "Pack items
        separately"


        **Order Note vs Contract Note:**

        - **Billing Attempt Note** (this endpoint): Applies to ONE specific
        upcoming order only

        - **Contract Note** (`/subscription-contracts-update-order-note`):
        Applies to ALL future orders

        - If both exist, they are concatenated in the final Shopify order


        **Example Workflows:**

        ```

        Scenario 1: One-time delivery instruction

        1. Customer going on vacation next week

        2. Call this endpoint to add "Deliver to neighbor at #123" for next
        billing attempt

        3. Following orders resume normal delivery (no note)


        Scenario 2: Clearing unwanted notes

        1. Previous note says "Call before delivery"

        2. Customer requests removal

        3. Call this endpoint with orderNote="" (empty string)

        4. Note cleared from next order


        Scenario 3: Gift message for specific order

        1. Customer's subscription ships to recipient monthly

        2. Special occasion (birthday) on next delivery

        3. Add gift message to next billing attempt only

        4. Regular shipments continue without message

        ```


        **Integration Tips:**

        - Fetch upcoming billing attempts via `/subscription-billing-attempts`
        endpoint first

        - Check `status` field to ensure billing attempt can be modified

        - Display character counter in UI (5000 char limit)

        - Sanitize input to prevent injection attacks

        - Consider validating against profanity/spam filters


        **Error Handling:**

        - **404**: Billing attempt ID doesn't exist or belongs to different shop

        - **400**: Billing attempt already processed (status is SUCCESS/FAILED)

        - **400**: Order note exceeds 5000 character limit

        - **401**: Invalid or missing API key


        **Authentication:** Requires API key authentication via X-API-Key header
        or api_key parameter
      operationId: updateOrderNoteV2_1
      parameters:
        - description: Billing attempt ID
          example: 123456
          in: path
          name: id
          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
        - description: Order note/instructions text
          example: Please leave at front door
          in: query
          name: orderNote
          required: true
          schema:
            type: string
      responses:
        '200':
          content:
            '*/*':
              schema:
                type: boolean
          description: Order note updated successfully. Returns true if update succeeded.
        '400':
          content:
            '*/*':
              schema:
                type: boolean
          description: >-
            Bad request - billing attempt already processed, note too long
            (>5000 chars), or invalid status for updates
        '401':
          content:
            '*/*':
              schema:
                type: boolean
          description: Authentication required - invalid or missing API key
        '404':
          content:
            '*/*':
              schema:
                type: boolean
          description: >-
            Billing attempt not found for the provided ID or doesn't belong to
            authenticated shop

````