# 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 Endpoint: PUT /api/external/v2/subscription-billing-attempts-update-order-note/{id} Version: 0.0.1 ## Path parameters: - `id` (integer, required) Billing attempt ID Example: 123456 ## Query parameters: - `api_key` (string) API Key (Deprecated - Use Header X-API-Key instead) - `orderNote` (string, required) Order note/instructions text Example: "Please leave at front door" ## Header parameters: - `X-API-Key` (string)