> ## 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 subscription billing attempt

> Updates billing attempt details for a subscription contract. Billing attempts represent individual charge attempts for recurring subscription orders.

**Key Information Updated:**
- **Billing Date**: Next scheduled billing/charge date
- **Status**: Success, failed, pending, or scheduled
- **Error Messages**: Failure reasons for declined payments
- **Retry Count**: Number of retry attempts made
- **Order ID**: Associated Shopify order if billing succeeded
- **Amount**: Billing amount charged or attempted

**Billing Attempt Lifecycle:**
1. **Scheduled**: Billing attempt is queued for future processing
2. **Pending**: Charge is being processed by payment gateway
3. **Success**: Payment captured, order created
4. **Failed**: Payment declined or error occurred
5. **Retrying**: Automatic retry scheduled after failure

**Common Use Cases:**
- Reschedule failed billing attempts to a new date
- Update billing date to align with customer preferences
- Mark manual payment reconciliation in external systems
- Sync billing status with external payment processors
- Trigger retry logic for failed payment attempts
- Update billing metadata for reporting and analytics

**Important Notes:**
- Changing billing date will affect the subscription's billing cycle
- Only pending or failed attempts can typically be modified
- Successfully billed attempts are immutable in most cases

**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
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:
    put:
      tags:
        - Billing & Orders
      summary: Update subscription billing attempt
      description: >-
        Updates billing attempt details for a subscription contract. Billing
        attempts represent individual charge attempts for recurring subscription
        orders.


        **Key Information Updated:**

        - **Billing Date**: Next scheduled billing/charge date

        - **Status**: Success, failed, pending, or scheduled

        - **Error Messages**: Failure reasons for declined payments

        - **Retry Count**: Number of retry attempts made

        - **Order ID**: Associated Shopify order if billing succeeded

        - **Amount**: Billing amount charged or attempted


        **Billing Attempt Lifecycle:**

        1. **Scheduled**: Billing attempt is queued for future processing

        2. **Pending**: Charge is being processed by payment gateway

        3. **Success**: Payment captured, order created

        4. **Failed**: Payment declined or error occurred

        5. **Retrying**: Automatic retry scheduled after failure


        **Common Use Cases:**

        - Reschedule failed billing attempts to a new date

        - Update billing date to align with customer preferences

        - Mark manual payment reconciliation in external systems

        - Sync billing status with external payment processors

        - Trigger retry logic for failed payment attempts

        - Update billing metadata for reporting and analytics


        **Important Notes:**

        - Changing billing date will affect the subscription's billing cycle

        - Only pending or failed attempts can typically be modified

        - Successfully billed attempts are immutable in most cases


        **Authentication:** Requires API key authentication via X-API-Key header
        or api_key parameter
      operationId: updateSubscriptionBillingAttemptV2
      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/SubscriptionBillingAttemptDTO'
        description: >-
          Updated billing attempt details including billing date, status, and
          metadata
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubscriptionBillingAttemptDTO'
          description: Billing attempt successfully updated
        '400':
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/SubscriptionBillingAttemptDTO'
          description: >-
            Invalid request - validation failed or billing attempt cannot be
            modified
        '401':
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/SubscriptionBillingAttemptDTO'
          description: Authentication required - invalid or missing API key
        '404':
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/SubscriptionBillingAttemptDTO'
          description: Billing attempt not found
components:
  schemas:
    SubscriptionBillingAttemptDTO:
      properties:
        applyUsageCharge:
          type: boolean
        attemptCount:
          description: Number of billing retry attempts
          example: 1
          format: int32
          type: integer
        attemptTime:
          format: date-time
          type: string
        billingAttemptId:
          description: Shopify billing attempt ID
          type: string
        billingAttemptResponseMessage:
          type: string
        billingDate:
          description: Scheduled billing date for this attempt
          format: date-time
          type: string
        contractId:
          description: Associated subscription contract ID
          example: 67890
          format: int64
          type: integer
        graphOrderId:
          type: string
        id:
          description: Unique identifier of the billing attempt record
          example: 12345
          format: int64
          type: integer
        orderAmount:
          description: Total order amount
          example: 29.99
          format: double
          type: number
        orderAmountUSD:
          format: double
          type: number
        orderId:
          description: Shopify order ID if billing was successful
          format: int64
          type: integer
        orderName:
          description: Shopify order name/number
          example: '#1001'
          type: string
        orderNote:
          description: Order note or special instructions
          type: string
        progressAttemptCount:
          format: int32
          type: integer
        recurringChargeId:
          format: int64
          type: integer
        retryingNeeded:
          type: boolean
        securityChallengeSentStatus:
          enum:
            - SENT
            - UNSENT
            - FAILED
            - EMAIL_SETTINGS_DISABLED
            - CONTRACT_CANCELLED
          type: string
        shop:
          description: Shop domain identifier
          example: my-store.myshopify.com
          type: string
        status:
          description: Current status of the billing attempt
          enum:
            - SUCCESS
            - FAILURE
            - REQUESTING
            - PROGRESS
            - QUEUED
            - SKIPPED
            - SOCIAL_CONNECTION_NULL
            - CONTRACT_CANCELLED
            - CONTRACT_ENDED
            - CONTRACT_PAUSED
            - AUTO_CHARGE_DISABLED
            - SKIPPED_DUNNING_MGMT
            - SECURITY_CHALLENGE
            - SHOPIFY_EXCEPTION
          type: string
        transactionFailedEmailSentStatus:
          enum:
            - SENT
            - UNSENT
            - FAILED
            - EMAIL_SETTINGS_DISABLED
            - CUSTOMER_PAYMENT_EMPTY
            - CONTRACT_CANCELLED
          type: string
        transactionFailedSmsSentStatus:
          enum:
            - SENT
            - UNSENT
            - FAILED
            - SMS_SETTINGS_DISABLED
            - CUSTOMER_PAYMENT_EMPTY
            - CONTRACT_CANCELLED
            - PHONE_NUMBER_EMPTY
          type: string
        transactionRate:
          format: double
          type: number
        upcomingOrderEmailSentStatus:
          enum:
            - SENT
            - UNSENT
            - FAILED
            - EMAIL_SETTINGS_DISABLED
            - CUSTOMER_PAYMENT_EMPTY
            - CONTRACT_CANCELLED
            - STOP_FROM_CONTRACT
            - CONTRACT_PAUSED
          type: string
        upcomingOrderSmsSentStatus:
          enum:
            - SENT
            - UNSENT
            - FAILED
            - SMS_SETTINGS_DISABLED
            - CUSTOMER_PAYMENT_EMPTY
            - CONTRACT_CANCELLED
            - STOP_FROM_CONTRACT
            - CONTRACT_PAUSED
            - PHONE_NUMBER_EMPTY
          type: string
        upgradeDowngradeBilling:
          type: boolean
        usageChargeStatus:
          enum:
            - SUCCESS
            - FAILED
            - TO_BE_TRIED
          type: string
        variantList:
          items:
            $ref: '#/components/schemas/VariantQuantity'
          type: array
      required:
        - retryingNeeded
        - shop
      type: object
    VariantQuantity:
      properties:
        image:
          type: string
        productId:
          type: string
        productTitle:
          type: string
        quantity:
          format: int32
          type: integer
        sellingPlanId:
          type: string
        title:
          type: string
        variantId:
          format: int64
          type: integer
      type: object

````