Recurly Coupon Redemptions API

The coupon-redemptions API from Recurly — 3 operation(s) for coupon-redemptions.

GitHub OpenAPI

Operations 9

GET /accounts/{account_code}/redemptions/{redemption_uuid} Lookup Coupon Redemption #
DELETE /accounts/{account_code}/redemptions/{redemption_uuid} Remove Coupon Redemption from Account #
GET /accounts/{account_code}/redemptions List Account's Coupon Redemptions #
GET /invoices/{invoice_number}/redemptions List Invoice's Coupon Redemptions #
GET /subscriptions/{uuid}/redemptions List Subscription's Coupon Redemption #
POST /coupons/{coupon_code}/redeem Redeem Coupon on Account #
GET /accounts/{account_code}/redemption Lookup a Coupon Redemption on an Account #
DELETE /accounts/{account_code}/redemption Remove a Coupon from an Account #
GET /invoices/{invoice_number}/redemption Lookup a Coupon Redemption on an Invoice #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/recurly:recurly-coupon-redemptions-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

recurly-coupon-redemptions-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Recurly Coupon Redemptions API
  version: '1.0'
  description: 'Operations tagged coupon-redemptions across 2 of this provider''s published API definitions: recurly-v2-v2.29-api.yaml, recurly-coupon-redemptions-api-openapi.yml. Each path carries the servers of the definition it was published in.'
servers:
- url: https://{subdomain}.{domain}/v2
  variables:
    subdomain:
      description: Subdomain of your Recurly site.
      default: my-super-successful-company
    domain:
      description: Domain of your Recurly site.
      default: recurly.com
- url: https://{subdomain}.recurly.com/v2
  variables:
    subdomain:
      description: Subdomain of your Recurly site.
      default: my-super-successful-company
security:
- api_key: []
tags:
- name: coupon-redemptions
  x-displayName: Coupon Redemptions
paths:
  /accounts/{account_code}/redemptions/{redemption_uuid}:
    parameters:
    - in: path
      name: account_code
      schema:
        type: string
        default: ''
      required: true
      description: Account's unique code.
    - in: path
      name: redemption_uuid
      schema:
        type: string
      required: true
      description: Coupon Redemption's unique uuid.
    get:
      summary: Lookup Coupon Redemption
      description: '


        '
      tags:
      - coupon-redemptions
      operationId: lookupCouponRedemption
      responses:
        '200':
          description: ''
          content:
            application/xml:
              example: "<redemption href=\"https://your-subdomain.recurly.com/v2/accounts/1/redemptions/374a1c75374bd81493a3f7425db0a2b8\">\n  <coupon href=\"https://your-subdomain.recurly.com/v2/coupons/special\" />\n  <account href=\"https://your-subdomain.recurly.com/v2/accounts/1\" />\n  <subscription href=\"https://your-subdomain.recurly.com/v2/subscriptions/37bfef7a8e44cfc3817b7a43eba8a6e6\">\n  <uuid>374a1c75374bd81493a3f7425db0a2b8</uuid>\n  <single_use type=\"boolean\">true</single_use>\n  <total_discounted_in_cents type=\"integer\">0</total_discounted_in_cents>\n  <currency>USD</currency>\n  <state>active</state>\n  <coupon_code>special</coupon_code>\n  <created_at type=\"datetime\">2016-07-11T18:56:20Z</created_at>\n  <updated_at type=\"datetime\">2016-07-11T18:56:20Z</updated_at>\n</redemption>"
              schema:
                $ref: '#/components/schemas/Redemption'
      x-codeSamples: []
    delete:
      summary: Remove Coupon Redemption from Account
      description: 'Manually expire a coupon redemption on an account. Please note: the coupon redemption will still count towards the "maximum redemption total" of the coupon.


        Specify the specific redemption uuid if you are allowing multiple active coupon redemptions on an account at a time. Otherwise, you can do a simple /redemption and automatically remove the most recent redemption on the account.'
      tags:
      - coupon-redemptions
      operationId: removeCouponRedemptionFromAccount
      responses:
        '204':
          description: ''
          content:
            application/xml:
              example: 'Status: 204 No Content'
      x-codeSamples:
      - lang: PHP
        source: '<?php


          $redemption = Recurly_CouponRedemption::get(''account_code'');

          $redemption->delete();'
      - lang: Ruby
        source: 'account = Recurly::Account.find(''1'')

          redemption = account.redemption

          redemption.destroy'
      - lang: Python
        source: 'account = Account.get(''1'')

          redemption = account.redemption()

          redemption.delete()'
      - lang: Dotnet
        source: 'var account = Accounts.Get("1");

          var redemption = account.GetActiveRedemption();

          redemption.Delete();'
    servers:
    - url: https://{subdomain}.{domain}/v2
      variables:
        subdomain:
          description: Subdomain of your Recurly site.
          default: my-super-successful-company
        domain:
          description: Domain of your Recurly site.
          default: recurly.com
  /accounts/{account_code}/redemptions:
    get:
      summary: List Account's Coupon Redemptions
      description: 'Lookup information about the coupon redemptions on an account. Active and naturally expired limited duration redemptions will be returned. Redemptions removed from the account or expired single use coupons will not be returned.


        If you use the singular, "redemption", in the endpoint, you will only see the most recently redeemed redemption.'
      tags:
      - coupon-redemptions
      operationId: listAccountsCouponRedemptions
      parameters:
      - in: path
        name: account_code
        schema:
          type: string
          default: ''
        required: true
        description: Unique account identifier.
      - in: query
        name: sort
        schema:
          type: string
          default: created_at
        description: 'The attribute that will be used to order records: `created_at`, `updated_at`.'
      - in: query
        name: order
        schema:
          type: string
          default: desc
        description: 'The order in which products will be returned: `asc` for ascending order, `desc` for descending order.'
      - in: query
        name: begin_time
        schema:
          type: string
          format: date-time
          default: ''
        description: Operates on the attribute specified by the sort parameter. Filters records to only include those with datetimes greater than or equal to the supplied datetime. Accepts an ISO 8601 date or date and time.
      - in: query
        name: end_time
        schema:
          type: string
          format: date-time
          default: ''
        description: Operates on the attribute specified by the sort parameter. Filters records to only include those with datetimes less than or equal to the supplied datetime. Accepts an ISO 8601 date or date and time.
      - in: query
        name: per_page
        schema:
          type: integer
          default: '50'
        description: Number of records to return per page, up to a maximum of 200.
      - in: query
        name: cursor
        schema:
          type: string
          default: ''
        description: Splits records across pages. Leave blank to return the first page. Follow the URI in the first page's Link header to fetch the next page.
      responses:
        '200':
          description: ''
          content:
            application/xml:
              example: "<redemptions type=\"array\">\n  <redemption href=\"https://your-subdomain.recurly.com/v2/accounts/1/redemptions/316a4213e8fa9e97390aff4995bda9e6\">\n    <coupon href=\"https://your-subdomain.recurly.com/v2/coupons/special\" />\n    <account href=\"https://your-subdomain.recurly.com/v2/accounts/1\" />\n    <subscription href=\"https://your-subdomain.recurly.com/v2/subscriptions/315fbd7a25b04f1333ea9f4418994fb5\" />\n    <uuid>316a4213e8fa9e97390aff4995bda9e6</uuid>\n    <single_use type=\"boolean\">false</single_use>\n    <total_discounted_in_cents type=\"integer\">0</total_discounted_in_cents>\n    <currency>USD</currency>\n    <state>active</state>\n    <coupon_code>special</coupon_code>\n    <created_at type=\"datetime\">2016-06-15T17:13:30Z</created_at>\n    <updated_at type=\"datetime\">2016-06-15T17:13:30Z</updated_at>\n  </redemption>\n  <redemption href=\"https://your-subdomain.recurly.com/v2/accounts/1/redemptions/3169fd6127ff82ccbfa08a442188d575\">\n    <coupon href=\"https://your-subdomain.recurly.com/v2/coupons/special\" />\n    <account href=\"https://your-subdomain.recurly.com/v2/accounts/1\" />\n    <uuid>3169fd6127ff82ccbfa08a442188d575</uuid>\n    <single_use type=\"boolean\">false</single_use>\n    <total_discounted_in_cents type=\"integer\">1500</total_discounted_in_cents>\n    <currency>USD</currency>\n    <state>active</state>\n    <coupon_code>special</coupon_code>\n    <created_at type=\"datetime\">2016-05-27T12:34:56Z</created_at>\n\t\t<updated_at type=\"datetime\">2016-06-15T17:13:30Z</updated_at>\n  </redemption>\n</redemptions>"
      x-codeSamples:
      - lang: PHP
        source: "<?php\n\ntry {\n  $account = Recurly_Account::get('b6f5783');\n  if ($account->redemptions) {\n    $redemptions = $account->redemptions->get();\n    print \"Redemptions: $redemptions\";\n  }\n} catch (Recurly_NotFoundError $e) {\n  print \"Account not found: $e\";\n}"
      - lang: Ruby
        source: 'account = Recurly::Account.find(''1'')

          redemptions = account.redemptions'
      - lang: Python
        source: 'account = Account.get(''1'')

          redemptions = account.redemptions()'
      - lang: Dotnet
        source: 'var account = Accounts.Get("1");

          var redemptions = account.GetActiveRedemptions();'
    servers:
    - url: https://{subdomain}.{domain}/v2
      variables:
        subdomain:
          description: Subdomain of your Recurly site.
          default: my-super-successful-company
        domain:
          description: Domain of your Recurly site.
          default: recurly.com
  /invoices/{invoice_number}/redemptions:
    get:
      summary: List Invoice's Coupon Redemptions
      description: 'Returns all coupon redemptions that discounted the invoice.


        If you use the singular, "redemption", in the endpoint, you will only see the first redemption applied to the invoice.'
      tags:
      - coupon-redemptions
      operationId: listInvoicesCouponRedemptions
      parameters:
      - in: path
        name: invoice_number
        schema:
          type: string
          default: ''
        required: true
        description: Invoice number
      - in: query
        name: cursor
        schema:
          type: string
          default: ''
        description: Splits records across pages. Leave blank to return the first page. Follow the URI in the first page's Link header to fetch the next page.
      - in: query
        name: per_page
        schema:
          type: integer
          default: '50'
        description: Number of records to return per page, up to a maximum of 200.
      responses:
        '200':
          description: ''
          content:
            application/xml:
              example: "<redemptions type=\"array\">\n  <redemption href=\"https://your-subdomain.recurly.com/v2/accounts/1/redemptions/316a4213e8fa9e97390aff4995bda9e6\">\n    <coupon href=\"https://your-subdomain.recurly.com/v2/coupons/special\" />\n    <account href=\"https://your-subdomain.recurly.com/v2/accounts/1\" />\n    <subscription href=\"https://your-subdomain.recurly.com/v2/subscriptions/315fbd7a25b04f1333ea9f4418994fb5\" />\n    <uuid>316a4213e8fa9e97390aff4995bda9e6</uuid>\n    <single_use type=\"boolean\">false</single_use>\n    <total_discounted_in_cents type=\"integer\">100</total_discounted_in_cents>\n    <currency>USD</currency>\n    <state>active</state>\n    <coupon_code>special</coupon_code>\n    <created_at type=\"datetime\">2016-06-15T17:13:30Z</created_at>\n    <updated_at type=\"datetime\">2016-06-15T17:13:30Z</updated_at>\n  </redemption>\n  <redemption href=\"https://your-subdomain.recurly.com/v2/accounts/1/redemptions/3169fd6127ff82ccbfa08a442188d575\">\n    <coupon href=\"https://your-subdomain.recurly.com/v2/coupons/special\" />\n    <account href=\"https://your-subdomain.recurly.com/v2/accounts/1\" />\n    <uuid>3169fd6127ff82ccbfa08a442188d575</uuid>\n    <single_use type=\"boolean\">false</single_use>\n    <total_discounted_in_cents type=\"integer\">1500</total_discounted_in_cents>\n    <currency>USD</currency>\n    <state>active</state>\n    <coupon_code>special</coupon_code>\n    <created_at type=\"datetime\">2016-05-27T12:34:56Z</created_at>\n    <updated_at type=\"datetime\">2016-06-15T17:13:30Z</updated_at>\n  </redemption>\n</redemptions>"
      x-codeSamples:
      - lang: PHP
        source: "<?php\n\n$invoice = Recurly_Invoice::get('1');\nif($invoice->redemptions) {\n  $redemptions = $invoice->redemptions->get();\n}"
      - lang: Ruby
        source: 'invoice = Recurly::Invoice.find(''1'')

          redemptions = invoice.redemptions'
      - lang: Python
        source: 'invoice = Invoice.get(''1'')

          redemptions = invoice.redemptions()'
      - lang: Dotnet
        source: 'var invoice = Invoices.Get(1);

          var redemptions = invoice.GetRedemptions();'
    servers:
    - url: https://{subdomain}.{domain}/v2
      variables:
        subdomain:
          description: Subdomain of your Recurly site.
          default: my-super-successful-company
        domain:
          description: Domain of your Recurly site.
          default: recurly.com
  /subscriptions/{uuid}/redemptions:
    parameters:
    - $ref: '#/components/parameters/subscription_uuid'
    get:
      summary: List Subscription's Coupon Redemption
      description: Returns an array of active coupon redemptions associated with the specific subscription. Coupon redemptions are only associated with a subscription if the coupon has a discount level of "subscription". Inactive coupon redemptions will not be returned.
      tags:
      - coupon-redemptions
      operationId: listSubscriptionsCouponRedemption
      parameters:
      - in: query
        name: cursor
        schema:
          type: string
          default: ''
        description: Splits records across pages. Leave blank to return the first page. Follow the URI in the first page's Link header to fetch the next page.
      - in: query
        name: per_page
        schema:
          type: integer
          default: '50'
        description: Number of records to return per page, up to a maximum of 200.
      - in: path
        name: uuid
        schema:
          type: string
        required: true
        description: Uuid.
      responses:
        '200':
          description: ''
          content:
            application/xml:
              example: "<redemptions type=\"array\">\n  <redemption href=\"https://your-subdomain.recurly.com/v2/accounts/1/redemptions/376e95a50fd77b5da9a727411bab7c54\">\n    <coupon href=\"https://your-subdomain.recurly.com/v2/coupons/subscription_special\"/>\n    <account href=\"https://your-subdomain.recurly.com/v2/accounts/1\"/>\n    <subscription href=\"https://your-subdomain.recurly.com/v2/subscriptions/376e95a4e15229034db706494a8cf445\"/>\n    <uuid>376e95a50fd77b5da9a727411bab7c54</uuid>\n    <single_use type=\"boolean\">false</single_use>\n    <total_discounted_in_cents type=\"integer\">450</total_discounted_in_cents>\n    <currency>EUR</currency>\n    <state>active</state>\n    <coupon_code>subscription_special</coupon_code>\n    <created_at type=\"datetime\">2016-07-18T20:55:02Z</created_at>\n    <updated_at type=\"datetime\">2016-07-18T20:55:02Z</updated_at>\n  </redemption>\n</redemptions>"
      x-codeSamples:
      - lang: PHP
        source: '<?php


          $subscription = Recurly_Subscription::get(''376e95a4e15229034db706494a8cf445'');

          $redemptions = $subscription->redemptions->get();

          '
      - lang: Ruby
        source: 'subscription = Recurly::Subscription.find ''376e95a4e15229034db706494a8cf445''

          redemptions = subscription.redemptions'
      - lang: Python
        source: 'sub = recurly.Subscription.get(''376e95a4e15229034db706494a8cf445'')

          redemptions = sub.redemptions()'
      - lang: Dotnet
        source: 'var sub = Subscriptions.Get("376e95a4e15229034db706494a8cf445");

          var redemptions = sub.GetRedemptions();'
    servers:
    - url: https://{subdomain}.{domain}/v2
      variables:
        subdomain:
          description: Subdomain of your Recurly site.
          default: my-super-successful-company
        domain:
          description: Domain of your Recurly site.
          default: recurly.com
  /coupons/{coupon_code}/redeem:
    post:
      summary: Redeem Coupon on Account
      description: 'Redeem a coupon on an existing customer''s account to apply to their next invoice.


        If you want the coupon redemption to be rejected if a subscription signup fails, you must redeem the coupon within the Create Subscription call, not in the Redeem on Account call.


        ##### Redeeming Multiple Coupons

        If you have Multiple Coupons Per Account enabled in Coupon Settings, you can have multiple active redemptions on an account. Call this redeem endpoint multiple times to redeem more than one coupon.

        ##### Maxed Out Error

        If a coupon can only be redeemed on an account a specific number of times and you have already redeemed the coupon that number of times on the account, you will see a maxed out error letting you know the coupon can no longer be redeemed on the account.


        ```


        Coupon has reached max redemptions for this account


        ```


        The only way you would be able to redeem this coupon again on the account would be to update the main coupon campaign to allow more redemptions per account.

        ##### Subscription-Level Redemption

        If the coupon is subscription-level, meaning it has a redemption_resource of "subscription", you must specify the subscription_uuid of an existing subscription on the account that you want to tie the redemption to. Otherwise you will get this error:


        ```


        must be redeemed on a subscription


        ```


        If the subscription_uuid you provide is for a subscription with a plan not eligible for the coupon, you will see this error:


        ```


        not valid for this coupon


        ```'
      tags:
      - coupon-redemptions
      operationId: redeemCouponOnAccount
      parameters:
      - in: path
        name: coupon_code
        schema:
          type: string
          default: ''
        required: true
        description: Unique code to identify and redeem the coupon.
      requestBody:
        required: true
        content:
          application/xml:
            schema:
              type: object
              required:
              - account_code
              - currency
              properties:
                account_code:
                  type: integer
                  default: ''
                  description: Account code to apply redemption
                currency:
                  type: string
                  default: ''
                  description: Currency for the redemption.
                subscription_uuid:
                  type: string
                  default: ''
                  description: If the coupon has a `redemption_resource` of `subscription`, you will need to specify the uuid of an existing subscription on the account, which you want to tie the redemption to.
      responses:
        '201':
          description: ''
          content:
            application/xml:
              example: "<redemption href=\"https://your-subdomain.recurly.com/v2/accounts/1/redemptions/374a1c75374bd81493a3f7425db0a2b8\">\n  <coupon href=\"https://your-subdomain.recurly.com/v2/coupons/special\" />\n  <account href=\"https://your-subdomain.recurly.com/v2/accounts/1\" />\n  <uuid>374a1c75374bd81493a3f7425db0a2b8</uuid>\n  <single_use type=\"boolean\">true</single_use>\n  <total_discounted_in_cents type=\"integer\">0</total_discounted_in_cents>\n  <currency>USD</currency>\n  <state>active</state>\n  <coupon_code>special</coupon_code>\n  <created_at type=\"datetime\">2016-07-11T18:56:20Z</created_at>\n  <updated_at type=\"datetime\">2016-07-11T18:56:20Z</updated_at>\n</redemption>"
              schema:
                $ref: '#/components/schemas/Redemption'
        '400':
          description: Expired/Invalid
          content:
            application/xml:
              example: "<error>\n    <symbol>not_found</symbol>\n    <description lang=\"en-US\">Couldn't find Coupon with coupon_code = savemore</description>\n</error>"
      x-codeSamples:
      - lang: xml
        source: "<redemption>\n  <account_code>1</account_code>\n  <currency>USD</currency>\n</redemption>"
      - lang: PHP
        source: '<?php


          $coupon = Recurly_Coupon::get(''special'');

          $redemption = $coupon->redeemCoupon(''1'', ''USD'');'
      - lang: Ruby
        source: 'account = Recurly::Account.find(''1'')

          coupon = Recurly::Coupon.find(''special'')

          redemption = coupon.redeem(account)'
      - lang: Python
        source: 'coupon = Coupon.get(''special'')

          redemption = Redemption(account_code=''1'', currency=''USD'')


          # new redemption object returned from this method will contain the updates

          # so we overwrite the redemption variable

          redemption = coupon.redeem(redemption)'
      - lang: Dotnet
        source: 'var account = Accounts.Get("1");

          var redemption = account.RedeemCoupon("special", "USD");'
    servers:
    - url: https://{subdomain}.{domain}/v2
      variables:
        subdomain:
          description: Subdomain of your Recurly site.
          default: my-super-successful-company
        domain:
          description: Domain of your Recurly site.
          default: recurly.com
  /accounts/{account_code}/redemption:
    servers:
    - url: https://{subdomain}.recurly.com/v2
      variables:
        subdomain:
          description: Subdomain of your Recurly site.
          default: my-super-successful-company
    get:
      summary: Lookup a Coupon Redemption on an Account
      description: Lookup information about the 'active' coupon redemption on an account
      tags:
      - coupon-redemptions
      operationId: lookupACouponRedemptionOnAnAccount
      parameters:
      - in: query
        name: single_use
        schema:
          type: boolean
          default: ''
        required: false
        description: True if the coupon is valid for one use only
      - in: query
        name: total_discounted_in_cents
        schema:
          type: integer
          default: ''
        required: false
        description: Total amount saved by the coupon
      - in: query
        name: currency
        schema:
          type: string
          default: ''
        required: false
        description: Currency of the redemption
      - in: query
        name: state
        schema:
          type: string
          default: ''
        required: false
        description: State of the redemption
      - in: query
        name: created_at
        schema:
          type: string
          format: date-time
          default: ''
        required: false
        description: Date the coupon was redeemed
      - in: path
        name: account_code
        schema:
          type: string
        required: true
        description: Account Code.
      responses:
        '200':
          description: ''
          content:
            application/xml:
              example: "Status: 200 OK\nContent-Type: application/xml; charset=utf-8\n\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<redemption href=\"https://your-subdomain.recurly.com/v2/accounts/1/redemption\">\n  <coupon href=\"https://your-subdomain.recurly.com/v2/coupons/special\"/>\n  <account href=\"https://your-subdomain.recurly.com/v2/accounts/b6f5783\"/>\n  <single_use type=\"boolean\">false</single_use>\n  <total_discounted_in_cents type=\"integer\">0</total_discounted_in_cents>\n  <currency>USD</currency>\n  <state>active</state>\n  <created_at type=\"datetime\">2015-06-27T12:34:56Z</created_at>\n</redemption>"
      x-codeSamples:
      - lang: PHP
        source: "try {\n  $account = Recurly_Account::get('b6f5783');\n  if ($account->redemption) {\n    $redemption = $account->redemption->get();\n    print \"Redemption: $redemption\";\n  }\n} catch (Recurly_NotFoundError $e) {\n  print \"Account not found: $e\";\n}"
      - lang: Ruby
        source: 'account = Recurly::Account.find(''1'')

          redemption = account.redemption'
      - lang: Python
        source: 'account = Account.get(''1'')

          redemption = account.redemption()'
      - lang: Dotnet
        source: 'var account = Accounts.Get("1");

          var redemption = account.GetActiveRedemption();'
    delete:
      summary: Remove a Coupon from an Account
      description: 'Occasionally, you may want to remove a coupon from an account. Recurly will automatically remove coupons after they expire or are otherwise no longer valid for an account. If you want to remove a coupon from an account before it expires, you may use the examples below. Please note: the coupon will still count towards the "maximum redemption total" of a coupon.'
      tags:
      - coupon-redemptions
      operationId: removeACouponFromAnAccount
      parameters:
      - in: path
        name: account_code
        schema:
          type: string
        required: true
        description: Account Code.
      responses:
        '200':
          description: ''
          content:
            application/text:
              example: ''
      x-codeSamples:
      - lang: PHP
        source: '$redemption = Recurly_CouponRedemption::get(''account_code'');

          $redemption->delete();'
      - lang: Ruby
        source: 'account = Recurly::Account.find(''1'')

          redemption = account.redemption

          redemption.destroy'
      - lang: Python
        source: 'account = Account.get(''1'')

          redemption = account.redemption()

          redemption.delete()'
      - lang: Dotnet
        source: 'var account = Accounts.Get("1");

          var redemption = account.GetActiveRedemption();

          redemption.Delete();'
  /invoices/{invoice_number}/redemption:
    servers:
    - url: https://{subdomain}.recurly.com/v2
      variables:
        subdomain:
          description: Subdomain of your Recurly site.
          default: my-super-successful-company
    get:
      summary: Lookup a Coupon Redemption on an Invoice
      description: Lookup information about a coupon redemption applied to an invoice
      tags:
      - coupon-redemptions
      operationId: lookupACouponRedemptionOnAnInvoice
      parameters:
      - in: query
        name: single_use
        schema:
          type: boolean
          default: ''
        required: false
        description: True if the coupon is valid for one use only
      - in: query
        name: total_discounted_in_cents
        schema:
          type: integer
          default: ''
        required: false
        description: Total amount saved by the coupon
      - in: query
        name: currency
        schema:
          type: string
          default: ''
        required: false
        description: Currency of the redemption
      - in: query
        name: state
        schema:
          type: string
          default: ''
        required: false
        description: State of the redemption
      - in: query
        name: created_at
        schema:
          type: string
          format: date-time
          default: ''
        required: false
        description: Date the coupon was redeemed
      - in: path
        name: invoice_number
        schema:
          type: string
        required: true
        description: Invoice Number.
      responses:
        '200':
          description: ''
          content:
            application/xml:
              example: "Status: 200 OK\nContent-Type: application/xml; charset=utf-8\n\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<redemption href=\"https://your-subdomain.recurly.com/v2/accounts/1/redemption\">\n  <coupon href=\"https://your-subdomain.recurly.com/v2/coupons/special\"/>\n  <account href=\"https://your-subdomain.recurly.com/v2/accounts/1\"/>\n  <single_use type=\"boolean\">true</single_use>\n  <total_discounted_in_cents type=\"integer\">0</total_discounted_in_cents>\n  <currency>USD</currency>\n  <state>inactive</state>\n  <created_at type=\"datetime\">2011-06-27T12:34:56Z</created_at>\n</redemption>"
      x-codeSamples:
      - lang: PHP
        source: "$invoice = Recurly_Invoice::get('1');\nif($invoice->redemption) {\n  $redemption = $invoice->redemption->get();\n}"
      - lang: Ruby
        source: 'invoice = Recurly::Invoice.find(''1'')

          redemption = invoice.redemption'
      - lang: Python
        source: 'invoice = Invoice.get(''1'')

          redemption = invoice.redemption()'
      - lang: Dotnet
        source: 'var invoice = Invoices.Get(1);

          var redemption = invoice.GetRedemption();'
components:
  schemas:
    Redemption:
      type: object
      properties:
        account_code:
          type: string
          description: ''
        redemption_uuid:
          type: string
          description: ''
        coupon:
          type: string
          description: The link to the coupon used
        account:
          type: string
          description: The link to the account
        subscription:
          type: string
          description: The link to the subscription (only available if redeemed on a subscription)
        uuid:
          type: string
          description: The unique UUID referencing this redemption.
        single_use:
          type: boolean
          description: True if this is a single_use coupon
        total_discounted_in_cents:
          type: integer
          description: Total in cents for the discount issued with this redemption
        currency:
          type: string
          description: The currency used at the time of purchase
        state:
          type: string
          description: The state of the redemption. Can be `active` or `inactive`
        coupon_code:
          type: string
          description: The coupon code of the coupon used
        created_at:
          type: string
          format: date-time
          description: The datetime this redemption was created
        updated_at:
          type: string
          description: The datetime this redemption was last updated
  parameters:
    subscription_uuid:
      in: path
      name: uuid
      schema:
        type: string
      required: true
      description: Subscription's unique identifier.
  securitySchemes:
    api_key:
      type: http
      description: Enter the API key as the username and set the password to an empty string. You can locate and manage your API keys from the [API Credentials](https://app.recurly.com/go/developer/api_keys) page.
      scheme: basic
x-refined-from:
- recurly-v2-v2.29-api.yaml
- recurly-coupon-redemptions-api-openapi.yml
x-readme:
  explorer-enabled: false