iOS

iOS SubscriptionOfferCodeOneTimeUseCodes API

The SubscriptionOfferCodeOneTimeUseCodes API from iOS — 3 operation(s) for subscriptionoffercodeonetimeusecodes.

OpenAPI Specification

ios-subscriptionoffercodeonetimeusecodes-api-openapi.yml Raw ↑
openapi: 3.0.1
info:
  title: App Store Connect AccessibilityDeclarations SubscriptionOfferCodeOneTimeUseCodes API
  version: 4.3.1
  x-platforms:
    app_store_connect_api: App Store Connect API
  description: The App Store Connect API is the standards-based REST API Apple provides to automate tasks across App Store Connect, Xcode, and Certificates, Identifiers & Profiles. It covers apps, builds, TestFlight, in-app purchases, subscriptions, Game Center, Xcode Cloud, provisioning, pricing and availability, and the full reporting surface (analytics, sales and trends, financial reports, power and performance). This spec is the official OpenAPI 3.0 document published by Apple at https://developer.apple.com/app-store-connect/api/ — mirrored here unmodified except for title-cased operation summaries.
servers:
- url: https://api.appstoreconnect.apple.com/
security:
- itc-bearer-token: []
tags:
- name: SubscriptionOfferCodeOneTimeUseCodes
paths:
  /v1/subscriptionOfferCodeOneTimeUseCodes:
    post:
      tags:
      - SubscriptionOfferCodeOneTimeUseCodes
      operationId: subscriptionOfferCodeOneTimeUseCodes_createInstance
      requestBody:
        description: SubscriptionOfferCodeOneTimeUseCode representation
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SubscriptionOfferCodeOneTimeUseCodeCreateRequest'
        required: true
      responses:
        '400':
          description: Parameter error(s)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized error(s)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: Unprocessable request entity error(s)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '201':
          description: Single SubscriptionOfferCodeOneTimeUseCode
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubscriptionOfferCodeOneTimeUseCodeResponse'
        '409':
          description: Request entity error(s)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Rate limit exceeded error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      summary: Create Subscription Offer Code One Time Use Codes
  /v1/subscriptionOfferCodeOneTimeUseCodes/{id}:
    parameters:
    - name: id
      in: path
      description: the id of the requested resource
      schema:
        type: string
      style: simple
      required: true
    get:
      tags:
      - SubscriptionOfferCodeOneTimeUseCodes
      operationId: subscriptionOfferCodeOneTimeUseCodes_getInstance
      parameters:
      - name: fields[subscriptionOfferCodeOneTimeUseCodes]
        in: query
        description: the fields to include for returned resources of type subscriptionOfferCodeOneTimeUseCodes
        schema:
          type: array
          items:
            type: string
            enum:
            - numberOfCodes
            - createdDate
            - expirationDate
            - active
            - environment
            - offerCode
            - values
        style: form
        explode: false
        required: false
      - name: fields[subscriptionOfferCodes]
        in: query
        description: the fields to include for returned resources of type subscriptionOfferCodes
        schema:
          type: array
          items:
            type: string
            enum:
            - name
            - customerEligibilities
            - offerEligibility
            - duration
            - offerMode
            - numberOfPeriods
            - totalNumberOfCodes
            - productionCodeCount
            - sandboxCodeCount
            - active
            - autoRenewEnabled
            - subscription
            - oneTimeUseCodes
            - customCodes
            - prices
        style: form
        explode: false
        required: false
      - name: include
        in: query
        description: comma-separated list of relationships to include
        schema:
          type: array
          items:
            type: string
            enum:
            - offerCode
        style: form
        explode: false
        required: false
      responses:
        '400':
          description: Parameter error(s)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized error(s)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not found error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '200':
          description: Single SubscriptionOfferCodeOneTimeUseCode
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubscriptionOfferCodeOneTimeUseCodeResponse'
        '429':
          description: Rate limit exceeded error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      summary: Get Subscription Offer Code One Time Use Codes
    patch:
      tags:
      - SubscriptionOfferCodeOneTimeUseCodes
      operationId: subscriptionOfferCodeOneTimeUseCodes_updateInstance
      requestBody:
        description: SubscriptionOfferCodeOneTimeUseCode representation
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SubscriptionOfferCodeOneTimeUseCodeUpdateRequest'
        required: true
      responses:
        '400':
          description: Parameter error(s)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized error(s)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not found error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: Unprocessable request entity error(s)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '200':
          description: Single SubscriptionOfferCodeOneTimeUseCode
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubscriptionOfferCodeOneTimeUseCodeResponse'
        '409':
          description: Request entity error(s)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Rate limit exceeded error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      summary: Update Subscription Offer Code One Time Use Codes
  /v1/subscriptionOfferCodeOneTimeUseCodes/{id}/values:
    parameters:
    - name: id
      in: path
      description: the id of the requested resource
      schema:
        type: string
      style: simple
      required: true
    get:
      tags:
      - SubscriptionOfferCodeOneTimeUseCodes
      operationId: subscriptionOfferCodeOneTimeUseCodes_values_getToOneRelated
      parameters: []
      responses:
        '400':
          description: Parameter error(s)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized error(s)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not found error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '200':
          description: Single SubscriptionOfferCodeOneTimeUseCodeValue
          content:
            text/csv:
              schema:
                $ref: '#/components/schemas/csv'
        '429':
          description: Rate limit exceeded error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      summary: Get Related Subscription Offer Code One Time Use Codes / Values
components:
  schemas:
    SubscriptionOfferCodeOneTimeUseCode:
      type: object
      title: SubscriptionOfferCodeOneTimeUseCode
      properties:
        type:
          type: string
          enum:
          - subscriptionOfferCodeOneTimeUseCodes
        id:
          type: string
        attributes:
          type: object
          properties:
            numberOfCodes:
              type: integer
            createdDate:
              type: string
              format: date-time
            expirationDate:
              type: string
              format: date
            active:
              type: boolean
            environment:
              $ref: '#/components/schemas/OfferCodeEnvironment'
        relationships:
          type: object
          properties:
            offerCode:
              type: object
              properties:
                data:
                  type: object
                  properties:
                    type:
                      type: string
                      enum:
                      - subscriptionOfferCodes
                    id:
                      type: string
                  required:
                  - id
                  - type
            values:
              type: object
              properties:
                links:
                  $ref: '#/components/schemas/RelationshipLinks'
        links:
          $ref: '#/components/schemas/ResourceLinks'
      required:
      - id
      - type
    SubscriptionOfferDuration:
      type: string
      enum:
      - THREE_DAYS
      - ONE_WEEK
      - TWO_WEEKS
      - ONE_MONTH
      - TWO_MONTHS
      - THREE_MONTHS
      - SIX_MONTHS
      - ONE_YEAR
    SubscriptionOfferMode:
      type: string
      enum:
      - PAY_AS_YOU_GO
      - PAY_UP_FRONT
      - FREE_TRIAL
    ResourceLinks:
      type: object
      properties:
        self:
          type: string
          format: uri-reference
    ErrorSourceParameter:
      type: object
      title: Parameter
      properties:
        parameter:
          type: string
      required:
      - parameter
    ErrorLinks:
      type: object
      properties:
        about:
          type: string
          format: uri-reference
        associated:
          oneOf:
          - type: string
            format: uri-reference
          - type: object
            properties:
              href:
                type: string
                format: uri-reference
              meta:
                type: object
                properties:
                  source:
                    type: string
    csv:
      type: string
    DocumentLinks:
      type: object
      properties:
        self:
          type: string
          format: uri-reference
      required:
      - self
    SubscriptionOfferCodeOneTimeUseCodeUpdateRequest:
      type: object
      title: SubscriptionOfferCodeOneTimeUseCodeUpdateRequest
      properties:
        data:
          type: object
          properties:
            type:
              type: string
              enum:
              - subscriptionOfferCodeOneTimeUseCodes
            id:
              type: string
            attributes:
              type: object
              properties:
                active:
                  type: boolean
                  nullable: true
          required:
          - id
          - type
      required:
      - data
    ErrorResponse:
      type: object
      properties:
        errors:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
              status:
                type: string
              code:
                type: string
              title:
                type: string
              detail:
                type: string
              source:
                oneOf:
                - $ref: '#/components/schemas/ErrorSourcePointer'
                - $ref: '#/components/schemas/ErrorSourceParameter'
              links:
                $ref: '#/components/schemas/ErrorLinks'
              meta:
                type: object
                additionalProperties: {}
            required:
            - code
            - detail
            - status
            - title
    RelationshipLinks:
      type: object
      properties:
        self:
          type: string
          format: uri-reference
        related:
          type: string
          format: uri-reference
    SubscriptionOfferCodeOneTimeUseCodeCreateRequest:
      type: object
      title: SubscriptionOfferCodeOneTimeUseCodeCreateRequest
      properties:
        data:
          type: object
          properties:
            type:
              type: string
              enum:
              - subscriptionOfferCodeOneTimeUseCodes
            attributes:
              type: object
              properties:
                numberOfCodes:
                  type: integer
                expirationDate:
                  type: string
                  format: date
                environment:
                  nullable: true
                  $ref: '#/components/schemas/OfferCodeEnvironment'
              required:
              - numberOfCodes
              - expirationDate
            relationships:
              type: object
              properties:
                offerCode:
                  type: object
                  properties:
                    data:
                      type: object
                      properties:
                        type:
                          type: string
                          enum:
                          - subscriptionOfferCodes
                        id:
                          type: string
                      required:
                      - id
                      - type
                  required:
                  - data
              required:
              - offerCode
          required:
          - relationships
          - attributes
          - type
      required:
      - data
    ErrorSourcePointer:
      type: object
      title: JsonPointer
      properties:
        pointer:
          type: string
      required:
      - pointer
    SubscriptionCustomerEligibility:
      type: string
      enum:
      - NEW
      - EXISTING
      - EXPIRED
    SubscriptionOfferCodeOneTimeUseCodeResponse:
      type: object
      title: SubscriptionOfferCodeOneTimeUseCodeResponse
      properties:
        data:
          $ref: '#/components/schemas/SubscriptionOfferCodeOneTimeUseCode'
        included:
          type: array
          items:
            $ref: '#/components/schemas/SubscriptionOfferCode'
        links:
          $ref: '#/components/schemas/DocumentLinks'
      required:
      - data
      - links
    OfferCodeEnvironment:
      type: string
      enum:
      - PRODUCTION
      - SANDBOX
    PagingInformation:
      type: object
      properties:
        paging:
          type: object
          properties:
            total:
              type: integer
            limit:
              type: integer
            nextCursor:
              type: string
          required:
          - limit
      required:
      - paging
    SubscriptionOfferEligibility:
      type: string
      enum:
      - STACK_WITH_INTRO_OFFERS
      - REPLACE_INTRO_OFFERS
    SubscriptionOfferCode:
      type: object
      title: SubscriptionOfferCode
      properties:
        type:
          type: string
          enum:
          - subscriptionOfferCodes
        id:
          type: string
        attributes:
          type: object
          properties:
            name:
              type: string
            customerEligibilities:
              type: array
              items:
                $ref: '#/components/schemas/SubscriptionCustomerEligibility'
            offerEligibility:
              $ref: '#/components/schemas/SubscriptionOfferEligibility'
            duration:
              $ref: '#/components/schemas/SubscriptionOfferDuration'
            offerMode:
              $ref: '#/components/schemas/SubscriptionOfferMode'
            numberOfPeriods:
              type: integer
            totalNumberOfCodes:
              type: integer
            productionCodeCount:
              type: integer
            sandboxCodeCount:
              type: integer
            active:
              type: boolean
            autoRenewEnabled:
              type: boolean
        relationships:
          type: object
          properties:
            subscription:
              type: object
              properties:
                data:
                  type: object
                  properties:
                    type:
                      type: string
                      enum:
                      - subscriptions
                    id:
                      type: string
                  required:
                  - id
                  - type
            oneTimeUseCodes:
              type: object
              properties:
                links:
                  $ref: '#/components/schemas/RelationshipLinks'
                meta:
                  $ref: '#/components/schemas/PagingInformation'
                data:
                  type: array
                  items:
                    type: object
                    properties:
                      type:
                        type: string
                        enum:
                        - subscriptionOfferCodeOneTimeUseCodes
                      id:
                        type: string
                    required:
                    - id
                    - type
            customCodes:
              type: object
              properties:
                links:
                  $ref: '#/components/schemas/RelationshipLinks'
                meta:
                  $ref: '#/components/schemas/PagingInformation'
                data:
                  type: array
                  items:
                    type: object
                    properties:
                      type:
                        type: string
                        enum:
                        - subscriptionOfferCodeCustomCodes
                      id:
                        type: string
                    required:
                    - id
                    - type
            prices:
              type: object
              properties:
                links:
                  $ref: '#/components/schemas/RelationshipLinks'
                meta:
                  $ref: '#/components/schemas/PagingInformation'
                data:
                  type: array
                  items:
                    type: object
                    properties:
                      type:
                        type: string
                        enum:
                        - subscriptionOfferCodePrices
                      id:
                        type: string
                    required:
                    - id
                    - type
        links:
          $ref: '#/components/schemas/ResourceLinks'
      required:
      - id
      - type
  securitySchemes:
    itc-bearer-token:
      type: http
      scheme: bearer
      bearerFormat: JWT