> ## Documentation Index
> Fetch the complete documentation index at: https://openloop.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Deactivate Promotion Code

> Deactivates a promotion code (`active: false`); the code remains in the system but cannot be used. Promotion codes cannot be hard-deleted, so `DELETE` maps to deactivation.



## OpenAPI

````yaml /openapi.json delete /promotion-codes/{provider_promotion_code_id}
openapi: 3.1.0
info:
  title: OpenLoop API
  version: 0.1.0
  description: >-
    Unified reference for the OpenLoop Patient (clinical) and Payments & Revenue
    APIs.
servers:
  - url: https://api.openloophealth.com/v0.1
    description: Production partner edge
  - url: https://api-staging.openloophealth.com/v0.1
    description: Staging partner edge (sandbox credentials)
security: []
paths:
  /promotion-codes/{provider_promotion_code_id}:
    delete:
      tags:
        - Promotion Codes
      summary: Deactivate Promotion Code
      description: >-
        Deactivates a promotion code (`active: false`); the code remains in the
        system but cannot be used. Promotion codes cannot be hard-deleted, so
        `DELETE` maps to deactivation.
      parameters:
        - in: path
          name: provider_promotion_code_id
          required: true
          schema:
            type: string
          description: >-
            Provider promotion code id (the payment provider `promo_...`) to
            deactivate.
      responses:
        '200':
          description: Success.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      code:
                        type: string
                        description: Promotion code value.
                      provider_coupon_id:
                        type: string
                        description: Provider coupon id the promotion code belongs to.
                      active:
                        type: boolean
                        description: Always `false` after deactivation.
                      provider_promotion_code_id:
                        type: string
                        description: >-
                          Provider promotion code id (the payment provider
                          `promo_...`).
                      max_redemptions:
                        type:
                          - number
                          - 'null'
                        description: Max total redemptions (`null` if unset).
                      provider_customer_id:
                        type:
                          - string
                          - 'null'
                        description: Restricted-to customer id (`null` if unset).
                      expires_at:
                        type:
                          - number
                          - 'null'
                        description: Expiry Unix timestamp in seconds (`null` if unset).
                      metadata:
                        type: object
                        additionalProperties:
                          type: string
                        description: String key/value metadata map (`{}` if none).
                      restrictions:
                        type: object
                        properties:
                          first_time_transaction:
                            type:
                              - boolean
                              - 'null'
                          minimum_amount:
                            type:
                              - integer
                              - 'null'
                          minimum_amount_currency:
                            type:
                              - string
                              - 'null'
                        description: >-
                          `{ first_time_transaction, minimum_amount,
                          minimum_amount_currency }`; amount/currency `null` if
                          unset.
                required:
                  - data
              example:
                data:
                  code: SUMMER20
                  provider_coupon_id: 20OFF
                  active: false
                  provider_promotion_code_id: test_promotion_code_id_2
                  max_redemptions: null
                  provider_customer_id: null
                  expires_at: null
                  metadata: {}
                  restrictions:
                    first_time_transaction: null
                    minimum_amount: null
                    minimum_amount_currency: null
        '400':
          description: 'ValidationError: Missing `promotion_code_id`.'
        '401':
          description: Missing or invalid bearer token.
        '403':
          description: >-
            No configuration exists for your account, or provider access has
            been disabled for it.
        '404':
          description: 'NotFoundError: Promotion code or config not found.'
        '500':
          description: Payment provider integration error.
      security:
        - serviceToken: []
        - userToken: []
components:
  securitySchemes:
    serviceToken:
      type: oauth2
      description: >-
        Service (M2M) access token issued by POST /auth/token using the
        client_credentials grant. Required scopes, where known, are listed on
        each operation below.
      flows:
        clientCredentials:
          tokenUrl: https://api.openloophealth.com/v0.1/auth/token
          scopes: {}
    userToken:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        User access token issued by POST /auth/token via the verification-code
        grant (after Verify a one-time code) or the refresh_token grant.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.