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

# Process refund for subscription order

> Processes a refund for a fulfilled subscription order. This creates a refund in Shopify and returns the money to the customer's original payment method.

**What it does:**
1. Validates order is eligible for refund (fulfilled, not already refunded)
2. Creates refund transaction in Shopify
3. Processes refund with payment gateway
4. Updates order status to 'Refunded'
5. Sends refund confirmation email to customer
6. Logs refund activity

**Refund Eligibility:**
- Order must be fulfilled
- Cannot already be refunded
- Must be within merchant's refund policy window
- Payment gateway must support refunds

**Refund Processing:**
- Refund is processed to original payment method
- Takes 5-10 business days to appear in customer's account
- Processing fees are typically not refunded
- Partial refunds are supported (if configured)

**Important Warnings:**
- This action cannot be undone
- Refunded orders cannot be un-refunded
- Inventory is restocked automatically
- Refunds may incur gateway fees

**Authentication:** Customer must be logged in and own the subscription



## OpenAPI

````yaml /subscription/storefront-api-swagger.json put /subscriptions/cp/api/subscription-billing-attempts/refund-fulfillment/{id}
openapi: 3.0.1
info:
  description: >-
    Comprehensive API documentation for the customer-facing subscription portal.
    These APIs enable customers to manage their subscriptions, update billing
    information, modify delivery schedules, and access their account details
    through your storefront.


    **Important**: These APIs must be called from your shop's domain (e.g.,
    https://www.myshop.com/apps/subscriptions/cp/api/**) and require customer
    authentication. Unauthenticated requests will return a 401 Unauthorized
    error.
  title: Storefront APIs
  version: 0.0.1
servers:
  - url: https://www.myshop.com/apps
security: []
tags:
  - description: >-
      Core customer portal APIs for managing customer account settings,
      authentication, and portal configurations.
    name: Customer Portal
  - description: >-
      APIs for customers to view and manage their subscription contracts
      including status updates, frequency changes, and cancellations.
    name: Subscription Management
  - description: >-
      APIs for retrieving and updating subscription contract details — delivery
      schedules, line items, addresses, billing cycles.
    name: Subscription Contracts
  - description: >-
      APIs for retrieving available subscription plans and selling plan
      configurations exposed to customers.
    name: Subscription Plans
  - description: >-
      APIs for managing one-time add-on products that can be purchased alongside
      recurring subscription items.
    name: Subscription One-Time Products
  - description: >-
      APIs for retrieving aggregated subscription data and account-level
      subscription information for the signed-in customer.
    name: Subscription Data
  - description: >-
      APIs for managing customizable product boxes and bundles where customers
      can select multiple items.
    name: Build-a-Box & Bundles
  - description: >-
      APIs for managing payment methods, billing information, and processing
      subscription payments.
    name: Billing & Payments
  - description: >-
      APIs for retrieving product information, selling plans, variant data, and
      subscription-enabled products available to customers.
    name: Product Catalog
  - description: >-
      APIs for managing delivery schedules, shipping addresses, delivery
      methods, and tracking order status.
    name: Delivery & Shipping
  - description: >-
      APIs for handling subscription cancellations, retention activities, and
      customer feedback management.
    name: Customer Retention
  - description: >-
      APIs for integrating loyalty programs with subscriptions including points
      redemption and earning options.
    name: Loyalty Integration
  - description: >-
      APIs for accessing portal customization settings, translations, and theme
      configurations.
    name: Customization
  - description: >-
      APIs for retrieving promotional campaigns shown in the customer portal,
      tracking banner engagement, and redeeming campaign offers.
    name: Campaigns
  - description: >-
      APIs for local pickup and click-and-collect — listing pickup locations and
      resolving eligible pickup dates and time slots.
    name: Store Pickup
paths:
  /subscriptions/cp/api/subscription-billing-attempts/refund-fulfillment/{id}:
    put:
      tags:
        - Billing & Payments
      summary: Process refund for subscription order
      description: >-
        Processes a refund for a fulfilled subscription order. This creates a
        refund in Shopify and returns the money to the customer's original
        payment method.


        **What it does:**

        1. Validates order is eligible for refund (fulfilled, not already
        refunded)

        2. Creates refund transaction in Shopify

        3. Processes refund with payment gateway

        4. Updates order status to 'Refunded'

        5. Sends refund confirmation email to customer

        6. Logs refund activity


        **Refund Eligibility:**

        - Order must be fulfilled

        - Cannot already be refunded

        - Must be within merchant's refund policy window

        - Payment gateway must support refunds


        **Refund Processing:**

        - Refund is processed to original payment method

        - Takes 5-10 business days to appear in customer's account

        - Processing fees are typically not refunded

        - Partial refunds are supported (if configured)


        **Important Warnings:**

        - This action cannot be undone

        - Refunded orders cannot be un-refunded

        - Inventory is restocked automatically

        - Refunds may incur gateway fees


        **Authentication:** Customer must be logged in and own the subscription
      operationId: refundFulfillment
      parameters:
        - description: Billing attempt ID to refund
          in: path
          name: id
          required: true
          schema:
            format: int64
            type: integer
        - description: Subscription contract ID for validation
          in: query
          name: subscriptionContractId
          required: false
          schema:
            format: int64
            type: integer
      responses:
        '200':
          content:
            application/json:
              example:
                message: >-
                  Refund processed successfully. Amount will appear in 5-10
                  business days.
                refundAmount: 44.49
                refundId: '123456'
                success: true
          description: Refund processed successfully
        '400':
          content:
            '*/*':
              schema:
                additionalProperties:
                  type: object
                type: object
          description: Order cannot be refunded or refund failed
        '401':
          content:
            '*/*':
              schema:
                additionalProperties:
                  type: object
                type: object
          description: Customer not logged in or doesn't own this subscription

````