openapi: 3.0.3
servers:
  - description: Sandbox Server.
    url: https://api-sandbox.rebilly.com
  - description: Live Server.
    url: https://api.rebilly.com
info:
  contact:
    email: integrations@rebilly.com
    name: Rebilly API Support
    url: https://www.rebilly.com/contact/
  description: >
    # Introduction

    The Rebilly API is built on HTTP.  Our API is RESTful.  It has predictable

    resource URLs.  It returns HTTP response codes to indicate errors.  It also

    accepts and returns JSON in the HTTP body.  You can use your favorite

    HTTP/REST library for your programming language to use Rebilly's API, or

    you can use one of our SDKs (currently available in [PHP](https://github.com/Rebilly/rebilly-php)

    and [Javascript](https://github.com/Rebilly/rebilly-js-sdk)).


    We have other APIs that are also available.  Every action from our [app](https://app.rebilly.com)

    is supported by an API which is documented and available for use so that you

    may automate any workflows necessary.  This document contains the most commonly

    integrated resources.


    # Authentication


    When you sign up for an account, you are given your first secret API key.

    You can generate additional API keys, and delete API keys (as you may

    need to rotate your keys in the future). You authenticate to the

    Rebilly API by providing your secret key in the request header.


    Rebilly offers three forms of authentication:  secret key, publishable key, JSON Web Tokens, and public signature key.

    - [Secret API key](#section/Authentication/SecretApiKey): used for requests made
      from the server side. Never share these keys. Keep them guarded and secure.
    - [Publishable API key](#section/Authentication/PublishableApiKey): used for 
      requests from the client side. For now can only be used to create 
      a [Payment Token](#operation/PostToken) and 
      a [File token](#operation/PostFile).
    - [JWT](#section/Authentication/JWT): short lifetime tokens that can be assigned a specific expiration time.


    Never share your secret keys. Keep them guarded and secure.


    &lt;!-- ReDoc-Inject: &lt;security-definitions&gt; --&gt;


    # Errors

    Rebilly follow's the error response format proposed in [RFC 7807](https://tools.ietf.org/html/rfc7807) also known as Problem Details for HTTP APIs.  As with our normal API responses, your client must be prepared to gracefully handle additional members of the response.


    ## Forbidden

    &lt;RedocResponse pointer={"#/components/responses/Forbidden"} /&gt;


    ## Conflict

    &lt;RedocResponse pointer={"#/components/responses/Conflict"} /&gt;


    ## NotFound

    &lt;RedocResponse pointer={"#/components/responses/NotFound"} /&gt;


    ## Unauthorized

    &lt;RedocResponse pointer={"#/components/responses/Unauthorized"} /&gt;


    ## ValidationError

    &lt;RedocResponse pointer={"#/components/responses/ValidationError"} /&gt;


    # SDKs


    Rebilly offers a Javascript SDK and a PHP SDK to help interact with

    the API.  However, no SDK is required to use the API.


    Rebilly also offers [FramePay](https://docs.rebilly.com/docs/developer-docs/framepay/),
     a client-side iFrame-based solution to help
    create payment tokens while minimizing PCI DSS compliance burdens

    and maximizing the customizability. [FramePay](https://docs.rebilly.com/docs/developer-docs/framepay/)

    is interacting with the [payment tokens creation operation](#operation/PostToken).


    ## Javascript SDK


    Installation and usage instructions can be found [here](https://docs.rebilly.com/docs/developer-docs/sdks).

    SDK code examples are included in these docs.


    ## PHP SDK

    For all PHP SDK examples provided in these docs you will need to configure the `$client`.

    You may do it like this:


    ```php

    $client = new Rebilly\Client([
        'apiKey' =&gt; 'YourApiKeyHere',
        'baseUrl' =&gt; 'https://api.rebilly.com',
    ]);

    ```


    # Using filter with collections

    Rebilly provides collections filtering. You can use `?filter` param on collections to define which records should be shown in the response.


    Here is filter format description:


    - Fields and values in filter are separated with `:`: `?filter=firstName:John`.


    - Sub-fields are separated with `.`: `?filter=billingAddress.country:US`.


    - Multiple filters are separated with `;`: `?filter=firstName:John;lastName:Doe`. They will be joined with `AND` logic. In this example: `firstName:John` AND `lastName:Doe`.


    - You can use multiple values using `,` as values separator: `?filter=firstName:John,Bob`. Multiple values specified for a field will be joined with `OR` logic. In this example: `firstName:John` OR `firstName:Bob`.


    - To negate the filter use `!`: `?filter=firstName:!John`. Note that you can negate multiple values like this: `?filter=firstName:!John,!Bob`. This filter rule will exclude all Johns and Bobs from the response.


    - You can use range filters like this: `?filter=amount:1..10`.


    - You can use gte (greater than or equals) filter like this: `?filter=amount:1..`, or lte (less than or equals) than filter like this: `?filter=amount:..10`. This also works for datetime-based fields.


    - You can create some [predefined values lists](https://user-api-docs.rebilly.com/#tag/Lists) and use them in filter: `?filter=firstName:@yourListName`. You can also exclude list values: `?filter=firstName:!@yourListName`.


    - Datetime-based fields accept values formatted using RFC 3339 like this: `?filter=createdTime:2021-02-14T13:30:00Z`. 


    # Expand to include embedded objects

    Rebilly provides the ability to pre-load additional 

    objects with a request. 


    You can use `?expand` param on most requests to expand

    and include embedded objects within the

    `_embedded` property of the response.


    The `_embedded` property contains an array of 

    objects keyed by the expand parameter value(s).


    You may expand multiple objects by passing them

    as comma-separated to the expand value like so:


    ```

    ?expand=recentInvoice,customer

    ```


    And in the response, you would see:


    ```

    "_embedded": [
        "recentInvoice": {...},
        "customer": {...}
    ]

    ```

    Expand may be utilitized not only on `GET` requests but also on `PATCH`, `POST`, `PUT` requests too.



    # Getting started guide


    Rebilly's API has over 300 operations.  That's more than you'll 

    need to implement your use cases.  If you have a use 

    case you would like to implement, please consult us for

    feedback on the best API operations for the task.


    Our getting started guide will demonstrate a basic order form use

    case.  It will allow us to highlight core resources

    in Rebilly that will be helpful for many other use cases

    too.


    Within 25 minutes, you'll have sent API requests (via our console)

    to create a subscription order.
  license:
    name: Rebilly
    url: https://www.rebilly.com/api-license/
  termsOfService: https://www.rebilly.com/terms-of-use/
  title: Rebilly REST API
  version: "2.1"
  x-apisguru-categories:
    - payment
    - ecommerce
  x-logo:
    backgroundColor: "#0033A0"
    url: https://rebilly-core.redoc.ly/rb_apiLogo.svg
  x-origin:
    - format: openapi
      url: https://api-reference.rebilly.com/openapi.json
      version: "3.0"
  x-providerName: rebilly.com
security:
  - SecretApiKey: []
  - JWT: []
tags:
  - description: |
      3D Secure is a way to authenticate and protect transactions.  Typically,
      it's only possible to protect the initial transaction in an order
      with 3D Secure.
    name: 3D Secure
  - description: >
      AML, also known as Anti-Money-Laundering is an endpoint that
      searches multiple

      PEP, Sanctions, and Adverse Media lists for listed identities or media for screening

      purposes. Used during some transaction processing and on Contact creation, it helps

      determine whether someone is blocklisted or has political or economic sanctions against

      them.
    name: AML
  - description: |
      Bank Accounts are a type of payment instrument used to collect
      ACH (echeck) payments, similar to how a payment
      card would be used to for a credit card payment.
    name: Bank Accounts
  - description: |
      Your blocklists contains values of customerIds, email addresses,
      ipAddresses, bank identification numbers, countries or payment cards that
      you do NOT want to do business with. They are a good tool for managing
      risk. A blocklist entry that expires after a period of time we call a
      greylist.
    name: Blocklists
  - description: >
      Coupons allows to apply different types of discounts to Invoices,
      Orders and Plans. Redeemed Coupons will be applied only to Invoices with
      the same currency.
    name: Coupons
  - description: |
      Customers are your customers, sometimes known as accounts, clients,
      members, patrons, or players in other systems.
    name: Customers
  - description: >
      The customers timeline keeps an audit trail of changes and activity
      for each customer.
    name: Customers Timeline
  - description: >
      Customer KYC files uploaded on behalf of a customer, tagged with a
      document type and submitted for validation.
    name: KYC Documents
  - description: >
      Create authentication credentials, login, logout, and verify your
      customers.
    name: Customer Authentication
  - description: |
      Create additional custom fields for particular resources.  You may name,
      describe, and determine the type of the schema.
    name: Custom Fields
  - description: |
      Handle disputes (chargebacks and retrievals).
    name: Disputes
  - description: >
      A File is an entity that can store a physical file and some
      metadata. It also provides an easy access to

      its size, mime-type, user-defined tags and description thus allowing easy sorting and searching among stored

      files.

      There are several methods of file uploading available: multipart/form-data encoded form, RAW POST (by sending

      file contents as POST body), fetching from URL (by providing the file URL via 'url' param)

      Attachment is an entity that is used to link a File to one or multiple objects like Customer, Dispute, Payment,

      Transaction, Order, Plan, Product, Invoice, Note. That allows to quickly find and use files related to

      those specific entities.
    name: Files
  - description: >
      Invoices leave a record for both you and your customer of the
      products sold.
    name: Invoices
  - description: >
      The Payment Instrument allows you to accept a variety of payment
      methods through a single API.
    name: Payment Instruments
  - description: >
      Payment cards are a type of payment instrument used for credit and
      debit card

      sales.  Rebilly securely vaults the full payment card number, and can pass it

      onward securely to any gateway account to transact business.
    name: Payment Cards
  - description: >
      PayPal Accounts are used for paying with PayPal.  We can generate a
      BAID (billing

      agreement id) which will allow for recurring billing.
    name: PayPal Accounts
  - description: >
      Payment tokens are used to reduce the scope of PCI DSS
      compliance.  A payment

      token can be made using a different authentication scheme (refer to the public key

      authentication scheme in the Authentication section), which allows you to

      create a payment token directly from the browser, bypassing the need to send

      sensitive cardholder info to your servers.  We recommend using this with our

      Rebilly.js library, which helps you wire a form into this API resource and create

      payment tokens.
    name: Payment Tokens
  - description: >
      Plans are a template for making a subscription.  For example, you
      may have a plan

      that has a 30-day free trial followed by a recurring charge of $19.95 per month

      until canceled.  The combination of the plan and a request to make an order

      will apply those instructions to create the invoices according to the plan's

      schedule.
    name: Plans
  - description: |
      A product describes what you sell (goods or services).
      A product determines how what you sell appears on invoices and receipts.
      The pricing for products is set in Plans.  One product can have many
      plans.
    name: Products
  - description: >
      The Rebilly Reporting API is currently experimental. You may see

      the [Reports API Documentation here](https://reports-api-docs.rebilly.com).
    name: Reports
  - description: |
      Search data including customers, invoices, orders, transactions and more.
    name: Search
  - description: >
      A shipping zone contains regions and countries that you ship to.
      Each shipping zone has its own shipping rates.
    name: Shipping Zones
  - description: >
      An order applies a plan's template to create invoice(s) for a
      customer, optionally at the appropriate scheduled intervals. A
      subscription order may also determine if the payment is collected
      automatically (with autopay set true).
    name: Orders
  - description: |
      Tag customers to better organize your data.
    name: Tags
  - description: |
      You can map a product to a tax category.  The tax category is used by
      tax providers to calculate taxes for invoices.
    name: Taxes
  - description: |
      Get and refund transactions.
    name: Transactions
  - description: >
      The Rebilly User API is primarily for our GUI apps.  You may see

      the [User API Documentation here](https://user-api-docs.rebilly.com).

      A User represents a person who can login to Rebilly, and take actions subject to

      their granted permissions.  It has resources less commonly integrated by

      3rd parties.
    name: Users
paths:
  /3dsecure:
    get:
      operationId: Get3DSecureCollection
      parameters:
        - $ref: "#/components/parameters/collectionLimit"
        - $ref: "#/components/parameters/collectionOffset"
      responses:
        "200":
          content:
            application/json:
              schema:
                items:
                  $ref: "#/components/schemas/ThreeDSecure"
                type: array
          description: A list was retrieved successfully.
          headers:
            Pagination-Limit:
              $ref: "#/components/headers/Pagination-Limit"
            Pagination-Offset:
              $ref: "#/components/headers/Pagination-Offset"
            Pagination-Total:
              $ref: "#/components/headers/Pagination-Total"
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
      summary: Retrieve a list of ThreeDSecure entries
      tags:
        - 3D Secure
      x-code-samples:
        - lang: JavaScript
          source: >-
            // all parameters are optional

            const firstCollection = await api.threeDSecure.getAll();


            // alternatively you can specify one or more of them

            const params = {limit: 20, offset: 100}; 

            const secondCollection = await api.threeDSecure.getAll(params);


            // access the collection items, each item is a Member

            secondCollection.items.forEach(entry =&gt; console.log(entry.fields.customerId));
      x-sdk-operation-name: getAll
    parameters:
      - $ref: "#/components/parameters/organizationId"
    post:
      description: |
        Create a ThreeDSecure entry.
      operationId: Post3DSecure
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ThreeDSecure"
        description: ThreeDSecure resource.
        required: true
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ThreeDSecure"
          description: ThreeDSecure entry was created.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "422":
          $ref: "#/components/responses/ValidationError"
      summary: Create a ThreeDSecure entry
      tags:
        - 3D Secure
      x-code-samples:
        - lang: JavaScript
          source: |-
            // first set the properties for the new entry
            const data = {
                customerId: 'foobar-001',
                websiteId: 'my-website-id',
                paymentCardId: 'a-certain-card-id',
                gatewayAccountId: 'main-gateway-id',
                enrolled: 'Y',
                // enrollment electronic 
                // commerce indicator
                enrollmentEci: 'abc',
                // electronic commerce indicator
                eci: 0,
                // cardholder authentication verification value
                cavv: '1234',
                // transaction Id
                xid: 'er9349gju09u40394guj',
                payerAuthResponseStatus: 'Y',
                signatureVerification: 'Y',
                amount: 12.99,
                currency: 'USD'
            };

            const entry = await api.threeDSecure.create({data});
      x-sdk-operation-name: create
  "/3dsecure/{id}":
    get:
      description: |
        Retrieve a ThreeDSecure entry with specified identifier string.
      operationId: Get3DSecure
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ThreeDSecure"
          description: ThreeDSecure entry was retrieved successfully.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "404":
          $ref: "#/components/responses/NotFound"
      summary: Retrieve a ThreeDSecure entry
      tags:
        - 3D Secure
      x-code-samples:
        - lang: JavaScript
          source: |-
            const entry = await api.threeDSecure.get({id: 'foobar-001'});
            console.log(entry.fields.customerId);
      x-sdk-operation-name: get
    parameters:
      - $ref: "#/components/parameters/resourceId"
      - $ref: "#/components/parameters/organizationId"
  /aml:
    get:
      description: >
        Search multiple PEP/Sanctions/Adverse Media lists with first and
        last name to find any blocklisted identities.

        Performs a fuzzy search including soundex. Not all fields are guaranteed to be filled.
      operationId: GetAmlEntry
      parameters:
        - $ref: "#/components/parameters/organizationId"
        - description: First name of individual to search.
          in: query
          name: firstName
          required: true
          schema:
            type: string
        - description: Last name of individual to search.
          in: query
          name: lastName
          required: true
          schema:
            type: string
        - description: Date of birth in format YYYY-MM-DD.
          in: query
          name: dob
          required: false
          schema:
            type: string
        - description: Country of individual as an ISO Alpha-2 code.
          in: query
          name: country
          required: false
          schema:
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                items:
                  $ref: "#/components/schemas/AML"
                type: array
          description: An array of objects representing hits, or an empty array if none
            are found.
          headers:
            Pagination-Limit:
              $ref: "#/components/headers/Pagination-Limit"
            Pagination-Offset:
              $ref: "#/components/headers/Pagination-Offset"
            Pagination-Total:
              $ref: "#/components/headers/Pagination-Total"
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
      summary: Search PEP/Sanctions/Adverse Media lists
      tags:
        - AML
      x-sdk-operation-name: getAll
    parameters:
      - $ref: "#/components/parameters/organizationId"
  /attachments:
    get:
      description: >
        Retrieve a list of attachments.

        You may sort by the id, name, relatedId, relatedType, fileId, createdTime, and updatedTime.
      operationId: GetAttachmentCollection
      parameters:
        - $ref: "#/components/parameters/collectionLimit"
        - $ref: "#/components/parameters/collectionOffset"
        - $ref: "#/components/parameters/collectionFilter"
        - $ref: "#/components/parameters/collectionQuery"
        - $ref: "#/components/parameters/collectionExpand"
        - $ref: "#/components/parameters/collectionFields"
        - $ref: "#/components/parameters/collectionSort"
      responses:
        "200":
          content:
            application/json:
              schema:
                items:
                  $ref: "#/components/schemas/Attachment"
                type: array
          description: A list of Attachments was retrieved successfully.
          headers:
            Pagination-Limit:
              $ref: "#/components/headers/Pagination-Limit"
            Pagination-Offset:
              $ref: "#/components/headers/Pagination-Offset"
            Pagination-Total:
              $ref: "#/components/headers/Pagination-Total"
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
      summary: Retrieve a list of Attachments
      tags:
        - Files
      x-code-samples:
        - lang: PHP
          source: |
            $attachments = $client-&gt;attachments()-&gt;search([
                'filter' =&gt; 'relatedType:customer',
            ]);
        - lang: JavaScript
          source: >-
            // all parameters are optional

            const firstCollection = await api.files.getAllAttachments();


            // alternatively you can specify one or more of them

            const params = {limit: 20, offset: 100, sort: '-createdTime'}; 

            const secondCollection = await api.files.getAllAttachments(params);


            // access the collection items, each item is a Member

            secondCollection.items.forEach(attachment =&gt; console.log(attachment.fields.relatedType));
      x-sdk-operation-name: getAllAttachments
    parameters:
      - $ref: "#/components/parameters/organizationId"
    post:
      description: |
        Create an Attachment.
      operationId: PostAttachment
      requestBody:
        $ref: "#/components/requestBodies/Attachment"
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Attachment"
          description: Attachment was created.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "409":
          $ref: "#/components/responses/Conflict"
        "422":
          $ref: "#/components/responses/ValidationError"
      summary: Create an Attachment
      tags:
        - Files
      x-code-samples:
        - lang: PHP
          source: >
            $attachmentForm = new Rebilly\Entities\Attachment();

            $attachmentForm-&gt;setFileId('fileId');

            $attachmentForm-&gt;setRelatedType($attachmentForm::TYPE_CUSTOMER);

            $attachmentForm-&gt;setRelatedId('customerId');


            try {
                $attachment = $client-&gt;attachments()-&gt;create($attachmentForm);
            } catch (UnprocessableEntityException $e) {
                echo $e-&gt;getMessage();
            }
        - lang: JavaScript
          source: |-
            // define the attachment
            const data = {
                // previously uploaded file ID
                fileId: 'my-file-id',
                relatedType: 'customer',
                relatedId: 'my-customer-id',
                name: 'an attachment',
                description: `the customer's file`
            };

            const attachment = await api.files.attach({data});
            console.log(attachment.fields.id);
      x-sdk-operation-name: attach
  "/attachments/{id}":
    delete:
      description: |
        Delete the Attachment with predefined identifier string.
      operationId: DeleteAttachment
      responses:
        "204":
          description: Attachment was deleted.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "404":
          $ref: "#/components/responses/NotFound"
      summary: Delete an Attachment
      tags:
        - Files
      x-code-samples:
        - lang: PHP
          source: |
            $client-&gt;attachments()-&gt;delete('attachmentId');
        - lang: JavaScript
          source: |-
            const request = await api.files.detach({id: 'my-attachment-id'});

            // the request does not return any fields but
            // you can confirm the success using the status code
            console.log(request.response.status); // 204
      x-sdk-operation-name: detach
    get:
      description: |
        Retrieve a Attachment with specified identifier string.
      operationId: GetAttachment
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Attachment"
          description: Attachment was retrieved successfully.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "404":
          $ref: "#/components/responses/NotFound"
      summary: Retrieve an Attachment
      tags:
        - Files
      x-code-samples:
        - lang: PHP
          source: |
            $attachment = $client-&gt;attachments()-&gt;load('attachmentId');
        - lang: JavaScript
          source: >-
            const attachment = await api.files.getAttachment({id: 'foobar-001'});

            console.log(attachment.fields.relatedType);
      x-sdk-operation-name: getAttachment
    parameters:
      - $ref: "#/components/parameters/resourceId"
      - $ref: "#/components/parameters/organizationId"
    put:
      description: |
        Update the Attachment with predefined ID.
      operationId: PutAttachment
      requestBody:
        $ref: "#/components/requestBodies/Attachment"
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Attachment"
          description: Attachment was updated.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Attachment"
          description: Attachment was created.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "404":
          $ref: "#/components/responses/NotFound"
        "409":
          $ref: "#/components/responses/Conflict"
        "422":
          $ref: "#/components/responses/ValidationError"
      summary: Update the Attachment with predefined ID
      tags:
        - Files
      x-code-samples:
        - lang: PHP
          source: >
            $attachmentForm = new Rebilly\Entities\Attachment();

            $attachmentForm-&gt;setFileId('fileId');

            $attachmentForm-&gt;setRelatedType($attachmentForm::TYPE_CUSTOMER);

            $attachmentForm-&gt;setRelatedId('customerId');


            try {
                $attachment = $client-&gt;attachments()-&gt;update('attachmentId', $attachmentForm);
            } catch (UnprocessableEntityException $e) {
                echo $e-&gt;getMessage();
            }
        - lang: JavaScript
          source: >-
            // define the values to update

            const data = {
                relatedType: 'customer',
                relatedId: 'my-customer-id',
                name: 'an attachment',
                description: `the customer's file`
            };


            const attachment = await api.files.updateAttachment({id: 'foobar-001', data});
      x-sdk-operation-name: updateAttachment
  /authentication-options:
    get:
      description: |
        Read current authentication options.
      operationId: GetAuthenticationOption
      responses:
        "200":
          content:
            application/json:
              schema:
                items:
                  $ref: "#/components/schemas/AuthenticationOptions"
                type: array
          description: Current authentication options was retrieved successfully.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
      summary: Read current authentication options
      tags:
        - Customer Authentication
      x-code-samples:
        - lang: PHP
          source: >
            $authenticationOptions = $client-&gt;authenticationOptions()-&gt;load();
        - lang: JavaScript
          source: |-
            const options = await api.customerAuthentication.getAuthOptions();
            console.log(options.fields.credentialTtl);
      x-sdk-operation-name: getAuthOptions
    parameters:
      - $ref: "#/components/parameters/organizationId"
    put:
      description: |
        Change options.
      operationId: PutAuthenticationOption
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/AuthenticationOptions"
        description: Authentication Options resource.
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AuthenticationOptions"
          description: Authentication Options were updated.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "422":
          $ref: "#/components/responses/ValidationError"
      summary: Change authentication options
      tags:
        - Customer Authentication
      x-code-samples:
        - lang: PHP
          source: >
            $authenticationOptionsForm = new
            Rebilly\Entities\AuthenticationOptions();

            // Regular expression below matches any password with 6+ length that contains alphabet symbols and/or numbers.

            $authenticationOptionsForm-&gt;setPasswordPattern('/^[a-zA-Z0-9]{6,}$/');


            try {
                $authenticationOptions = $client-&gt;authenticationOptions()-&gt;update($authenticationOptionsForm);
            } catch (UnprocessableEntityException $e) {
                echo $e-&gt;getMessage();
            }
        - lang: JavaScript
          source: >-
            // first set the properties for the authentication options

            const data = {
                passwordPattern: null,
                credentialTtl: 10,
                authTokenTtl: 20,
                resetTokenTtl: 30
            };


            const options = await api.customerAuthentication.updateAuthOptions({data});

            console.log(options.fields.credentialTtl);
      x-sdk-operation-name: updateAuthOptions
  /authentication-tokens:
    get:
      description: |
        Retrieve a list of auth tokens.
      operationId: GetAuthenticationTokenCollection
      parameters:
        - $ref: "#/components/parameters/collectionLimit"
        - $ref: "#/components/parameters/collectionOffset"
      responses:
        "200":
          content:
            application/json:
              schema:
                items:
                  $ref: "#/components/schemas/AuthenticationToken"
                type: array
          description: A list of auth tokens was retrieved successfully.
          headers:
            Pagination-Limit:
              $ref: "#/components/headers/Pagination-Limit"
            Pagination-Offset:
              $ref: "#/components/headers/Pagination-Offset"
            Pagination-Total:
              $ref: "#/components/headers/Pagination-Total"
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
      summary: Retrieve a list of auth tokens
      tags:
        - Customer Authentication
      x-code-samples:
        - lang: PHP
          source: >
            $authenticationTokens = $client-&gt;authenticationTokens()-&gt;search([
                'filter' =&gt; 'customerId:testCustomer',
            ]);
        - lang: JavaScript
          source: >-
            // all parameters are optional

            const firstCollection = await api.customerAuthentication.getAllAuthTokens();


            // alternatively you can specify one or more of them

            const params = {limit: 20, offset: 100}; 

            const secondCollection = await api.customerAuthentication.getAllAuthTokens(params);


            // access the collection items, each item is a Member

            secondCollection.items.forEach(token =&gt; console.log(token.fields.username));
      x-sdk-operation-name: getAllAuthTokens
    parameters:
      - $ref: "#/components/parameters/organizationId"
    post:
      description: |
        Login a customer.
      operationId: PostAuthenticationToken
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/AuthenticationToken"
        description: AuthenticationToken resource.
        required: true
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AuthenticationToken"
          description: Login successful.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "422":
          $ref: "#/components/responses/ValidationError"
      security:
        - SecretApiKey: []
        - JWT: []
        - PublishableApiKey: []
      summary: Login
      tags:
        - Customer Authentication
      x-code-samples:
        - lang: PHP
          source: >
            $authenticationForm = new Rebilly\Entities\AuthenticationToken();

            $authenticationForm-&gt;setUsername('username');

            $authenticationForm-&gt;setPassword('test123');


            try {
                $authenticationToken = $client-&gt;authenticationTokens()-&gt;login($authenticationForm);
            } catch (UnprocessableEntityException $e) {
                echo $e-&gt;getMessage();
            }
        - lang: JavaScript
          source: |-
            const data = {
                username: 'foobar',
                password: 'fuubar'

                // optionally you can define an `expiredTime` to 
                // limit the duration of the session token

                //expiredTime: '2017-09-18T19:17:39Z'
            };
            const session = await api.customerAuthentication.login({data});
            console.log(session.fields.token);
      x-sdk-operation-name: login
  "/authentication-tokens/{token}":
    delete:
      description: |
        Logout a customer.
      operationId: DeleteAuthenticationToken
      responses:
        "204":
          description: Customer was logged out.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "404":
          $ref: "#/components/responses/NotFound"
      security:
        - SecretApiKey: []
        - JWT: []
        - PublishableApiKey: []
      summary: Logout a customer
      tags:
        - Customer Authentication
      x-code-samples:
        - lang: PHP
          source: |
            $client-&gt;authenticationTokens()-&gt;logout('token');
        - lang: JavaScript
          source: |-
            const token = 'dcf6e32f2daee457a1db8ce5fdfbe200';
            const request = await api.customerAuthentication.logout({token});

            // the request does not return any fields but
            // you can confirm the success using the status code
            console.log(request.response.status); // 204
      x-sdk-operation-name: logout
    get:
      description: |
        Verify an authentication token.
      operationId: GetAuthenticationTokenVerification
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AuthenticationToken"
          description: Authentication Token was verified.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "404":
          $ref: "#/components/responses/NotFound"
      security:
        - SecretApiKey: []
        - JWT: []
        - PublishableApiKey: []
      summary: Verify
      tags:
        - Customer Authentication
      x-code-samples:
        - lang: PHP
          source: >
            $isVerified = $client-&gt;authenticationTokens()-&gt;verify('token');
        - lang: JavaScript
          source: >-
            const token = 'dcf6e32f2daee457a1db8ce5fdfbe200';

            const verification = await api.customerAuthentication.verify({token});

            // if the the token is valid then no error will be thrown

            console.log(verification.reponse.status) // 200
      x-sdk-operation-name: verify
    parameters:
      - description: The token identifier string.
        in: path
        name: token
        required: true
        schema:
          type: string
      - $ref: "#/components/parameters/organizationId"
  "/authentication-tokens/{token}/exchange":
    parameters:
      - description: The token identifier string.
        in: path
        name: token
        required: true
        schema:
          type: string
      - $ref: "#/components/parameters/organizationId"
    post:
      description: >
        Exchange Authentication Token for JWT.


        It will also invalidate an Authentication Token by default (so it can only be exchanged once).
      operationId: PostAuthenticationTokenExchange
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CustomerJWT"
        required: true
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CustomerJWT"
          description: Authentication Token exchanged for JWT.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "404":
          $ref: "#/components/responses/NotFound"
      security:
        - SecretApiKey: []
        - JWT: []
        - PublishableApiKey: []
      summary: Exchange
      tags:
        - Customer Authentication
      x-sdk-operation-name: exchangeToken
  /bank-accounts:
    get:
      description: |
        Retrieve a list of Bank Accounts.
      operationId: GetBankAccountCollection
      parameters:
        - $ref: "#/components/parameters/collectionLimit"
        - $ref: "#/components/parameters/collectionOffset"
        - $ref: "#/components/parameters/collectionQuery"
        - $ref: "#/components/parameters/collectionSort"
        - $ref: "#/components/parameters/collectionFilter"
        - $ref: "#/components/parameters/collectionExpand"
      responses:
        "200":
          content:
            application/json:
              schema:
                items:
                  $ref: "#/components/schemas/BankAccount"
                type: array
          description: A list of Bank Accounts was retrieved successfully.
          headers:
            Pagination-Limit:
              $ref: "#/components/headers/Pagination-Limit"
            Pagination-Offset:
              $ref: "#/components/headers/Pagination-Offset"
            Pagination-Total:
              $ref: "#/components/headers/Pagination-Total"
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
      summary: Retrieve a list of bank accounts
      tags:
        - Bank Accounts
      x-code-samples:
        - lang: PHP
          source: |
            $bankAccounts = $client-&gt;bankAccounts()-&gt;search([
                'filter' =&gt; 'customerId:testId',
            ]);
        - lang: JavaScript
          source: >-
            // all parameters are optional

            const firstCollection = await api.bankAccounts.getAll();


            // alternatively you can specify one or more of them

            const params = {limit: 20, offset: 100, sort: '-createdTime'}; 

            const secondCollection = await api.bankAccounts.getAll(params);


            // access the collection items, each item is a Member

            secondCollection.items.forEach(bankAccount =&gt; console.log(bankAccount.fields.status));
      x-sdk-operation-name: getAll
    parameters:
      - $ref: "#/components/parameters/organizationId"
    post:
      description: |
        Create a Bank Account.
      operationId: PostBankAccount
      requestBody:
        content:
          application/json:
            schema:
              oneOf:
                - $ref: "#/components/schemas/BankAccountCreateToken"
                - $ref: "#/components/schemas/BankAccountCreatePlain"
        description: BankAccount resource.
        required: true
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/BankAccount"
          description: Bank Account was created.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "422":
          $ref: "#/components/responses/ValidationError"
      summary: Create a Bank Account
      tags:
        - Bank Accounts
      x-code-samples:
        - lang: PHP
          source: >
            $bankAccountForm = new Rebilly\Entities\BankAccount();

            $bankAccountForm-&gt;setCustomerId('customerId');

            $bankAccountForm-&gt;setRoutingNumber('0123456');

            $bankAccountForm-&gt;setAccountNumber('0123456');

            $bankAccountForm-&gt;setAccountType('checking');

            $bankAccountForm-&gt;setBillingAddress([
                'firstName' =&gt; 'John',
                'lastName' =&gt; 'Doe',
                'organization' =&gt; 'Test LTD',
                'address' =&gt; 'Test street 5',
                'address2' =&gt; 'Test house 5',
                'city' =&gt; 'New York',
                'region' =&gt; 'Long Island',
                'country' =&gt; 'US',
                'postalCode' =&gt; '123456',
                'emails' =&gt; [
                    [
                        'label' =&gt; 'main',
                        'value' =&gt; 'johndoe@testemail.com',
                        'primary' =&gt; true,
                    ],
                    [
                        'label' =&gt; 'secondary',
                        'value' =&gt; 'otheremail@testemail.com',
                    ],
                ],
                'phoneNumbers' =&gt; [
                    [
                        'label' =&gt; 'work',
                        'value' =&gt; '+123456789',
                        'primary' =&gt; true,
                    ],
                    [
                        'label' =&gt; 'home',
                        'value' =&gt; '+9874654321',
                    ],
                ],
            ]);


            try {
                $bankAccount = $client-&gt;bankAccounts()-&gt;create($bankAccountForm);
            } catch (UnprocessableEntityException $e) {
                echo $e-&gt;getMessage();
            }
        - lang: JavaScript
          source: >-
            // first set the required properties for the new bank account

            const data = {
                bankName: 'My Fake Financial',
                routingNumber: '12345678',
                accountNumber: '12345678',
                accountType: 'checking',
                customerId: 'acme-001'
            };


            // the ID is optional

            const firstKey = await api.bankAccounts.create({data});


            // or you can provide one

            const secondKey = await api.bankAccounts.create({id: 'my-second-id', data});
      x-sdk-operation-name: create
  "/bank-accounts/{id}":
    get:
      description: |
        Retrieve a Bank Account with specified identifier string.
      operationId: GetBankAccount
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/BankAccount"
          description: Bank Account was retrieved successfully.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "404":
          $ref: "#/components/responses/NotFound"
      summary: Retrieve a Bank Account
      tags:
        - Bank Accounts
      x-code-samples:
        - lang: PHP
          source: |
            $bankAccount = $client-&gt;bankAccounts()-&gt;load('bankAccountId');
        - lang: JavaScript
          source: |-
            const bankAccount = await api.bankAccounts.get({id: 'foobar-001'});
            console.log(bankAccount.fields.status);
      x-sdk-operation-name: get
    parameters:
      - $ref: "#/components/parameters/resourceId"
      - $ref: "#/components/parameters/organizationId"
    patch:
      description: >
        Update bank account's values except for the account number and
        routing. number.
      operationId: PatchBankAccount
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/BankAccountUpdatePlain"
        description: Bank Account.
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/BankAccount"
          description: Bank Account was updated.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "404":
          $ref: "#/components/responses/NotFound"
        "422":
          $ref: "#/components/responses/ValidationError"
      summary: Update a bank account's values
      tags:
        - Bank Accounts
      x-code-samples:
        - lang: JavaScript
          source: |
            // properties to be updated
            const data = {
                bankName: 'Your Fake Financial',
                accountType: 'savings',
                billingAddress: {
                    firstName: 'John'
                }
            };

            api.bankAccounts.patch({id: 'id-to-update', data});
      x-sdk-operation-name: patch
    put:
      description: |
        Create or update a BankAccount with predefined identifier string.
      operationId: PutBankAccount
      requestBody:
        content:
          application/json:
            schema:
              oneOf:
                - $ref: "#/components/schemas/BankAccountCreateToken"
                - $ref: "#/components/schemas/BankAccountCreatePlain"
        description: BankAccount resource.
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/BankAccount"
          description: BankAccount was updated.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/BankAccount"
          description: BankAccount was created.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "404":
          $ref: "#/components/responses/NotFound"
        "422":
          $ref: "#/components/responses/ValidationError"
      summary: Create a Bank Account with predefined ID
      tags:
        - Bank Accounts
      x-code-samples:
        - lang: PHP
          source: >
            $bankAccountForm = new Rebilly\Entities\BankAccount();

            $bankAccountForm-&gt;setCustomerId('customerId');

            $bankAccountForm-&gt;setRoutingNumber('0123456');

            $bankAccountForm-&gt;setAccountNumber('0123456');

            $bankAccountForm-&gt;setAccountType('checking');

            $bankAccountForm-&gt;setBillingAddress([
                'firstName' =&gt; 'John',
                'lastName' =&gt; 'Doe',
                'organization' =&gt; 'Test LTD',
                'address' =&gt; 'Test street 5',
                'address2' =&gt; 'Test house 5',
                'city' =&gt; 'New York',
                'region' =&gt; 'Long Island',
                'country' =&gt; 'US',
                'postalCode' =&gt; '123456',
                'emails' =&gt; [
                    [
                        'label' =&gt; 'main',
                        'value' =&gt; 'johndoe@testemail.com',
                        'primary' =&gt; true,
                    ],
                    [
                        'label' =&gt; 'secondary',
                        'value' =&gt; 'otheremail@testemail.com',
                    ],
                ],
                'phoneNumbers' =&gt; [
                    [
                        'label' =&gt; 'work',
                        'value' =&gt; '+123456789',
                        'primary' =&gt; true,
                    ],
                    [
                        'label' =&gt; 'home',
                        'value' =&gt; '+9874654321',
                    ],
                ],
            ]);


            try {
                $bankAccount = $client-&gt;customers()-&gt;create($bankAccountForm, 'bankAccountId');
            } catch (UnprocessableEntityException $e) {
                echo $e-&gt;getMessage();
            }
        - lang: JavaScript
          source: >-
            // first set the required properties for the new bank account

            const data = {
                bankName: 'My Fake Financial',
                routingNumber: '12345678',
                accountNumber: '12345678',
                accountType: 'checking',
                customerId: 'acme-001'
            };


            // the ID is optional

            const firstKey = await api.bankAccounts.create({data});


            // or you can provide one

            const secondKey = await api.bankAccounts.create({id: 'my-second-id', data});
      x-sdk-operation-name: update
  "/bank-accounts/{id}/deactivation":
    parameters:
      - $ref: "#/components/parameters/resourceId"
      - $ref: "#/components/parameters/organizationId"
    post:
      description: |
        Deactivate a Bank Account.
      operationId: PostBankAccountDeactivation
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/BankAccount"
          description: Bank Account was deactivated.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "404":
          $ref: "#/components/responses/NotFound"
        "409":
          $ref: "#/components/responses/Conflict"
      summary: Deactivate a Bank Account
      tags:
        - Bank Accounts
      x-code-samples:
        - lang: PHP
          source: >
            $bankAccount =
            $client-&gt;bankAccounts()-&gt;deactivate('bankAccountId');
        - lang: JavaScript
          source: >-
            const bankAccount = await api.bankAccounts.deactivate({id:
            'id-to-deactivate'});


            // the bank account status will be updated to reflect the modification

            console.log(bankAccount.fields.status);
      x-sdk-operation-name: deactivate
  /blocklists:
    get:
      description: |
        Retrieve a list of blocklists.
      operationId: GetBlocklistCollection
      parameters:
        - $ref: "#/components/parameters/collectionLimit"
        - $ref: "#/components/parameters/collectionOffset"
        - $ref: "#/components/parameters/collectionSort"
        - $ref: "#/components/parameters/collectionFilter"
        - $ref: "#/components/parameters/collectionQuery"
      responses:
        "200":
          content:
            application/json:
              schema:
                items:
                  $ref: "#/components/schemas/Blocklist"
                type: array
          description: A list of Blocklists was retrieved successfully.
          headers:
            Pagination-Limit:
              $ref: "#/components/headers/Pagination-Limit"
            Pagination-Offset:
              $ref: "#/components/headers/Pagination-Offset"
            Pagination-Total:
              $ref: "#/components/headers/Pagination-Total"
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
      summary: Retrieve a list of blocklists
      tags:
        - Blocklists
      x-code-samples:
        - lang: PHP
          source: |
            $blocklists = $client-&gt;blocklists()-&gt;search([
                'filter' =&gt; 'value:testValue',
            ]);
        - lang: JavaScript
          source: >
            // all parameters are optional

            const firstCollection = await api.blocklists.getAll();


            // alternatively you can specify one or more of them

            const params = {limit: 20, offset: 100, sort: '-createdTime'};

            const secondCollection = await api.blocklists.getAll(params);


            // access the collection items, each item is a Member

            secondCollection.items.forEach(blocklistItem =&gt; console.log(blocklistItem.fields.status));
      x-sdk-operation-name: getAll
    parameters:
      - $ref: "#/components/parameters/organizationId"
    post:
      description: |
        Create a blocklist.
      operationId: PostBlocklist
      requestBody:
        $ref: "#/components/requestBodies/Blocklist"
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Blocklist"
          description: Blocklist was created.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "422":
          $ref: "#/components/responses/ValidationError"
      summary: Create a blocklist
      tags:
        - Blocklists
      x-code-samples:
        - lang: PHP
          source: >
            $blocklistForm = new Rebilly\Entities\Blocklist();

            $blocklistForm-&gt;setType($blocklistForm::TYPE_EMAIL);

            $blocklistForm-&gt;setValue('test@test.com');

            $blocklistForm-&gt;setExpiredTime('2025-01-01 05:00:00');


            try {
                $blocklist = $client-&gt;blocklists()-&gt;create($blocklistForm);
            } catch (UnprocessableEntityException $e) {
                echo $e-&gt;getMessage();
            }
        - lang: JavaScript
          source: >
            // first set the required properties for the new blocklist item

            const data = {
                type: 'ip-address',
                value: '63.118.98.100'

                // optionally provide an `expirationTime` to make
                // the item expire and function like a `greylist`

                // expirationTime: '2017-09-18T21:50:44Z'
            };


            // the ID is optional

            const firstKey = await api.blocklists.create({data});


            // or you can provide one

            const secondKey = await api.blocklists.create({id: 'my-second-id', data});
      x-sdk-operation-name: create
  "/blocklists/{id}":
    delete:
      description: |
        Delete a blocklist with predefined identifier string.
      operationId: DeleteBlocklist
      responses:
        "204":
          description: Blocklist was deleted.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "404":
          $ref: "#/components/responses/NotFound"
      summary: Delete a blocklist
      tags:
        - Blocklists
      x-code-samples:
        - lang: PHP
          source: |
            $client-&gt;blocklists()-&gt;delete('blocklistId');
        - lang: JavaScript
          source: |
            const request = await api.blocklists.delete({id: 'my-second-key'});

            // the request does not return any fields but
            // you can confirm the success using the status code
            console.log(request.response.status); // 204
      x-sdk-operation-name: delete
    get:
      description: |
        Retrieve a blocklist with specified identifier string.
      operationId: GetBlocklist
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Blocklist"
          description: Blocklist was retrieved successfully.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "404":
          $ref: "#/components/responses/NotFound"
      summary: Retrieve a blocklist
      tags:
        - Blocklists
      x-code-samples:
        - lang: PHP
          source: |
            $blocklist = $client-&gt;blocklists()-&gt;load('blocklistId');
        - lang: JavaScript
          source: |
            const blocklistItem = await api.blocklists.get({id: 'foobar-001'});
            console.log(blocklistItem.fields.status);
      x-sdk-operation-name: get
    parameters:
      - $ref: "#/components/parameters/resourceId"
      - $ref: "#/components/parameters/organizationId"
    put:
      description: |
        Create a blocklist with predefined identifier string.
      operationId: PutBlocklist
      requestBody:
        $ref: "#/components/requestBodies/Blocklist"
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Blocklist"
          description: Blocklist was created.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "409":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: Blocklist exist and cannot be updated.
        "422":
          $ref: "#/components/responses/ValidationError"
      summary: Create a blocklist with predefined ID
      tags:
        - Blocklists
      x-code-samples:
        - lang: PHP
          source: >
            $blocklistForm = new Rebilly\Entities\Blocklist();

            $blocklistForm-&gt;setType($blocklistForm::TYPE_EMAIL);

            $blocklistForm-&gt;setValue('test@test.com');

            $blocklistForm-&gt;setExpiredTime('2025-01-01 05:00:00');


            try {
                $blocklist = $client-&gt;blocklists()-&gt;create($blocklistForm, 'blocklistId');
            } catch (UnprocessableEntityException $e) {
                echo $e-&gt;getMessage();
            }
        - lang: JavaScript
          source: >
            // first set the required properties for the new blocklist item

            const data = {
                type: 'ip-address',
                value: '63.118.98.100'

                // optionally provide an `expirationTime` to make
                // the item expire and function like a `greylist`

                // expirationTime: '2017-09-18T21:50:44Z'
            };


            // the ID is optional

            const firstKey = await api.blocklists.create({data});


            // or you can provide one

            const secondKey = await api.blocklists.create({id: 'my-second-id', data});
      x-sdk-operation-name: update
  /coupons:
    get:
      description: |
        Retrieve a list of coupons.
      operationId: GetCouponCollection
      parameters:
        - $ref: "#/components/parameters/collectionLimit"
        - $ref: "#/components/parameters/collectionOffset"
        - $ref: "#/components/parameters/collectionFilter"
        - $ref: "#/components/parameters/collectionQuery"
        - $ref: "#/components/parameters/collectionSort"
      responses:
        "200":
          content:
            application/json:
              schema:
                items:
                  $ref: "#/components/schemas/Coupon"
                type: array
          description: A list of coupons was retrieved successfully.
          headers:
            Pagination-Limit:
              $ref: "#/components/headers/Pagination-Limit"
            Pagination-Offset:
              $ref: "#/components/headers/Pagination-Offset"
            Pagination-Total:
              $ref: "#/components/headers/Pagination-Total"
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
      summary: Retrieve a list of coupons
      tags:
        - Coupons
      x-code-samples:
        - lang: PHP
          source: |
            $coupons = $client-&gt;coupons()-&gt;search([
                'filter' =&gt; 'status:issued',
            ]);
        - lang: JavaScript
          source: >-
            // all parameters are optional

            const firstCollection = await api.coupons.getAll();


            // alternatively you can specify one or more of them

            const params = {limit: 20, offset: 100, sort: '-createdTime'}; 

            const secondCollection = await api.coupons.getAll(params);


            // access the collection items, each item is a Member

            secondCollection.items.forEach(coupon =&gt; console.log(coupon.fields.status));
      x-sdk-operation-name: getAll
    parameters:
      - $ref: "#/components/parameters/organizationId"
    post:
      description: |
        Create a coupon.
      operationId: PostCoupon
      requestBody:
        $ref: "#/components/requestBodies/Coupon"
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Coupon"
          description: Coupon was created.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "422":
          $ref: "#/components/responses/ValidationError"
      summary: Create a coupon
      tags:
        - Coupons
      x-code-samples:
        - lang: PHP
          source: >
            $couponForm = new Rebilly\Entities\Coupons\Coupon();


            $discountArray = [
                'currency' =&gt; 'USD',
                'amount' =&gt; 1.99,
            ];


            $discountForm = new \Rebilly\Entities\Coupons\Discounts\Fixed($discountArray);

            $couponForm-&gt;setDiscount($discountForm);

            // Coupon can be used right now

            $couponForm-&gt;setIssuedTime(date('Y-m-d H:i:s'));


            $restrictionArray = [
                'quantity' =&gt; 2,
            ];


            $restrictionForm = new Rebilly\Entities\Coupons\Restrictions\DiscountsPerRedemption($restrictionArray);


            $couponForm-&gt;setRestrictions([$restrictionForm]);


            try {
                $coupon = $client-&gt;coupons()-&gt;create($couponForm);
            } catch (UnprocessableEntityException $e) {
                echo $e-&gt;getMessage();
            }
        - lang: JavaScript
          source: >
            // first set the required properties for the new coupon

            const data = {
                description: 'a new coupon',
                issuedTime: '2017-09-19T20:46:44Z',
                discount: {
                    type: 'percent',
                    value: 12
                },
                restrictions: [{
                    type: 'discounts-per-redemption',
                    quantity: 12
                }]
            };


            // the ID is optional

            const firstKey = await api.coupons.create({data});


            // or you can provide one

            const secondKey = await api.coupons.create({id: 'my-second-id', data});
      x-sdk-operation-name: create
  /coupons-redemptions:
    get:
      operationId: GetCouponRedemptionCollection
      parameters:
        - $ref: "#/components/parameters/collectionLimit"
        - $ref: "#/components/parameters/collectionOffset"
        - $ref: "#/components/parameters/collectionFilter"
        - $ref: "#/components/parameters/collectionQuery"
        - $ref: "#/components/parameters/collectionSort"
      responses:
        "200":
          content:
            application/json:
              schema:
                items:
                  $ref: "#/components/schemas/CouponRedemption"
                type: array
          description: Coupons redemptions were retrieved successfully.
          headers:
            Pagination-Limit:
              $ref: "#/components/headers/Pagination-Limit"
            Pagination-Offset:
              $ref: "#/components/headers/Pagination-Offset"
            Pagination-Total:
              $ref: "#/components/headers/Pagination-Total"
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
      summary: Retrieve a list of coupon redemptions
      tags:
        - Coupons
      x-code-samples:
        - lang: PHP
          source: |
            $couponRedemptions = $client-&gt;couponsRedemptions()-&gt;search([
                'filter' =&gt; 'customerId:testCustomer',
            ]);
        - lang: JavaScript
          source: >-
            // all parameters are optional

            const firstCollection = await api.coupons.getAllRedemptions();


            // alternatively you can specify one or more of them

            const params = {limit: 20, offset: 100, sort: '-createdTime'}; 

            const secondCollection = await api.coupons.getAllRedemptions(params);


            // access the collection items, each item is a Member

            secondCollection.items.forEach(coupon =&gt; console.log(coupon.fields.status));
      x-sdk-operation-name: getAllRedemptions
    parameters:
      - $ref: "#/components/parameters/organizationId"
    post:
      description: |
        Redeem a coupon.
      operationId: PostCouponRedemption
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CouponRedemption"
        description: Redeem a coupon.
        required: true
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CouponRedemption"
          description: Coupon was redeemed.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "422":
          $ref: "#/components/responses/ValidationError"
      summary: Redeem a coupon
      tags:
        - Coupons
      x-code-samples:
        - lang: PHP
          source: >
            $redemptionForm = new Rebilly\Entities\Coupons\Redemption();

            $redemptionForm-&gt;setCustomerId('customerId');

            $redemptionForm-&gt;setCouponId('couponId');


            $restrictionArray = [
                'type' =&gt; Rebilly\Entities\Coupons\Restriction::TYPE_DISCOUNTS_PER_REDEMPTION,
                'quantity' =&gt; 2,
            ];


            $restrictionForm = new Rebilly\Entities\Coupons\Restriction([
                $restrictionArray,
            ]);


            $redemptionForm-&gt;setAdditionalRestrictions($restrictionForm);


            try {
                $couponRedemption = $client-&gt;couponsRedemptions()-&gt;redeem($redemptionForm);
            } catch (UnprocessableEntityException $e) {
                echo $e-&gt;getMessage();
            }
        - lang: JavaScript
          source: |
            // build the redemption data
            const data = {
              couponId: 'my-best-coupon',
              customerId: 'foobar-001'
            };

            const redemption = await api.coupons.redeem({data});
            console.log(redemption.fields.id);
      x-sdk-operation-name: redeem
  "/coupons-redemptions/{id}":
    get:
      operationId: GetCouponRedemption
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CouponRedemption"
          description: Retrieve a coupon redemption with specified identifier string.
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "404":
          $ref: "#/components/responses/NotFound"
      summary: Retrieve a coupon redemption with specified identifier string
      tags:
        - Coupons
      x-code-samples:
        - lang: PHP
          source: >
            $couponRedemption =
            $client-&gt;couponsRedemptions()-&gt;load('redemptionId');
        - lang: JavaScript
          source: >-
            const redemption = await api.coupons.getRedemption({id: 'foobar-001'});

            console.log(redemption.fields.id);
      x-sdk-operation-name: getRedemption
    parameters:
      - $ref: "#/components/parameters/resourceId"
      - $ref: "#/components/parameters/organizationId"
  "/coupons-redemptions/{id}/cancel":
    parameters:
      - $ref: "#/components/parameters/resourceId"
      - $ref: "#/components/parameters/organizationId"
    post:
      operationId: PostCouponRedemptionCancellation
      responses:
        "201":
          description: Cancel a coupon redemption.
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "404":
          $ref: "#/components/responses/NotFound"
      summary: Cancel a coupon redemption
      tags:
        - Coupons
      x-code-samples:
        - lang: PHP
          source: |
            $client-&gt;couponsRedemptions()-&gt;cancel('id');
        - lang: JavaScript
          source: >-
            const cancellation = await api.coupons.cancelRedemption({id:
            'foobar-001'});


            // the request does not return any fields but

            // you can confirm the success using the status code

            console.log(cancellation.response.status); // 201
      x-sdk-operation-name: cancelRedemption
  "/coupons/{id}":
    get:
      description: |
        Retrieve a coupon with specified coupon ID string.
      operationId: GetCoupon
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Coupon"
          description: Coupon was retrieved successfully.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "404":
          $ref: "#/components/responses/NotFound"
      summary: Retrieve a coupon
      tags:
        - Coupons
      x-code-samples:
        - lang: PHP
          source: |
            $coupon = $client-&gt;coupons()-&gt;load('couponId');
        - lang: JavaScript
          source: |
            const coupon = await api.coupons.get({couponId: 'foobar-001'});
            console.log(coupon.fields.status);
      x-sdk-operation-name: get
    parameters:
      - $ref: "#/components/parameters/resourceId"
      - $ref: "#/components/parameters/organizationId"
    put:
      description: |
        Create or update a coupon with predefined coupon ID.
      operationId: PutCoupon
      requestBody:
        $ref: "#/components/requestBodies/Coupon"
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Coupon"
          description: Coupon was updated.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Coupon"
          description: Coupon was created.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "404":
          $ref: "#/components/responses/NotFound"
        "409":
          $ref: "#/components/responses/Conflict"
        "422":
          $ref: "#/components/responses/ValidationError"
      summary: Create or update a coupon with predefined coupon ID
      tags:
        - Coupons
      x-code-samples:
        - lang: PHP
          source: >
            $couponForm = new Rebilly\Entities\Coupons\Coupon();


            $discountArray = [
                'type' =&gt; Rebilly\Entities\Coupons\Discount::TYPE_FIXED,
                'currency' =&gt; 'USD',
                'amount' =&gt; 1.99,
            ];


            $discountForm = new Rebilly\Entities\Coupons\Discount($discountArray);

            $couponForm-&gt;setDiscount($discountForm);


            $restrictionArray = [
                'type' =&gt; Rebilly\Entities\Coupons\Restriction::TYPE_DISCOUNTS_PER_REDEMPTION,
                'quantity' =&gt; 2,
            ];


            $restrictionForm = new Rebilly\Entities\Coupons\Restriction([
                $restrictionArray,
            ]);


            $couponForm-&gt;setRestrictions($restrictionForm);


            try {
                $coupon = $client-&gt;coupons()-&gt;create($couponForm, 'couponId');
            } catch (UnprocessableEntityException $e) {
                echo $e-&gt;getMessage();
            }
        - lang: JavaScript
          source: >
            // creating a coupon

            const data = {
                description: 'a new coupon',
                issuedTime: '2017-09-19T20:46:44Z',
                discount: {
                    type: 'percent',
                    value: 12
                },
                restrictions: [{
                    type: 'discounts-per-redemption',
                    quantity: 12
                }]
            };


            // the ID is optional

            const firstKey = await api.coupons.create({data});


            // or you can provide one

            const secondKey = await api.coupons.create({id: 'my-second-id', data});



            // updating a coupon

            const data = {
                description: 'a small update'
            };


            const coupon = await api.coupons.update({id: 'my-second-id', data});
      x-sdk-operation-name: update
  "/coupons/{id}/expiration":
    parameters:
      - $ref: "#/components/parameters/resourceId"
      - $ref: "#/components/parameters/organizationId"
    post:
      description: |
        Set a coupon's expiry time with the specified coupon ID.
        The expiredTime of a coupon must be greater than its issuedTime.
        This cannot be performed on expired coupons.
      operationId: PostCouponExpiration
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CouponExpiration"
        description: Coupon resource.
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Coupon"
          description: Coupon expiration was successfully set.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "404":
          $ref: "#/components/responses/NotFound"
        "409":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: The coupon is already expired and has been redeemed, unable to.
            reschedule expiration.
        "422":
          $ref: "#/components/responses/ValidationError"
      summary: Set a coupon's expiration time
      tags:
        - Coupons
      x-code-samples:
        - lang: JavaScript
          source: >
            const data = {
                expiredTime: "2020-05-25T18:51:14Z"
            }


            const coupon = await api.coupons.setExpiration({id: 'my-second-id', data});
      x-sdk-operation-name: setExpiration
  /credentials:
    get:
      description: |
        Retrieve a list of credentials.
      operationId: GetCredentialCollection
      parameters:
        - $ref: "#/components/parameters/collectionLimit"
        - $ref: "#/components/parameters/collectionOffset"
      responses:
        "200":
          content:
            application/json:
              schema:
                items:
                  $ref: "#/components/schemas/Credential"
                type: array
          description: A list of Credentials was retrieved successfully.
          headers:
            Pagination-Limit:
              $ref: "#/components/headers/Pagination-Limit"
            Pagination-Offset:
              $ref: "#/components/headers/Pagination-Offset"
            Pagination-Total:
              $ref: "#/components/headers/Pagination-Total"
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
      summary: Retrieve a list of credentials
      tags:
        - Customer Authentication
      x-code-samples:
        - lang: PHP
          source: >
            $customerCredentials = $client-&gt;customerCredentials()-&gt;search([
                'filter' =&gt; 'customerId:testCustomer',
            ]);
        - lang: JavaScript
          source: >-
            // all parameters are optional

            const firstCollection = await api.customerAuthentication.getAllCredentials();


            // alternatively you can specify one or more of them

            const params = {limit: 20, offset: 100}; 

            const secondCollection = await api.customerAuthentication.getAllCredentials(params);


            // access the collection items, each item is a Member

            secondCollection.items.forEach(credential =&gt; console.log(credential.fields.customerId));
      x-sdk-operation-name: getAllCredentials
    parameters:
      - $ref: "#/components/parameters/organizationId"
    post:
      description: |
        Create a credential.
      operationId: PostCredential
      requestBody:
        $ref: "#/components/requestBodies/Credential"
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Credential"
          description: Credential was created.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "422":
          $ref: "#/components/responses/ValidationError"
      summary: Create a credential
      tags:
        - Customer Authentication
      x-code-samples:
        - lang: PHP
          source: >
            $customerCredentialForm = new Rebilly\Entities\CustomerCredential();

            $customerCredentialForm-&gt;setCustomerId('customerId');

            $customerCredentialForm-&gt;setUsername('test');

            $customerCredentialForm-&gt;setPassword('1234');


            try {
                $customerCredential = $client-&gt;customerCredentials()-&gt;create($customerCredentialForm);
            } catch (UnprocessableEntityException $e) {
                echo $e-&gt;getMessage();
            }
        - lang: JavaScript
          source: >-
            // first set the required properties for the new credential

            const data = {
                username: 'foobar',
                password: 'fuubar',
                customerId: 'foobar-0001'

                // optionally you can define an `expiredTime` to 
                // limit the duration of the credential

                //expiredTime: '2017-09-18T19:17:39Z'
            };


            // the ID is optional

            const firstCredential = await api.customerAuthentication.createCredential({data});


            // or you can provide one

            const secondCredential = await api.customerAuthentication.createCredential({id: 'my-second-id', data});
      x-sdk-operation-name: createCredential
  "/credentials/{id}":
    delete:
      description: |
        Delete a credential with predefined identifier string.
      operationId: DeleteCredential
      responses:
        "204":
          description: Credential was deleted.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "404":
          $ref: "#/components/responses/NotFound"
      summary: Delete a credential
      tags:
        - Customer Authentication
      x-code-samples:
        - lang: PHP
          source: |
            $client-&gt;customerCredentials()-&gt;delete('credentialId');
        - lang: JavaScript
          source: >-
            const request = await api.customerAuthentication.deleteCredential({id:
            'my-second-key'});


            // the request does not return any fields but

            // you can confirm the success using the status code

            console.log(request.response.status); // 204
      x-sdk-operation-name: deleteCredential
    get:
      description: |
        Retrieve a credential with specified identifier string.
      operationId: GetCredential
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Credential"
          description: Credential was retrieved successfully.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "404":
          $ref: "#/components/responses/NotFound"
      summary: Retrieve a credential
      tags:
        - Customer Authentication
      x-code-samples:
        - lang: PHP
          source: >
            $customerCredential =
            $client-&gt;customerCredentials()-&gt;load('credentialId');
        - lang: JavaScript
          source: >-
            const credential = await api.customerAuthentication.getCredential({id:
            'my-first-id'});

            console.log(credential.fields.customerId);
      x-sdk-operation-name: getCredential
    parameters:
      - $ref: "#/components/parameters/resourceId"
      - $ref: "#/components/parameters/organizationId"
    put:
      description: |
        Create or update a credential with predefined identifier string.
      operationId: PutCredential
      requestBody:
        $ref: "#/components/requestBodies/Credential"
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Credential"
          description: Credential was updated.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Credential"
          description: Credential was created.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "404":
          $ref: "#/components/responses/NotFound"
        "422":
          $ref: "#/components/responses/ValidationError"
      summary: Create or update a credential with predefined ID
      tags:
        - Customer Authentication
      x-code-samples:
        - lang: PHP
          source: >
            $customerCredentialForm = new Rebilly\Entities\CustomerCredential();

            $customerCredentialForm-&gt;setCustomerId('customerId');

            $customerCredentialForm-&gt;setUsername('test');

            $customerCredentialForm-&gt;setPassword('1234');


            try {
                $customerCredential = $client-&gt;customerCredentials()-&gt;update('credentialId', $customerCredentialForm);
            } catch (UnprocessableEntityException $e) {
                echo $e-&gt;getMessage();
            }
        - lang: JavaScript
          source: >-
            // creating a new credential

            const data = {
                username: 'foobar',
                password: 'fuubar',
                customerId: 'foobar-0001'

                // optionally you can define an `expiredTime` to 
                // limit the duration of the credential

                //expiredTime: '2017-09-18T19:17:39Z'
            };


            // the ID is optional

            const firstCredential = await api.customerAuthentication.createCredential({data});


            // or you can provide one

            const secondCredential = await api.customerAuthentication.createCredential({id: 'my-second-id', data});





            // updating a credential

            const data = {
                username: 'foobar',
                password: 'hell0'
            };


            const secondCredential = await api.customerAuthentication.updateCredential({id: 'my-second-id', data});
      x-sdk-operation-name: updateCredential
  "/custom-fields/{resource}":
    get:
      description: |
        Retrieve a schema of Custom Fields for the given resource type.
      operationId: GetCustomFieldCollection
      parameters:
        - $ref: "#/components/parameters/collectionLimit"
        - $ref: "#/components/parameters/collectionOffset"
      responses:
        "200":
          content:
            application/json:
              schema:
                description: The list of custom fields.
                items:
                  $ref: "#/components/schemas/CustomField"
                type: array
          description: A schema of Custom Fields was retrieved successfully.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
      summary: Retrieve Custom Fields
      tags:
        - Custom Fields
      x-code-samples:
        - lang: PHP
          source: |
            $customFields = $client-&gt;customFields()-&gt;search('customers', [
                'filter' =&gt; 'type:boolean',
            ]);
        - lang: JavaScript
          source: >-
            // all parameters except `resource` are optional

            const firstCollection = await api.customFields.getAll({resource: 'customers'});


            // alternatively you can specify one or more of them

            const params = {resource: 'customers', limit: 20, offset: 100}; 

            const secondCollection = await api.customFields.getAll(params);


            // access the collection items, each item is a Member

            secondCollection.items.forEach(customField =&gt; console.log(customField.fields.description));
      x-sdk-operation-name: getAll
    parameters:
      - $ref: "#/components/parameters/customFieldResource"
      - $ref: "#/components/parameters/organizationId"
  "/custom-fields/{resource}/{name}":
    get:
      description: |
        Retrieve a schema of the given Custom Field for the given resource type.
      operationId: GetCustomField
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CustomField"
          description: A schema of the Custom Field was retrieved successfully.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "404":
          $ref: "#/components/responses/NotFound"
      summary: Retrieve a Custom Field
      tags:
        - Custom Fields
      x-code-samples:
        - lang: PHP
          source: >
            $customField = $client-&gt;customFields()-&gt;load('customers',
            'testFieldName');
        - lang: JavaScript
          source: >-
            const customField = await api.customFields.get({resource: 'customers',
            name: 'dob'});

            console.log(customField.fields.description);
      x-sdk-operation-name: get
    parameters:
      - $ref: "#/components/parameters/customFieldResource"
      - description: The custom field's identifier string.
        in: path
        name: name
        required: true
        schema:
          maxLength: 60
          pattern: ^[\w-]+$
          type: string
      - $ref: "#/components/parameters/organizationId"
    put:
      description: >
        Create or alter a schema of the given Custom Field for the given
        resource. type.
      operationId: PutCustomField
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CustomField"
        description: Custom Fields schema of the given resource type.
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CustomField"
          description: The Custom Field was updated.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CustomField"
          description: The Custom Fields was created.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "409":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: >
            The schema is in use: remove all the associated data in order to
            remove or alter the schema.
        "422":
          $ref: "#/components/responses/ValidationError"
      summary: Create or alter a Custom Field
      tags:
        - Custom Fields
      x-code-samples:
        - lang: PHP
          source: >
            $customFieldForm = new Rebilly\Entities\CustomField();

            $customFieldForm-&gt;setType($customFieldForm::TYPE_BOOLEAN);


            try {
                $customField = $client-&gt;customFields()-&gt;update('customers', 'testFieldName', $customFieldForm);
            } catch (UnprocessableEntityException $e) {
                echo $e-&gt;getMessage();
            }
        - lang: JavaScript
          source: |
            // creating a custom field
            const data = {
                name: 'Date of Birth',
                type: 'date',
                description: `The customer's date of birth`
            };

            // define the entire payload
            const params = {resource: 'customers', name: 'dob', data};

            // create the custom field
            const customField = await api.customFields.create(params);

            // or update the custom field
            const customField = await api.customFields.update(params);

            // you can verify if the custom field is used
            console.log(customField.fields.isUsed);
      x-sdk-operation-name: create
  /customer-timeline-custom-events:
    get:
      description: |
        Retrieve a list of customer timeline custom event types.
      operationId: GetCustomerTimelineCustomEventTypeCollection
      parameters:
        - $ref: "#/components/parameters/collectionLimit"
        - $ref: "#/components/parameters/collectionOffset"
        - $ref: "#/components/parameters/collectionFilter"
      responses:
        "200":
          content:
            application/json:
              schema:
                items:
                  $ref: "#/components/schemas/CustomerTimelineCustomEvent"
                type: array
          description: A list of customer timeline custom event types was retrieved
            successfully.
          headers:
            Pagination-Limit:
              $ref: "#/components/headers/Pagination-Limit"
            Pagination-Offset:
              $ref: "#/components/headers/Pagination-Offset"
            Pagination-Total:
              $ref: "#/components/headers/Pagination-Total"
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
      summary: Retrieve a list of customer timeline custom event types
      tags:
        - Customers Timeline
      x-sdk-operation-name: getAll
    parameters:
      - $ref: "#/components/parameters/organizationId"
    post:
      description: |
        Create Customer Timeline custom event type.
      operationId: PostCustomerTimelineCustomEventType
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CustomerTimelineCustomEvent"
        description: Customer Timeline Custom Event Type resource.
        required: true
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CustomerTimelineCustomEvent"
          description: Customer Timeline Custom Event Type was created.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "422":
          $ref: "#/components/responses/ValidationError"
      summary: Create Customer Timeline custom event type
      tags:
        - Customers
      x-sdk-operation-name: create
  "/customer-timeline-custom-events/{id}":
    get:
      description: |
        Retrieve customer timeline custom event type.
      operationId: GetCustomerTimelineCustomEventType
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CustomerTimelineCustomEvent"
          description: Customer Timeline custom event type was retrieved successfully.
          headers:
            Pagination-Limit:
              $ref: "#/components/headers/Pagination-Limit"
            Pagination-Offset:
              $ref: "#/components/headers/Pagination-Offset"
            Pagination-Total:
              $ref: "#/components/headers/Pagination-Total"
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
      summary: Retrieve customer timeline custom event type with specified identifier
        string
      tags:
        - Customers Timeline
      x-sdk-operation-name: get
    parameters:
      - $ref: "#/components/parameters/resourceId"
      - $ref: "#/components/parameters/organizationId"
  /customer-timeline-events:
    get:
      description: |
        Retrieve a list of customer timeline messages for all customers.
      operationId: GetCustomerTimelineEventCollection
      parameters:
        - $ref: "#/components/parameters/collectionLimit"
        - $ref: "#/components/parameters/collectionOffset"
        - $ref: "#/components/parameters/collectionFilter"
      responses:
        "200":
          content:
            application/json:
              schema:
                items:
                  $ref: "#/components/schemas/CustomerTimeline"
                type: array
          description: A list of customer timeline messages was retrieved successfully.
          headers:
            Pagination-Limit:
              $ref: "#/components/headers/Pagination-Limit"
            Pagination-Offset:
              $ref: "#/components/headers/Pagination-Offset"
            Pagination-Total:
              $ref: "#/components/headers/Pagination-Total"
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
      summary: Retrieve a list of customer timeline messages for all customers
      tags:
        - Customers Timeline
      x-sdk-operation-name: getCustomerTimelineMessages
    parameters:
      - $ref: "#/components/parameters/organizationId"
  /customers:
    get:
      description: |
        Retrieve a list of customers.
      operationId: GetCustomerCollection
      parameters:
        - $ref: "#/components/parameters/collectionLimit"
        - $ref: "#/components/parameters/collectionOffset"
        - $ref: "#/components/parameters/collectionFilter"
        - $ref: "#/components/parameters/collectionQuery"
        - $ref: "#/components/parameters/collectionExpand"
        - $ref: "#/components/parameters/collectionFields"
        - $ref: "#/components/parameters/collectionSort"
      responses:
        "200":
          content:
            application/json:
              schema:
                items:
                  $ref: "#/components/schemas/Customer"
                type: array
          description: A list of Customers was retrieved successfully.
          headers:
            Pagination-Limit:
              $ref: "#/components/headers/Pagination-Limit"
            Pagination-Offset:
              $ref: "#/components/headers/Pagination-Offset"
            Pagination-Total:
              $ref: "#/components/headers/Pagination-Total"
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
      summary: Retrieve a list of customers
      tags:
        - Customers
      x-code-samples:
        - lang: PHP
          source: |
            $customers = $client-&gt;customers()-&gt;search([
                'filter' =&gt; 'firstName:John',
            ]);
        - lang: JavaScript
          source: >-
            // all parameters are optional

            const firstCollection = await api.customers.getAll();


            // alternatively you can specify one or more of them

            const params = {limit: 20, offset: 100, sort: '-createdTime'}; 

            const secondCollection = await api.customers.getAll(params);


            // access the collection items, each item is a Member

            secondCollection.items.forEach(customer =&gt; console.log(customer.fields.primaryAddress.firstName));




            // alternatively you can get the collection as a CSV


            // all parameters are optional

            const firstFile = await api.customers.downloadCSV();


            // alternatively you can specify one or more of them

            const params = {limit: 20, offset: 100, sort: '-createdTime'}; 

            const secondFile = await api.customers.downloadCSV(params);


            // access the file data to view the CSV content 

            console.log(secondFile.data);
      x-sdk-operation-name: getAll
    parameters:
      - $ref: "#/components/parameters/organizationId"
    post:
      description: >
        Create a customer without a predefined ID.

        The customer's primary address

        will be used as the default address for payment

        instruments, subscriptions and invoices if none

        are provided.


        If you wish to create the customer with a predefined

        ID (which we recommend to prevent duplication), you

        may use our `PUT` request described below.


        Read our guide to [preventing duplicates](https://api-guides.rebilly.com/core-concepts/preventing-duplicates)

        to understand more.
      operationId: PostCustomer
      requestBody:
        $ref: "#/components/requestBodies/Customer"
      responses:
        "201":
          $ref: "#/components/responses/Customer"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "409":
          $ref: "#/components/responses/Conflict"
        "422":
          $ref: "#/components/responses/ValidationError"
      summary: Create a customer (without an ID)
      tags:
        - Customers
      x-code-samples:
        - lang: PHP
          source: |
            $customerForm = new Rebilly\Entities\Customer();
            $customerForm-&gt;setPrimaryAddress([
                'firstName' =&gt; 'John',
                'lastName' =&gt; 'Doe',
                'organization' =&gt; 'Test LTD',
                'address' =&gt; 'Test street 5',
                'address2' =&gt; 'Test house 5',
                'city' =&gt; 'New York',
                'region' =&gt; 'Long Island',
                'country' =&gt; 'US',
                'postalCode' =&gt; '123456',
                'emails' =&gt; [
                    [
                        'label' =&gt; 'main',
                        'value' =&gt; 'johndoe@testemail.com',
                        'primary' =&gt; true,
                    ],
                    [
                        'label' =&gt; 'secondary',
                        'value' =&gt; 'otheremail@testemail.com',
                    ],
                ],
                'phoneNumbers' =&gt; [
                    [
                        'label' =&gt; 'work',
                        'value' =&gt; '+123456789',
                        'primary' =&gt; true,
                    ],
                    [
                        'label' =&gt; 'home',
                        'value' =&gt; '+9874654321',
                    ],
                ],
            ]);

            try {
                $customer = $client-&gt;customers()-&gt;create($customerForm);
            } catch (UnprocessableEntityException $e) {
                echo $e-&gt;getMessage();
            }
        - lang: JavaScript
          source: >-
            // first set the properties for the new customer

            const data = {
                primaryAddress: {
                    firstName: 'John',
                    lastName: 'Doe',
                    emails: [{
                        label: 'main',
                        value: 'john.doe+test@grr.la',
                        primary: true
                    }],
                }
            };


            // the ID is optional

            const firstCustomer = await api.customers.create({data});


            // or you can provide one

            const secondCustomer = await api.customers.create({id: 'my-second-id', data});
      x-sdk-operation-name: create
  "/customers/{id}":
    delete:
      description: Merge one duplicate customer to another target customer and delete
        the. former.
      operationId: DeleteCustomer
      parameters:
        - description: The customer identifier to get the data of the deleted duplicate
            customer.
          in: query
          name: targetCustomerId
          required: true
          schema:
            type: string
      responses:
        "204":
          description: Customer has been merged and removed.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "404":
          $ref: "#/components/responses/NotFound"
      summary: Merge and delete a customer
      tags:
        - Customers
      x-sdk-operation-name: merge
    get:
      description: |
        Retrieve a customer with specified identifier string.
      operationId: GetCustomer
      parameters:
        - $ref: "#/components/parameters/collectionExpand"
        - $ref: "#/components/parameters/collectionFields"
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Customer"
          description: Customer was retrieved successfully.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "404":
          $ref: "#/components/responses/NotFound"
      summary: Retrieve a customer
      tags:
        - Customers
      x-code-samples:
        - lang: PHP
          source: |
            $customers = $client-&gt;customers()-&gt;load('myCustomerId');
        - lang: JavaScript
          source: |-
            const customer = await api.customers.get({id: 'foobar-001'});
            console.log(customer.fields.primaryAddress.firstName);
      x-sdk-operation-name: get
    parameters:
      - $ref: "#/components/parameters/resourceId"
      - $ref: "#/components/parameters/organizationId"
    put:
      description: >
        Create or update (upsert) a customer with predefined identifier
        string.

        Read our guide to [preventing duplicates](https://api-guides.rebilly.com/core-concepts/preventing-duplicates)

        to understand more.
      operationId: PutCustomer
      requestBody:
        $ref: "#/components/requestBodies/Customer"
      responses:
        "200":
          $ref: "#/components/responses/Customer"
        "201":
          $ref: "#/components/responses/Customer"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "409":
          $ref: "#/components/responses/Conflict"
        "422":
          $ref: "#/components/responses/ValidationError"
      summary: Upsert a customer with predefined ID
      tags:
        - Customers
      x-code-samples:
        - lang: PHP
          source: >
            $customerForm = new Rebilly\Entities\Customer();

            $customerForm-&gt;setPrimaryAddress([
                'firstName' =&gt; 'John',
                'lastName' =&gt; 'Doe',
                'organization' =&gt; 'Test LTD',
                'address' =&gt; 'Test street 5',
                'address2' =&gt; 'Test house 5',
                'city' =&gt; 'New York',
                'region' =&gt; 'Long Island',
                'country' =&gt; 'US',
                'postalCode' =&gt; '123456',
                'emails' =&gt; [
                    [
                        'label' =&gt; 'main',
                        'value' =&gt; 'johndoe@testemail.com',
                        'primary' =&gt; true,
                    ],
                    [
                        'label' =&gt; 'secondary',
                        'value' =&gt; 'otheremail@testemail.com',
                    ],
                ],
                'phoneNumbers' =&gt; [
                    [
                        'label' =&gt; 'work',
                        'value' =&gt; '+123456789',
                        'primary' =&gt; true,
                    ],
                    [
                        'label' =&gt; 'home',
                        'value' =&gt; '+9874654321',
                    ],
                ],
            ]);


            try {
                $customer = $client-&gt;customers()-&gt;update('myCustomerId', $customerForm);
            } catch (UnprocessableEntityException $e) {
                echo $e-&gt;getMessage();
            }
        - lang: JavaScript
          source: >-
            // creating a customer

            const data = {
                primaryAddress: {
                    firstName: 'John',
                    lastName: 'Doe',
                    emails: [{
                        label: 'main',
                        value: 'john.doe+test@grr.la',
                        primary: true
                    }],
                }
            };


            // the ID is optional

            const firstCustomer = await api.customers.create({data});


            // or you can provide one

            const secondCustomer = await api.customers.create({id: 'my-second-id', data});




            // updating a customer

            const data = {
                primaryAddress: {
                    firstName: 'Johnny',
                    lastName: 'Doe',
                    emails: [{
                        label: 'main',
                        value: 'johnny.doe+test@grr.la',
                        primary: true
                    }],
                }
            };


            const customer = await api.customers.update({id: 'my-second-id', data});
      x-sdk-operation-name: update
  "/customers/{id}/lead-source":
    delete:
      description: |
        Delete a Lead Source that belongs to a certain customer.
      operationId: DeleteCustomerLeadSource
      responses:
        "204":
          description: Lead Source was deleted.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "404":
          $ref: "#/components/responses/NotFound"
        "409":
          $ref: "#/components/responses/Conflict"
      summary: Delete a Lead Source for a customer
      tags:
        - Customers
      x-code-samples:
        - lang: PHP
          source: >
            $customer =
            $client-&gt;customers()-&gt;deleteLeadSource('myCustomerId');
        - lang: JavaScript
          source: >-
            const request = await api.customers.deleteLeadSource({id:
            'my-second-id'});


            // the request does not return any fields but

            // you can confirm the success using the status code

            console.log(request.response.status); // 204
      x-sdk-operation-name: deleteLeadSource
    get:
      description: |
        Retrieve a Lead Source of given customer.
      operationId: GetCustomerLeadSource
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/LeadSource"
          description: Lead Source was retrieved successfully.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "404":
          $ref: "#/components/responses/NotFound"
      summary: Retrieve a customer's Lead Source
      tags:
        - Customers
      x-code-samples:
        - lang: PHP
          source: |
            $customer = $client-&gt;customers()-&gt;load('myCustomerId');
            $leadSource = $customer-&gt;getLeadSource();
        - lang: JavaScript
          source: >-
            const lead = await api.customers.getLeadSource({id: 'my-second-id'});

            console.log(lead.fields.affiliate);
      x-sdk-operation-name: getLeadSource
    parameters:
      - $ref: "#/components/parameters/resourceId"
      - $ref: "#/components/parameters/organizationId"
    put:
      description: |
        Create a Lead Source for a customer.
      operationId: PutCustomerLeadSource
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/LeadSource"
        description: Lead Source resource.
        required: true
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/LeadSource"
          description: Lead Source was created.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "422":
          $ref: "#/components/responses/ValidationError"
      summary: Create a Lead Source for a customer
      tags:
        - Customers
      x-code-samples:
        - lang: PHP
          source: >
            $leadSourceForm = new Rebilly\Entities\LeadSource();

            $leadSourceForm-&gt;setSource('TestSource');

            $leadSourceForm-&gt;setCampaign('TestCampaign');


            try {
                $customer = $client-&gt;customers()-&gt;updateLeadSource('myCustomerId', $leadSourceForm);
            } catch (UnprocessableEntityException $e) {
                echo $e-&gt;getMessage();
            }
        - lang: JavaScript
          source: >-
            // first set the properties for the new lead source

            const data = {
                medium: 'foobar',
                source: 'www.google.com',
                campaign: 'my-first-campaign',
                term: 'subscriptions',
                content: 'subscription business',
                affiliate: 'Acme',
                subAffiliate: null,
                salesAgent: null,
                clickId: null,
                path: null,
                ipAddress: '12.34.56.78',
                currency: 'USD',
                amount: 0
            };


            const lead = await api.customers.createLeadSource({id: 'my-second-id', data});
      x-sdk-operation-name: createLeadSource
  "/customers/{id}/timeline":
    get:
      description: |
        Retrieve a list of customer timeline messages.
      operationId: GetCustomerTimelineCollection
      parameters:
        - $ref: "#/components/parameters/collectionLimit"
        - $ref: "#/components/parameters/collectionOffset"
        - $ref: "#/components/parameters/collectionFilter"
        - $ref: "#/components/parameters/collectionSort"
        - $ref: "#/components/parameters/collectionQuery"
      responses:
        "200":
          content:
            application/json:
              schema:
                items:
                  $ref: "#/components/schemas/CustomerTimeline"
                type: array
          description: A list of customer timeline messages was retrieved successfully.
          headers:
            Pagination-Limit:
              $ref: "#/components/headers/Pagination-Limit"
            Pagination-Offset:
              $ref: "#/components/headers/Pagination-Offset"
            Pagination-Total:
              $ref: "#/components/headers/Pagination-Total"
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
      summary: Retrieve a list of customer timeline messages
      tags:
        - Customers Timeline
      x-code-samples:
        - lang: JavaScript
          source: >-
            // all parameters are optional except for the `id`

            const firstCollection = await api.customers
                .getAllTimelineMessages({id: 'my-customer'});

            // alternatively you can specify one or more of them

            const params = {id: 'my-customer', limit: 20, offset: 100};

            const secondCollection = await api.customers.getAllTimelineMessages(params);


            // access the collection items, each item is a Member

            secondCollection.items
                .forEach(message =&gt; console.log(message.fields.eventType));
      x-sdk-operation-name: getAllTimelineMessages
    parameters:
      - $ref: "#/components/parameters/resourceId"
      - $ref: "#/components/parameters/organizationId"
    post:
      description: |
        Create a customer Timeline comment or custom defined event.
      operationId: PostCustomerTimeline
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CustomerTimeline"
        description: Customer Timeline resource.
        required: true
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CustomerTimeline"
          description: Customer Timeline comment or custom defined event was created.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "422":
          $ref: "#/components/responses/ValidationError"
      summary: Create a customer Timeline comment or custom defined event
      tags:
        - Customers Timeline
      x-code-samples:
        - lang: JavaScript
          source: >-
            // Create a comment

            const firstComment = await api
                .customers.createTimelineComment({id: 'my-customer-id', data: {message: 'Your comment here'}});

            // Using params object, mentions and references

            const message = `Example of mentions @user@mydomain.com and references #customers-customer-id`;

            const params = {
                id: 'my-customer-id',
                data: {
                    message,
                },
            };

            const secondComment = await api.customers.createTimelineComment(params);
      x-sdk-operation-name: createTimelineComment
  "/customers/{id}/timeline/{messageId}":
    delete:
      description: |
        Delete a Customer Timeline message with predefined identifier string.
      operationId: DeleteCustomerTimeline
      responses:
        "204":
          description: Customer Timeline message was deleted.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "404":
          $ref: "#/components/responses/NotFound"
        "409":
          $ref: "#/components/responses/Conflict"
      summary: Delete a Customer Timeline message
      tags:
        - Customers Timeline
      x-code-samples:
        - lang: JavaScript
          source: >-
            const request = await api.customers
                .deleteTimelineMessage({id: 'foobar-001', messageId: 'message-202'});

            // the request does not return any fields but

            // you can confirm the success using the status code

            console.log(request.response.status); // 204
      x-sdk-operation-name: deleteTimelineMessage
    get:
      description: |
        Retrieve a customer message with specified identifier string.
      operationId: GetCustomerTimeline
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CustomerTimeline"
          description: Customer message was retrieved successfully.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "404":
          $ref: "#/components/responses/NotFound"
      summary: Retrieve a customer Timeline message
      tags:
        - Customers Timeline
      x-code-samples:
        - lang: JavaScript
          source: >-
            const message = await api.customers
                .getTimelineMessage({id: 'foobar-001', messageId: 'message-202'});
            console.log(message.fields.eventType);
      x-sdk-operation-name: getTimelineMessage
    parameters:
      - $ref: "#/components/parameters/resourceId"
      - description: The Customer Timeline message ID.
        in: path
        name: messageId
        required: true
        schema:
          type: string
      - $ref: "#/components/parameters/organizationId"
  "/customers/{id}/upcoming-invoices":
    get:
      description: >
        Retrieve a list of upcoming invoices from the subscriptions which
        belong to. the given customer.

        The endpoint is temporary before upcoming invoices get a complete integration.
      operationId: GetCustomerUpcomingInvoiceCollection
      parameters:
        - $ref: "#/components/parameters/collectionExpand"
      responses:
        "200":
          content:
            application/json:
              schema:
                items:
                  $ref: "#/components/schemas/Invoice"
                type: array
          description: Upcoming invoices are retrieved successfully.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "404":
          $ref: "#/components/responses/NotFound"
      summary: Retrieve customer's upcoming invoices
      tags:
        - Invoices
      x-sdk-operation-name: getAllUpcomingInvoices
    parameters:
      - $ref: "#/components/parameters/resourceId"
      - $ref: "#/components/parameters/organizationId"
  /digital-wallets/validation:
    post:
      description: |
        [FramePay](https://docs.rebilly.com/docs/developer-docs/framepay/)
        is the recommended way to use when validating a digital wallet session.
      operationId: PostDigitalWalletValidation
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/DigitalWalletValidation"
        description: Digital wallet validation request.
        required: true
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/DigitalWalletValidation"
          description: Digital wallet validation was made.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "422":
          $ref: "#/components/responses/ValidationError"
      security:
        - PublishableApiKey: []
        - SecretApiKey: []
        - JWT: []
      summary: Validate a digital wallet session
      tags:
        - Payment Tokens
      x-sdk-operation-name: create
  /disputes:
    get:
      description: |
        Retrieve a list of disputes.
      operationId: GetDisputeCollection
      parameters:
        - $ref: "#/components/parameters/collectionFilter"
        - $ref: "#/components/parameters/collectionSort"
        - $ref: "#/components/parameters/collectionLimit"
        - $ref: "#/components/parameters/collectionOffset"
        - $ref: "#/components/parameters/collectionQuery"
        - $ref: "#/components/parameters/collectionExpand"
      responses:
        "200":
          content:
            application/json:
              schema:
                items:
                  $ref: "#/components/schemas/Dispute"
                type: array
          description: A list of disputes was retrieved successfully.
          headers:
            Pagination-Limit:
              $ref: "#/components/headers/Pagination-Limit"
            Pagination-Offset:
              $ref: "#/components/headers/Pagination-Offset"
            Pagination-Total:
              $ref: "#/components/headers/Pagination-Total"
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
      summary: Retrieve a list of disputes
      tags:
        - Disputes
      x-code-samples:
        - lang: PHP
          source: |
            $disputes = $client-&gt;disputes()-&gt;search([
                'filter' =&gt; 'transactionId:testId',
            ]);
        - lang: JavaScript
          source: >-
            // all parameters are optional

            const firstCollection = await api.disputes.getAll();


            // alternatively you can specify one or more of them

            const params = {limit: 20, offset: 100, sort: '-createdTime'}; 

            const secondCollection = await api.disputes.getAll(params);


            // access the collection items, each item is a Member

            secondCollection.items.forEach(dispute =&gt; console.log(dispute.fields.transactionId));




            // alternatively, you can get disputes as a CSV file

            // all parameters are optional

            const firstFile = await api.disputes.downloadCSV();


            // alternatively you can specify one or more of them

            const params = {limit: 20, offset: 100, sort: '-createdTime'}; 

            const secondFile = await api.disputes.downloadCSV(params);


            // access the file data to view the CSV content 

            console.log(secondFile.data);
      x-sdk-operation-name: getAll
    parameters:
      - $ref: "#/components/parameters/organizationId"
    post:
      description: |
        Create a dispute.
      operationId: PostDispute
      requestBody:
        $ref: "#/components/requestBodies/Dispute"
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Dispute"
          description: Dispute was created.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "422":
          $ref: "#/components/responses/ValidationError"
      summary: Create a dispute
      tags:
        - Disputes
      x-code-samples:
        - lang: PHP
          source: |
            $disputeForm = new Rebilly\Entities\Dispute();
            $disputeForm-&gt;setTransactionId('transactionId');
            $disputeForm-&gt;setCurrency('USD');
            $disputeForm-&gt;setAmount(10);
            $disputeForm-&gt;setReasonCode(1000);
            $disputeForm-&gt;setType($disputeForm::TYPE_1CB);
            $disputeForm-&gt;setStatus($disputeForm::STATUS_RESPONSE_NEEDED);
            $disputeForm-&gt;setPostedTime('2025-01-01 05:00:00');

            try {
                $dispute = $client-&gt;disputes()-&gt;create($disputeForm);
            } catch (UnprocessableEntityException $e) {
                echo $e-&gt;getMessage();
            }
        - lang: JavaScript
          source: >-
            // first set the properties for the new dispute

            const data = {
                transactionId: 'my-transaction-id',
                currency: 'USD',
                amount: 5,
                reasonCode: '1000',
                type: 'first-chargeback',
                status: 'response-needed',
                acquirerReferenceNumber: '143543',
                postedTime: '2017-09-19T20:46:48Z',
                deadlineTime: '2017-09-19T20:46:48Z'
            };


            // the ID is optional

            const firstdispute = await api.disputes.create({data});


            // or you can provide one

            const secondDispute = await api.disputes.create({id: 'my-second-id', data});
      x-sdk-operation-name: create
  "/disputes/{id}":
    get:
      description: |
        Retrieve a dispute with specified identifier string.
      operationId: GetDispute
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Dispute"
          description: Dispute was retrieved successfully.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "404":
          $ref: "#/components/responses/NotFound"
      summary: Retrieve a dispute
      tags:
        - Disputes
      x-code-samples:
        - lang: PHP
          source: |
            $dispute = $client-&gt;disputes()-&gt;load('disputeId');
        - lang: JavaScript
          source: |-
            const dispute = await api.disputes.get({id: 'foobar-001'});
            console.log(dispute.fields.firstName);
      x-sdk-operation-name: get
    parameters:
      - $ref: "#/components/parameters/resourceId"
      - $ref: "#/components/parameters/organizationId"
    put:
      description: |
        Create or update a Dispute with predefined identifier string.
      operationId: PutDispute
      requestBody:
        $ref: "#/components/requestBodies/Dispute"
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Dispute"
          description: Dispute was updated.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Dispute"
          description: Dispute was created.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "422":
          $ref: "#/components/responses/ValidationError"
      summary: Create or update a Dispute with predefined ID
      tags:
        - Disputes
      x-code-samples:
        - lang: PHP
          source: >
            $disputeForm = new Rebilly\Entities\Dispute();

            $disputeForm-&gt;setTransactionId('transactionId');

            $disputeForm-&gt;setCurrency('USD');

            $disputeForm-&gt;setAmount(10);

            $disputeForm-&gt;setReasonCode(1000);

            $disputeForm-&gt;setType($disputeForm::TYPE_1CB);

            $disputeForm-&gt;setStatus($disputeForm::STATUS_RESPONSE_NEEDED);

            $disputeForm-&gt;setPostedTime('2025-01-01 05:00:00');


            try {
                $dispute = $client-&gt;disputes()-&gt;update('disputeId', $dispute);
            } catch (UnprocessableEntityException $e) {
                echo $e-&gt;getMessage();
            }
        - lang: JavaScript
          source: >-
            // creating a dispute

            const data = {
                transactionId: 'my-transaction-id',
                currency: 'USD',
                amount: 5,
                reasonCode: '1000',
                type: 'first-chargeback',
                status: 'response-needed',
                acquirerReferenceNumber: '143543',
                postedTime: '2017-09-19T20:46:48Z',
                deadlineTime: '2017-09-19T20:46:48Z'
            };


            // the ID is optional

            const firstdispute = await api.disputes.create({data});


            // or you can provide one

            const secondDispute = await api.disputes.create({id: 'my-second-id', data});




            // updating a dispute

            const data = {
                transactionId: 'my-other-transaction-id',
                currency: 'USD',
                amount: 5,
                reasonCode: '1000',
                type: 'first-chargeback',
                status: 'response-needed',
                acquirerReferenceNumber: '143543',
                postedTime: '2017-09-19T20:46:48Z',
                deadlineTime: '2017-09-19T20:46:48Z'
            };


            const dispute = await api.disputes.update({id: 'my-second-id', data});
      x-sdk-operation-name: update
  /files:
    get:
      description: |
        Retrieve a list of files.
      operationId: GetFileCollection
      parameters:
        - $ref: "#/components/parameters/collectionLimit"
        - $ref: "#/components/parameters/collectionOffset"
        - $ref: "#/components/parameters/collectionFilter"
        - $ref: "#/components/parameters/collectionQuery"
        - $ref: "#/components/parameters/collectionExpand"
        - $ref: "#/components/parameters/collectionFields"
        - $ref: "#/components/parameters/collectionSort"
      responses:
        "200":
          content:
            application/json:
              schema:
                items:
                  $ref: "#/components/schemas/File"
                type: array
          description: A list of Files was retrieved successfully.
          headers:
            Pagination-Limit:
              $ref: "#/components/headers/Pagination-Limit"
            Pagination-Offset:
              $ref: "#/components/headers/Pagination-Offset"
            Pagination-Total:
              $ref: "#/components/headers/Pagination-Total"
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
      summary: Retrieve a list of files
      tags:
        - Files
      x-code-samples:
        - lang: PHP
          source: |
            $files = $client-&gt;files()-&gt;search([
                'filter' =&gt; 'name:TestFile',
            ]);
        - lang: JavaScript
          source: >-
            // all parameters are optional

            const firstCollection = await api.files.getAll();


            // alternatively you can specify one or more of them

            const params = {limit: 20, offset: 100, sort: '-createdTime'}; 

            const secondCollection = await api.files.getAll(params);


            // access the collection items, each item is a Member

            secondCollection.items.forEach(file =&gt; console.log(file.fields.name));
      x-sdk-operation-name: getAll
    parameters:
      - $ref: "#/components/parameters/organizationId"
    post:
      description: >
        Additionally, a file can be sent with:.
         - multipart/form-data POST request: in this case all property names are the same as the JSON ones (`file` is an uploaded file)
         - file body request: the file body is sent as the request body, with the appropriate `Content-Type`. No additional
         properties can be set along the request data

        The following file types only are allowed:
         - jpg
         - png
         - gif
         - pdf
         - mp3


        If using a Publishable Api Key, only private files can be created. The files can later on be modified or used using
         a secret API key.
      operationId: PostFile
      requestBody:
        content:
          application/json:
            schema:
              oneOf:
                - $ref: "#/components/schemas/FileCreateFromInline"
                - $ref: "#/components/schemas/FileCreateFromUrl"
        required: true
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/File"
          description: File was created.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "422":
          $ref: "#/components/responses/ValidationError"
      security:
        - SecretApiKey: []
        - JWT: []
        - PublishableApiKey: []
      summary: Create a file
      tags:
        - Files
      x-code-samples:
        - lang: PHP
          source: |
            $fileForm = new Rebilly\Entities\File();
            $fileForm-&gt;setUrl('http://test.com/somefile.jpg');

            try {
                $file = $client-&gt;files()-&gt;create($fileForm);
            } catch (UnprocessableEntityException $e) {
                echo $e-&gt;getMessage();
            }
        - lang: JavaScript
          source: >-
            // using a FileList to fetch a file

            const fileObject = fileList[0];


            const addedFile = await api.files.upload({fileObject});





            // or, upload and update a file at the same time


            // using a FileList to fetch a file

            const fileObject = fileList[0];


            // define file data

            const data = {
                description: 'my new file',
                tags: ['original']
            };


            const addedFile = await api.files.uploadAndUpdate({fileObject, data});
      x-sdk-operation-name: upload
  "/files/{id}":
    delete:
      description: |
        Delete the File with predefined identifier string.
      operationId: DeleteFile
      responses:
        "204":
          description: File was deleted.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "404":
          $ref: "#/components/responses/NotFound"
      summary: Delete a File
      tags:
        - Files
      x-code-samples:
        - lang: PHP
          source: |
            $client-&gt;files()-&gt;delete('fileId');
        - lang: JavaScript
          source: >-
            // simply delete a file

            const request = await api.files.delete({id: 'my-file-id'});


            // the request does not return any fields but

            // you can confirm the success using the status code

            console.log(request.response.status); // 204





            // or, delete a file and its related resource attachments

            // use this method to remove the file completely from all resources at once.


            const request = await api.files.detachAndDelete({id: 'my-file-id'});


            // the request does not return any fields but

            // you can confirm the success using the status code

            console.log(request.response.status); // 204
      x-sdk-operation-name: delete
    get:
      description: |
        Retrieve a File with specified identifier string.
      operationId: GetFile
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/File"
          description: File was retrieved successfully.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "404":
          $ref: "#/components/responses/NotFound"
      summary: Retrieve a File Record
      tags:
        - Files
      x-code-samples:
        - lang: PHP
          source: |
            $file = $client-&gt;files()-&gt;load('fileId');
        - lang: JavaScript
          source: |-
            const file = await api.files.get({id: 'foobar-001'});
            console.log(file.fields.name);
      x-sdk-operation-name: get
    parameters:
      - $ref: "#/components/parameters/resourceId"
      - $ref: "#/components/parameters/organizationId"
    put:
      description: >
        Update the File with predefined ID. Note that file can be uploaded
        with POST. only.
      operationId: PutFile
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/File"
        description: File resource.
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/File"
          description: File was updated.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "404":
          $ref: "#/components/responses/NotFound"
        "422":
          $ref: "#/components/responses/ValidationError"
      summary: Update the File with predefined ID
      tags:
        - Files
      x-code-samples:
        - lang: PHP
          source: |
            $fileForm = new Rebilly\Entities\File();
            $fileForm-&gt;setDescription('This is a test file');

            try {
                $file = $client-&gt;files()-&gt;update('fileId', $fileForm);
            } catch (UnprocessableEntityException $e) {
                echo $e-&gt;getMessage();
            }
        - lang: JavaScript
          source: >-
            // define the values to update

            const data = {
                name: 'new file name',
                description: 'a fitting description',
                tags: ['original']
            };


            const file = await api.files.update({id: 'my-file-id', data});





            // or, upload and update a file at the same time


            // using a FileList to fetch a file

            const fileObject = fileList[0];


            // define file data

            const data = {
                description: 'my new file',
                tags: ['original']
            };


            const addedFile = await api.files.uploadAndUpdate({fileObject, data});
      x-sdk-operation-name: update
  "/files/{id}/download":
    get:
      description: |
        Download a file.
      operationId: GetFileDownload
      responses:
        "200":
          content:
            application/json:
              schema:
                readOnly: true
                type: string
          description: The file was retrieved successfully.
          headers:
            Content-Length:
              description: The number of bytes in the file.
              schema:
                type: integer
            Content-Type:
              description: The MIME type of the file.
              schema:
                type: string
        "302":
          $ref: "#/components/responses/Found"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "404":
          $ref: "#/components/responses/NotFound"
      summary: Download a file
      tags:
        - Files
      x-code-samples:
        - lang: JavaScript
          source: |-
            const file = await api.files.download({id: 'my-file-id'});

            // access the file ArrayBuffer to view the content 
            console.log(file.data);
      x-sdk-operation-name: download
    parameters:
      - $ref: "#/components/parameters/resourceId"
      - $ref: "#/components/parameters/organizationId"
      - $ref: "#/components/parameters/imageSize"
  "/files/{id}/download{extension}":
    get:
      description: |
        Download image in specific format. Images are converted server-side.
      operationId: GetFileDownloadExtension
      responses:
        "200":
          content:
            application/json:
              schema:
                readOnly: true
                type: string
          description: The file was retrieved successfully.
          headers:
            Content-Length:
              description: The number of bytes in the file.
              schema:
                type: integer
            Content-Type:
              description: The MIME type of the file.
              schema:
                type: string
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "404":
          $ref: "#/components/responses/NotFound"
        "422":
          $ref: "#/components/responses/ValidationError"
      summary: Download image in specific format
      tags:
        - Files
      x-sdk-operation-name: downloadWithExtension
    parameters:
      - $ref: "#/components/parameters/resourceId"
      - description: File extension which also indicates the desired file format.
        in: path
        name: extension
        required: true
        schema:
          enum:
            - .png
            - .jpg
            - .gif
          type: string
      - $ref: "#/components/parameters/organizationId"
  /invoices:
    get:
      description: |
        Retrieve a list of invoices.
      operationId: GetInvoiceCollection
      parameters:
        - $ref: "#/components/parameters/collectionFilter"
        - $ref: "#/components/parameters/collectionSort"
        - $ref: "#/components/parameters/collectionLimit"
        - $ref: "#/components/parameters/collectionOffset"
        - $ref: "#/components/parameters/collectionQuery"
        - $ref: "#/components/parameters/collectionExpand"
      responses:
        "200":
          content:
            application/json:
              schema:
                items:
                  $ref: "#/components/schemas/Invoice"
                type: array
          description: A list of invoices was retrieved successfully.
          headers:
            Pagination-Limit:
              $ref: "#/components/headers/Pagination-Limit"
            Pagination-Offset:
              $ref: "#/components/headers/Pagination-Offset"
            Pagination-Total:
              $ref: "#/components/headers/Pagination-Total"
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
      summary: Retrieve a list of invoices
      tags:
        - Invoices
      x-code-samples:
        - lang: PHP
          source: |
            $invoices = $client-&gt;invoices()-&gt;search([
                'filter' =&gt; 'customerId:testCustomerId',
            ]);
        - lang: JavaScript
          source: >-
            // all parameters are optional

            const firstCollection = await api.invoices.getAll();


            // alternatively you can specify one or more of them

            const params = {limit: 20, offset: 100, sort: '-createdTime'}; 

            const secondCollection = await api.invoices.getAll(params);


            // access the collection items, each item is a Member

            secondCollection.items.forEach(invoice =&gt; console.log(invoice.fields.firstName));




            // alternatively, download as a CSV file

            // all parameters are optional

            const firstFile = await api.invoices.downloadCSV();


            // alternatively you can specify one or more of them

            const params = {limit: 20, offset: 100, sort: '-createdTime'}; 

            const secondFile = await api.invoices.downloadCSV(params);


            // access the file data to view the CSV content 

            console.log(secondFile.data);
      x-sdk-operation-name: getAll
    parameters:
      - $ref: "#/components/parameters/organizationId"
    post:
      description: |
        Create an invoice.
      operationId: PostInvoice
      requestBody:
        $ref: "#/components/requestBodies/Invoice"
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Invoice"
          description: Invoice was created.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "422":
          $ref: "#/components/responses/ValidationError"
      summary: Create an invoice
      tags:
        - Invoices
      x-code-samples:
        - lang: PHP
          source: |
            &lt;?
            $invoiceForm = new Rebilly\Entities\Invoice();
            $invoiceForm-&gt;setCustomerId('customerId');
            $invoiceForm-&gt;setWebsiteId('websiteId');
            $invoiceForm-&gt;setCurrency('USD');
            $invoiceForm-&gt;setBillingAddress([
                'firstName' =&gt; 'John',
                'lastName' =&gt; 'Doe',
                'organization' =&gt; 'Test LTD',
                'address' =&gt; 'Test street 5',
                'address2' =&gt; 'Test house 5',
                'city' =&gt; 'New York',
                'region' =&gt; 'Long Island',
                'country' =&gt; 'US',
                'postalCode' =&gt; '123456',
                'emails' =&gt; [
                    [
                        'label' =&gt; 'main',
                        'value' =&gt; 'johndoe@testemail.com',
                        'primary' =&gt; true,
                    ],
                    [
                        'label' =&gt; 'secondary',
                        'value' =&gt; 'otheremail@testemail.com',
                    ],
                ],
                'phoneNumbers' =&gt; [
                    [
                        'label' =&gt; 'work',
                        'value' =&gt; '+123456789',
                        'primary' =&gt; true,
                    ],
                    [
                        'label' =&gt; 'home',
                        'value' =&gt; '+9874654321',
                    ],
                ],
            ]);

            try {
                $invoice = $client-&gt;invoices()-&gt;create($invoiceForm);
            } catch (UnprocessableEntityException $e) {
                echo $e-&gt;getMessage();
            }
        - lang: JavaScript
          source: >-
            // first set the properties for the new invoice

            const data = {
                customerId: 'foobar-0001',
                websiteId: 'my-main-website',
                currency: 'USD',
                billingAddress: {
                    firstName: 'Johnny',
                    lastName: 'Brown',
                    emails: [{
                        label: 'main',
                        value: 'johnny+test@grr.la',
                        primary: true
                    }],
                },
                deliveryAddress: {
                    firstName: 'Johnny',
                    lastName: 'Brown',
                    emails: [{
                        label: 'main',
                        value: 'johnny+test@grr.la',
                        primary: true
                    }],
                },
                notes: `customer's first invoice`,
            };


            // the ID is optional

            const firstInvoice = await api.invoices.create({data});


            // or you can provide one

            const secondInvoice = await api.invoices.create({id: 'my-second-id', data});
      x-sdk-operation-name: create
  "/invoices/{id}":
    get:
      description: |
        Retrieve an invoice with specified identifier string.
      operationId: GetInvoice
      parameters:
        - $ref: "#/components/parameters/mediaTypeJsonPdf"
        - $ref: "#/components/parameters/collectionExpand"
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Invoice"
            application/pdf:
              schema:
                $ref: "#/components/schemas/Invoice"
          description: Invoice was retrieved successfully.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "404":
          $ref: "#/components/responses/NotFound"
      summary: Retrieve an invoice
      tags:
        - Invoices
      x-code-samples:
        - lang: PHP
          source: |
            $invoice = $client-&gt;invoices()-&gt;load('invoiceId');
        - lang: JavaScript
          source: |-
            const invoice = await api.invoices.get({id: 'foobar-001'});
            console.log(invoice.fields.primaryAddress.firstName);


            // alternatively, download as a PDF file
            const pdf = await api.invoices.downloadPDF({id: 'foobar-001'});
            // the invoice's data in arraybuffer format
            console.log(pdf.data);
      x-sdk-operation-name: get
    parameters:
      - $ref: "#/components/parameters/resourceId"
      - $ref: "#/components/parameters/organizationId"
    put:
      description: |
        Create or update an invoice with predefined identifier string.
      operationId: PutInvoice
      requestBody:
        $ref: "#/components/requestBodies/Invoice"
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Invoice"
          description: Invoice was updated.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Invoice"
          description: Invoice was created.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "404":
          $ref: "#/components/responses/NotFound"
        "422":
          $ref: "#/components/responses/ValidationError"
      summary: Create or update an invoice with predefined ID
      tags:
        - Invoices
      x-code-samples:
        - lang: PHP
          source: >
            &lt;?

            $invoiceForm = new Rebilly\Entities\Invoice();

            $invoiceForm-&gt;setCustomerId('customerId');

            $invoiceForm-&gt;setWebsiteId('websiteId');

            $invoiceForm-&gt;setCurrency('USD');

            $invoiceForm-&gt;setBillingAddress([
                'firstName' =&gt; 'John',
                'lastName' =&gt; 'Doe',
                'organization' =&gt; 'Test LTD',
                'address' =&gt; 'Test street 5',
                'address2' =&gt; 'Test house 5',
                'city' =&gt; 'New York',
                'region' =&gt; 'Long Island',
                'country' =&gt; 'US',
                'postalCode' =&gt; '123456',
                'emails' =&gt; [
                    [
                        'label' =&gt; 'main',
                        'value' =&gt; 'johndoe@testemail.com',
                        'primary' =&gt; true,
                    ],
                    [
                        'label' =&gt; 'secondary',
                        'value' =&gt; 'otheremail@testemail.com',
                    ],
                ],
                'phoneNumbers' =&gt; [
                    [
                        'label' =&gt; 'work',
                        'value' =&gt; '+123456789',
                        'primary' =&gt; true,
                    ],
                    [
                        'label' =&gt; 'home',
                        'value' =&gt; '+9874654321',
                    ],
                ],
            ]);


            try {
                $invoice = $client-&gt;invoices()-&gt;update('invoiceId', $invoiceForm);
            } catch (UnprocessableEntityException $e) {
                echo $e-&gt;getMessage();
            }
        - lang: JavaScript
          source: >-
            // creating an invoice

            const data = {
                customerId: 'foobar-0001',
                websiteId: 'my-main-website',
                currency: 'USD',
                billingAddress: {
                    firstName: 'Johnny',
                    lastName: 'Brown',
                    emails: [{
                        label: 'main',
                        value: 'johnny+test@grr.la',
                        primary: true
                    }],
                },
                deliveryAddress: {
                    firstName: 'Johnny',
                    lastName: 'Brown',
                    emails: [{
                        label: 'main',
                        value: 'johnny+test@grr.la',
                        primary: true
                    }],
                },
                notes: `customer's first invoice`,
            };


            // the ID is optional

            const firstInvoice = await api.invoices.create({data});


            // or you can provide one

            const secondInvoice = await api.invoices.create({id: 'my-second-id', data});




            // updating an invoice

            const data = {
                customerId: 'foobar-0001',
                websiteId: 'my-main-website',
                currency: 'USD',
                billingAddress: {
                    firstName: 'Johnny',
                    lastName: 'Brown',
                    emails: [{
                        label: 'main',
                        value: 'johnny+test@grr.la',
                        primary: true
                    }],
                },
                deliveryAddress: {
                    firstName: 'Johnny',
                    lastName: 'Brown',
                    emails: [{
                        label: 'main',
                        value: 'johnny+test@grr.la',
                        primary: true
                    }],
                },
                notes: `customer's first invoice`,
            };


            const invoice = await api.invoices.update({id: 'my-second-id', data});
      x-sdk-operation-name: update
  "/invoices/{id}/abandon":
    parameters:
      - $ref: "#/components/parameters/resourceId"
      - $ref: "#/components/parameters/organizationId"
    post:
      description: |
        Abandon an invoice with specified identifier string.
      operationId: PostInvoiceAbandonment
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Invoice"
          description: Invoice was abandoned successfully.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "404":
          $ref: "#/components/responses/NotFound"
      summary: Abandon an invoice
      tags:
        - Invoices
      x-code-samples:
        - lang: PHP
          source: |
            $invoice = $client-&gt;invoices()-&gt;abandon('invoiceId');
        - lang: JavaScript
          source: >-
            const abandonedInvoice = await api.invoices.abandon({id:
            'my-invoice-id'});

            console.log(abandonedInvoice.fields.status);
      x-sdk-operation-name: abandon
  "/invoices/{id}/issue":
    parameters:
      - $ref: "#/components/parameters/resourceId"
      - $ref: "#/components/parameters/organizationId"
    post:
      description: >
        Issue an invoice with specified identifier string. It must be in
        `draft` status.
      operationId: PostInvoiceIssuance
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/InvoiceIssue"
        description: InvoiceIssue resource.
        required: true
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Invoice"
          description: Invoice was issued successfully.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "404":
          $ref: "#/components/responses/NotFound"
        "409":
          $ref: "#/components/responses/Conflict"
      summary: Issue an invoice
      tags:
        - Invoices
      x-code-samples:
        - lang: PHP
          source: >
            $invoice = $client-&gt;invoices()-&gt;issue('invoiceId', '2025-01-01
            05:00:00');
        - lang: JavaScript
          source: >-
            // define the issued time

            const data = {
                issuedTime: "2017-09-19T20:46:51Z"
            };


            // issue the invoice without an issued time

            const firstInvoice = await api.invoices.issue({id: 'my-first-id'});


            // or include it

            const secondInvoice = await api.invoices.issue({id: 'my-second-id', data});
      x-sdk-operation-name: issue
  "/invoices/{id}/items":
    get:
      description: |
        Retrieve an invoice items with specified invoice identifier string.
      operationId: GetInvoiceItemCollection
      parameters:
        - $ref: "#/components/parameters/collectionLimit"
        - $ref: "#/components/parameters/collectionOffset"
        - $ref: "#/components/parameters/collectionExpand"
      responses:
        "200":
          content:
            application/json:
              schema:
                items:
                  $ref: "#/components/schemas/InvoiceItem"
                type: array
          description: Invoice items were retrieved successfully.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "404":
          $ref: "#/components/responses/NotFound"
      summary: Retrieve invoice items
      tags:
        - Invoices
      x-code-samples:
        - lang: PHP
          source: |
            $invoiceItems = $client-&gt;invoiceItems()-&gt;search('invoiceId', [
                'filter' =&gt; 'quantity:5',
            ]);
        - lang: JavaScript
          source: >-
            // get the top 20 invoice items for this ID

            const invoiceItems = await api.invoices.getAllInvoiceItems({id: 'my-invoice-id', limit: 20});

            invoiceItems.items.forEach(item =&gt; console.log(item.fields.description));
      x-sdk-operation-name: getAllInvoiceItems
    parameters:
      - $ref: "#/components/parameters/resourceId"
      - $ref: "#/components/parameters/organizationId"
    post:
      description: |
        Create an invoice item.
      operationId: PostInvoiceItem
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/InvoiceItem"
        description: InvoiceItem resource.
        required: true
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/InvoiceItem"
          description: InvoiceItem was created.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "422":
          $ref: "#/components/responses/ValidationError"
      summary: Create an invoice item
      tags:
        - Invoices
      x-code-samples:
        - lang: PHP
          source: >
            $invoiceItemForm = new Rebilly\Entities\InvoiceItem();

            $invoiceItemForm-&gt;setType($invoiceItemForm::TYPE_DEBIT);

            $invoiceItemForm-&gt;setUnitPrice(0.99);

            $invoiceItemForm-&gt;setQuantity(5);


            try {
                $invoiceItem = $client-&gt;invoiceItems()-&gt;create($invoiceItemForm, 'invoiceId');
            } catch (UnprocessableEntityException $e) {
                echo $e-&gt;getMessage();
            }
        - lang: JavaScript
          source: >-
            // first set the properties for the new invoice item

            const data = {
                type: 'debit', 
                unitPrice: 5
            };


            const invoiceItem = await api.invoices.createInvoiceItem({id: 'my-second-id', data});
      x-sdk-operation-name: createInvoiceItem
  "/invoices/{id}/recalculate":
    parameters:
      - $ref: "#/components/parameters/resourceId"
      - $ref: "#/components/parameters/organizationId"
    post:
      description: >
        Recalculate an invoice with specified identifier string.

        It will recalculate shipping rates, taxes, discounts. It is useful when coupon was revoked or customer redeemed coupon after invoice was issued and you want to apply it to this invoice.
      operationId: PostInvoiceRecalculation
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Invoice"
          description: Invoice was recalculated successfully.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "404":
          $ref: "#/components/responses/NotFound"
        "409":
          $ref: "#/components/responses/Conflict"
      summary: Recalculate an invoice
      tags:
        - Invoices
      x-sdk-operation-name: recalculate
  "/invoices/{id}/reissue":
    parameters:
      - $ref: "#/components/parameters/resourceId"
      - $ref: "#/components/parameters/organizationId"
    post:
      description: >
        Reissue an invoice with specified identifier string. It must be
        issued. (status must be `unpaid` or `past-due`).
      operationId: PostInvoiceReissuance
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/InvoiceReissue"
        description: InvoiceReissue resource.
        required: true
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Invoice"
          description: Invoice was reissued successfully.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "404":
          $ref: "#/components/responses/NotFound"
        "409":
          $ref: "#/components/responses/Conflict"
      summary: Reissue an invoice
      tags:
        - Invoices
      x-sdk-operation-name: reissue
  "/invoices/{id}/timeline":
    get:
      description: |
        Retrieve a list of invoice timeline messages.
      operationId: GetInvoiceTimelineCollection
      parameters:
        - $ref: "#/components/parameters/collectionLimit"
        - $ref: "#/components/parameters/collectionOffset"
        - $ref: "#/components/parameters/collectionFilter"
        - $ref: "#/components/parameters/collectionSort"
        - $ref: "#/components/parameters/collectionQuery"
      responses:
        "200":
          content:
            application/json:
              schema:
                items:
                  $ref: "#/components/schemas/InvoiceTimeline"
                type: array
          description: A list of invoice timeline messages was retrieved successfully.
          headers:
            Pagination-Limit:
              $ref: "#/components/headers/Pagination-Limit"
            Pagination-Offset:
              $ref: "#/components/headers/Pagination-Offset"
            Pagination-Total:
              $ref: "#/components/headers/Pagination-Total"
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
      summary: Retrieve a list of invoice timeline messages
      tags:
        - Invoices
      x-code-samples:
        - lang: JavaScript
          source: >-
            // all parameters are optional except for the `id`

            const firstCollection = await api.invoices
                .getAllTimelineMessages({id: 'my-invoice'});

            // alternatively you can specify one or more of them

            const params = {id: 'my-invoice', limit: 20, offset: 100};

            const secondCollection = await api.invoices.getAllTimelineMessages(params);


            // access the collection items, each item is a Member

            secondCollection.items
                .forEach(message =&gt; console.log(message.fields.eventType));
      x-sdk-operation-name: getAllTimelineMessages
    parameters:
      - $ref: "#/components/parameters/resourceId"
      - $ref: "#/components/parameters/organizationId"
    post:
      description: |
        Create an invoice Timeline comment.
      operationId: PostInvoiceTimeline
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/InvoiceTimeline"
        description: Invoice Timeline resource.
        required: true
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/InvoiceTimeline"
          description: Invoice Timeline comment was created.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "422":
          $ref: "#/components/responses/ValidationError"
      summary: Create an invoice Timeline comment
      tags:
        - Invoices
      x-code-samples:
        - lang: JavaScript
          source: >-
            // Create a comment

            const firstComment = await api
                .invoices.createTimelineComment({id: 'my-invoice-id', data: {message: 'Your comment here'}});

            // Using params object, mentions and references

            const message = `Example of mentions @user@mydomain.com and references #invoice-subscription-id`;

            const params = {
                id: 'my-invoice-id',
                data: {
                    message,
                },
            };

            const secondComment = await api.invoices.createTimelineComment(params);
      x-sdk-operation-name: createTimelineComment
  "/invoices/{id}/timeline/{messageId}":
    delete:
      description: |
        Delete an Invoice Timeline message with predefined identifier string.
      operationId: DeleteInvoiceTimeline
      responses:
        "204":
          description: Invoice Timeline message was deleted.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "404":
          $ref: "#/components/responses/NotFound"
        "409":
          $ref: "#/components/responses/Conflict"
      summary: Delete an Invoice Timeline message
      tags:
        - Invoices
      x-code-samples:
        - lang: JavaScript
          source: >-
            const request = await api.invoices
                .deleteTimelineMessage({id: 'foobar-001', messageId: 'message-202'});

            // the request does not return any fields but

            // you can confirm the success using the status code

            console.log(request.response.status); // 204
      x-sdk-operation-name: deleteTimelineMessage
    get:
      description: |
        Retrieve a invoice message with specified identifier string.
      operationId: GetInvoiceTimeline
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/InvoiceTimeline"
          description: Invoice message was retrieved successfully.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "404":
          $ref: "#/components/responses/NotFound"
      summary: Retrieve an Invoice Timeline message
      tags:
        - Invoices
      x-code-samples:
        - lang: JavaScript
          source: >-
            const message = await api.invoices
                .getTimelineMessage({id: 'foobar-001', messageId: 'message-202'});
            console.log(message.fields.eventType);
      x-sdk-operation-name: getTimelineMessage
    parameters:
      - $ref: "#/components/parameters/resourceId"
      - description: The Invoice Timeline message ID.
        in: path
        name: messageId
        required: true
        schema:
          type: string
      - $ref: "#/components/parameters/organizationId"
  "/invoices/{id}/transaction":
    parameters:
      - $ref: "#/components/parameters/resourceId"
      - $ref: "#/components/parameters/organizationId"
    post:
      description: >
        Apply a transaction to an invoice. The invoice must be unpaid. The
        transaction must have a non-zero unused amount (not fully applied to
        other invoices).
      operationId: PostInvoiceTransaction
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/InvoiceTransaction"
        description: InvoiceTransaction resource.
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Invoice"
          description: Transaction was applied to invoice successfully.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "404":
          $ref: "#/components/responses/NotFound"
        "422":
          $ref: "#/components/responses/ValidationError"
      summary: Apply a transaction to an invoice
      tags:
        - Invoices
      x-code-samples:
        - lang: JavaScript
          source: |
            const params = {
                id: 'my-invoice-id', 
                transactionId: 'my-transaction-id',
                amount: 12,99 
            };

            const invoice = await api.invoices.applyTransaction(params);
      x-sdk-operation-name: applyTransaction
  "/invoices/{id}/transaction-allocations":
    get:
      description: Get the precise amounts from a transaction allocated as invoice payments.
      operationId: GetInvoiceTransactionAllocationCollection
      parameters:
        - $ref: "#/components/parameters/collectionLimit"
        - $ref: "#/components/parameters/collectionOffset"
      responses:
        "200":
          content:
            application/json:
              schema:
                items:
                  $ref: "#/components/schemas/InvoiceTransactionAllocation"
                type: array
          description: List of allocations was retrieved successfully.
          headers:
            Pagination-Limit:
              $ref: "#/components/headers/Pagination-Limit"
            Pagination-Offset:
              $ref: "#/components/headers/Pagination-Offset"
            Pagination-Total:
              $ref: "#/components/headers/Pagination-Total"
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "404":
          $ref: "#/components/responses/NotFound"
      summary: Get transaction amounts allocated to an invoice
      tags:
        - Invoices
      x-sdk-operation-name: getAllTransactionAllocations
    parameters:
      - $ref: "#/components/parameters/resourceId"
      - $ref: "#/components/parameters/organizationId"
  "/invoices/{id}/void":
    parameters:
      - $ref: "#/components/parameters/resourceId"
      - $ref: "#/components/parameters/organizationId"
    post:
      description: |
        Void an invoice with specified identifier string.
      operationId: PostInvoiceVoid
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Invoice"
          description: Invoice was voided successfully.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "404":
          $ref: "#/components/responses/NotFound"
      summary: Void an invoice
      tags:
        - Invoices
      x-code-samples:
        - lang: PHP
          source: |
            $invoice = $client-&gt;invoices()-&gt;void('invoiceId');
        - lang: JavaScript
          source: >-
            const voidedInvoice = await api.invoices.void({id: 'my-invoice-id'});

            console.log(voidedInvoice.fields.status);
      x-sdk-operation-name: void
  /kyc-documents:
    get:
      description: |
        Retrieve a list of KYC documents.
      operationId: GetKycDocumentCollection
      parameters:
        - $ref: "#/components/parameters/collectionLimit"
        - $ref: "#/components/parameters/collectionOffset"
        - $ref: "#/components/parameters/collectionFilter"
        - $ref: "#/components/parameters/collectionSort"
      responses:
        "200":
          content:
            application/json:
              schema:
                items:
                  $ref: "#/components/schemas/KycDocument-2"
                type: array
          description: A list of KYC documents was retrieved successfully.
          headers:
            Pagination-Limit:
              $ref: "#/components/headers/Pagination-Limit"
            Pagination-Offset:
              $ref: "#/components/headers/Pagination-Offset"
            Pagination-Total:
              $ref: "#/components/headers/Pagination-Total"
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
      summary: Retrieve a list of KYC documents
      tags:
        - KYC Documents
      x-code-samples:
        - lang: JavaScript
          source: >-
            // all parameters are optional

            const firstCollection = await api.kycDocuments.getAll();


            // alternatively you can specify one or more of them

            const params = {limit: 20, offset: 100, sort: '-createdTime'};

            const secondCollection = await api.kycDocuments.getAll(params);


            // access the collection items, each item is a Member

            secondCollection.items.forEach(document =&gt; console.log(document.fields.documentType));
      x-sdk-operation-name: getAll
    parameters:
      - $ref: "#/components/parameters/organizationId"
    post:
      description: |
        Create a KYC Document.
      operationId: PostKycDocument
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/KycDocument-2"
        description: Kyc document resource.
        required: true
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/KycDocument-2"
          description: Kyc document was created.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "422":
          $ref: "#/components/responses/ValidationError"
      summary: Create a KYC Document
      tags:
        - KYC Documents
      x-code-samples:
        - lang: JavaScript
          source: |-
            // All fields are required
            const data = {
                fieldId: '4f6cf35x-2c4y-483z-a0a9-158621f77a21',
                customerId: '4f6cf35x-2c4y-483z-a0a9-158621f77a21',
                documentType: 'identity-proof'
            };

            const firstKycDocument = await api.kycDocuments.create({data});
      x-sdk-operation-name: create
  "/kyc-documents/{id}":
    get:
      description: Retrieve a KYC document with specified identifier string.
      operationId: GetKycDocument
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/KycDocument-2"
          description: KYC document was retrieved successfully.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "404":
          $ref: "#/components/responses/NotFound"
      summary: Retrieve a KYC Document
      tags:
        - KYC Documents
      x-code-samples:
        - lang: JavaScript
          source: |-
            const document = await api.kycDocuments.get({id: 'foobar-001'});
            console.log(document.fields.documentType);
      x-sdk-operation-name: get
    parameters:
      - $ref: "#/components/parameters/resourceId"
      - $ref: "#/components/parameters/organizationId"
    put:
      description: Create or update a KYC document with predefined identifier string.
      operationId: PutKycDocument
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/KycDocument-2"
        description: KYC document resource.
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/KycDocument-2"
          description: KYC document was updated.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/KycDocument-2"
          description: KYC document was created.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "404":
          $ref: "#/components/responses/NotFound"
        "422":
          $ref: "#/components/responses/ValidationError"
      summary: Create or update a KYC document with predefined ID
      tags:
        - KYC Documents
      x-code-samples:
        - lang: JavaScript
          source: >-
            // define the values to update

            const data = {
                status: 'accepted'
            };


            const document = await api.kycDocuments.update({id: 'my-second-id', data});
      x-sdk-operation-name: update
  "/kyc-documents/{id}/acceptance":
    parameters:
      - $ref: "#/components/parameters/resourceId"
      - $ref: "#/components/parameters/organizationId"
    post:
      description: >
        Marks that status of the document as `accepted`. Updates the review
        time and reviewer information. Intended to be used for manual overrides.
      operationId: PostKycDocumentAcceptance
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/KycDocument-2"
          description: KYC document acceptance was created.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "404":
          $ref: "#/components/responses/NotFound"
      summary: Accept a KYC document
      tags:
        - KYC Documents
      x-code-samples:
        - lang: JavaScript
          source: >-
            const acceptedDocument = await api.kycDocuments.accept({id:
            'my-second-id'});

            console.log(acceptedDocument.fields.status);
      x-sdk-operation-name: accept
  "/kyc-documents/{id}/matches":
    parameters:
      - $ref: "#/components/parameters/resourceId"
      - $ref: "#/components/parameters/organizationId"
    post:
      description: >
        Updates a KYC document's documentMatches. Intended to be used for
        manual overrides.
      operationId: PostKycDocumentMatches
      requestBody:
        content:
          application/json:
            schema:
              anyOf:
                - $ref: "#/components/schemas/IdentityMatches"
                - $ref: "#/components/schemas/AddressMatches"
        description: Kyc document resource.
        required: true
      responses:
        "204":
          description: KYC document's documentMatches were updated.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "404":
          $ref: "#/components/responses/NotFound"
      summary: Update a KYC document's documentMatches
      tags:
        - KYC Documents
      x-sdk-operation-name: matches
  "/kyc-documents/{id}/rejection":
    parameters:
      - $ref: "#/components/parameters/resourceId"
      - $ref: "#/components/parameters/organizationId"
    post:
      description: >
        Marks that status of the document as `rejected`. Updates the review
        time and reviewer information. Intended to be used for manual overrides.
      operationId: PostKycDocumentRejection
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/KycDocumentRejection"
        description: KYC document resource.
        required: true
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/KycDocument-2"
          description: KYC document rejection was created.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "404":
          $ref: "#/components/responses/NotFound"
        "422":
          $ref: "#/components/responses/ValidationError"
      summary: Reject a KYC document
      tags:
        - KYC Documents
      x-code-samples:
        - lang: JavaScript
          source: >-
            const data = {
                type: 'document-expired',
                message: 'Document is expired'
            }

            const rejectedDocument = await api.kycDocuments.reject({id: 'my-second-id', data});

            console.log(rejectedDocument.fields.rejectionReason.type);
      x-sdk-operation-name: reject
  "/kyc-documents/{id}/review":
    parameters:
      - $ref: "#/components/parameters/resourceId"
      - $ref: "#/components/parameters/organizationId"
    post:
      description: Mark the KYC document as reviewed. Updates the review time and
        reviewer. information.
      operationId: PostKycDocumentReview
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/KycDocument-2"
          description: KYC document was reviewed.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "404":
          $ref: "#/components/responses/NotFound"
        "422":
          $ref: "#/components/responses/ValidationError"
      summary: Review a KYC document
      tags:
        - KYC Documents
      x-code-samples:
        - lang: JavaScript
          source: >-
            const reviewedDocument = await api.kycDocuments.review({id:
            'my-second-id'});

            console.log(reviewedDocument.fields.status);
      x-sdk-operation-name: review
  /kyc-requests:
    get:
      description: |
        Retrieve a list of KYC requests.
      operationId: GetKycRequestCollection
      parameters:
        - $ref: "#/components/parameters/collectionLimit"
        - $ref: "#/components/parameters/collectionOffset"
        - $ref: "#/components/parameters/collectionFilter"
        - $ref: "#/components/parameters/collectionSort"
      responses:
        "200":
          content:
            application/json:
              schema:
                items:
                  $ref: "#/components/schemas/KycRequest"
                type: array
          description: A list of KYC requests was retrieved successfully.
          headers:
            Pagination-Limit:
              $ref: "#/components/headers/Pagination-Limit"
            Pagination-Offset:
              $ref: "#/components/headers/Pagination-Offset"
            Pagination-Total:
              $ref: "#/components/headers/Pagination-Total"
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
      summary: Retrieve a list of KYC requests
      tags:
        - KYC Documents
      x-sdk-operation-name: getAll
    parameters:
      - $ref: "#/components/parameters/organizationId"
    post:
      description: |
        Create a KYC Request.
      operationId: PostKycRequest
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/KycRequest"
        description: Kyc request resource.
        required: true
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/KycRequest"
          description: Kyc request was created.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "422":
          $ref: "#/components/responses/ValidationError"
      summary: Create a KYC Request
      tags:
        - KYC Documents
      x-sdk-operation-name: create
  "/kyc-requests/{id}":
    delete:
      description: |
        Delete the KYC request with the predefined identifier string.
      operationId: DeleteKycRequest
      responses:
        "204":
          description: The KYC request was deleted.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "404":
          $ref: "#/components/responses/NotFound"
      summary: Delete the KYC request
      tags:
        - KYC Documents
      x-sdk-operation-name: delete
    get:
      description: Retrieve a KYC request with specified identifier string.
      operationId: GetKycRequest
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/KycRequest"
          description: KYC request was retrieved successfully.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "404":
          $ref: "#/components/responses/NotFound"
      summary: Retrieve a KYC request
      tags:
        - KYC Documents
      x-sdk-operation-name: get
    parameters:
      - $ref: "#/components/parameters/resourceId"
      - $ref: "#/components/parameters/organizationId"
    patch:
      description: Update a KYC request.
      operationId: PatchKycRequest
      requestBody:
        $ref: "#/components/requestBodies/PatchKycRequest"
        description: KYC document resource.
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/KycRequest"
          description: KYC request was updated.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "404":
          $ref: "#/components/responses/NotFound"
        "422":
          $ref: "#/components/responses/ValidationError"
      summary: Update a KYC request
      tags:
        - KYC Documents
      x-sdk-operation-name: update
  /password-tokens:
    get:
      description: |
        Retrieve a list of tokens.
      operationId: GetPasswordTokenCollection
      parameters:
        - $ref: "#/components/parameters/collectionLimit"
        - $ref: "#/components/parameters/collectionOffset"
      responses:
        "200":
          content:
            application/json:
              schema:
                items:
                  $ref: "#/components/schemas/ResetPasswordToken"
                type: array
          description: A list of Reset Password Tokens was retrieved successfully.
          headers:
            Pagination-Limit:
              $ref: "#/components/headers/Pagination-Limit"
            Pagination-Offset:
              $ref: "#/components/headers/Pagination-Offset"
            Pagination-Total:
              $ref: "#/components/headers/Pagination-Total"
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
      summary: Retrieve a list of tokens
      tags:
        - Customer Authentication
      x-code-samples:
        - lang: JavaScript
          source: >-
            // all parameters are optional

            const firstCollection = await api.customerAuthentication.getAllResetPasswordTokens();


            // alternatively you can specify one or more of them

            const params = {limit: 20, offset: 100}; 

            const secondCollection = await api.customerAuthentication.getAllResetPasswordTokens(params);


            // access the collection items, each item is a Member

            secondCollection.items.forEach(token =&gt; console.log(token.fields.token));
      x-sdk-operation-name: getAllResetPasswordTokens
    parameters:
      - $ref: "#/components/parameters/organizationId"
    post:
      description: |
        Create a Reset Password Token.
      operationId: PostPasswordToken
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ResetPasswordToken"
        description: ResetPasswordToken resource.
        required: true
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ResetPasswordToken"
          description: Reset Password Token was created.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "422":
          $ref: "#/components/responses/ValidationError"
      summary: Create a Reset Password Token
      tags:
        - Customer Authentication
      x-code-samples:
        - lang: JavaScript
          source: >-
            // first set the required properties for the new credential

            const data = {
                username: 'foobar',
                password: 'fuubar',
                // the `credential` expects 
                // the customer credential's ID
                credential: 'foobar-0001'

                // optionally you can define an `expiredTime` to 
                // limit the duration of the reset token

                //expiredTime: '2017-09-18T19:17:39Z'
            };


            const resetToken = await api.customerAuthentication.createResetPasswordToken({data});
      x-sdk-operation-name: createResetPasswordToken
  "/password-tokens/{id}":
    delete:
      description: |
        Delete a Reset Password Token with predefined identifier string.
      operationId: DeletePasswordToken
      responses:
        "204":
          description: ResetPasswordToken was deleted.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "404":
          $ref: "#/components/responses/NotFound"
        "409":
          $ref: "#/components/responses/Conflict"
      summary: Delete a Reset Password Token
      tags:
        - Customer Authentication
      x-code-samples:
        - lang: JavaScript
          source: >-
            const request = await
            api.customerAuthentication.deleteResetPasswordToken({id:
            'my-second-key'});


            // the request does not return any fields but

            // you can confirm the success using the status code

            console.log(request.response.status); // 204
      x-sdk-operation-name: deleteResetPasswordToken
    get:
      description: |
        Retrieve a Reset Password Token with specified identifier string.
      operationId: GetPasswordToken
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ResetPasswordToken"
          description: ResetPasswordToken was retrieved successfully.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "404":
          $ref: "#/components/responses/NotFound"
      summary: Retrieve a Reset Password Token
      tags:
        - Customer Authentication
      x-code-samples:
        - lang: JavaScript
          source: >-
            const token = await
            api.customerAuthentication.getResetPasswordToken({id:
            'my-first-id'});

            console.log(token.fields.credential);
      x-sdk-operation-name: getResetPasswordToken
    parameters:
      - $ref: "#/components/parameters/resourceId"
      - $ref: "#/components/parameters/organizationId"
  /payment-cards:
    get:
      description: |
        Retrieve a list of Payments Cards.
      operationId: GetPaymentCardCollection
      parameters:
        - $ref: "#/components/parameters/collectionLimit"
        - $ref: "#/components/parameters/collectionOffset"
        - $ref: "#/components/parameters/collectionFilter"
        - $ref: "#/components/parameters/collectionSort"
        - $ref: "#/components/parameters/collectionQuery"
        - $ref: "#/components/parameters/collectionExpand"
      responses:
        "200":
          content:
            application/json:
              schema:
                items:
                  $ref: "#/components/schemas/PaymentCard"
                type: array
          description: A list of Payment Card was retrieved successfully.
          headers:
            Pagination-Limit:
              $ref: "#/components/headers/Pagination-Limit"
            Pagination-Offset:
              $ref: "#/components/headers/Pagination-Offset"
            Pagination-Total:
              $ref: "#/components/headers/Pagination-Total"
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
      summary: Retrieve a list of Payment Cards
      tags:
        - Payment Cards
      x-code-samples:
        - lang: PHP
          source: |
            $paymentCards = $client-&gt;paymentCards()-&gt;search([
                'filter' =&gt; 'status:active',
            ]);
        - lang: JavaScript
          source: >-
            // all parameters are optional

            const firstCollection = await api.paymentCards.getAll();


            // alternatively you can specify one or more of them

            const params = {limit: 20, offset: 100, sort: '-createdTime'}; 

            const secondCollection = await api.paymentCards.getAll(params);


            // access the collection items, each item is a Member

            secondCollection.items.forEach(paymentCard =&gt; console.log(paymentCard.fields.customerId));
      x-sdk-operation-name: getAll
    parameters:
      - $ref: "#/components/parameters/organizationId"
    post:
      description: |
        Create a Payment Card.
      operationId: PostPaymentCard
      requestBody:
        content:
          application/json:
            schema:
              oneOf:
                - $ref: "#/components/schemas/PaymentCardCreateToken"
                - $ref: "#/components/schemas/PaymentCardCreatePlain"
        description: PaymentCard resource.
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PaymentCard"
          description: Payment Card was updated.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PaymentCard"
          description: Payment Card was created.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "422":
          $ref: "#/components/responses/ValidationError"
      summary: Create a Payment Card
      tags:
        - Payment Cards
      x-code-samples:
        - lang: PHP
          source: >
            $paymentCardForm = new Rebilly\Entities\PaymentCard();

            $paymentCardForm-&gt;setCustomerId('customerId');

            $paymentCardForm-&gt;setPan('4111111111111111');

            $paymentCardForm-&gt;setExpYear(2025);

            $paymentCardForm-&gt;setExpMonth(8);

            $paymentCardForm-&gt;setBillingAddress([
                'firstName' =&gt; 'John',
                'lastName' =&gt; 'Doe',
                'organization' =&gt; 'Test LTD',
                'address' =&gt; 'Test street 5',
                'address2' =&gt; 'Test house 5',
                'city' =&gt; 'New York',
                'region' =&gt; 'Long Island',
                'country' =&gt; 'US',
                'postalCode' =&gt; '123456',
                'emails' =&gt; [
                    [
                        'label' =&gt; 'main',
                        'value' =&gt; 'johndoe@testemail.com',
                        'primary' =&gt; true,
                    ],
                    [
                        'label' =&gt; 'secondary',
                        'value' =&gt; 'otheremail@testemail.com',
                    ],
                ],
                'phoneNumbers' =&gt; [
                    [
                        'label' =&gt; 'work',
                        'value' =&gt; '+123456789',
                        'primary' =&gt; true,
                    ],
                    [
                        'label' =&gt; 'home',
                        'value' =&gt; '+9874654321',
                    ],
                ],
            ]);


            try {
                $paymentCard = $client-&gt;paymentCards()-&gt;create($paymentCardForm);
            } catch (UnprocessableEntityException $e) {
                echo $e-&gt;getMessage();
            }
        - lang: JavaScript
          source: >
            // first set the properties for the new payment card

            const data = {
                pan: '4111111111111111',
                expYear: 2022,
                expMonth: 11,
                cvv: '123',
                billingAddress: {
                  firstName: 'Johnny',
                  lastName: 'Brown',
                  emails: [{
                      label: 'main',
                      value: 'johnny+test@grr.la',
                      primary: true
                  }]
                },
                // the customer ID for which
                // we are adding a payment card
                customerId: 'foobar-0001'
            };


            // the ID is optional

            const firstCard = await api.paymentCards.create({data});


            // or you can provide one

            const secondCard = await api.paymentCards.create({id: 'my-second-key', data});
      x-sdk-operation-name: create
  "/payment-cards/{id}":
    get:
      description: |
        Retrieve a Payment Card with specified identifier string.
      operationId: GetPaymentCard
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PaymentCard"
          description: Payment card was retrieved successfully.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "404":
          $ref: "#/components/responses/NotFound"
      summary: Retrieve a Payment Card
      tags:
        - Payment Cards
      x-code-samples:
        - lang: PHP
          source: |
            $paymentCard = $client-&gt;paymentCards()-&gt;load('paymentCardId');
        - lang: JavaScript
          source: |-
            const paymentCard = await api.paymentCards.get({id: 'foobar-001'});
            console.log(paymentCard.fields.customerId);
      x-sdk-operation-name: get
    parameters:
      - $ref: "#/components/parameters/resourceId"
      - $ref: "#/components/parameters/organizationId"
    patch:
      description: |
        Update any of the payment card's values except for the pan.
      operationId: PatchPaymentCard
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/PaymentCardUpdatePlain"
        description: Payment card.
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PaymentCard"
          description: Payment card was updated.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "404":
          $ref: "#/components/responses/NotFound"
        "422":
          $ref: "#/components/responses/ValidationError"
      summary: Update a payment card's values
      tags:
        - Payment Cards
      x-sdk-operation-name: patch
    put:
      operationId: PutPaymentCard
      requestBody:
        content:
          application/json:
            schema:
              oneOf:
                - $ref: "#/components/schemas/PaymentCardCreateToken"
                - $ref: "#/components/schemas/PaymentCardCreatePlain"
        description: Payment card.
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PaymentCard"
          description: Payment card was updated.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PaymentCard"
          description: Payment card was created.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "409":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: Payment card already exists and cannot be updated.
        "422":
          $ref: "#/components/responses/ValidationError"
      summary: Create a payment card with predefined ID
      tags:
        - Payment Cards
      x-code-samples:
        - lang: PHP
          source: >
            $paymentCardForm = new Rebilly\Entities\PaymentCard();

            $paymentCardForm-&gt;setCustomerId('customerId');

            $paymentCardForm-&gt;setPan('4111111111111111');

            $paymentCardForm-&gt;setExpYear(2025);

            $paymentCardForm-&gt;setExpMonth(8);

            $paymentCardForm-&gt;setBillingAddress([
                'firstName' =&gt; 'John',
                'lastName' =&gt; 'Doe',
                'organization' =&gt; 'Test LTD',
                'address' =&gt; 'Test street 5',
                'address2' =&gt; 'Test house 5',
                'city' =&gt; 'New York',
                'region' =&gt; 'Long Island',
                'country' =&gt; 'US',
                'postalCode' =&gt; '123456',
                'emails' =&gt; [
                    [
                        'label' =&gt; 'main',
                        'value' =&gt; 'johndoe@testemail.com',
                        'primary' =&gt; true,
                    ],
                    [
                        'label' =&gt; 'secondary',
                        'value' =&gt; 'otheremail@testemail.com',
                    ],
                ],
                'phoneNumbers' =&gt; [
                    [
                        'label' =&gt; 'work',
                        'value' =&gt; '+123456789',
                        'primary' =&gt; true,
                    ],
                    [
                        'label' =&gt; 'home',
                        'value' =&gt; '+9874654321',
                    ],
                ],
            ]);


            try {
                $paymentCard = $client-&gt;paymentCards()-&gt;create($paymentCardForm, 'paymentCardId');
            } catch (UnprocessableEntityException $e) {
                echo $e-&gt;getMessage();
            }
        - lang: JavaScript
          source: >
            // first set the properties for the new payment card

            const data = {
                pan: '4111111111111111',
                expYear: 2022,
                expMonth: 11,
                cvv: '123',
                billingAddress: {
                  firstName: 'Johnny',
                  lastName: 'Brown',
                  emails: [{
                      label: 'main',
                      value: 'johnny+test@grr.la',
                      primary: true
                  }]
                },
                // the customer ID for which
                // we are adding a payment card
                customerId: 'foobar-0001'
            };


            // the ID is optional

            const firstCard = await api.paymentCards.create({data});


            // or you can provide one

            const secondCard = await api.paymentCards.create({id: 'my-second-key', data});
      x-sdk-operation-name: update
  "/payment-cards/{id}/deactivation":
    parameters:
      - $ref: "#/components/parameters/resourceId"
      - $ref: "#/components/parameters/organizationId"
    post:
      description: |
        Deactivate a Payment Card.
      operationId: PostPaymentCardDeactivation
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PaymentCard"
          description: Payment Card was deactivated.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "404":
          $ref: "#/components/responses/NotFound"
        "409":
          $ref: "#/components/responses/Conflict"
      summary: Deactivate a Payment Card
      tags:
        - Payment Cards
      x-code-samples:
        - lang: PHP
          source: |
            $client-&gt;paymentCards()-&gt;deactivate('paymentCardId');
        - lang: JavaScript
          source: >-
            const paymentCard = await api.paymentCards.deactivate({id:
            'my-second-key'});

            console.log(paymentCard.fields.status);
      x-sdk-operation-name: deactivate
  /payment-instruments:
    get:
      description: |
        Retrieve a list of payment instruments.
      operationId: GetPaymentInstrumentCollection
      parameters:
        - $ref: "#/components/parameters/collectionFilter"
        - $ref: "#/components/parameters/collectionSort"
        - $ref: "#/components/parameters/collectionLimit"
        - $ref: "#/components/parameters/collectionOffset"
        - $ref: "#/components/parameters/collectionQuery"
        - $ref: "#/components/parameters/collectionExpand"
      responses:
        "200":
          content:
            application/json:
              schema:
                items:
                  $ref: "#/components/schemas/PaymentInstrument-2"
                type: array
          description: A list of payment instruments was retrieved successfully.
          headers:
            Pagination-Limit:
              $ref: "#/components/headers/Pagination-Limit"
            Pagination-Offset:
              $ref: "#/components/headers/Pagination-Offset"
            Pagination-Total:
              $ref: "#/components/headers/Pagination-Total"
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
      summary: Retrieve a list of payment instruments
      tags:
        - Payment Instruments
      x-code-samples:
        - lang: PHP
          source: |
            $paymentInstruments = $client-&gt;paymentInstruments()-&gt;search([
                'filter' =&gt; 'status:active;method:payment-card',
            ]);
        - lang: JavaScript
          source: >
            // all parameters are optional

            const firstCollection = await api.paymentInstruments.getAll();


            // alternatively you can specify one or more of them

            const params = {limit: 20, offset: 100, sort: '-createdTime'};

            const secondCollection = await api.paymentInstruments.getAll(params);


            // access the collection items, each item is a Member

            secondCollection.items.forEach(paymentInstrument =&gt; console.log(paymentInstrument.fields.customerId));
      x-sdk-operation-name: getAll
    parameters:
      - $ref: "#/components/parameters/organizationId"
    post:
      description: >
        Create a payment instrument.

        If such payment card or bank account payment instrument already exists then updates it instead.
      operationId: PostPaymentInstrument
      requestBody:
        $ref: "#/components/requestBodies/PostPaymentInstrument"
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PaymentInstrument-2"
          description: Payment instrument was created.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "303":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PaymentInstrument-2"
          description: Payment instrument was updated.
          headers:
            Location:
              $ref: "#/components/headers/Location"
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "422":
          $ref: "#/components/responses/ValidationError"
      summary: Create a Payment Instrument
      tags:
        - Payment Instruments
      x-code-samples:
        - lang: PHP
          source: >
            $paymentInstrumentForm = new Rebilly\Entities\CommonPaymentInstrument();

            $paymentInstrumentForm-&gt;setCustomerId('customerId');

            $paymentInstrumentForm-&gt;setPan('4111111111111111');

            $paymentInstrumentForm-&gt;setExpYear(2025);

            $paymentInstrumentForm-&gt;setExpMonth(8);

            $paymentInstrumentForm-&gt;setBillingAddress([
                'firstName' =&gt; 'John',
                'lastName' =&gt; 'Doe',
                'organization' =&gt; 'Test LTD',
                'address' =&gt; 'Test street 5',
                'address2' =&gt; 'Test house 5',
                'city' =&gt; 'New York',
                'region' =&gt; 'Long Island',
                'country' =&gt; 'US',
                'postalCode' =&gt; '123456',
                'emails' =&gt; [
                    [
                        'label' =&gt; 'main',
                        'value' =&gt; 'johndoe@testemail.com',
                        'primary' =&gt; true,
                    ],
                    [
                        'label' =&gt; 'secondary',
                        'value' =&gt; 'otheremail@testemail.com',
                    ],
                ],
                'phoneNumbers' =&gt; [
                    [
                        'label' =&gt; 'work',
                        'value' =&gt; '+123456789',
                        'primary' =&gt; true,
                    ],
                    [
                        'label' =&gt; 'home',
                        'value' =&gt; '+9874654321',
                    ],
                ],
            ]);


            try {
                $paymentInstrument = $client-&gt;paymentInstruments()-&gt;create($paymentInstrumentForm);
            } catch (UnprocessableEntityException $e) {
                echo $e-&gt;getMessage();
            }


            // Alternatively you can specify a payment token

            $paymentInstrumentForm = new Rebilly\Entities\CommonPaymentInstrument();

            $paymentInstrumentForm-&gt;setCustomerId('customerId');

            $paymentInstrumentForm-&gt;setToken('payment-token');


            try {
                $paymentInstrument = $client-&gt;paymentInstruments()-&gt;create($paymentInstrumentForm);
            } catch (UnprocessableEntityException $e) {
                echo $e-&gt;getMessage();
            }
        - lang: JavaScript
          source: >
            // first set the properties for the new payment card instrument

            const data = {
                method: 'payment-card',
                pan: '4111111111111111',
                expYear: 2025,
                expMonth: 11,
                cvv: '123',
                billingAddress: {
                  firstName: 'Johnny',
                  lastName: 'Brown',
                  emails: [{
                      label: 'main',
                      value: 'johnny+test@grr.la',
                      primary: true
                  }]
                },
                // the customer ID for which
                // we are adding a payment card instrument
                customerId: 'foobar-0001'
            };


            const firstPaymentInstrument = await api.paymentInstruments.create({data});


            // alternatively you can specify a payment token

            const tokenData = {
                token: 'payment-token',
                // the customer ID for which
                // we are adding a payment card instrument
                customerId: 'foobar-0001'
            };


            const secondPaymentInstrument = await api.paymentInstruments.create({tokenData});
      x-sdk-operation-name: create
  "/payment-instruments/{id}":
    get:
      description: |
        Retrieve a payment instrument by ID.
      operationId: GetPaymentInstrument
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PaymentInstrument-2"
          description: Payment Instrument was retrieved successfully.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "404":
          $ref: "#/components/responses/NotFound"
      summary: Retrieve a Payment Instrument
      tags:
        - Payment Instruments
      x-code-samples:
        - lang: PHP
          source: >
            $paymentInstrument =
            $client-&gt;paymentInstruments()-&gt;load('paymentInstrumentId');
        - lang: JavaScript
          source: >
            const paymentInstrument = await api.paymentInstruments.get({id:
            'payment-instrument-id'});


            console.log(paymentInstrument.fields.customerId);
      x-sdk-operation-name: get
    parameters:
      - $ref: "#/components/parameters/resourceId"
      - $ref: "#/components/parameters/organizationId"
    patch:
      description: Update allowed payment instrument's values.
      operationId: PatchPaymentInstrument
      requestBody:
        $ref: "#/components/requestBodies/PatchPaymentInstrument"
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PaymentInstrument-2"
          description: Payment instrument was updated.
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "404":
          $ref: "#/components/responses/NotFound"
        "422":
          $ref: "#/components/responses/ValidationError"
      summary: Update a Payment Instrument's values
      tags:
        - Payment Instruments
      x-code-samples:
        - lang: PHP
          source: >
            $paymentInstrumentForm = new Rebilly\Entities\CommonPaymentInstrument();

            $paymentInstrumentForm-&gt;setCvv('123');

            $paymentInstrumentForm-&gt;setExpYear(2025);

            $paymentInstrumentForm-&gt;setExpMonth(12);

            $paymentInstrumentForm-&gt;setBillingAddress([
                'firstName' =&gt; 'John',
            ]);


            try {
                $paymentInstrument = $client-&gt;paymentInstruments()-&gt;update('paymentInstrumentId', $paymentInstrumentForm);
            } catch (UnprocessableEntityException $e) {
                echo $e-&gt;getMessage();
            }


            // Alternatively you can specify a partial token

            $paymentInstrumentForm = new Rebilly\Entities\CommonPaymentInstrument();

            $paymentInstrumentForm-&gt;setToken('partial-token');

            $paymentInstrumentForm-&gt;setBillingAddress([
                'firstName' =&gt; 'John',
            ]);


            try {
                $paymentInstrument = $client-&gt;paymentInstruments()-&gt;update('paymentInstrumentId', $paymentInstrumentForm);
            } catch (UnprocessableEntityException $e) {
                echo $e-&gt;getMessage();
            }
        - lang: JavaScript
          source: |
            // payment instrument properties to be updated
            const data = {
                cvv: '123',
                expMonth: 12,
                expYear: 2025,
                billingAddress: {
                    firstName: 'John'
                }
            };

            api.paymentInstruments.patch({id: 'id-to-update', data});

            // alternatively you can specify a partial token
            const tokenData = {
                token: 'partial-token',
                billingAddress: {
                    firstName: 'John'
                },
                customFields: {
                    foo: 'bar'
                }
            };

            api.paymentInstruments.patch({id: 'id-to-update', tokenData});
      x-sdk-operation-name: update
  "/payment-instruments/{id}/deactivation":
    parameters:
      - $ref: "#/components/parameters/resourceId"
      - $ref: "#/components/parameters/organizationId"
    post:
      description: |
        Deactivate a payment instrument.
      operationId: PostPaymentInstrumentDeactivation
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PaymentInstrument-2"
          description: Payment instrument was deactivated.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "404":
          $ref: "#/components/responses/NotFound"
        "409":
          $ref: "#/components/responses/Conflict"
      summary: Deactivate a payment instrument
      tags:
        - Payment Instruments
      x-code-samples:
        - lang: PHP
          source: >
            $client-&gt;paymentInstruments()-&gt;deactivate('paymentInstrumentId');
        - lang: JavaScript
          source: >
            const paymentInstrument = await api.paymentInstruments.deactivate({id:
            'id-to-deactivate'});


            console.log(paymentInstrument.fields.status);
      x-sdk-operation-name: deactivate
  /payouts:
    parameters:
      - $ref: "#/components/parameters/organizationId"
    post:
      description: |
        Create a transaction of type `credit`.
      operationId: PostPayout
      requestBody:
        $ref: "#/components/requestBodies/PayoutRequest"
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Transaction"
          description: Transaction was created.
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "409":
          $ref: "#/components/responses/Conflict"
        "422":
          $ref: "#/components/responses/ValidationError"
      summary: Create a credit transaction
      tags:
        - Transactions
      x-sdk-operation-name: create
  /paypal-accounts:
    get:
      description: |
        Retrieve a list of PayPal Accounts.
      operationId: GetPayPalAccountCollection
      parameters:
        - $ref: "#/components/parameters/collectionFilter"
        - $ref: "#/components/parameters/collectionSort"
        - $ref: "#/components/parameters/collectionLimit"
        - $ref: "#/components/parameters/collectionOffset"
        - $ref: "#/components/parameters/collectionQuery"
        - $ref: "#/components/parameters/collectionExpand"
      responses:
        "200":
          content:
            application/json:
              schema:
                items:
                  $ref: "#/components/schemas/PayPalAccount"
                type: array
          description: A list of PayPal Accounts was retrieved successfully.
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
      summary: Retrieve a list of PayPal accounts
      tags:
        - PayPal Accounts
      x-code-samples:
        - lang: PHP
          source: |
            $payPalAccounts = $client-&gt;payPalAccounts()-&gt;search([
                'filter' =&gt; 'status:active',
            ]);
        - lang: JavaScript
          source: >-
            // all parameters are optional

            const firstCollection = await api.paypalAccounts.getAll();


            // alternatively you can specify one or more of them

            const params = {limit: 20, offset: 100, sort: '-createdTime'}; 

            const secondCollection = await api.paypalAccounts.getAll(params);


            // access the collection items, each item is a Member

            secondCollection.items.forEach(paypalAccount =&gt; console.log(paypalAccount.fields.customerId));
      x-sdk-operation-name: getAll
    parameters:
      - $ref: "#/components/parameters/organizationId"
    post:
      description: |
        Create a PayPal Account.
      operationId: PostPayPalAccount
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/PayPalAccount"
        description: PayPalAccount resource.
        required: true
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PayPalAccount"
          description: PayPal Account was created.
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "422":
          $ref: "#/components/responses/ValidationError"
      summary: Create a PayPal Account
      tags:
        - PayPal Accounts
      x-code-samples:
        - lang: PHP
          source: >
            $payPalForm = new Rebilly\Entities\PayPalAccount();

            $payPalForm-&gt;setCustomerId('customerId');

            $payPalForm-&gt;setBillingAddress([
                'firstName' =&gt; 'John',
                'lastName' =&gt; 'Doe',
                'organization' =&gt; 'Test LTD',
                'address' =&gt; 'Test street 5',
                'address2' =&gt; 'Test house 5',
                'city' =&gt; 'New York',
                'region' =&gt; 'Long Island',
                'country' =&gt; 'US',
                'postalCode' =&gt; '123456',
                'emails' =&gt; [
                    [
                        'label' =&gt; 'main',
                        'value' =&gt; 'johndoe@testemail.com',
                        'primary' =&gt; true,
                    ],
                    [
                        'label' =&gt; 'secondary',
                        'value' =&gt; 'otheremail@testemail.com',
                    ],
                ],
                'phoneNumbers' =&gt; [
                    [
                        'label' =&gt; 'work',
                        'value' =&gt; '+123456789',
                        'primary' =&gt; true,
                    ],
                    [
                        'label' =&gt; 'home',
                        'value' =&gt; '+9874654321',
                    ],
                ],
            ]);


            try {
                $payPalAccount = $client-&gt;payPalAccounts()-&gt;create($payPalForm);
            } catch (UnprocessableEntityException $e) {
                echo $e-&gt;getMessage();
            }
        - lang: JavaScript
          source: >-
            // first set the properties for the new paypal account

            const data = {
                username: 'myPaypalUser',
                billingAddress: {
                  firstName: 'Johnny',
                  lastName: 'Brown',
                  emails: [{
                      label: 'main',
                      value: 'johnny+test@grr.la',
                      primary: true
                  }]  
                },
                // the customer ID for which
                // we are adding a paypal account
                customerId: 'foobar-0001'
            };


            // the ID is optional

            const firstCard = await api.paypalAccounts.create({data});


            // or you can provide one

            const secondCard = await api.paypalAccounts.create({id: 'my-second-key', data});
      x-sdk-operation-name: create
  "/paypal-accounts/{id}":
    get:
      description: |
        Retrieve a PayPal Account with specified identifier string.
      operationId: GetPayPalAccount
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PayPalAccount"
          description: PayPal Account was retrieved successfully.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "404":
          $ref: "#/components/responses/NotFound"
      summary: Retrieve a PayPal Account
      tags:
        - PayPal Accounts
      x-code-samples:
        - lang: PHP
          source: >
            $payPalAccount =
            $client-&gt;payPalAccounts()-&gt;load('payPalAccountId');
        - lang: JavaScript
          source: >-
            const paypalAccount = await api.paypalAccounts.get({id: 'foobar-001'});

            console.log(paypalAccount.fields.customerId);
      x-sdk-operation-name: get
    parameters:
      - $ref: "#/components/parameters/resourceId"
      - $ref: "#/components/parameters/organizationId"
    put:
      operationId: PutPayPalAccount
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/PayPalAccount"
        description: PayPal Account.
        required: true
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PayPalAccount"
          description: PayPal Account was created.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "409":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
          description: PayPal Account exist and cannot be updated.
        "422":
          $ref: "#/components/responses/ValidationError"
      summary: Create a PayPal account with predefined ID
      tags:
        - PayPal Accounts
      x-code-samples:
        - lang: PHP
          source: >
            $payPalForm = new Rebilly\Entities\PayPalAccount();

            $payPalForm-&gt;setCustomerId('customerId');

            $payPalForm-&gt;setBillingAddress([
                'firstName' =&gt; 'John',
                'lastName' =&gt; 'Doe',
                'organization' =&gt; 'Test LTD',
                'address' =&gt; 'Test street 5',
                'address2' =&gt; 'Test house 5',
                'city' =&gt; 'New York',
                'region' =&gt; 'Long Island',
                'country' =&gt; 'US',
                'postalCode' =&gt; '123456',
                'emails' =&gt; [
                    [
                        'label' =&gt; 'main',
                        'value' =&gt; 'johndoe@testemail.com',
                        'primary' =&gt; true,
                    ],
                    [
                        'label' =&gt; 'secondary',
                        'value' =&gt; 'otheremail@testemail.com',
                    ],
                ],
                'phoneNumbers' =&gt; [
                    [
                        'label' =&gt; 'work',
                        'value' =&gt; '+123456789',
                        'primary' =&gt; true,
                    ],
                    [
                        'label' =&gt; 'home',
                        'value' =&gt; '+9874654321',
                    ],
                ],
            ]);


            try {
                $payPalAccount = $client-&gt;payPalAccounts()-&gt;create($payPalForm, 'payPalAccountId');
            } catch (UnprocessableEntityException $e) {
                echo $e-&gt;getMessage();
            }
        - lang: JavaScript
          source: >-
            // first set the properties for the new paypal account

            const data = {
                username: 'myPaypalUser',
                billingAddress: {
                  firstName: 'Johnny',
                  lastName: 'Brown',
                  emails: [{
                      label: 'main',
                      value: 'johnny+test@grr.la',
                      primary: true
                  }]  
                },
                // the customer ID for which
                // we are adding a paypal account
                customerId: 'foobar-0001'
            };


            // the ID is optional

            const firstCard = await api.paypalAccounts.create({data});


            // or you can provide one

            const secondCard = await api.paypalAccounts.create({id: 'my-second-key', data});
      x-sdk-operation-name: update
  "/paypal-accounts/{id}/deactivation":
    parameters:
      - $ref: "#/components/parameters/resourceId"
      - $ref: "#/components/parameters/organizationId"
    post:
      description: |
        Deactivate a PayPal Account.
      operationId: PostPayPalAccountDeactivation
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PayPalAccount"
          description: PayPal Account was deactivated.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "404":
          $ref: "#/components/responses/NotFound"
        "409":
          $ref: "#/components/responses/Conflict"
      summary: Deactivate a PayPal Account
      tags:
        - PayPal Accounts
      x-code-samples:
        - lang: PHP
          source: |
            $client-&gt;payPalAccounts()-&gt;deactivate('payPalAccountId');
        - lang: JavaScript
          source: >-
            // first set the properties for the activation

            const data = {
                websiteId: 'my-main-website',
                // currency three letter code
                currency: 'USD',
                gatewayAccountId: 'my-main-gateway',
                amount: 12.99,
                redirectURLs: {
                    success: 'https://www.acme.com/success',
                    decline: 'https://www.acme.com/decline',
                    cancel: 'https://www.acme.com/cancel',
                    error: 'https://www.acme.com/error'
                }
            };


            const paypalAccount = await api.paypalAccounts.activate({id: 'my-second-key', data});
      x-sdk-operation-name: deactivate
  /plans:
    get:
      description: |
        Retrieve a list of plans.
      operationId: GetPlanCollection
      parameters:
        - $ref: "#/components/parameters/collectionFilter"
        - $ref: "#/components/parameters/collectionSort"
        - $ref: "#/components/parameters/collectionLimit"
        - $ref: "#/components/parameters/collectionOffset"
        - $ref: "#/components/parameters/collectionQuery"
      responses:
        "200":
          content:
            application/json:
              schema:
                items:
                  $ref: "#/components/schemas/Plan"
                type: array
          description: A list of Plans was retrieved successfully.
          headers:
            Pagination-Limit:
              $ref: "#/components/headers/Pagination-Limit"
            Pagination-Offset:
              $ref: "#/components/headers/Pagination-Offset"
            Pagination-Total:
              $ref: "#/components/headers/Pagination-Total"
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
      summary: Retrieve a list of plans
      tags:
        - Plans
      x-code-samples:
        - lang: PHP
          source: |
            $plans = $client-&gt;plans()-&gt;search([
                'filter' =&gt; 'name:TestPlan',
            ]);
        - lang: JavaScript
          source: >-
            // all parameters are optional

            const firstCollection = await api.plans.getAll();


            // alternatively you can specify one or more of them

            const params = {limit: 20, offset: 100, sort: '-createdTime'}; 

            const secondCollection = await api.plans.getAll(params);


            // access the collection items, each item is a Member

            secondCollection.items.forEach(plan =&gt; console.log(plan.fields.name));
      x-sdk-operation-name: getAll
    parameters:
      - $ref: "#/components/parameters/organizationId"
    post:
      description: |
        Create a plan.
      operationId: PostPlan
      requestBody:
        $ref: "#/components/requestBodies/Plan"
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Plan"
          description: Plan was created.
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "422":
          $ref: "#/components/responses/ValidationError"
      summary: Create a plan
      tags:
        - Plans
      x-code-samples:
        - lang: PHP
          source: |
            $planForm = new Rebilly\Entities\Plan();
            $planForm-&gt;setName('TestPlan');
            $planForm-&gt;setCurrency('USD');
            $planForm-&gt;setTrialAmount(1);
            $planForm-&gt;setTrialPeriodUnit('day');
            $planForm-&gt;setTrialPeriodLength(1);
            $planForm-&gt;setProductId('test-product');

            try {
                $plan = $client-&gt;plans()-&gt;create($planForm);
            } catch (UnprocessableEntityException $e) {
                echo $e-&gt;getMessage();
            }
        - lang: JavaScript
          source: >-
            // first set the properties for the new plan

            const data = {
                name: 'My strongest plan',
                currency: 'USD',
                setupAmount: 12.99,
                // you could also include a trial if needed
                recurringPeriodUnit: 'month',
                recurringPeriodLength: 1,
                recurringAmount: 25.99
            };


            // the ID is optional

            const firstPlan = await api.plans.create({data});


            // or you can provide one

            const secondPlan = await api.plans.create({id: 'my-second-key', data});
      x-sdk-operation-name: create
  "/plans/{id}":
    delete:
      description: |
        Delete a Plan with predefined identifier string.
      operationId: DeletePlan
      responses:
        "204":
          description: Plan was deleted.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "404":
          $ref: "#/components/responses/NotFound"
        "409":
          $ref: "#/components/responses/Conflict"
      summary: Delete a Plan
      tags:
        - Plans
      x-code-samples:
        - lang: PHP
          source: |
            $client-&gt;plans()-&gt;delete('planId');
        - lang: JavaScript
          source: |-
            const request = await api.plans.delete({id: 'my-second-key'});

            // the request does not return any fields but
            // you can confirm the success using the status code
            console.log(request.response.status); // 204
      x-sdk-operation-name: delete
    get:
      description: |
        Retrieve a plan with specified identifier string.
      operationId: GetPlan
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Plan"
          description: Plan was retrieved successfully.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "404":
          $ref: "#/components/responses/NotFound"
      summary: Retrieve a plan
      tags:
        - Plans
      x-code-samples:
        - lang: PHP
          source: |
            $plan = $client-&gt;plans()-&gt;load('planId');
        - lang: JavaScript
          source: |-
            const plan = await api.plans.get({id: 'foobar-001'});
            console.log(plan.fields.name);
      x-sdk-operation-name: get
    parameters:
      - $ref: "#/components/parameters/resourceId"
      - $ref: "#/components/parameters/organizationId"
    put:
      description: |
        Create or update a Plan with predefined identifier string.
      operationId: PutPlan
      requestBody:
        $ref: "#/components/requestBodies/Plan"
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Plan"
          description: Plan was updated.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Plan"
          description: Plan was created.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "404":
          $ref: "#/components/responses/NotFound"
        "422":
          $ref: "#/components/responses/ValidationError"
      summary: Create or update a Plan with predefined ID
      tags:
        - Plans
      x-code-samples:
        - lang: PHP
          source: |
            $planForm = new Rebilly\Entities\Plan();
            $planForm-&gt;setName('TestPlan');
            $planForm-&gt;setCurrency('USD');
            $planForm-&gt;setTrialAmount(1);
            $planForm-&gt;setTrialPeriodUnit('day');
            $planForm-&gt;setTrialPeriodLength(1);

            try {
                $plan = $client-&gt;plans()-&gt;update('planId', $planForm);
            } catch (UnprocessableEntityException $e) {
                echo $e-&gt;getMessage();
            }
        - lang: JavaScript
          source: >-
            // first set the properties for the new plan

            const data = {
                name: 'My strongest plan',
                currency: 'USD',
                setupAmount: 12.99,
                // you could also include a trial if needed
                recurringPeriodUnit: 'month',
                recurringPeriodLength: 1,
                recurringAmount: 25.99
            };


            // the ID is optional

            const firstPlan = await api.plans.create({data});


            // or you can provide one

            const secondPlan = await api.plans.create({id: 'my-second-key', data});
      x-sdk-operation-name: update
  /products:
    get:
      description: |
        Retrieve a list of products.
      operationId: GetProductCollection
      parameters:
        - $ref: "#/components/parameters/collectionFilter"
        - $ref: "#/components/parameters/collectionSort"
        - $ref: "#/components/parameters/collectionLimit"
        - $ref: "#/components/parameters/collectionOffset"
        - $ref: "#/components/parameters/collectionQuery"
      responses:
        "200":
          content:
            application/json:
              schema:
                items:
                  $ref: "#/components/schemas/Product"
                type: array
          description: A list of products was retrieved successfully.
          headers:
            Pagination-Limit:
              $ref: "#/components/headers/Pagination-Limit"
            Pagination-Offset:
              $ref: "#/components/headers/Pagination-Offset"
            Pagination-Total:
              $ref: "#/components/headers/Pagination-Total"
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
      summary: Retrieve a list of products
      tags:
        - Products
      x-code-samples:
        - lang: JavaScript
          source: >-
            // all parameters are optional

            const firstCollection = await api.products.getAll();


            // alternatively you can specify one or more of them

            const params = {limit: 20, offset: 100, sort: '-createdTime'}; 

            const secondCollection = await api.products.getAll(params);


            // access the collection items, each item is a Member

            secondCollection.items.forEach(product =&gt; console.log(product.fields.name));
      x-sdk-operation-name: getAll
    parameters:
      - $ref: "#/components/parameters/organizationId"
    post:
      description: |
        Create a Product.
      operationId: PostProduct
      requestBody:
        $ref: "#/components/requestBodies/Product"
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Product"
          description: Product was created.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "422":
          $ref: "#/components/responses/ValidationError"
      summary: Create a Product
      tags:
        - Products
      x-code-samples:
        - lang: JavaScript
          source: >-
            // first set the properties for the new product

            const data = {
                name: 'my first product',
                description: 'made to be of the highest quality',
                taxCategoryId: '',
                requiresShipping: true,
                accountingCode: '100',
                customFields: []
            };


            // the ID is optional

            const firstProduct = await api.products.create({data});


            // or you can provide one

            const secondProduct = await api.products.create({id: 'my-second-key', data});
      x-sdk-operation-name: create
  "/products/{id}":
    delete:
      description: |
        Delete a product with predefined identifier string.
      operationId: DeleteProduct
      responses:
        "204":
          description: Product was deleted.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "404":
          $ref: "#/components/responses/NotFound"
      summary: Delete a product
      tags:
        - Products
      x-code-samples:
        - lang: JavaScript
          source: |-
            const request = await api.products.delete({id: 'my-second-key'});

            // the request does not return any fields but
            // you can confirm the success using the status code
            console.log(request.response.status); // 204
      x-sdk-operation-name: delete
    get:
      description: |
        Retrieve a product with specified identifier string.
      operationId: GetProduct
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Product"
          description: Product was retrieved successfully.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "404":
          $ref: "#/components/responses/NotFound"
      summary: Retrieve a product
      tags:
        - Products
      x-code-samples:
        - lang: JavaScript
          source: |-
            const product = await api.products.get({id: 'foobar-001'});
            console.log(product.fields.name);
      x-sdk-operation-name: get
    parameters:
      - $ref: "#/components/parameters/resourceId"
      - $ref: "#/components/parameters/organizationId"
    put:
      description: |
        Create a product with predefined identifier string.
      operationId: PutProduct
      requestBody:
        $ref: "#/components/requestBodies/Product"
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Product"
          description: Product was updated.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Product"
          description: Product was created.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "422":
          $ref: "#/components/responses/ValidationError"
      summary: Create a product with predefined ID
      tags:
        - Products
      x-code-samples:
        - lang: JavaScript
          source: >-
            // creating a new product

            const data = {
                name: 'my first product',
                description: 'made to be of the highest quality',
                taxCategoryId: '',
                requiresShipping: true,
                accountingCode: '100',
                customFields: []
            };


            // the ID is optional

            const firstProduct = await api.products.create({data});


            // or you can provide one

            const secondProduct = await api.products.create({id: 'my-second-key', data});




            // updating a product

            const data = {
                name: 'my first product',
                description: 'made to be of the highest quality',
                taxCategoryId: '20010',
                requiresShipping: false,
                accountingCode: '77',
                customFields: []
            };


            const product = await api.products.update({id: 'my-second-key', data});
      x-sdk-operation-name: update
  /ready-to-pay:
    parameters:
      - $ref: "#/components/parameters/organizationId"
    post:
      description: >
        Get available payment methods for a specific transaction or a
        purchase.


        The payment methods order shown to a customer **SHOULD** be the same as the order in the response.


        The list of available methods is generated from available [Gateway Accounts](https://user-api-docs.rebilly.com/tag/Gateway-Accounts)

        intersected with the last matched [Rules Engine](https://user-api-docs.rebilly.com/tag/Rules#operation/PutEventRule)

        `adjust-ready-to-pay` action on `ready-to-pay-requested` event.


        If there were no actions matched for the specific request – all methods supported by the Gateway Accounts are sent.


        To invert this behavior – place an all-matching rule at the very end of the `ready-to-pay-requested` event in

        Rules Engine with an empty `paymentMethods` property of the `adjust-ready-to-pay` action.
      operationId: PostReadyToPay
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CoreReadyToPay"
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ReadyToPayMethods"
          description: Payment methods retrieved.
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "422":
          $ref: "#/components/responses/ValidationError"
      summary: Ready to Pay
      tags:
        - Transactions
      x-sdk-operation-name: readyToPay
  /search:
    get:
      description: >
        Search merchant's data to return resources such as customers,
        invoices, orders, transactions.
      operationId: GetSearch
      parameters:
        - $ref: "#/components/parameters/collectionSort"
        - $ref: "#/components/parameters/collectionLimit"
        - $ref: "#/components/parameters/collectionOffset"
        - description: The default search. It will search across resources and many fields.
          in: query
          name: q
          schema:
            type: string
      responses:
        "200":
          content:
            application/json:
              schema:
                items:
                  $ref: "#/components/schemas/Search"
                type: array
          description: Results keyed by resource.
          headers:
            Pagination-Limit:
              $ref: "#/components/headers/Pagination-Limit"
            Pagination-Offset:
              $ref: "#/components/headers/Pagination-Offset"
            Pagination-Total:
              $ref: "#/components/headers/Pagination-Total"
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
      summary: Search merchant data
      tags:
        - Search
      x-sdk-operation-name: get
    parameters:
      - $ref: "#/components/parameters/organizationId"
  /shipping-zones:
    get:
      description: |
        Retrieve a list of shipping zones.
      operationId: GetShippingZoneCollection
      parameters:
        - $ref: "#/components/parameters/collectionLimit"
        - $ref: "#/components/parameters/collectionOffset"
        - $ref: "#/components/parameters/collectionFilter"
        - $ref: "#/components/parameters/collectionSort"
        - $ref: "#/components/parameters/collectionQuery"
      responses:
        "200":
          content:
            application/json:
              schema:
                items:
                  $ref: "#/components/schemas/ShippingZone"
                type: array
          description: A list of shipping zones was retrieved successfully.
          headers:
            Pagination-Limit:
              $ref: "#/components/headers/Pagination-Limit"
            Pagination-Offset:
              $ref: "#/components/headers/Pagination-Offset"
            Pagination-Total:
              $ref: "#/components/headers/Pagination-Total"
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
      summary: Retrieve a list of shipping zones
      tags:
        - Shipping Zones
      x-code-samples:
        - lang: JavaScript
          source: >-
            // all parameters are optional

            const firstCollection = await api.shippingZones.getAll();


            // alternatively you can specify one or more of them

            const params = {limit: 20, offset: 100, sort: '-createdTime'}; 

            const secondCollection = await api.shippingZones.getAll(params);


            // access the collection items, each item is a Member

            secondCollection.items.forEach(shippingZone =&gt; console.log(shippingZone.fields.name));
      x-sdk-operation-name: getAll
    parameters:
      - $ref: "#/components/parameters/organizationId"
    post:
      description: |
        Create a Shipping Zone.
      operationId: PostShippingZone
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ShippingZone"
        description: Shipping Zone resource.
        required: true
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ShippingZone"
          description: Shipping Zone was created.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "422":
          $ref: "#/components/responses/ValidationError"
      summary: Create a Shipping Zone
      tags:
        - Shipping Zones
      x-code-samples:
        - lang: JavaScript
          source: >-
            // first set the properties for the new shipping zone

            const data = {
                name: 'free shipping',
                rates: [
                    {
                        name: 'free shipping',
                        price: 0,
                        currency: 'USD'
                    }
                ],
                countries: ['US']
            };


            // the ID is optional

            const firstZone = await api.shippingZones.create({data});


            // or you can provide one

            const secondZone = await api.shippingZones.create({id: 'my-second-key', data});
      x-sdk-operation-name: create
  "/shipping-zones/{id}":
    delete:
      description: |
        Delete a shipping zone with predefined identifier string.
      operationId: DeleteShippingZone
      responses:
        "204":
          description: Shipping zone was deleted.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "404":
          $ref: "#/components/responses/NotFound"
      summary: Delete a shipping zone
      tags:
        - Shipping Zones
      x-code-samples:
        - lang: JavaScript
          source: >-
            const request = await api.shippingZones.delete({id: 'my-second-key'});


            // the request does not return any fields but

            // you can confirm the success using the status code

            console.log(request.response.status); // 204
      x-sdk-operation-name: delete
    get:
      description: |
        Retrieve a shipping zone with specified identifier string.
      operationId: GetShippingZone
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ShippingZone"
          description: Shipping zone was retrieved successfully.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "404":
          $ref: "#/components/responses/NotFound"
      summary: Retrieve a shipping zone
      tags:
        - Shipping Zones
      x-code-samples:
        - lang: JavaScript
          source: >-
            const shippingZone = await api.shippingZones.get({id: 'foobar-001'});

            console.log(shippingZone.fields.name);
      x-sdk-operation-name: get
    parameters:
      - $ref: "#/components/parameters/resourceId"
      - $ref: "#/components/parameters/organizationId"
    put:
      description: |
        Create a shipping zone with predefined identifier string.
      operationId: PutShippingZone
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ShippingZone"
        description: Shipping zone resource.
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ShippingZone"
          description: Shipping zone was updated.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ShippingZone"
          description: Shipping zone was created.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "422":
          $ref: "#/components/responses/ValidationError"
      summary: Create a shipping zone with predefined ID
      tags:
        - Shipping Zones
      x-code-samples:
        - lang: JavaScript
          source: >-
            // creating a new shipping zone

            const data = {
                name: 'free shipping',
                rates: [
                    {
                        name: 'free shipping',
                        price: 0,
                        currency: 'USD'
                    }
                ],
                countries: ['US']
            };


            // the ID is optional

            const firstZone = await api.shippingZones.create({data});


            // or you can provide one

            const secondZone = await api.shippingZones.create({id: 'my-second-key', data});




            // updating a shipping zone

            const data = {
                name: 'normal shipping',
                rates: [
                    {
                        name: 'flat rate',
                        price: 9.99,
                        currency: 'USD'
                    }
                ],
                // when null it will match any country
                countries: null
            };


            const shippingZone = await api.shippingZones.update({id: 'my-second-key', data});
      x-sdk-operation-name: update
  /subscription-cancellations:
    get:
      description: Retrieve a list of cancellations for all subscriptions.
      operationId: GetSubscriptionCancellationCollection
      parameters:
        - $ref: "#/components/parameters/collectionLimit"
        - $ref: "#/components/parameters/collectionOffset"
        - $ref: "#/components/parameters/collectionFilter"
        - $ref: "#/components/parameters/collectionSort"
      responses:
        "200":
          content:
            application/json:
              schema:
                items:
                  $ref: "#/components/schemas/SubscriptionCancellation"
                type: array
          description: A list of cancellations was retrieved successfully.
          headers:
            Pagination-Limit:
              $ref: "#/components/headers/Pagination-Limit"
            Pagination-Offset:
              $ref: "#/components/headers/Pagination-Offset"
            Pagination-Total:
              $ref: "#/components/headers/Pagination-Total"
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
      summary: Retrieve a list of cancellations
      tags:
        - Orders
      x-sdk-operation-name: getAll
    parameters:
      - $ref: "#/components/parameters/organizationId"
    post:
      description: Cancel an order or preview the cancellation parameters before that.
      operationId: PostSubscriptionCancellation
      requestBody:
        $ref: "#/components/requestBodies/SubscriptionCancellation"
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SubscriptionCancellation"
          description: Cancellation was created, the order is or will be deactivated.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "422":
          $ref: "#/components/responses/ValidationError"
      summary: Cancel an order
      tags:
        - Orders
      x-code-samples:
        - lang: PHP
          source: >
            $subscriptionCancelForm = new Rebilly\Entities\SubscriptionCancel();

            $subscriptionCancelForm-&gt;setEffectiveTime(new DateTime());


            try {
                $subscription = $client-&gt;subscriptions()-&gt;cancel('subscriptionId', $subscriptionCancelForm);
            } catch (UnprocessableEntityException $e) {
                echo $e-&gt;getMessage();
            }
        - lang: JavaScript
          source: >-
            const data = {
                subscriptionId: 'subscription-id-to-delete',
                churnTime: '2020-06-10T13:55:51Z',
            }


            // the ID is optional

            const firstSubscriptionCancellation = await api.subscriptionCancellations.create({data});


            // or you can provide one

            const secondSubscriptionCancellation = await api.subscriptionCancellations.create({id: 'custom-cancellation-id', data});
      x-sdk-operation-name: create
  "/subscription-cancellations/{id}":
    delete:
      description: Delete an order's cancellation. Only draft can be deleted.
      operationId: DeleteSubscriptionCancellation
      responses:
        "204":
          description: Cancellaton was deleted.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "404":
          $ref: "#/components/responses/NotFound"
        "409":
          $ref: "#/components/responses/Conflict"
      summary: Delete a cancellation
      tags:
        - Orders
      x-sdk-operation-name: delete
    get:
      description: Retrieve an order сancellation with specified identifier string.
      operationId: GetSubscriptionCancellation
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SubscriptionCancellation"
          description: Cancellation was retrieved successfully.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "404":
          $ref: "#/components/responses/NotFound"
      summary: Retrieve an order сancellation
      tags:
        - Orders
      x-sdk-operation-name: get
    parameters:
      - $ref: "#/components/parameters/resourceId"
      - $ref: "#/components/parameters/organizationId"
    put:
      description: Cancel a subscription.
      operationId: PutSubscriptionCancellation
      requestBody:
        $ref: "#/components/requestBodies/SubscriptionCancellation"
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SubscriptionCancellation"
          description: Cancellation was updated, the order is or will be deactivated.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SubscriptionCancellation"
          description: Cancellation was created, the order is or will be deactivated.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "422":
          $ref: "#/components/responses/ValidationError"
      summary: Cancel an order
      tags:
        - Orders
      x-code-samples:
        - lang: JavaScript
          source: >-
            const data = {
                subscriptionId: 'subscription-id-to-delete',
                churnTime: '2020-06-10T13:55:51Z',
            }


            // the ID is optional

            const firstSubscriptionCancellation = await api.subscriptionCancellations.create({data});


            // or you can provide one

            const secondSubscriptionCancellation = await api.subscriptionCancellations.create({id: 'custom-cancellation-id', data});
      x-sdk-operation-name: update
  /subscription-reactivations:
    get:
      description: Retrieve a list of reactivations for all subscriptions.
      operationId: GetSubscriptionReactivationCollection
      parameters:
        - $ref: "#/components/parameters/collectionLimit"
        - $ref: "#/components/parameters/collectionOffset"
        - $ref: "#/components/parameters/collectionFilter"
        - $ref: "#/components/parameters/collectionSort"
      responses:
        "200":
          content:
            application/json:
              schema:
                items:
                  $ref: "#/components/schemas/SubscriptionReactivation"
                type: array
          description: A list of reactivations was retrieved successfully.
          headers:
            Pagination-Limit:
              $ref: "#/components/headers/Pagination-Limit"
            Pagination-Offset:
              $ref: "#/components/headers/Pagination-Offset"
            Pagination-Total:
              $ref: "#/components/headers/Pagination-Total"
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
      summary: Retrieve a list of reactivations
      tags:
        - Orders
      x-code-samples:
        - lang: JavaScript
          source: >
            // all parameters are optional

            const firstCollection = await api.subscriptionReactivations.getAll();


            // alternatively you can specify one or more of them

            const params = {limit: 20, offset: 100, sort: '-createdTime'};

            const secondCollection = await api.subscriptionReactivations.getAll(params);


            // access the collection items, each item is a Member

            secondCollection.items.forEach(subscription =&gt; console.log(subscription.fields.customerId));
      x-sdk-operation-name: getAll
    parameters:
      - $ref: "#/components/parameters/organizationId"
    post:
      description: Reactivate a subscription.
      operationId: PostSubscriptionReactivation
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/SubscriptionReactivation"
        description: Reactivation resource.
        required: true
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SubscriptionReactivation"
          description: >
            Reactivation was created, the order is active and won't be.
            deactivated.

            If there was a cancellation with status "confirmed", it is revoked.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "422":
          $ref: "#/components/responses/ValidationError"
      summary: Reactivate an order
      tags:
        - Orders
      x-code-samples:
        - lang: JavaScript
          source: >
            const data = {
                subscriptionId: '4f6cf35x-2c4y-483z-a0a9-158621f77a21',
                description: 'reactivation-reason',
                effectiveTime: '2020-06-10T13:55:51Z',
                renewalTime: '2020-07-10T13:55:51Z'
            };


            const reactivatedSubscription = await api.subscriptionReactivations.reactivate({data});
      x-sdk-operation-name: reactivate
  "/subscription-reactivations/{id}":
    get:
      description: Retrieve an order reactivation with specified identifier string.
      operationId: GetSubscriptionReactivation
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SubscriptionReactivation"
          description: Reactivation was retrieved successfully.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "404":
          $ref: "#/components/responses/NotFound"
      summary: Retrieve an order reactivation
      tags:
        - Orders
      x-code-samples:
        - lang: JavaScript
          source: >
            const subscription = await api.subscriptionReactivations.get({id:
            'foobar-001'});

            console.log(subscription.fields.description);
      x-sdk-operation-name: get
    parameters:
      - $ref: "#/components/parameters/resourceId"
      - $ref: "#/components/parameters/organizationId"
  /subscriptions:
    get:
      description: |
        Retrieve a list of orders.
      operationId: GetSubscriptionCollection
      parameters:
        - $ref: "#/components/parameters/collectionFilter"
        - $ref: "#/components/parameters/collectionSort"
        - $ref: "#/components/parameters/collectionLimit"
        - $ref: "#/components/parameters/collectionOffset"
        - $ref: "#/components/parameters/collectionQuery"
        - $ref: "#/components/parameters/subscriptionExpand"
      responses:
        "200":
          content:
            application/json:
              schema:
                items:
                  $ref: "#/components/schemas/Subscription"
                type: array
          description: A list of subscriptions was retrieved successfully.
          headers:
            Pagination-Limit:
              $ref: "#/components/headers/Pagination-Limit"
            Pagination-Offset:
              $ref: "#/components/headers/Pagination-Offset"
            Pagination-Total:
              $ref: "#/components/headers/Pagination-Total"
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
      summary: Retrieve a list of orders
      tags:
        - Orders
      x-code-samples:
        - lang: PHP
          source: |
            $subscriptions = $client-&gt;subscriptions()-&gt;search([
                'filter' =&gt; 'customerId:testCustomerId',
            ]);
        - lang: JavaScript
          source: >-
            // all parameters are optional

            const firstCollection = await api.subscriptions.getAll();


            // alternatively you can specify one or more of them

            const params = {limit: 20, offset: 100, sort: '-createdTime'}; 

            const secondCollection = await api.subscriptions.getAll(params);


            // access the collection items, each item is a Member

            secondCollection.items.forEach(subscription =&gt; console.log(subscription.fields.customerId));




            // alternatively, download as CSV file


            // all parameters are optional

            const firstFile = await api.subscriptions.downloadCSV();


            // alternatively you can specify one or more of them

            const params = {limit: 20, offset: 100, sort: '-createdTime'}; 

            const secondFile = await api.subscriptions.downloadCSV(params);


            // access the file data to view the CSV content 

            console.log(secondFile.data);
      x-sdk-operation-name: getAll
    parameters:
      - $ref: "#/components/parameters/organizationId"
    post:
      description: |
        Create an order. Consider using the upsert.
        operation to accomplish this task.
      operationId: PostSubscription
      parameters:
        - $ref: "#/components/parameters/subscriptionExpand"
      requestBody:
        $ref: "#/components/requestBodies/Subscription"
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Subscription"
          description: Order was created.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "422":
          $ref: "#/components/responses/ValidationError"
      summary: Create an order
      tags:
        - Orders
      x-code-samples:
        - lang: PHP
          source: >
            $subscriptionForm = new Rebilly\Entities\Subscription();

            $subscriptionForm-&gt;setCustomerId('customerId');

            $subscriptionForm-&gt;setWebsiteId('websiteId');

            $subscriptionForm-&gt;setItems([
                [
                    'planId' =&gt; 'my-plan',
                    'quantity' =&gt; 1,
                ],
            ]);

            $subscriptionForm-&gt;setBillingAddress([
                'firstName' =&gt; 'John',
                'lastName' =&gt; 'Doe',
                'organization' =&gt; 'Test LTD',
                'address' =&gt; 'Test street 5',
                'address2' =&gt; 'Test house 5',
                'city' =&gt; 'New York',
                'region' =&gt; 'Long Island',
                'country' =&gt; 'US',
                'postalCode' =&gt; '123456',
                'emails' =&gt; [
                    [
                        'label' =&gt; 'main',
                        'value' =&gt; 'johndoe@testemail.com',
                        'primary' =&gt; true,
                    ],
                    [
                        'label' =&gt; 'secondary',
                        'value' =&gt; 'otheremail@testemail.com',
                    ],
                ],
                'phoneNumbers' =&gt; [
                    [
                        'label' =&gt; 'work',
                        'value' =&gt; '+123456789',
                        'primary' =&gt; true,
                    ],
                    [
                        'label' =&gt; 'home',
                        'value' =&gt; '+9874654321',
                    ],
                ],
            ]);


            try {
                $subscription = $client-&gt;subscriptions()-&gt;create($subscriptionForm);
            } catch (UnprocessableEntityException $e) {
                echo $e-&gt;getMessage();
            }
        - lang: JavaScript
          source: >-
            // first set the properties for the new subscription

            const data = {
                customerId: 'foobar-0001',
                websiteId: 'my-main-website',
                items: [
                    { planId: 'my-plan-id', quantity: '1' },
                ],
                // you can append this subscription to
                // an existing invoice by passing its ID
                initialInvoiceId: 'my-existing-invoice-id',
                billingAddress: {
                    firstName: 'Johnny',
                    lastName: 'Brown',
                    emails: [{
                        label: 'main',
                        value: 'johnny+test@grr.la',
                        primary: true
                    }],
                },
                deliveryAddress: {
                    firstName: 'Johnny',
                    lastName: 'Brown',
                    emails: [{
                        label: 'main',
                        value: 'johnny+test@grr.la',
                        primary: true
                    }],
                },
                quantity: 1,
                customFields: {}
            };


            // the ID is optional

            const firstInvoice = await api.subscriptions.create({data});


            // or you can provide one

            const secondInvoice = await api.subscriptions.create({id: 'my-second-id', data});
      x-sdk-operation-name: create
  "/subscriptions/{id}":
    get:
      description: |
        Retrieve an order with specified identifier string.
      operationId: GetSubscription
      parameters:
        - $ref: "#/components/parameters/subscriptionExpand"
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Subscription"
          description: Order was retrieved successfully.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "404":
          $ref: "#/components/responses/NotFound"
      summary: Retrieve an order
      tags:
        - Orders
      x-code-samples:
        - lang: PHP
          source: >
            $subscription = $client-&gt;subscriptions()-&gt;load('subscriptionId');
        - lang: JavaScript
          source: >-
            const subscription = await api.subscriptions.get({id: 'foobar-001'});

            console.log(subscription.fields.billingAddress.firstName);
      x-sdk-operation-name: get
    parameters:
      - $ref: "#/components/parameters/resourceId"
      - $ref: "#/components/parameters/organizationId"
    put:
      description: |
        Create or update an order with predefined identifier string.
      operationId: PutSubscription
      parameters:
        - $ref: "#/components/parameters/subscriptionExpand"
      requestBody:
        $ref: "#/components/requestBodies/Subscription"
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Subscription"
          description: Order was updated.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Subscription"
          description: Order was created.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "404":
          $ref: "#/components/responses/NotFound"
        "422":
          $ref: "#/components/responses/ValidationError"
      summary: Upsert an order with predefined ID
      tags:
        - Orders
      x-code-samples:
        - lang: PHP
          source: >
            $subscriptionForm = new Rebilly\Entities\Subscription();

            $subscriptionForm-&gt;setCustomerId('customerId');

            $subscriptionForm-&gt;setWebsiteId('websiteId');

            $subscriptionForm-&gt;setItems($subscriptionForm-&gt;createItems([
                'planId' =&gt; 'my-plan',
                'quantity' =&gt; 1,
            ]));

            $subscriptionForm-&gt;setBillingAddress([
                'firstName' =&gt; 'John',
                'lastName' =&gt; 'Doe',
                'organization' =&gt; 'Test LTD',
                'address' =&gt; 'Test street 5',
                'address2' =&gt; 'Test house 5',
                'city' =&gt; 'New York',
                'region' =&gt; 'Long Island',
                'country' =&gt; 'US',
                'postalCode' =&gt; '123456',
                'emails' =&gt; [
                    [
                        'label' =&gt; 'main',
                        'value' =&gt; 'johndoe@testemail.com',
                        'primary' =&gt; true,
                    ],
                    [
                        'label' =&gt; 'secondary',
                        'value' =&gt; 'otheremail@testemail.com',
                    ],
                ],
                'phoneNumbers' =&gt; [
                    [
                        'label' =&gt; 'work',
                        'value' =&gt; '+123456789',
                        'primary' =&gt; true,
                    ],
                    [
                        'label' =&gt; 'home',
                        'value' =&gt; '+9874654321',
                    ],
                ],
            ]);


            try {
                $subscription = $client-&gt;subscriptions()-&gt;update('subscriptionId', $subscriptionForm);
            } catch (UnprocessableEntityException $e) {
                echo $e-&gt;getMessage();
            }
        - lang: JavaScript
          source: >-
            // creating a subscription

            const data = {
                customerId: 'foobar-0001',
                websiteId: 'my-main-website',
                planId: 'my-plan-id',
                // you can append this subscription to
                // an existing invoice by passing its ID
                initialInvoiceId: 'my-existing-invoice-id',
                billingAddress: {
                    firstName: 'Johnny',
                    lastName: 'Brown',
                    emails: [{
                        label: 'main',
                        value: 'johnny+test@grr.la',
                        primary: true
                    }],
                },
                deliveryAddress: {
                    firstName: 'Johnny',
                    lastName: 'Brown',
                    emails: [{
                        label: 'main',
                        value: 'johnny+test@grr.la',
                        primary: true
                    }],
                },
                quantity: 1,
                customFields: {}
            };


            // the ID is optional

            const firstInvoice = await api.subscriptions.create({data});


            // or you can provide one

            const secondInvoice = await api.subscriptions.create({id: 'my-second-id', data});




            // updating a subscription

            const data = {
                // determines if a payment attempt will be automatic
                autopay: false,
                // set the next renewal time
                renewalTime: '2018-09-26T15:34:29Z'
            };


            const subscription = await api.subscriptions.update({id: 'my-second-id', data});
      x-sdk-operation-name: update
  "/subscriptions/{id}/change-items":
    parameters:
      - $ref: "#/components/parameters/resourceId"
      - $ref: "#/components/parameters/organizationId"
    post:
      description: >
        Change an order's items or quantities and designate when and if
        there should be pro-rata credits given.
      operationId: PostSubscriptionItemsChange
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/SubscriptionChange"
        description: Change items request.
        required: true
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Subscription"
          description: Order was changed.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "422":
          $ref: "#/components/responses/ValidationError"
      summary: Change an order's items
      tags:
        - Orders
      x-sdk-operation-name: changeItems
  "/subscriptions/{id}/interim-invoice":
    parameters:
      - $ref: "#/components/parameters/resourceId"
      - $ref: "#/components/parameters/organizationId"
    post:
      description: >
        Issue an interim invoice for a subscription, typically used in
        conjunction. with plan changes and pro rata adjustments.

        This process creates an invoice, adds the subscription's line items to the invoice, and issues the invoice, and applies

        payment to it if a transaction id is supplied.
      operationId: PostSubscriptionInterimInvoice
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/SubscriptionInvoice"
        description: Issue an interim invoice.
        required: true
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Invoice"
          description: Invoice was created.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "422":
          $ref: "#/components/responses/ValidationError"
      summary: Issue an interim invoice for a subscription order
      tags:
        - Orders
      x-sdk-operation-name: createInterimInvoice
  "/subscriptions/{id}/timeline":
    get:
      description: |
        Retrieve a list of order timeline messages.
      operationId: GetSubscriptionTimelineCollection
      parameters:
        - $ref: "#/components/parameters/collectionLimit"
        - $ref: "#/components/parameters/collectionOffset"
        - $ref: "#/components/parameters/collectionFilter"
        - $ref: "#/components/parameters/collectionSort"
        - $ref: "#/components/parameters/collectionQuery"
      responses:
        "200":
          content:
            application/json:
              schema:
                items:
                  $ref: "#/components/schemas/OrderTimeline"
                type: array
          description: A list of order timeline messages was retrieved successfully.
          headers:
            Pagination-Limit:
              $ref: "#/components/headers/Pagination-Limit"
            Pagination-Offset:
              $ref: "#/components/headers/Pagination-Offset"
            Pagination-Total:
              $ref: "#/components/headers/Pagination-Total"
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
      summary: Retrieve a list of order timeline messages
      tags:
        - Orders
      x-code-samples:
        - lang: JavaScript
          source: >-
            // all parameters are optional except for the `id`

            const firstCollection = await api.subscriptions
                .getAllTimelineMessages({id: 'my-transaction'});

            // alternatively you can specify one or more of them

            const params = {id: 'my-transaction', limit: 20, offset: 100};

            const secondCollection = await api.subscriptions.getAllTimelineMessages(params);


            // access the collection items, each item is a Member

            secondCollection.items
                .forEach(message =&gt; console.log(message.fields.eventType));
      x-sdk-operation-name: getAllTimelineMessages
    parameters:
      - $ref: "#/components/parameters/resourceId"
      - $ref: "#/components/parameters/organizationId"
    post:
      description: |
        Create an order Timeline comment.
      operationId: PostSubscriptionTimeline
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/OrderTimeline"
        description: Order Timeline resource.
        required: true
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/OrderTimeline"
          description: Order Timeline comment was created.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "422":
          $ref: "#/components/responses/ValidationError"
      summary: Create an order Timeline comment
      tags:
        - Orders
      x-code-samples:
        - lang: JavaScript
          source: >-
            // Create a comment

            const firstComment = await api
                .subscriptions.createTimelineComment({id: 'my-subscription-id', data: {message: 'Your comment here'}});

            // Using params object, mentions and references

            const message = `Example of mentions @user@mydomain.com and references #subscriptions-subscription-id`;

            const params = {
                id: 'my-subscription-id',
                data: {
                    message,
                },
            };

            const secondComment = await api.subscriptions.createTimelineComment(params);
      x-sdk-operation-name: createTimelineComment
  "/subscriptions/{id}/timeline/{messageId}":
    delete:
      description: |
        Delete an Order Timeline message with predefined identifier string.
      operationId: DeleteSubscriptionTimeline
      responses:
        "204":
          description: Order Timeline message was deleted.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "404":
          $ref: "#/components/responses/NotFound"
        "409":
          $ref: "#/components/responses/Conflict"
      summary: Delete an Order Timeline message
      tags:
        - Orders
      x-code-samples:
        - lang: JavaScript
          source: >-
            const request = await api.subscriptions
                .deleteTimelineMessage({id: 'foobar-001', messageId: 'message-202'});

            // the request does not return any fields but

            // you can confirm the success using the status code

            console.log(request.response.status); // 204
      x-sdk-operation-name: deleteTimelineMessage
    get:
      description: |
        Retrieve a order message with specified identifier string.
      operationId: GetSubscriptionTimeline
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/OrderTimeline"
          description: Order message was retrieved successfully.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "404":
          $ref: "#/components/responses/NotFound"
      summary: Retrieve an Order Timeline message
      tags:
        - Orders
      x-code-samples:
        - lang: JavaScript
          source: >-
            const message = await api.subscriptions
                .getTimelineMessage({id: 'foobar-001', messageId: 'message-202'});
            console.log(message.fields.eventType);
      x-sdk-operation-name: getTimelineMessage
    parameters:
      - $ref: "#/components/parameters/resourceId"
      - description: The Order Timeline message ID.
        in: path
        name: messageId
        required: true
        schema:
          type: string
      - $ref: "#/components/parameters/organizationId"
  "/subscriptions/{id}/upcoming-invoices":
    get:
      description: >
        Retrieve an upcoming invoice from the specified subscription order.

        The endpoint is temporary before upcoming invoices get a complete integration.
      operationId: GetSubscriptionUpcomingInvoiceCollection
      parameters:
        - $ref: "#/components/parameters/collectionExpand"
      responses:
        "200":
          content:
            application/json:
              schema:
                items:
                  $ref: "#/components/schemas/Invoice"
                type: array
          description: Upcoming invoices are retrieved successfully.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "404":
          $ref: "#/components/responses/NotFound"
      summary: Retrieve subscription order's upcoming invoice
      tags:
        - Orders
      x-sdk-operation-name: getAllUpcomingInvoices
    parameters:
      - $ref: "#/components/parameters/resourceId"
      - $ref: "#/components/parameters/organizationId"
  "/subscriptions/{id}/upcoming-invoices/{invoiceId}/issue":
    parameters:
      - $ref: "#/components/parameters/resourceId"
      - description: The Upcoming Invoice ID.
        in: path
        name: invoiceId
        required: true
        schema:
          type: string
      - $ref: "#/components/parameters/organizationId"
    post:
      description: >
        Issue an upcoming invoice with specified identifier string for early pay.
      operationId: PostUpcomingInvoiceIssuance
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/InvoiceIssue"
        description: InvoiceIssue resource.
        required: true
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Invoice"
          description: Upcoming Invoice was issued successfully.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "404":
          $ref: "#/components/responses/NotFound"
        "409":
          $ref: "#/components/responses/Conflict"
      summary: Issue an upcoming invoice for early pay
      tags:
        - Orders
      x-sdk-operation-name: issueUpcomingInvoice
  /tags:
    get:
      description: |
        Retrieve a list of tags.
      operationId: GetTagCollection
      parameters:
        - $ref: "#/components/parameters/collectionLimit"
        - $ref: "#/components/parameters/collectionOffset"
        - $ref: "#/components/parameters/collectionFilter"
        - $ref: "#/components/parameters/collectionQuery"
        - $ref: "#/components/parameters/collectionSort"
      responses:
        "200":
          content:
            application/json:
              schema:
                items:
                  $ref: "#/components/schemas/Tag"
                type: array
          description: A list of tags was retrieved successfully.
          headers:
            Pagination-Limit:
              $ref: "#/components/headers/Pagination-Limit"
            Pagination-Offset:
              $ref: "#/components/headers/Pagination-Offset"
            Pagination-Total:
              $ref: "#/components/headers/Pagination-Total"
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
      summary: Retrieve a list of tags
      tags:
        - Tags
      x-sdk-operation-name: getAll
    parameters:
      - $ref: "#/components/parameters/organizationId"
    post:
      description: |
        Create a tag.
      operationId: PostTag
      requestBody:
        $ref: "#/components/requestBodies/Tag"
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Tag"
          description: Tag was created.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "409":
          $ref: "#/components/responses/Conflict"
        "422":
          $ref: "#/components/responses/ValidationError"
      summary: Create a tag
      tags:
        - Tags
      x-sdk-operation-name: create
  "/tags/{tag}":
    delete:
      description: |
        Delete a tag.
        It's an asynchronous operation.
      operationId: DeleteTag
      responses:
        "204":
          description: Tag was deleted.
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "404":
          $ref: "#/components/responses/NotFound"
      summary: Delete a tag
      tags:
        - Tags
      x-sdk-operation-name: delete
    get:
      description: |
        Retrieve a tag.
      operationId: GetTag
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Tag"
          description: Tag with specified name was retrieved successfully.
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "404":
          $ref: "#/components/responses/NotFound"
      summary: Retrieve a tag
      tags:
        - Tags
      x-sdk-operation-name: get
    parameters:
      - $ref: "#/components/parameters/tag"
      - $ref: "#/components/parameters/organizationId"
    patch:
      description: |
        Update a tag.
      operationId: PatchTag
      requestBody:
        $ref: "#/components/requestBodies/Tag"
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Tag"
          description: Tag was updated.
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "404":
          $ref: "#/components/responses/NotFound"
        "409":
          $ref: "#/components/responses/Conflict"
        "422":
          $ref: "#/components/responses/ValidationError"
      summary: Update a tag
      tags:
        - Tags
      x-sdk-operation-name: update
  "/tags/{tag}/customers":
    delete:
      description: |
        Untag a list of customers.
        If the customer from the list is already untagged it will be ignored.
        It's an asynchronous operation.
      operationId: DeleteTagCustomerCollection
      requestBody:
        content:
          application/json:
            schema:
              properties:
                customerIds:
                  description: The list of customer IDs.
                  items:
                    type: string
                  maxItems: 1000
                  minItems: 1
                  type: array
              required:
                - customerIds
              type: object
        required: true
      responses:
        "204":
          description: Customers was untagged.
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "422":
          $ref: "#/components/responses/ValidationError"
      summary: Untag a list of customers
      tags:
        - Tags
      x-sdk-operation-name: untagCustomers
    parameters:
      - $ref: "#/components/parameters/tag"
      - $ref: "#/components/parameters/organizationId"
    post:
      description: |
        Tag a list of customers.
        If the customer from the list is already tagged it will be ignored.
        It's an asynchronous operation.
      operationId: PostTagCustomerCollection
      requestBody:
        content:
          application/json:
            schema:
              properties:
                customerIds:
                  description: The list of customer IDs.
                  items:
                    type: string
                  maxItems: 1000
                  minItems: 1
                  type: array
              required:
                - customerIds
              type: object
        required: true
      responses:
        "204":
          description: Customers was tagged.
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "422":
          $ref: "#/components/responses/ValidationError"
      summary: Tag a list of customers
      tags:
        - Tags
      x-sdk-operation-name: tagCustomers
  "/tags/{tag}/customers/{customerId}":
    delete:
      description: |
        Untag a customer.
      operationId: DeleteTagCustomer
      responses:
        "204":
          description: Customer was untagged.
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "404":
          $ref: "#/components/responses/NotFound"
      summary: Untag a customer
      tags:
        - Tags
      x-sdk-operation-name: untagCustomer
    parameters:
      - $ref: "#/components/parameters/tag"
      - $ref: "#/components/parameters/customerId"
      - $ref: "#/components/parameters/organizationId"
    post:
      description: |
        Tag a customer.
      operationId: PostTagCustomer
      responses:
        "204":
          description: Customer was tagged.
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "404":
          $ref: "#/components/responses/NotFound"
      summary: Tag a customer
      tags:
        - Tags
      x-sdk-operation-name: tagCustomer
  /tokens:
    get:
      description: |
        Retrieve a list of tokens.
      operationId: GetTokenCollection
      parameters:
        - $ref: "#/components/parameters/collectionLimit"
        - $ref: "#/components/parameters/collectionOffset"
      responses:
        "200":
          content:
            application/json:
              schema:
                items:
                  $ref: "#/components/schemas/CompositeToken"
                type: array
          description: A list of tokens was retrieved successfully.
          headers:
            Pagination-Limit:
              $ref: "#/components/headers/Pagination-Limit"
            Pagination-Offset:
              $ref: "#/components/headers/Pagination-Offset"
            Pagination-Total:
              $ref: "#/components/headers/Pagination-Total"
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
      summary: Retrieve a list of tokens
      tags:
        - Payment Tokens
      x-code-samples:
        - lang: PHP
          source: |
            $paymentCardTokens = $client-&gt;paymentCardTokens()-&gt;search([
                'filter' =&gt; 'token:string',
            ]);
        - lang: JavaScript
          source: >-
            // all parameters are optional

            const firstCollection = await api.paymentTokens.getAll();


            // alternatively you can specify one or more of them

            const params = {limit: 20, offset: 100}; 

            const secondCollection = await api.paymentTokens.getAll(params);


            // access the collection items, each item is a Member

            secondCollection.items.forEach(paymentToken =&gt; console.log(paymentToken.fields.id));
      x-sdk-operation-name: getAll
    parameters:
      - $ref: "#/components/parameters/organizationId"
    post:
      description: |
        [FramePay](https://docs.rebilly.com/docs/developer-docs/framepay/)
        is the recommended way to
        create a payment token because it minimizes
        PCI DSS compliance.  Once a payment token
        is created, it can only be used once.

        A payment token expires upon first use
        or within 30 minutes of the token creation
        (whichever comes first).
      operationId: PostToken
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CompositeToken"
        description: PaymentToken resource.
        required: true
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CompositeToken"
          description: Token was created.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "422":
          $ref: "#/components/responses/ValidationError"
      security:
        - PublishableApiKey: []
        - SecretApiKey: []
        - JWT: []
      summary: Create a payment token
      tags:
        - Payment Tokens
      x-code-samples:
        - lang: PHP
          source: >
            $paymentCardTokenForm = new Rebilly\Entities\PaymentCardToken();

            $paymentCardTokenForm-&gt;setBillingAddress([
                'firstName' =&gt; 'John',
                'lastName' =&gt; 'Doe',
                'organization' =&gt; 'Test LTD',
                'address' =&gt; 'Test street 5',
                'address2' =&gt; 'Test house 5',
                'city' =&gt; 'New York',
                'region' =&gt; 'Long Island',
                'country' =&gt; 'US',
                'postalCode' =&gt; '123456',
                'emails' =&gt; [
                    [
                        'label' =&gt; 'main',
                        'value' =&gt; 'johndoe@testemail.com',
                        'primary' =&gt; true,
                    ],
                    [
                        'label' =&gt; 'secondary',
                        'value' =&gt; 'otheremail@testemail.com',
                    ],
                ],
                'phoneNumbers' =&gt; [
                    [
                        'label' =&gt; 'work',
                        'value' =&gt; '+123456789',
                        'primary' =&gt; true,
                    ],
                    [
                        'label' =&gt; 'home',
                        'value' =&gt; '+9874654321',
                    ],
                ],
            ]);


            $paymentInstrumentForm = new Entities\PaymentInstruments\PaymentCardPaymentInstrument();

            $paymentInstrumentForm-&gt;setPan('4111111111111111');

            $paymentInstrumentForm-&gt;setExpYear(2025);

            $paymentInstrumentForm-&gt;setExpMonth(8);

            $paymentInstrumentForm-&gt;setCvv(123);


            $paymentCardTokenForm-&gt;setPaymentInstrument($paymentInstrumentForm);


            try {
                $paymentCardToken = $client-&gt;paymentCardTokens()-&gt;create($paymentCardTokenForm);
            } catch (UnprocessableEntityException $e) {
                echo $e-&gt;getMessage();
            }
        - lang: JavaScript
          source: |
            // first set the properties for the new payment token
            const data = {
                method: 'payment-card',
                paymentInstrument: {
                    pan: '4111111111111111',
                    expYear: 2022,
                    expMonth: 12,
                    cvv: '123'
                },
                billingAddress: {
                  firstName: 'Johnny',
                  lastName: 'Brown',
                  emails: [{
                      label: 'main',
                      value: 'johnny+test@grr.la',
                      primary: true
                  }]
                }
            };

            const token = await api.paymentTokens.create({data});
      x-sdk-operation-name: create
  "/tokens/{token}":
    get:
      description: |
        Retrieve a token with specified identifier string.
      operationId: GetToken
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CompositeToken"
          description: Token was retrieved successfully.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "404":
          $ref: "#/components/responses/NotFound"
      security:
        - PublishableApiKey: []
      summary: Retrieve a token
      tags:
        - Payment Tokens
      x-code-samples:
        - lang: PHP
          source: >
            $paymentCardToken = $client-&gt;paymentCardTokens()-&gt;load('tokenId');
        - lang: JavaScript
          source: >-
            const paymentToken = await api.paymentTokens.get({id: 'foobar-001'});

            console.log(paymentToken.fields.method);
      x-sdk-operation-name: get
    parameters:
      - description: The token identifier string.
        in: path
        name: token
        required: true
        schema:
          type: string
      - $ref: "#/components/parameters/organizationId"
  /transactions:
    get:
      description: |
        Retrieve a list of transactions.
      operationId: GetTransactionCollection
      parameters:
        - $ref: "#/components/parameters/collectionLimit"
        - $ref: "#/components/parameters/collectionOffset"
        - $ref: "#/components/parameters/collectionFilter"
        - $ref: "#/components/parameters/collectionQuery"
        - $ref: "#/components/parameters/collectionSort"
        - $ref: "#/components/parameters/collectionExpand"
      responses:
        "200":
          content:
            application/json:
              schema:
                items:
                  $ref: "#/components/schemas/Transaction"
                type: array
          description: A list of transactions was retrieved successfully.
          headers:
            Pagination-Limit:
              $ref: "#/components/headers/Pagination-Limit"
            Pagination-Offset:
              $ref: "#/components/headers/Pagination-Offset"
            Pagination-Total:
              $ref: "#/components/headers/Pagination-Total"
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "422":
          $ref: "#/components/responses/ValidationError"
      summary: Retrieve a list of transactions
      tags:
        - Transactions
      x-code-samples:
        - lang: PHP
          source: |
            $transactions = $client-&gt;transactions()-&gt;search([
                'filter' =&gt; 'result:approved',
            ]);
        - lang: JavaScript
          source: >-
            // all parameters are optional

            const firstCollection = await api.transactions.getAll();


            // alternatively you can specify one or more of them

            const params = {limit: 20, offset: 100, sort: '-createdTime'}; 

            const secondCollection = await api.transactions.getAll(params);


            // access the collection items, each item is a Member

            secondCollection.items.forEach(transaction =&gt; console.log(transaction.fields.type));




            // alternatively, download as a CSV file


            // all parameters are optional

            const firstFile = await api.transactions.downloadCSV();


            // alternatively you can specify one or more of them

            const params = {limit: 20, offset: 100, sort: '-createdTime'}; 

            const secondFile = await api.transactions.downloadCSV(params);


            // access the file data to view the CSV content 

            console.log(secondFile.data);
      x-sdk-operation-name: getAll
    parameters:
      - $ref: "#/components/parameters/organizationId"
    post:
      description: |
        Create a transaction of type `sale` or `authorize`.
        This endpoint supports two main styles of transactions:
          1. A real-time decision and response.
          2. User approval/interaction is required.

        A real-time decision is very familiar.  You send a request, and
        inspect the `result` of the response for `approved` or `declined`.

        However, many transactions, especially those for alternative
        methods, require the user to interact with a 3rd party.  You
        may be able to envision PayPal, for example, the user must
        give permission to complete the payment (or accept the
        billing agreement).

        Even payment cards may require user approval in the case of
        3D secure authentication.  In the event that approval is
        required, you will receive a response back and notice
        that the `result` is `unknown`.  You will find that the
        `status` is `waiting-approval`. And you will find in the
        `_links` section of the response a link for the `approvalUrl`.

        In this case you would either open the `approvalUrl` in an
        iframe or in a pop (better workflow for mobile).
      operationId: PostTransaction
      parameters:
        - $ref: "#/components/parameters/collectionExpand"
      requestBody:
        $ref: "#/components/requestBodies/TransactionRequest"
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Transaction"
          description: Transaction was created.
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "409":
          $ref: "#/components/responses/Conflict"
        "422":
          $ref: "#/components/responses/ValidationError"
      summary: Create a transaction
      tags:
        - Transactions
      x-code-samples:
        - lang: JavaScript
          source: |
            // first set the properties for the new transaction
            const data = {
                customerId: 'foobar-0001',
                websiteId: 'my-main-website',
                paymentInstrument: {
                    method: 'payment-card',
                    paymentCardId: 'my-payment-card-id',
                    gatewayAccountId: 'my-gateway-account-id'
                },
                currency: 'USD',
                amount: 12.99,
                description: 'manual transaction',

                // optionally you can specify a scheduled time
                // to process the transaction at a later date
                // scheduledTime: '2017-09-28T16:13:44Z'
            };

            const transaction = await api.transactions.create({data});
      x-sdk-operation-name: create
  "/transactions/{id}":
    get:
      description: |
        Retrieve a Transaction with specified identifier string.
      operationId: GetTransaction
      parameters:
        - $ref: "#/components/parameters/collectionExpand"
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Transaction"
          description: Transaction was retrieved successfully.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "404":
          $ref: "#/components/responses/NotFound"
      summary: Retrieve a Transaction
      tags:
        - Transactions
      x-code-samples:
        - lang: PHP
          source: |
            $transaction = $client-&gt;transactions()-&gt;load('transactionId');
        - lang: JavaScript
          source: |-
            const transaction = await api.transactions.get({id: 'foobar-001'});
            console.log(transaction.fields.billingAddress.firstName);
      x-sdk-operation-name: get
    parameters:
      - $ref: "#/components/parameters/resourceId"
      - $ref: "#/components/parameters/organizationId"
    patch:
      description: |
        Update a transaction's custom fields.
      operationId: PatchTransaction
      requestBody:
        $ref: "#/components/requestBodies/PatchTransactionRequest"
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Transaction"
          description: Transaction was updated successfully.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "404":
          $ref: "#/components/responses/NotFound"
      summary: Update a transaction
      tags:
        - Transactions
      x-code-samples:
        - lang: PHP
          source: >
            try {
                $transaction = $client-&gt;transactions()-&gt;patch($transactionId, $data);
            } catch (UnprocessableEntityException $e) {
                echo $e-&gt;getMessage();
            }
        - lang: JavaScript
          source: >
            // first set the custom fields to update for the transaction

            const data = {
                customFields: {
                    'myCustomField': 'myCustomData',
                    'myOtherField': 'myOtherData',        
                }
            };


            const transaction = await api.transactions.patch({id: 'my-transaction-id', data});
      x-sdk-operation-name: patch
  "/transactions/{id}/query":
    parameters:
      - $ref: "#/components/parameters/resourceId"
      - $ref: "#/components/parameters/organizationId"
    post:
      description: >
        Query a Transaction with a specified identifier string.

        The query will contact the gateway account to find the result and amount/currency.

        The response should be analyzed.  If deemed appropriate, the transaction could be updated using the Transaction Update API.
      operationId: PostTransactionQuery
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/TransactionQuery"
          description: Transaction was queried successfully.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "404":
          $ref: "#/components/responses/NotFound"
      summary: Query a Transaction
      tags:
        - Transactions
      x-sdk-operation-name: query
  "/transactions/{id}/refund":
    parameters:
      - $ref: "#/components/parameters/resourceId"
      - $ref: "#/components/parameters/organizationId"
    post:
      description: >
        Refund a Transaction with specified identifier string.

        Note that the refund will be in the same currency as the original transaction.
      operationId: PostTransactionRefund
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/TransactionRefund"
        description: Transaction resource.
        required: true
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Transaction"
          description: Transaction was refunded successfully.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "404":
          $ref: "#/components/responses/NotFound"
      summary: Refund a Transaction
      tags:
        - Transactions
      x-code-samples:
        - lang: PHP
          source: >
            $transaction = $client-&gt;transactions()-&gt;refund('transactionId',
            1.99);
        - lang: JavaScript
          source: >-
            // define the refund amount

            const data = {
                amount: 12.99
            };


            const refund = await api.transactions.switch({id: 'my-transaction-id', data});

            console.log(refund.fields.status);
      x-sdk-operation-name: refund
  "/transactions/{id}/timeline":
    get:
      description: |
        Retrieve a list of transaction timeline messages.
      operationId: GetTransactionTimelineCollection
      parameters:
        - $ref: "#/components/parameters/collectionLimit"
        - $ref: "#/components/parameters/collectionOffset"
        - $ref: "#/components/parameters/collectionFilter"
      responses:
        "200":
          content:
            application/json:
              schema:
                items:
                  $ref: "#/components/schemas/TransactionTimeline"
                type: array
          description: A list of transaction timeline messages was retrieved successfully.
          headers:
            Pagination-Limit:
              $ref: "#/components/headers/Pagination-Limit"
            Pagination-Offset:
              $ref: "#/components/headers/Pagination-Offset"
            Pagination-Total:
              $ref: "#/components/headers/Pagination-Total"
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
      summary: Retrieve a list of transaction timeline messages
      tags:
        - Transactions
      x-code-samples:
        - lang: JavaScript
          source: >-
            // all parameters are optional except for the `id`

            const firstCollection = await api.transactions
                .getAllTimelineMessages({id: 'my-transaction'});

            // alternatively you can specify one or more of them

            const params = {id: 'my-transaction', limit: 20, offset: 100};

            const secondCollection = await api.transactions.getAllTimelineMessages(params);


            // access the collection items, each item is a Member

            secondCollection.items
                .forEach(message =&gt; console.log(message.fields.eventType));
      x-sdk-operation-name: getAllTimelineMessages
    parameters:
      - $ref: "#/components/parameters/resourceId"
      - $ref: "#/components/parameters/organizationId"
    post:
      description: |
        Create a transaction Timeline comment.
      operationId: PostTransactionTimeline
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/TransactionTimeline"
        description: Transaction Timeline resource.
        required: true
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/TransactionTimeline"
          description: Transaction Timeline comment was created.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "422":
          $ref: "#/components/responses/ValidationError"
      summary: Create a transaction Timeline comment
      tags:
        - Transactions
      x-code-samples:
        - lang: JavaScript
          source: >-
            // Create a comment

            const firstComment = await api
                .transactions.createTimelineComment({id: 'my-transaction-id', data: {message: 'Your comment here'}});

            // Using params object, mentions and references

            const message = `Example of mentions @user@mydomain.com and references #transactions-transaction-id`;

            const params = {
                id: 'my-transaction-id',
                data: {
                    message,
                },
            };

            const secondComment = await api.transactions.createTimelineComment(params);
      x-sdk-operation-name: createTimelineComment
  "/transactions/{id}/timeline/{messageId}":
    delete:
      description: |
        Delete a Transaction Timeline message with predefined identifier string.
      operationId: DeleteTransactionTimeline
      responses:
        "204":
          description: Transaction Timeline message was deleted.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "404":
          $ref: "#/components/responses/NotFound"
        "409":
          $ref: "#/components/responses/Conflict"
      summary: Delete a Transaction Timeline message
      tags:
        - Transactions
      x-code-samples:
        - lang: JavaScript
          source: >-
            const request = await api.transactions
                .deleteTimelineMessage({id: 'foobar-001', messageId: 'message-202'});

            // the request does not return any fields but

            // you can confirm the success using the status code

            console.log(request.response.status); // 204
      x-sdk-operation-name: deleteTimelineMessage
    get:
      description: |
        Retrieve a timeline message with specified identifier string.
      operationId: GetTransactionTimeline
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/TransactionTimeline"
          description: Timeline message was retrieved successfully.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "404":
          $ref: "#/components/responses/NotFound"
      summary: Retrieve a transaction Timeline message
      tags:
        - Transactions
      x-code-samples:
        - lang: JavaScript
          source: >-
            const message = await api.transactions
                .getTimelineMessage({id: 'foobar-001', messageId: 'message-202'});
            console.log(message.fields.eventType);
      x-sdk-operation-name: getTimelineMessage
    parameters:
      - $ref: "#/components/parameters/resourceId"
      - description: The Transaction Timeline message ID.
        in: path
        name: messageId
        required: true
        schema:
          type: string
      - $ref: "#/components/parameters/organizationId"
  "/transactions/{id}/update":
    parameters:
      - $ref: "#/components/parameters/resourceId"
      - $ref: "#/components/parameters/organizationId"
    post:
      description: Update a Transaction manually to completed status with given result
        with optional currency and amount.
      operationId: PostTransactionUpdate
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/TransactionUpdate"
        required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Transaction"
          description: Transaction was updated.
          headers:
            Rate-Limit-Limit:
              $ref: "#/components/headers/Rate-Limit-Limit"
            Rate-Limit-Remaining:
              $ref: "#/components/headers/Rate-Limit-Remaining"
            Rate-Limit-Reset:
              $ref: "#/components/headers/Rate-Limit-Reset"
        "401":
          $ref: "#/components/responses/Unauthorized"
        "403":
          $ref: "#/components/responses/Forbidden"
        "404":
          $ref: "#/components/responses/NotFound"
      summary: Update a Transaction status
      tags:
        - Transactions
      x-sdk-operation-name: update
components:
  headers:
    Location:
      description: The location of the related resource.
      schema:
        format: url
        type: string
    Pagination-Limit:
      description: Items per page limit.
      schema:
        type: integer
    Pagination-Offset:
      description: Pagination offset.
      schema:
        type: integer
    Pagination-Total:
      description: Total items count.
      schema:
        type: integer
    Rate-Limit-Limit:
      description: The number of allowed requests in the current period.
      schema:
        type: integer
    Rate-Limit-Remaining:
      description: The number of remaining requests in the current period.
      schema:
        type: integer
    Rate-Limit-Reset:
      description: >
        The date in format defined by [RFC
        822](https://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3.1)

        when the current period will reset.
      schema:
        type: string
  parameters:
    collectionExpand:
      description: >
        Expand a response to get a full related object included inside of
        the `_embedded` path in the response.

        It accepts a comma-separated list of objects to expand.

        See the [expand guide](https://api-reference.rebilly.com/#section/Expand-to-include-embedded-objects) for more info.
      in: query
      name: expand
      schema:
        type: string
    collectionFields:
      description: Limit the returned fields to the list specified, separated by
        comma. Note that id is always returned.
      in: query
      name: fields
      schema:
        type: string
    collectionFilter:
      description: >
        The collection items filter requires a special format.

        Use "," for multiple allowed values.  Use ";" for multiple fields.

        See the [filter guide](https://api-reference.rebilly.com/#section/Using-filter-with-collections) for more options and examples about this format.
      in: query
      name: filter
      schema:
        type: string
    collectionLimit:
      description: The collection items limit.
      in: query
      name: limit
      schema:
        maximum: 1000
        minimum: 0
        type: integer
    collectionOffset:
      description: The collection items offset.
      in: query
      name: offset
      schema:
        minimum: 0
        type: integer
    collectionQuery:
      description: The partial search of the text fields.
      in: query
      name: q
      schema:
        type: string
    collectionSort:
      description: The collection items sort field and order (prefix with "-" for
        descending sort).
      explode: false
      in: query
      name: sort
      schema:
        items:
          type: string
        type: array
      style: form
    customFieldResource:
      description: The resource type string.
      in: path
      name: resource
      required: true
      schema:
        enum:
          - customers
          - payment-instruments
          - subscriptions
          - transactions
          - websites
          - products
          - plans
          - bump-offers
        type: string
    customerId:
      description: The customer identifier string.
      in: path
      name: customerId
      required: true
      schema:
        maxLength: 50
        pattern: ^[@~\-\.\w]+$
        type: string
    imageSize:
      description: Resize image to specified size. Supports any sizes from 10x10 to
        2000x2000 (format `{width}x{height}`). The image will be returned in the
        original size if the value is invalid. This parameter will be ignored
        for non-image files.
      in: query
      name: imageSize
      schema:
        example: 700x700
        pattern: ^[1-9]{1}[0-9]{1,3}x[1-9]{1}[0-9]{1,3}$
        type: string
    mediaTypeJsonPdf:
      description: The response media type.
      in: header
      name: Accept
      schema:
        default: application/json
        enum:
          - application/json
          - application/pdf
        type: string
    organizationId:
      description: Organization identifier in scope of which need to perform request
        (if not specified, the default organization will be used).
      in: header
      name: Organization-Id
      required: false
      schema:
        $ref: "#/components/schemas/ResourceId"
    resourceId:
      description: The resource identifier string.
      in: path
      name: id
      required: true
      schema:
        maxLength: 50
        pattern: ^[@~\-\.\w]+$
        type: string
    subscriptionExpand:
      description: >
        Expand a response to get a full related object included inside of
        the `_embedded` path in the response.

        To expand multiple objects, it accepts a comma-separated list of objects (example: `expand=recentInvoice,initialInvoice`).

        Available arguments are:
          - recentInvoice
          - initialInvoice
          - customer
          - website

        See the [expand guide](https://api-reference.rebilly.com/#section/Expand-to-include-embedded-objects) for more info.
      in: query
      name: expand
      schema:
        type: string
    tag:
      description: The tag name.
      in: path
      name: tag
      required: true
      schema:
        pattern: ^[@~\-\.\w\s]+$
        type: string
  requestBodies:
    Attachment:
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/Attachment"
      description: Attachment resource.
      required: true
    Blocklist:
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/Blocklist"
      description: Blocklist resource.
      required: true
    Coupon:
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/Coupon"
      description: Coupon resource.
      required: true
    Credential:
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/Credential"
      description: Credential resource.
      required: true
    Customer:
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/Customer"
      description: Customer resource.
      required: true
    Customer-2:
      content:
        application/json:
          schema:
            properties:
              _embedded:
                properties:
                  customer:
                    $ref: "#/components/schemas/Customer"
                type: object
              _links:
                description: The links related to resource.
                items:
                  anyOf:
                    - $ref: "#/components/schemas/CustomerLink"
                minItems: 1
                type: array
              customerId:
                description: The customer ID.
                type: string
              eventType:
                $ref: "#/components/schemas/GlobalWebhookEventType"
      description: Customer webhook request body resource.
    Dispute:
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/Dispute"
      description: Dispute resource.
      required: true
    Dispute-2:
      content:
        application/json:
          schema:
            properties:
              _embedded:
                properties:
                  dispute:
                    $ref: "#/components/schemas/Dispute"
                type: object
              _links:
                description: The links related to resource.
                items:
                  anyOf:
                    - $ref: "#/components/schemas/DisputeLink"
                minItems: 1
                type: array
              disputeId:
                description: The dispute ID.
                type: string
              eventType:
                $ref: "#/components/schemas/GlobalWebhookEventType"
      description: Dispute webhook request body resource.
    ExperianCheckPerformed:
      content:
        application/json:
          schema:
            properties:
              _embedded:
                description: Customer object.
                properties:
                  customer:
                    $ref: "#/components/schemas/Customer"
                type: object
              _links:
                description: The links related to resource.
                items:
                  anyOf:
                    - $ref: "#/components/schemas/CustomerLink"
                minItems: 1
                type: array
              customerId:
                description: The ID of the checked customer.
                type: string
              errorCode:
                description: Error code produced by the Experian system.
                example: "001"
                type: string
              errorMessage:
                description: Error message produced by the Experian system.
                example: "Authentication Error: Bad Username or Password"
                type: string
              eventType:
                $ref: "#/components/schemas/GlobalWebhookEventType"
              outcome:
                description: The check decision where `1` - record matches, `0` - no matches
                  found, `-1` - record mismatches.
                enum:
                  - -1
                  - 0
                  - 1
                example: 1
                type: integer
              reason:
                description: The text representation of the outcome.
                example: Individual has a 90 percent or greater match to forename surname
                  premise postcode with ID verified and DOB
                type: string
      description: Experian check performed webhook request body resource.
    GatewayAccount:
      content:
        application/json:
          schema:
            properties:
              _embedded:
                properties:
                  gatewayAccount:
                    $ref: "#/components/schemas/GatewayAccount"
                type: object
              _links:
                description: The links related to resource.
                items:
                  anyOf:
                    - $ref: "#/components/schemas/GatewayAccountLink"
                minItems: 1
                type: array
              eventType:
                $ref: "#/components/schemas/GlobalWebhookEventType"
              gatewayAccountId:
                description: The gateway account ID.
                type: string
      description: Gateway account limit was reached body resource.
    GatewayAccountAndGatewayAccountLimit:
      content:
        application/json:
          schema:
            properties:
              _embedded:
                properties:
                  gatewayAccount:
                    $ref: "#/components/schemas/GatewayAccount"
                  gatewayAccountLimit:
                    $ref: "#/components/schemas/GatewayAccountLimit"
                type: object
              _links:
                description: The links related to resource.
                items:
                  anyOf:
                    - $ref: "#/components/schemas/GatewayAccountLink"
                    - $ref: "#/components/schemas/GatewayAccountLimitLink"
                minItems: 2
                type: array
              eventType:
                $ref: "#/components/schemas/GlobalWebhookEventType"
              gatewayAccountId:
                description: The gateway account ID.
                type: string
      description: Gateway account limit was reached body resource.
    Invoice:
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/Invoice"
      description: Invoice resource.
      required: true
    Invoice-2:
      content:
        application/json:
          schema:
            properties:
              _embedded:
                properties:
                  invoice:
                    $ref: "#/components/schemas/Invoice"
                type: object
              _links:
                description: The links related to resource.
                items:
                  anyOf:
                    - $ref: "#/components/schemas/InvoiceLink"
                minItems: 1
                type: array
              eventType:
                $ref: "#/components/schemas/GlobalWebhookEventType"
              invoiceId:
                description: The invoice ID.
                type: string
      description: Invoice webhook request body resource.
    InvoiceAndSubscription:
      content:
        application/json:
          schema:
            properties:
              _embedded:
                properties:
                  invoice:
                    $ref: "#/components/schemas/Invoice"
                  subscription:
                    $ref: "#/components/schemas/Subscription"
                type: object
              _links:
                description: The links related to resource.
                items:
                  anyOf:
                    - $ref: "#/components/schemas/SubscriptionLink"
                    - $ref: "#/components/schemas/InvoiceLink"
                minItems: 2
                type: array
              eventType:
                $ref: "#/components/schemas/GlobalWebhookEventType"
              invoiceId:
                description: The invoice ID.
                type: string
              subscriptionId:
                description: The order ID.
                type: string
      description: Invoice and Order webhook request body resource.
    InvoiceAndTransaction:
      content:
        application/json:
          schema:
            properties:
              _embedded:
                properties:
                  invoice:
                    $ref: "#/components/schemas/Invoice"
                  transaction:
                    $ref: "#/components/schemas/Transaction"
                type: object
              _links:
                description: The links related to resource.
                items:
                  anyOf:
                    - $ref: "#/components/schemas/TransactionLink"
                    - $ref: "#/components/schemas/InvoiceLink"
                minItems: 2
                type: array
              eventType:
                $ref: "#/components/schemas/GlobalWebhookEventType"
              invoiceId:
                description: The invoice ID.
                type: string
              transactionId:
                description: The transaction ID.
                type: string
      description: Invoice and Transaction webhook request body resource.
    KycDocument:
      content:
        application/json:
          schema:
            properties:
              _embedded:
                properties:
                  customer:
                    $ref: "#/components/schemas/Customer"
                  kycDocument:
                    $ref: "#/components/schemas/KycDocument-2"
                type: object
              _links:
                description: The links related to resource.
                items:
                  anyOf:
                    - $ref: "#/components/schemas/CustomerLink"
                    - $ref: "#/components/schemas/FileLink"
                    - $ref: "#/components/schemas/KycDocumentLink"
                minItems: 3
                type: array
              customerId:
                description: The customer ID.
                type: string
              eventType:
                $ref: "#/components/schemas/GlobalWebhookEventType"
              fileId:
                description: The file ID.
                type: string
              kycDocumentId:
                description: The KYC document ID.
                type: string
      description: KYC document webhook request body resource.
    MergedCustomer:
      content:
        application/json:
          schema:
            properties:
              _embedded:
                description: Customer object.
                properties:
                  targetCustomer:
                    $ref: "#/components/schemas/Customer"
                type: object
              _links:
                description: The links related to resource.
                items:
                  anyOf:
                    - $ref: "#/components/schemas/CustomerLink"
                minItems: 1
                type: array
              duplicatedCustomer:
                $ref: "#/components/schemas/Customer"
              eventType:
                $ref: "#/components/schemas/GlobalWebhookEventType"
              targetCustomerId:
                description: The ID of the customer containing the merged data.
                type: string
      description: Merged customer webhook request body resource.
    PatchKycRequest:
      content:
        application/json:
          schema:
            allOf:
              - properties:
                  customerId:
                    readOnly: true
              - $ref: "#/components/schemas/KycRequest"
    PatchPaymentInstrument:
      content:
        application/json:
          schema:
            oneOf:
              - $ref: "#/components/schemas/PaymentInstrumentUpdateToken"
              - $ref: "#/components/schemas/PaymentCardUpdatePlain"
              - $ref: "#/components/schemas/BankAccountUpdatePlain"
      description: PaymentInstrument resource.
      required: true
    PatchTransactionRequest:
      content:
        application/json:
          schema:
            properties:
              customFields:
                $ref: "#/components/schemas/ResourceCustomFields"
            type: object
      description: Use the patch transaction request to modify custom fields.
      required: true
    PaymentCard:
      content:
        application/json:
          schema:
            properties:
              _embedded:
                properties:
                  paymentCard:
                    $ref: "#/components/schemas/PaymentCard"
                type: object
              _links:
                description: The links related to resource.
                items:
                  anyOf:
                    - $ref: "#/components/schemas/PaymentCardLink"
                minItems: 1
                type: array
              eventType:
                $ref: "#/components/schemas/GlobalWebhookEventType"
              paymentCardId:
                description: The payment card ID.
                type: string
      description: Payment card webhook request body resource.
    PayoutRequest:
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/PayoutRequest"
      description: Transaction resource.
      required: true
    Plan:
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/Plan"
      description: Plan resource.
      required: true
    PostPaymentInstrument:
      content:
        application/json:
          schema:
            anyOf:
              - $ref: "#/components/schemas/PaymentInstrumentCreateToken"
              - $ref: "#/components/schemas/PaymentCardCreatePlain"
              - $ref: "#/components/schemas/BankAccountCreatePlain"
              - $ref: "#/components/schemas/PayPalAccount"
      description: PaymentInstrument resource.
      required: true
    Product:
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/Product"
      description: Product resource.
      required: true
    Subscription:
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/Subscription"
      description: Order resource.
      required: true
    Subscription-2:
      content:
        application/json:
          schema:
            properties:
              _embedded:
                properties:
                  subscription:
                    $ref: "#/components/schemas/Subscription"
                type: object
              _links:
                description: The links related to resource.
                items:
                  anyOf:
                    - $ref: "#/components/schemas/SubscriptionLink"
                minItems: 1
                type: array
              eventType:
                $ref: "#/components/schemas/GlobalWebhookEventType"
              subscriptionId:
                description: The order ID.
                type: string
      description: Order webhook request body resource.
    SubscriptionCancellation:
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/SubscriptionCancellation"
      description: Cancellation resource.
      required: true
    Tag:
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/Tag"
      description: Tag resource.
      required: true
    Transaction:
      content:
        application/json:
          schema:
            properties:
              _embedded:
                properties:
                  transaction:
                    $ref: "#/components/schemas/Transaction"
                type: object
              _links:
                description: The links related to resource.
                items:
                  anyOf:
                    - $ref: "#/components/schemas/TransactionLink"
                minItems: 1
                type: array
              eventType:
                $ref: "#/components/schemas/GlobalWebhookEventType"
              transactionId:
                description: The transaction ID.
                type: string
      description: Transaction webhook request body resource.
    TransactionRequest:
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/TransactionRequest"
      description: Transaction resource.
      required: true
  responses:
    Conflict:
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/Error"
      description: Conflict.
    Customer:
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/Customer"
      description: Customer.
      headers:
        Rate-Limit-Limit:
          $ref: "#/components/headers/Rate-Limit-Limit"
        Rate-Limit-Remaining:
          $ref: "#/components/headers/Rate-Limit-Remaining"
        Rate-Limit-Reset:
          $ref: "#/components/headers/Rate-Limit-Reset"
    Forbidden:
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/Error"
      description: Access forbidden.
    Found:
      description: Resource was moved.
      headers:
        Location:
          schema:
            type: string
    NotFound:
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/Error"
      description: Resource was not found.
    Unauthorized:
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/Error"
      description: Unauthorized access, invalid credentials was used.
    ValidationError:
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/InvalidError"
      description: Invalid data was sent.
  schemas:
    A1Gateway:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              description: A1Gateway credentials object.
              properties:
                accountId:
                  description: A1Gateway account ID.
                  type: string
                password:
                  description: A1Gateway password.
                  format: password
                  type: string
              required:
                - accountId
                - password
              type: object
            threeDSecureServer:
              $ref: "#/components/schemas/A1Gateway3dsServers"
          required:
            - credentials
          type: object
      description: A1Gateway config.
    A1Gateway3dsServers:
      description: A1Gateway 3DS Servers.
      discriminator:
        mapping:
          Other: "#/components/schemas/Other"
          Paay3dsServer: "#/components/schemas/Paay3dsServer"
        propertyName: name
      properties:
        name:
          allOf:
            - $ref: "#/components/schemas/ThreeDSecureServerName"
          enum:
            - Paay3dsServer
            - Other
      required:
        - name
      type: object
    AML:
      properties:
        _links:
          description: The links related to resource, including links provided by the list.
          items:
            $ref: "#/components/schemas/SelfLink"
          minItems: 1
          readOnly: true
          type: array
        address:
          description: Addresses related to the identity.
          items:
            properties:
              address:
                description: Street Address Line 1.
                nullable: true
                readOnly: true
                type: string
              address2:
                description: Street Address Line 2.
                nullable: true
                readOnly: true
                type: string
              birthplace:
                default: false
                description: This address is their birth place.
                readOnly: true
                type: boolean
              city:
                description: City.
                nullable: true
                readOnly: true
                type: string
              country:
                description: Country.
                nullable: true
                readOnly: true
                type: string
              region:
                description: State/Province/Region.
                nullable: true
                readOnly: true
                type: string
            type: object
          readOnly: true
          type: array
        aliases:
          description: List of aliases, if any.
          items:
            properties:
              authenticity:
                description: The level of confidence in the alias.
                enum:
                  - strong
                  - weak
                  - unknown
                readOnly: true
                type: string
              firstName:
                description: First name of alias.
                readOnly: true
                type: string
              lastName:
                description: Last name of alias.
                readOnly: true
                type: string
            type: object
          readOnly: true
          type: array
        comments:
          description: Extra information (the content varies per list).
          nullable: true
          readOnly: true
          type: string
        confidence:
          description: The source list's confidence in information.
          enum:
            - weak
            - medium
            - strong
            - very-strong
          readOnly: true
          type: string
        dob:
          description: One or more possible dates of birth.
          items:
            description: Date of birth.
            example: 1706-01-17T00:00:00.000Z
            format: date
            readOnly: true
            type: string
          readOnly: true
          type: array
        firstName:
          description: First Name.
          example: Benjamin
          readOnly: true
          type: string
        gender:
          description: Gender of returned identity (if `type` is `individual`).
          nullable: true
          readOnly: true
          type: string
        lastName:
          description: Last Name. `null` if it is a single-name entity.
          example: Franklin
          nullable: true
          readOnly: true
          type: string
        legalBasis:
          description: List of references to legal documents if they exist.
          items:
            type: string
          readOnly: true
          type: array
        nationality:
          description: The nationality of the identity.
          readOnly: true
          type: string
        passport:
          description: Passport information.
          items:
            properties:
              number:
                description: Passport number.
                readOnly: true
                type: string
              registrationDate:
                description: Passport registration date.
                format: date
                readOnly: true
                type: string
            type: object
          readOnly: true
          type: array
        regime:
          description: Regime.
          example: United States Government
          nullable: true
          readOnly: true
          type: string
        source:
          description: Which list this came from.
          readOnly: true
          type: string
        sourceType:
          description: The list type.
          enum:
            - pep
            - sanctions
            - adverse-media
          readOnly: true
          type: string
        title:
          description: The title of their position.
          example:
            - Postmaster General
            - Ambassador to France
            - Ambassador to Sweden
            - Supreme Executive Council of Commonwealth of Pennsylvania
          items:
            type: string
          nullable: true
          readOnly: true
          type: array
        type:
          description: The record type.
          enum:
            - individual
            - entity
          readOnly: true
          type: string
      type: object
    AchPlaidFeature:
      properties:
        expirationTime:
          description: The expiration time of a `linkToken`.
          format: date-time
          type: string
        linkToken:
          description: The Plaid `linkToken` for frontend integrations.
          type: string
        name:
          description: The feature name.
          enum:
            - Plaid
          type: string
      title: Plaid
      type: object
    Acl:
      items:
        properties:
          permissions:
            allOf:
              - $ref: "#/components/schemas/AclPermissions"
            description: Specify individual permission here if creating a restricted API
              key. Use wildcard `*` for full access.
          scope:
            allOf:
              - $ref: "#/components/schemas/ApiKeyScope"
            description: Api Key scope.
        required:
          - scope
          - permissions
        type: object
      type: array
    AclPermissions:
      example:
        - PostFile
        - StorefrontGetAccount
        - StorefrontGetWebsite
        - StorefrontGetKycDocumentCollection
        - StorefrontGetKycDocument
        - StorefrontPostKycDocument
      items:
        format: operationId
        type: string
      type: array
    AcquirerName:
      description: The acquirer name.
      enum:
        - Adyen
        - Alipay
        - AIB
        - Airpay
        - ApcoPay
        - AsiaPaymentGateway
        - AstroPay Card
        - Ipay Options
        - B+S
        - Bambora
        - BitPay
        - Bank of America
        - Bank of Moscow
        - Bank of Rebilly
        - Bank One
        - BMO Harris Bank
        - Borgun
        - BraintreePayments
        - Cardknox
        - CASHlib
        - CashToCode
        - Catalunya Caixa
        - CCAvenue
        - Chase
        - ChinaUnionPay
        - CIM
        - Circle
        - Citadel
        - Clearhaus
        - CODVoucher
        - CoinPayments
        - Conekta
        - Coppr
        - Credorax
        - Cryptonator
        - CyberSource
        - dLocal
        - Dragonphoenix
        - EBANX
        - ecoPayz
        - EcorePay
        - Elavon
        - EMS
        - EPG
        - Euteller
        - eZeeWallet
        - ezyEFT
        - Fifth Third Bank
        - Finrax
        - First Data Buypass
        - First Data Nashville
        - First Data North
        - First Data Omaha
        - FinTecSystems
        - Flexepin
        - Forte
        - FundSend
        - Gigadat
        - Global East
        - Gooney
        - Gpaysafe
        - Heartland
        - HiPay
        - HSBC
        - iCanPay
        - ICEPAY
        - iCheque
        - Ilixium
        - Ingenico
        - INOVAPAY
        - Intuit
        - Jeton
        - Khelocard
        - Konnektive
        - loonie
        - LPG
        - Masapay
        - Merrick
        - Mission Valley Bank
        - MiFinity
        - Moneris
        - MuchBetter
        - MyFatoorah
        - NATWEST
        - Neosurf
        - Netbanking
        - Neteller
        - NinjaWallet
        - NMI
        - NuaPay
        - OchaPay
        - Onlineueberweisen
        - OnRamp
        - Other
        - Panamerican
        - Panda Bank
        - Paramount
        - ParamountEft
        - ParamountInterac
        - Pay4fun
        - PayCash
        - PayClub
        - PaymentAsia
        - PaymenTechnologies
        - PaymentsOS
        - Paymero
        - Paynetics
        - PayPal
        - Payr
        - PayTabs
        - PayULatam
        - Payvision
        - Piastrix
        - Peoples Trust Company
        - PostFinance
        - Privatbank
        - Prosa
        - QQPay
        - Rapyd
        - RBC
        - RBS WorldPay
        - RealTime
        - Rotessa
        - SaltarPay
        - SecureTrading
        - SecurionPay
        - Skrill
        - SmartInvoice
        - SMSVoucher
        - Sofort
        - SparkPay
        - State Bank of Mauritius
        - Stripe
        - TBI
        - TestProcessor
        - ToditoCash
        - Trustly
        - TrustPay
        - TrustsPay
        - TSYS
        - TWINT
        - UPayCard
        - Vantiv
        - VCreditos
        - VoicePay
        - Wallet88
        - WeChat Pay
        - Wells Fargo
        - Wing Hang Bank
        - Wirecard
        - WorldPay
        - XPay
        - Zimpler
        - Zotapay
      type: string
    AddressMatches:
      properties:
        city:
          description: The customer city if it was matched, null otherwise.
          example: London
          type: string
        date:
          description: The date on the document proving the document is recent.
          example: 2021-01-01T00:00:00.000Z
          format: date
          type: string
        firstName:
          description: The customer first name if it was matched, null otherwise.
          example: John
          type: string
        lastName:
          description: The customer last name if it was matched, null otherwise.
          example: Doe
          type: string
        line1:
          description: The customer address if it was matched, null otherwise.
          example: 36 Craven St
          type: string
        phone:
          description: The phone of the company or agency that sent the document.
          example: (123) 456-7890
          type: string
        postalCode:
          description: The customer postal code if it was matched, null otherwise.
          example: WC2N 5NF
          type: string
        region:
          description: The customer region if it was matched, null otherwise.
          example: London
          type: string
        uniqueWords:
          description: The number of unique words in the document.
          example: 175
          type: integer
        uniqueWordsResult:
          description: Flag that indicates if the unique words passed the threshold.
          example: true
          readOnly: true
          type: boolean
        wordCount:
          description: The number of words in the document.
          example: 350
          type: integer
        wordCountResult:
          description: Flag that indicates if the word count passed the threshold.
          example: true
          readOnly: true
          type: boolean
      type: object
    Adyen:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              description: Adyen credentials object.
              properties:
                apiKey:
                  description: Adyen api key.
                  format: password
                  type: string
                merchantAccount:
                  description: Adyen merchant account.
                  type: string
              required:
                - merchantAccount
                - apiKey
              type: object
            settings:
              description: Adyen settings object.
              properties:
                url:
                  description: Adyen post URL.
                  type: string
              required:
                - url
              type: object
          required:
            - credentials
            - settings
          type: object
      description: Adyen config.
    Airpay:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              description: Airpay credentials object.
              properties:
                apiKey:
                  description: Airpay api key.
                  format: password
                  type: string
                merchantId:
                  description: Airpay merchant ID.
                  type: string
                password:
                  description: Airpay password.
                  format: password
                  type: string
                username:
                  description: Airpay username.
                  type: string
              required:
                - username
                - merchantId
                - password
                - apiKey
              type: object
          required:
            - credentials
          type: object
      description: Airpay config.
    AlternativePaymentInstrument:
      description: Alternative payment method instrument.
      properties:
        method:
          $ref: "#/components/schemas/PaymentMethod"
        paymentInstrumentId:
          description: The payment instrument ID.
      required:
        - method
      title: Alternative instrument
      type: object
    AlternativePaymentInstrument-2:
      properties:
        _embedded:
          description: Any embedded objects available that are requested by the `expand`
            querystring parameter.
          items:
            anyOf:
              - $ref: "#/components/schemas/CustomerEmbed"
          minItems: 1
          readOnly: true
          type: array
        _links:
          description: Links related to the resource.
          items:
            anyOf:
              - $ref: "#/components/schemas/SelfLink"
              - $ref: "#/components/schemas/CustomerLink"
          minItems: 1
          readOnly: true
          type: array
        billingAddress:
          allOf:
            - $ref: "#/components/schemas/ContactObject"
          description: The billing address.
        createdTime:
          allOf:
            - $ref: "#/components/schemas/ServerTimestamp"
          description: The payment instrument created time.
        customFields:
          $ref: "#/components/schemas/ResourceCustomFields"
        customerId:
          allOf:
            - $ref: "#/components/schemas/ResourceId"
          description: Customer's ID.
        id:
          allOf:
            - $ref: "#/components/schemas/ResourceId"
          description: The payment instrument ID.
        method:
          allOf:
            - $ref: "#/components/schemas/AlternativePaymentMethods"
          description: The method of payment instrument.
        riskMetadata:
          $ref: "#/components/schemas/RiskMetadata"
        status:
          description: The payment instrument status.
          enum:
            - active
            - deactivated
          type: string
        updatedTime:
          allOf:
            - $ref: "#/components/schemas/ServerTimestamp"
          description: The payment instrument updated time.
      title: Alternative instrument
      type: object
    AlternativePaymentMethods:
      enum:
        - cash
        - check
        - paypal
        - AdvCash
        - Alfa-click
        - Alipay
        - AstroPay Card
        - AstroPay-GO
        - bank-transfer
        - bank-transfer-2
        - bank-transfer-3
        - bank-transfer-4
        - bank-transfer-5
        - bank-transfer-6
        - bank-transfer-7
        - bank-transfer-8
        - bank-transfer-9
        - Beeline
        - Belfius-direct-net
        - bitcoin
        - Boleto
        - cash-deposit
        - CASHlib
        - CashToCode
        - China UnionPay
        - CODVoucher
        - Conekta-oxxo
        - Cupon-de-pagos
        - cryptocurrency
        - domestic-cards
        - echeck
        - ecoPayz
        - ecoVoucher
        - EPS
        - ePay.bg
        - eZeeWallet
        - Flexepin
        - Giropay
        - Gpaysafe
        - Google Pay
        - iDebit
        - iDEAL
        - ING-homepay
        - INOVAPAY-pin
        - INOVAPAY-wallet
        - InstaDebit
        - instant-bank-transfer
        - Interac
        - Interac-online
        - Interac-eTransfer
        - invoice
        - iWallet
        - Jeton
        - jpay
        - Khelocard
        - Klarna
        - loonie
        - Megafon
        - MiFinity-eWallet
        - miscellaneous
        - Bancontact
        - MTS
        - MuchBetter
        - Neosurf
        - Netbanking
        - Neteller
        - Nordea-Solo
        - OchaPay
        - online-bank-transfer
        - Onlineueberweisen
        - oriental-wallet
        - OXXO
        - Pagsmile-deposit-express
        - Pagsmile-lottery
        - PayCash
        - Payeer
        - PaymentAsia-crypto
        - Paymero
        - Perfect-money
        - Piastrix
        - plaid-account
        - PayTabs
        - Paysafecard
        - Paysafecash
        - Pay4Fun
        - PinPay
        - phone
        - PhonePe
        - POLi
        - PostFinance-card
        - PostFinance-e-finance
        - Przelewy24
        - QIWI
        - QQPay
        - Resurs
        - SEPA
        - Skrill
        - Skrill Rapid Transfer
        - SMSVoucher
        - Sofort
        - SparkPay
        - swift-dbt
        - Tele2
        - Terminaly-RF
        - ToditoCash-card
        - Trustly
        - UPayCard
        - UPI
        - VCreditos
        - VenusPoint
        - voucher
        - voucher-2
        - voucher-3
        - voucher-4
        - Webmoney
        - Webpay
        - Webpay-2
        - Webpay Card
        - WeChat Pay
        - XPay-P2P
        - XPay-QR
        - Yandex-money
        - Zotapay
        - Zimpler
      type: string
    AlternativePaymentToken:
      allOf:
        - $ref: "#/components/schemas/CommonPaymentToken"
      properties:
        billingAddress:
          allOf:
            - $ref: "#/components/schemas/ContactObject"
          description: The billing address object.
        method:
          allOf:
            - $ref: "#/components/schemas/AlternativePaymentMethods"
          description: The token payment method.
      required:
        - method
        - billingAddress
      title: Alternative payment token.
      type: object
    AmexVPC:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              description: AmexVPC credentials object.
              properties:
                accessCode:
                  description: Access Code.
                  format: password
                  type: string
                merchantId:
                  description: Merchant ID.
                  type: string
                password:
                  description: Password (used for refund, void and capture).
                  format: password
                  type: string
                user:
                  description: User (used for refund, void and capture).
                  type: string
              required:
                - merchantId
                - accessCode
                - user
                - password
              type: object
            settings:
              description: AmexVPC settings object.
              properties:
                url:
                  description: Virtual Payment Client URL.
                  type: string
              required:
                - url
              type: object
          required:
            - credentials
            - settings
          type: object
      description: AmexVPC config.
    AmountAdjustment:
      discriminator:
        mapping:
          discount: "#/components/schemas/discount"
          partial: "#/components/schemas/partial"
        propertyName: method
      properties:
        method:
          enum:
            - none
            - partial
            - discount
          type: string
      required:
        - method
      type: object
    AmountAdjustmentTolerance:
      description: Tolerance percentage for settled amount.
      example: 5
      maximum: 5
      minimum: 0
      type: integer
    ApcoPay:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              description: ApcoPay credentials object.
              properties:
                MerchantID:
                  description: ApcoPay merchant ID.
                  type: string
                MerchantPassword:
                  description: ApcoPay merchant password.
                  format: password
                  type: string
                profileID:
                  description: ApcoPay profile ID.
                  type: string
                secretWord:
                  description: ApcoPay secret word.
                  format: password
                  type: string
              required:
                - profileID
                - secretWord
                - MerchantID
                - MerchantPassword
              type: object
            settings:
              properties:
                method:
                  description: ApcoPay's method.
                  enum:
                    - AFTERPAY
                    - IDEAL
                    - CREDITCLICK
                    - BANCONTACT
                    - ONLINEUBERWEISEN
                  type: string
              required:
                - method
              type: object
          required:
            - credentials
          type: object
      description: ApcoPay config.
    ApiKeyScope:
      example:
        organizationId:
          - organizationId-id-1
      properties:
        customFieldName:
          description: The array of custom field names.
          items:
            maxLength: 60
            pattern: ^[\w-]+$
            type: string
          type: array
        organizationId:
          description: The array of account identifier strings.
          items:
            allOf:
              - $ref: "#/components/schemas/ResourceId"
          type: array
        planId:
          description: The array of plan identifier strings.
          items:
            allOf:
              - $ref: "#/components/schemas/ResourceId"
          type: array
        productId:
          description: The array of product identifier strings.
          items:
            allOf:
              - $ref: "#/components/schemas/ResourceId"
          type: array
      type: object
    ApplePayValidation:
      allOf:
        - $ref: "#/components/schemas/DigitalWalletValidation"
        - properties:
            type:
              type: string
            validationRequest:
              description: The validation request.
              properties:
                displayName:
                  description: A name of your store, suitable for display.
                  example: My Store
                  type: string
                domainName:
                  description: >
                    The domain where the client code like FramePay is executed. Should
                    be registered in the Apple Pay console by Rebilly before
                    using.
                  example: www.example.com
                  type: string
                validationURL:
                  description: The URL provided by the Apple Pay SDK to perform the validation.
                  type: string
              type: object
              writeOnly: true
            validationResponse:
              description: The validation response to use by the Apple Pay SDK to proceed.
              readOnly: true
              type: object
          required:
            - validationRequest
          type: object
      description: Apple Pay session validation.
    ApprovalUrlLink:
      allOf:
        - $ref: "#/components/schemas/Link"
      properties:
        rel:
          description: The link type.
          enum:
            - approvalUrl
          type: string
      required:
        - rel
      type: object
    AsiaPaymentGateway:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              description: AsiaPaymentGateway credentials object.
              properties:
                merchantNumber:
                  description: AsiaPaymentGateway merchant number.
                  type: string
                secretKey:
                  description: AsiaPaymentGateway secret key for hash.
                  format: password
                  type: string
              required:
                - merchantNumber
                - secretKey
              type: object
          required:
            - credentials
          type: object
      description: AsiaPaymentGateway config.
    AstroPayCard:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              description: AstroPay Card credentials object.
              properties:
                api_key:
                  description: One Touch Astropay API key.
                  format: password
                  type: string
                secret_key:
                  description: AstroPay Card secret key.
                  format: password
                  type: string
                x_login:
                  description: AstroPay Card login.
                  type: string
                x_tran_key:
                  description: AstroPay Card transaction key.
                  format: password
                  type: string
              required:
                - x_login
                - x_tran_key
                - secret_key
              type: object
            settings:
              description: AstroPay Card settings object.
              properties:
                oneTouchApi:
                  default: false
                  description: Use One Touch Astropay API.
                  type: boolean
              type: object
          required:
            - credentials
          type: object
      description: AstroPay Card config.
    Attachment:
      properties:
        _embedded:
          description: Any embedded objects available that are requested by the `expand`
            querystring parameter.
          items:
            anyOf:
              - $ref: "#/components/schemas/FileEmbed"
          minItems: 1
          readOnly: true
          type: array
        _links:
          description: The links related to resource.
          items:
            anyOf:
              - $ref: "#/components/schemas/SelfLink"
              - $ref: "#/components/schemas/FileLink"
              - $ref: "#/components/schemas/AttachmentResourceLink"
          minItems: 3
          readOnly: true
          type: array
        createdTime:
          allOf:
            - $ref: "#/components/schemas/ServerTimestamp"
          description: Creation date/time.
        description:
          description: The Attachment description.
          type: string
        fileId:
          description: Linked File object id.
          type: string
        id:
          allOf:
            - $ref: "#/components/schemas/ResourceId"
          readOnly: true
        name:
          description: The Original Attachment name.
          type: string
        relatedId:
          description: Linked object Id.
          type: string
        relatedType:
          description: Linked object type.
          enum:
            - customer
            - dispute
            - gateway-timeline-comment
            - invoice
            - organization
            - payment
            - plan
            - product
            - subscription
            - transaction
            - customer-timeline-comment
            - transaction-timeline-comment
            - order-timeline-comment
          type: string
        updatedTime:
          allOf:
            - $ref: "#/components/schemas/ServerTimestamp"
          description: Latest update date/time.
      required:
        - fileId
        - relatedId
        - relatedType
      type: object
    AttachmentResourceLink:
      allOf:
        - $ref: "#/components/schemas/Link"
      properties:
        rel:
          description: The link type.
          enum:
            - customer
            - dispute
            - invoice
            - payment
            - plan
            - product
            - subscription
            - transaction
          type: string
      required:
        - rel
      type: object
    AuthTransactionEmbed:
      description: Auth Transaction object.
      properties:
        authTransaction:
          $ref: "#/components/schemas/Transaction"
      readOnly: true
      type: object
    AuthTransactionLink:
      allOf:
        - $ref: "#/components/schemas/Link"
      properties:
        rel:
          description: The link type.
          enum:
            - authTransaction
          type: string
      required:
        - rel
      type: object
    AuthenticationOptions:
      properties:
        authTokenTtl:
          description: The default lifetime of the auth-token in seconds.
          type: integer
        credentialTtl:
          description: The default lifetime of the credential in seconds.
          type: integer
        otpRequired:
          description: Should OTP be required to exchange token.
          type: boolean
        passwordPattern:
          description: Allowed password pattern.
          type: string
        resetTokenTtl:
          description: The default lifetime of the reset-token in seconds.
          type: integer
      type: object
    AuthenticationToken:
      discriminator:
        mapping:
          password: "#/components/schemas/password"
          passwordless: "#/components/schemas/passwordless"
        propertyName: mode
      properties:
        credentialId:
          allOf:
            - $ref: "#/components/schemas/ResourceId"
          description: The credential's ID.
          readOnly: true
        mode:
          default: password
          description: The token's generation mode.
          enum:
            - password
            - passwordless
          type: string
          writeOnly: true
        otpRequired:
          description: Should OTP be required to exchange this token.
          type: boolean
        token:
          description: The token identifier string.
          readOnly: true
          type: string
      type: object
    AuthenticationTokenMetadata:
      properties:
        _links:
          description: The links related to resource.
          items:
            $ref: "#/components/schemas/SelfLink"
          minItems: 1
          readOnly: true
          type: array
        expiredTime:
          description: Token's expired time.
          format: date-time
          type: string
      type: object
    AuthorizeNet:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              properties:
                apiLoginId:
                  description: AuthorizeNet Gateway api login ID.
                  type: string
                transactionKey:
                  description: AuthorizeNet Gateway Transaction Key.
                  format: password
                  type: string
              required:
                - apiLoginId
                - transactionKey
              type: object
          required:
            - credentials
          type: object
      description: AuthorizeNet Gateway config.
    BBANInstrument:
      allOf:
        - $ref: "#/components/schemas/BankAccountInstrument"
        - properties:
            accountNumber:
              description: Bank Account Number.
              pattern: ^[0-9]+$
              type: string
              writeOnly: true
            accountType:
              description: Bank Account Type.
              enum:
                - checking
                - savings
                - other
              type: string
            bankName:
              description: Bank name.
              type: string
            bic:
              description: Bank Identifier Code.
              type: string
            last4:
              description: Bank Account Number's last 4 digits.
              readOnly: true
              type: string
            routingNumber:
              description: Bank Routing Number.
              pattern: ^[0-9]+$
              type: string
          required:
            - accountNumber
            - routingNumber
            - accountType
          type: object
      description: Bank account BBAN instrument.
    BBANType:
      description: BBAN type object.
      properties:
        accountNumber:
          description: Bank's account number.
          pattern: ^[0-9]+$
          type: string
        accountNumberType:
          default: BBAN
          description: >-
            Bank's Account Number type. A valid value is basic bank account
            number (BBAN) or international bank account number (IBAN).

            This is the object for the BBAN.
          enum:
            - IBAN
            - BBAN
          type: string
        accountType:
          description: Bank's account type.
          enum:
            - checking
            - savings
            - other
          type: string
        bankName:
          description: Bank's name.
          type: string
        bic:
          description: Bank Identifier Code.
          type: string
        billingAddress:
          allOf:
            - $ref: "#/components/schemas/ContactObject"
          description: The billing address.
        customFields:
          $ref: "#/components/schemas/ResourceCustomFields"
        customerId:
          allOf:
            - $ref: "#/components/schemas/ResourceId"
          description: Customer's ID.
        method:
          description: The method of payment instrument.
          enum:
            - ach
          type: string
        riskMetadata:
          $ref: "#/components/schemas/RiskMetadata"
        routingNumber:
          description: Bank's routing number.
          pattern: ^[0-9]+$
          type: string
      required:
        - method
        - customerId
        - accountNumberType
        - accountNumber
        - routingNumber
        - accountType
        - billingAddress
      type: object
    Bambora:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              properties:
                apiPasscode:
                  description: Bambora Gateway API Passcode.
                  format: password
                  type: string
                merchantId:
                  description: Bambora Gateway merchant ID.
                  type: string
              required:
                - merchantId
                - apiPasscode
              type: object
          required:
            - credentials
          type: object
      description: Bambora Gateway config.
    BankAccount:
      allOf:
        - $ref: "#/components/schemas/CommonBankAccount"
        - properties:
            _embedded:
              description: Any embedded objects available that are requested by the `expand`
                querystring parameter.
              items:
                anyOf:
                  - $ref: "#/components/schemas/CustomerEmbed"
              minItems: 1
              readOnly: true
              type: array
            _links:
              description: The links related to resource.
              items:
                anyOf:
                  - $ref: "#/components/schemas/SelfLink"
                  - $ref: "#/components/schemas/CustomerLink"
              minItems: 1
              readOnly: true
              type: array
    BankAccountCreatePlain:
      anyOf:
        - $ref: "#/components/schemas/BBANType"
        - $ref: "#/components/schemas/IBANType"
    BankAccountCreateToken:
      properties:
        customFields:
          $ref: "#/components/schemas/ResourceCustomFields"
        customerId:
          allOf:
            - $ref: "#/components/schemas/ResourceId"
          description: The Customer's ID.
        token:
          description: BankAccountToken ID.
          type: string
      required:
        - customerId
        - token
      type: object
    BankAccountEmbed:
      description: Bank Account object.
      properties:
        bankAccount:
          $ref: "#/components/schemas/BankAccount"
      readOnly: true
      type: object
    BankAccountInstrument:
      description: The bank account BBAN or IBAN instrument.
      discriminator:
        mapping:
          BBAN: "#/components/schemas/BBANInstrument"
          IBAN: "#/components/schemas/IBANInstrument"
        propertyName: accountNumberType
      properties:
        accountNumberType:
          default: BBAN
          description: Bank's Account Number type. A valid value is basic bank account
            number (BBAN) or international bank account number (IBAN).
          enum:
            - IBAN
            - BBAN
          type: string
      required:
        - accountNumberType
      type: object
    BankAccountToken:
      allOf:
        - $ref: "#/components/schemas/CommonPaymentToken"
      properties:
        billingAddress:
          allOf:
            - $ref: "#/components/schemas/ContactObject"
          description: The billing address object.
        method:
          description: The token payment method.
          enum:
            - ach
            - echeck
          type: string
        paymentInstrument:
          $ref: "#/components/schemas/BankAccountInstrument"
      required:
        - method
        - paymentInstrument
        - billingAddress
      title: Bank Account Token.
      type: object
    BankAccountUpdatePlain:
      properties:
        accountType:
          description: Bank's account type.
          enum:
            - checking
            - savings
            - other
          type: string
        bankName:
          description: Bank's name.
          type: string
        billingAddress:
          allOf:
            - $ref: "#/components/schemas/ContactObject"
          description: The billing address.
        customFields:
          $ref: "#/components/schemas/ResourceCustomFields"
      type: object
    BitPay:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              description: BitPay credentials object.
              properties:
                token:
                  description: BitPay merchant API token.
                  format: password
                  type: string
              required:
                - token
              type: object
          required:
            - credentials
          type: object
      description: BitPay Gateway config.
    BlankProblem:
      additionalProperties: true
      description: The Problem Details JSON Object
        [[RFC7807](https://tools.ietf.org/html/rfc7807)].
      minProperties: 1
      properties:
        status:
          description: The HTTP status code.
          maximum: 599
          minimum: 400
          type: integer
        title:
          description: A short, human-readable summary of the problem type. It SHOULD NOT
            change from occurrence to occurrence of the problem, except for
            purposes of localization.
          type: string
      type: object
    Blocklist:
      properties:
        _links:
          description: The links related to resource.
          items:
            $ref: "#/components/schemas/SelfLink"
          minItems: 1
          readOnly: true
          type: array
        createdTime:
          allOf:
            - $ref: "#/components/schemas/ServerTimestamp"
          description: The blocklist created time.
        expirationTime:
          description: The blocklist expiration time.
          format: date-time
          type: string
        id:
          allOf:
            - $ref: "#/components/schemas/ResourceId"
          description: The blocklist identifier string.
          readOnly: true
        type:
          description: The blocklist type.
          enum:
            - payment-card
            - bank-account
            - customer-id
            - email
            - email-domain
            - ip-address
            - country
            - fingerprint
            - bin
            - address
          type: string
        updatedTime:
          allOf:
            - $ref: "#/components/schemas/ServerTimestamp"
          description: The blocklist updated time.
        value:
          description: The blocklist value.
          type: string
      required:
        - type
        - value
      type: object
    BlueSnap:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              description: BlueSnap credentials object.
              properties:
                password:
                  description: BlueSnap merchant's api password.
                  format: password
                  type: string
                username:
                  description: BlueSnap merchant's api username.
                  type: string
              required:
                - username
                - password
              type: object
          required:
            - credentials
          type: object
      description: BlueSnap config.
    BraintreePayments:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              properties:
                merchantAccountId:
                  description: BraintreePayments merchant account ID.
                  format: password
                  type: string
                merchantId:
                  description: BraintreePayments merchant ID.
                  format: password
                  type: string
                privateKey:
                  description: BraintreePayments Private Key.
                  format: password
                  type: string
                publicKey:
                  description: BraintreePayments Public Key.
                  type: string
              required:
                - publicKey
                - privateKey
                - merchantId
                - merchantAccountId
              type: object
          required:
            - credentials
          type: object
      description: BraintreePayments Gateway config.
    BrowserData:
      description: Browser data used for 3DS and risk scoring.
      properties:
        colorDepth:
          description: The browser's color depth in bits per pixel obtained using the
            `screen.colorDepth` property.
          example: 24
          maximum: 48
          minimum: 1
          type: integer
        isJavaEnabled:
          description: Whether Java is enabled in a browser or not. Value is returned from
            the `navigator.javaEnabled` property.
          type: boolean
        language:
          description: The browser's language settings returned from the
            `navigator.language` property.
          example: en-US
          maxLength: 8
          type: string
        screenHeight:
          description: The browser's screen height returned from the `screen.height`
            property.
          example: 1080
          maximum: 65535
          minimum: 0
          type: integer
        screenWidth:
          description: The browser's screen width returned from the `screen.width` property.
          example: 1920
          maximum: 65535
          minimum: 0
          type: integer
        timeZoneOffset:
          description: >
            The browser's time zone offset in minutes from UTC.

            A positive offset indicates the local time is behind UTC, and negative is ahead.

            Can find it with `(new Date()).getTimezoneOffset()` property.
          example: 300
          maximum: 1410
          minimum: -1410
          type: integer
      required:
        - colorDepth
        - isJavaEnabled
        - language
        - screenWidth
        - screenHeight
        - timeZoneOffset
      title: Browser data
      type: object
    CASHlib:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              description: CASHlib credentials object.
              properties:
                apiKey:
                  description: CASHlib API Key.
                  format: password
                  type: string
                merchantId:
                  description: CASHlib merchant id.
                  type: string
              required:
                - apiKey
                - merchantId
              type: object
          required:
            - credentials
          type: object
      description: CASHlib config.
    CCAvenue:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              description: CCAvenue credentials object.
              properties:
                accessCode:
                  description: CCAvenue access code.
                  format: password
                  type: string
                merchantId:
                  description: CCAvenue merchant id.
                  type: string
                workingKey:
                  description: CCAvenue working key.
                  format: password
                  type: string
              required:
                - merchantId
                - accessCode
                - workingKey
              type: object
          required:
            - credentials
          type: object
      description: CCAvenue config.
    CODVoucher:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              description: COD Voucher credentials object.
              properties:
                apiKey:
                  description: COD Voucher API key.
                  format: password
                  type: string
                apiSecret:
                  description: COD Voucher API secret.
                  format: password
                  type: string
              required:
                - apiKey
                - apiSecret
              type: object
          required:
            - credentials
          type: object
      description: COD Voucher config.
    CardinalCommerce3dsServer:
      allOf:
        - $ref: "#/components/schemas/Payvision3dsServers"
        - properties:
            merchantId:
              description: Cardinal MerchantId.
              type: string
            processorId:
              description: Cardinal ProcessorId.
              type: string
            transactionPwd:
              description: Cardinal TransactionPwd.
              format: password
              type: string
          required:
            - merchantId
            - processorId
            - transactionPwd
          type: object
      description: CardinalCommerce 3DS Server Credentials.
    Cardknox:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              properties:
                xKey:
                  description: Cardknox xKey.
                  format: password
                  type: string
              required:
                - xKey
              type: object
          required:
            - credentials
          type: object
      description: Cardknox Gateway config.
    CashInstrument:
      description: Cash payment instrument object.
      properties:
        method:
          enum:
            - cash
          type: string
        receivedBy:
          description: The receiver's name.
          type: string
      required:
        - method
      title: Cash
      type: object
    CashToCode:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              description: CashToCode credentials object.
              properties:
                cashToCodePassword:
                  description: CashToCode credentials password.
                  format: password
                  type: string
                cashToCodeUsername:
                  description: CashToCode credentials Username.
                  type: string
                merchantPassword:
                  description: Merchant credentials password.
                  format: password
                  type: string
                merchantUsername:
                  description: Merchant credentials Username.
                  type: string
              required:
                - cashToCodeUsername
                - cashToCodePassword
                - merchantUsername
                - merchantPassword
              type: object
            settings:
              properties:
                amounts:
                  description: Amounts for which to allow transactions.
                  items:
                    format: double
                    minimum: 0
                    type: number
                  type: array
                skipAmountSelection:
                  default: false
                  description: Skip amount selection screen.
                  type: boolean
              type: object
          required:
            - credentials
          type: object
      description: CashToCode config.
    Cashflows:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              properties:
                authId:
                  description: Cashflows Gateway auth ID.
                  type: string
                authPassword:
                  description: Cashflows Gateway auth password.
                  format: password
                  type: string
              required:
                - authPassword
                - authId
              type: object
          required:
            - credentials
          type: object
      description: Cashflows Gateway config.
    CauriPayment:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              description: CauriPayment credentials object.
              properties:
                privateKey:
                  description: CauriPayment merchant's private key.
                  format: password
                  type: string
                publicKey:
                  description: CauriPayment merchant's public key.
                  type: string
              required:
                - publicKey
                - privateKey
              type: object
          required:
            - credentials
          type: object
      description: CauriPayment config.
    Cayan:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              properties:
                merchantKey:
                  description: Cayan Gateway merchant key.
                  format: password
                  type: string
                merchantName:
                  description: Cayan Gateway merchant name.
                  type: string
                merchantSiteId:
                  description: Cayan Gateway merchant site ID.
                  type: string
              required:
                - merchantSiteId
                - merchantName
                - merchantKey
              type: object
          required:
            - credentials
          type: object
      description: Cayan Gateway config.
    Chase:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              properties:
                coNumber:
                  description: Chase Gateway CO Number used for delimited file reports.
                  type: string
                divisionId:
                  description: Chase Gateway division ID.
                  type: string
                partialAuth:
                  default: false
                  description: Support for Partial Auths.
                  type: boolean
                password:
                  description: Chase Gateway Net Connect password.
                  format: password
                  type: string
                username:
                  description: Chase Gateway Net Connect username.
                  type: string
              required:
                - username
                - password
                - coNumber
                - divisionId
                - partialAuth
              type: object
          required:
            - credentials
          type: object
      description: Chase Gateway config.
    CheckInstrument:
      description: Check payment instrument object.
      properties:
        method:
          enum:
            - cash
          type: string
        reference:
          description: Reference data.
          type: string
      required:
        - method
      title: Check
      type: object
    Circle:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              description: Circle credentials object.
              properties:
                apiKey:
                  format: password
                  type: string
              required:
                - apiKey
              type: object
          required:
            - credentials
          type: object
      description: Circle config.
    Citadel:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              description: Citadel credentials object.
              properties:
                password:
                  description: Password.
                  format: password
                  type: string
                storeId:
                  description: Store ID.
                  type: string
                storeName:
                  description: Store name.
                  type: string
                username:
                  description: Username.
                  type: string
              required:
                - storeName
                - storeId
                - username
                - password
              type: object
          required:
            - credentials
          type: object
      description: Citadel config.
    Clearhaus:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              properties:
                apiKey:
                  description: Clearhaus api key.
                  format: password
                  type: string
              required:
                - apiKey
              type: object
            threeDSecureServer:
              $ref: "#/components/schemas/Clearhaus3dsServers"
          required:
            - credentials
          type: object
      description: Clearhaus Gateway config.
    Clearhaus3dsServer:
      allOf:
        - $ref: "#/components/schemas/Clearhaus3dsServers"
        - properties:
            acquirerBin:
              description: Acquiring institution identification code.
              type: string
            apiKey:
              description: 3DS Server Api key.
              format: password
              type: string
            merchantId:
              description: Merchant account ID or Card Acceptor ID provided by the acquiring
                bank.
              type: string
          required:
            - merchantId
            - acquirerBin
            - apiKey
          type: object
      description: Clearhaus 3DS Server Credentials.
    Clearhaus3dsServers:
      description: Clearhaus 3DS Servers.
      discriminator:
        mapping:
          Clearhaus3dsServer: "#/components/schemas/Clearhaus3dsServer"
        propertyName: name
      properties:
        name:
          allOf:
            - $ref: "#/components/schemas/ThreeDSecureServerName"
          enum:
            - Clearhaus3dsServers
      required:
        - name
      type: object
    CoinPayments:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              description: CoinPayments credentials object.
              properties:
                ipnSecret:
                  format: password
                  type: string
                privateKey:
                  format: password
                  type: string
                publicKey:
                  type: string
              required:
                - publicKey
                - privateKey
                - ipnSecret
              type: object
          required:
            - credentials
          type: object
      description: CoinPayments config.
    CommonBankAccount:
      properties:
        accountNumberType:
          default: BBAN
          description: Bank's account number type. A valid value is basic bank account
            number (BBAN) or international bank account number (IBAN).
          enum:
            - BBAN
            - IBAN
          type: string
        accountType:
          description: Bank's account type.
          enum:
            - checking
            - savings
            - other
          type: string
        bankName:
          description: Bank's name.
          type: string
        bic:
          description: Bank Identifier Code.
          type: string
        billingAddress:
          allOf:
            - $ref: "#/components/schemas/ContactObject"
          description: The billing address.
        createdTime:
          allOf:
            - $ref: "#/components/schemas/ServerTimestamp"
          description: Bank account created time.
        customFields:
          $ref: "#/components/schemas/ResourceCustomFields"
        customerId:
          allOf:
            - $ref: "#/components/schemas/ResourceId"
          description: The customer's ID.
        fingerprint:
          description: A unique value to identify the bank account. It contains
            alphanumeric values.
          readOnly: true
          type: string
        id:
          allOf:
            - $ref: "#/components/schemas/ResourceId"
          description: The payment instrument ID.
          readOnly: true
        last4:
          description: The last 4 digits of the bank account.
          readOnly: true
          type: string
        method:
          description: The method of payment instrument.
          enum:
            - ach
          readOnly: true
          type: string
        riskMetadata:
          $ref: "#/components/schemas/RiskMetadata"
        routingNumber:
          description: Bank's routing number.
          type: string
        status:
          description: Bank account status.
          enum:
            - active
            - deactivated
          readOnly: true
          type: string
        updatedTime:
          allOf:
            - $ref: "#/components/schemas/ServerTimestamp"
          description: Bank account updated time.
      title: Bank Account
      type: object
    CommonInvoice:
      properties:
        abandonedTime:
          allOf:
            - $ref: "#/components/schemas/ServerTimestamp"
          description: Invoice abandoned time.
          x-sortable: true
        amount:
          description: The invoice's amount.
          format: double
          readOnly: true
          type: number
          x-basic: true
          x-sortable: true
          x-type: Money
        amountDue:
          description: The invoice's due amount.
          format: double
          readOnly: true
          type: number
          x-sortable: true
          x-type: Money
        autopayRetryNumber:
          default: 0
          description: Invoice autopay retry number.
          minimum: 0
          readOnly: true
          type: integer
          x-sortable: true
        autopayScheduledTime:
          description: Invoice autopay scheduled time.
          format: date-time
          type: string
          x-sortable: true
        billingAddress:
          allOf:
            - $ref: "#/components/schemas/ContactObject"
          description: Invoice's billing address.
        collectionPeriod:
          description: Collection period - difference between paidTime and issuedTime in
            days.
          readOnly: true
          type: integer
          x-sortable: true
        createdTime:
          allOf:
            - $ref: "#/components/schemas/ServerTimestamp"
          description: Invoice created time.
          x-sortable: true
        currency:
          allOf:
            - $ref: "#/components/schemas/CurrencyCode"
          x-basic: true
          x-sortable: true
        delinquentCollectionPeriod:
          description: Delinquent collection period - difference between paidTime and
            dueTime in days.
          readOnly: true
          type: integer
          x-sortable: true
        deliveryAddress:
          allOf:
            - $ref: "#/components/schemas/ContactObject"
          description: Invoice's delivery address.
        discountAmount:
          description: The invoice's discounts amount.
          format: double
          readOnly: true
          type: number
          x-type: Money
        discounts:
          description: Discounts applied.
          items:
            allOf:
              - $ref: "#/components/schemas/InvoiceDiscount"
          readOnly: true
          type: array
        dueTime:
          allOf:
            - $ref: "#/components/schemas/ServerTimestamp"
          description: Invoice due time.
          x-sortable: true
        id:
          allOf:
            - $ref: "#/components/schemas/ResourceId"
          description: The invoice ID.
          readOnly: true
        invoiceNumber:
          description: An auto-incrementing number based on the sequence of invoices for
            any particular customer.
          readOnly: true
          type: integer
          x-basic: true
        issuedTime:
          allOf:
            - $ref: "#/components/schemas/ServerTimestamp"
          description: Invoice issued time.
          x-basic: true
          x-label: Date Issued
          x-sortable: true
        items:
          description: Invoice items array.
          items:
            $ref: "#/components/schemas/InvoiceItem"
          readOnly: true
          type: array
        notes:
          description: Notes for the customer which will be displayed on the invoice.
          type: string
        paidTime:
          allOf:
            - $ref: "#/components/schemas/ServerTimestamp"
          description: Invoice paid time.
          x-basic: true
          x-label: Payment Date
          x-sortable: true
        paymentFormUrl:
          description: >
            URL where the customer can be redirected to pay for the invoice

            with one of the methods which are available for this customer.

            It's an alternative to creating a new transaction with empty `methods`.
          format: url
          readOnly: true
          type: string
        poNumber:
          description: Purchase order number which will be displayed on the invoice.
          example: PO123456
          nullable: true
          type: string
        shipping:
          $ref: "#/components/schemas/InvoiceShipping"
        status:
          description: Invoice status.
          enum:
            - draft
            - unpaid
            - paid
            - past-due
            - delinquent
            - abandoned
            - voided
            - partially-refunded
            - refunded
            - disputed
          readOnly: true
          type: string
          x-basic: true
        subscriptionId:
          allOf:
            - $ref: "#/components/schemas/ResourceId"
          description: The related order's ID if available, otherwise null.
          readOnly: true
        subtotalAmount:
          description: The invoice's subtotal amount.
          format: double
          readOnly: true
          type: number
          x-type: Money
        tax:
          $ref: "#/components/schemas/InvoiceTax"
        updatedTime:
          allOf:
            - $ref: "#/components/schemas/ServerTimestamp"
          description: Invoice updated time.
          x-sortable: true
        voidedTime:
          allOf:
            - $ref: "#/components/schemas/ServerTimestamp"
          description: Invoice voided time.
          x-sortable: true
        websiteId:
          allOf:
            - $ref: "#/components/schemas/ResourceId"
          description: The website ID.
      required:
        - currency
        - websiteId
      type: object
    CommonKycDocument:
      properties:
        _links:
          description: The links related to resource.
          items:
            anyOf:
              - $ref: "#/components/schemas/SelfLink"
          minItems: 1
          readOnly: true
          type: array
        createdTime:
          allOf:
            - $ref: "#/components/schemas/ServerTimestamp"
          description: Creation date/time.
        documentSubtype:
          allOf:
            - $ref: "#/components/schemas/KycDocumentSubtypes"
          description: Document subtype submitted for validation.
        documentType:
          allOf:
            - $ref: "#/components/schemas/KycDocumentTypes"
          description: Document type submitted for validation, only identity-proof type is
            analyzed in an automated manner.
        fileId:
          allOf:
            - $ref: "#/components/schemas/ResourceId"
          deprecated: true
          description: Linked file object id.
        fileIds:
          description: Linked file object id's.
          items:
            allOf:
              - $ref: "#/components/schemas/ResourceId"
          type: array
        id:
          allOf:
            - $ref: "#/components/schemas/ResourceId"
          readOnly: true
        processedTime:
          allOf:
            - $ref: "#/components/schemas/ServerTimestamp"
          description: Processing date/time.
        rejectionReason:
          $ref: "#/components/schemas/KycDocumentRejection"
        requestId:
          allOf:
            - $ref: "#/components/schemas/ResourceId"
          description: KYC request identifier string.
          nullable: true
          readOnly: true
        status:
          description: Status of the validation.
          enum:
            - pending
            - in-progress
            - accepted
            - rejected
          readOnly: true
          type: string
        updatedTime:
          allOf:
            - $ref: "#/components/schemas/ServerTimestamp"
          description: Latest update date/time.
      required:
        - customerId
        - documentType
        - status
      type: object
    CommonKycRequest:
      properties:
        createdTime:
          allOf:
            - $ref: "#/components/schemas/ServerTimestamp"
          description: Creation date/time.
        documents:
          description: Documents to be requested from customer.
          items:
            properties:
              maxAttempts:
                default: 3
                description: The number of document upload attempts. `0` treated as unlimited.
                maximum: 100
                minimum: 0
                type: integer
              subtypes:
                description: Document subtype allowed for customer.
                items:
                  $ref: "#/components/schemas/KycDocumentSubtypes"
                type: array
              type:
                allOf:
                  - $ref: "#/components/schemas/KycDocumentTypes"
                description: Document type to be requested from customer.
            required:
              - type
            type: object
          type: array
        expirationTime:
          description: Expiration date/time.
          format: date-time
          type: string
        id:
          allOf:
            - $ref: "#/components/schemas/ResourceId"
          readOnly: true
        redirectUrl:
          description: The URL to redirect the customer when an upload is completed.
          format: uri
          type: string
        updatedTime:
          allOf:
            - $ref: "#/components/schemas/ServerTimestamp"
          description: Latest update date/time.
      required:
        - documents
      type: object
    CommonOneTimeOrder:
      allOf:
        - $ref: "#/components/schemas/CommonSubscription"
        - properties:
            status:
              description: One-time order status.
              enum:
                - pending
                - completed
                - abandoned
              readOnly: true
              type: string
      type: object
    CommonPayPalAccount:
      properties:
        billingAddress:
          allOf:
            - $ref: "#/components/schemas/ContactObject"
          description: The billing address.
        createdTime:
          allOf:
            - $ref: "#/components/schemas/ServerTimestamp"
          description: PayPal account created time.
        customFields:
          $ref: "#/components/schemas/ResourceCustomFields"
        customerId:
          allOf:
            - $ref: "#/components/schemas/ResourceId"
          description: The customer's ID.
        id:
          allOf:
            - $ref: "#/components/schemas/ResourceId"
          description: The payment instrument ID.
          readOnly: true
        method:
          description: The method of payment instrument.
          enum:
            - paypal
          type: string
        riskMetadata:
          $ref: "#/components/schemas/RiskMetadata"
        status:
          description: PayPal account status.
          enum:
            - inactive
            - active
            - deactivated
          readOnly: true
          type: string
        updatedTime:
          allOf:
            - $ref: "#/components/schemas/ServerTimestamp"
          description: PayPal account updated time.
        username:
          description: PayPal username.
          readOnly: true
          type: string
      required:
        - method
        - customerId
        - billingAddress
      title: PayPal Account
      type: object
    CommonPaymentCard:
      properties:
        bankCountry:
          description: Payment instrument bank country.
          readOnly: true
          type: string
        bankName:
          description: Payment instrument bank name.
          readOnly: true
          type: string
        billingAddress:
          allOf:
            - $ref: "#/components/schemas/ContactObject"
          description: The billing address.
        bin:
          description: The card's bin (the PAN's first 6 digits).
          format: bin
          readOnly: true
          type: string
        brand:
          allOf:
            - $ref: "#/components/schemas/PaymentCardBrand"
          readOnly: true
        createdTime:
          allOf:
            - $ref: "#/components/schemas/ServerTimestamp"
          description: Payment instrument created time.
        customFields:
          $ref: "#/components/schemas/ResourceCustomFields"
        customerId:
          allOf:
            - $ref: "#/components/schemas/ResourceId"
          description: The сustomer's ID.
        cvv:
          description: Card's cvv (card verification value).
          type: string
          writeOnly: true
        expMonth:
          description: Card's expiration month.
          type: integer
        expYear:
          description: Card's expiration year.
          type: integer
        fingerprint:
          description: A unique value to identify the payment instrument regardless of
            variable values. It contains alphanumeric values.
          readOnly: true
          type: string
        id:
          allOf:
            - $ref: "#/components/schemas/ResourceId"
          description: The payment instrument ID.
          readOnly: true
        last4:
          description: The PAN's last 4 digits.
          readOnly: true
          type: string
        method:
          description: The method of payment instrument.
          enum:
            - payment-card
          readOnly: true
          type: string
        pan:
          description: The card PAN (primary account number).
          type: string
          writeOnly: true
        riskMetadata:
          $ref: "#/components/schemas/RiskMetadata"
        status:
          description: >
            Payment instrument status. When an instrument is `active` it means
            it has been used at least once for an approved transaction.

            To remove an instrument from being in use, set it as `deactivated` (see the deactivation endpoint).
          enum:
            - active
            - inactive
            - expired
            - deactivated
            - verification-needed
          type: string
        updatedTime:
          allOf:
            - $ref: "#/components/schemas/ServerTimestamp"
          description: Payment instrument updated time.
      title: Payment Card
      type: object
    CommonPaymentToken:
      properties:
        _links:
          description: The links related to resource.
          items:
            $ref: "#/components/schemas/SelfLink"
          minItems: 1
          readOnly: true
          type: array
        createdTime:
          allOf:
            - $ref: "#/components/schemas/ServerTimestamp"
          description: Token created time.
        expirationTime:
          allOf:
            - $ref: "#/components/schemas/ServerTimestamp"
          description: Token expiration time.
        id:
          allOf:
            - $ref: "#/components/schemas/ResourceId"
          description: The token identifier string.
          readOnly: true
        isUsed:
          default: false
          description: Whether the token was already used.
          readOnly: true
          type: boolean
        leadSource:
          allOf:
            - $ref: "#/components/schemas/LeadSource"
          writeOnly: true
        method:
          type: string
        riskMetadata:
          allOf:
            - $ref: "#/components/schemas/RiskMetadata"
        updatedTime:
          allOf:
            - $ref: "#/components/schemas/ServerTimestamp"
          description: Token updated time.
        usageTime:
          allOf:
            - $ref: "#/components/schemas/ServerTimestamp"
          description: Token usage time.
      required:
        - method
      type: object
    CommonPlan:
      properties:
        createdTime:
          allOf:
            - $ref: "#/components/schemas/ServerTimestamp"
          description: Plan created time.
        currency:
          allOf:
            - $ref: "#/components/schemas/CurrencyCode"
        currencySign:
          description: Currency sign.
          readOnly: true
          type: string
        customFields:
          $ref: "#/components/schemas/ResourceCustomFields"
        id:
          allOf:
            - $ref: "#/components/schemas/ResourceId"
          description: The plan ID.
          readOnly: true
        isTrialOnly:
          description: Whether a plan has a trial without recurring instructions.
          readOnly: true
          type: boolean
        name:
          description: The plan name, displayed on invoices and receipts.
          type: string
        pricing:
          $ref: "#/components/schemas/PlanPriceFormula"
        productId:
          allOf:
            - $ref: "#/components/schemas/ResourceId"
          description: The related product ID.
        productOptions:
          additionalProperties:
            type: string
          description: Name-value pairs to specify the product options.
          example:
            color: red
            size: xxl
          type: object
        recurringInterval:
          allOf:
            - $ref: "#/components/schemas/PlanPeriod"
            - properties:
                billingTiming:
                  $ref: "#/components/schemas/PlanBillingTiming"
                limit:
                  description: >
                    The number of invoices this subscription order will generate

                    (if 1, it will not generate any beyond the initial order creation).

                    For example, set this property to `12`, when the `periodUnit` is month and the

                    `periodDuration` is 1, for a 1 year contract billed monthly.
                  type: integer
              type: object
          description: The service interval. For a one-time item, use `null`.
        revision:
          description: |
            Increments when the plan is modified. 
            Compare to materialized subscription items revision.
          readOnly: true
          type: integer
        setup:
          description: The setup. Set `null` if no setup.
          properties:
            price:
              description: The price of a setup - 0 is a valid value (for free).
              format: double
              type: number
          required:
            - price
          type: object
        trial:
          description: The trial. Set `null` if no trial.
          properties:
            period:
              $ref: "#/components/schemas/PlanPeriod"
            price:
              description: The price of the trial. For a free trial, use `0`.
              format: double
              type: number
          required:
            - price
            - period
          type: object
        updatedTime:
          allOf:
            - $ref: "#/components/schemas/ServerTimestamp"
          description: Plan updated time.
      required:
        - name
        - currency
        - productId
        - pricing
      type: object
    CommonProduct:
      description: >
        Products include digital goods, services, and physical goods.

        Products appear on invoice line items. If you set a tax category identifier,

        taxes will be calculated upon invoice generation. If it is shippable,

        shipping will be calculated upon invoice generation. Pricing and

        variations are set within Plans.
      properties:
        createdTime:
          allOf:
            - $ref: "#/components/schemas/ServerTimestamp"
          description: The product created time.
        customFields:
          $ref: "#/components/schemas/ResourceCustomFields"
        description:
          description: The product description.
          maxLength: 512
          type: string
        id:
          allOf:
            - $ref: "#/components/schemas/ResourceId"
          description: The product ID.
          example: membership
          readOnly: true
        name:
          description: The product name.
          example: Premium membership
          maxLength: 255
          type: string
        options:
          description: >
            The product options such as color, size, etc. The product options
            definition does

            not include option values. Those are defined within the plans.
          items:
            type: string
          type: array
        requiresShipping:
          description: If the product requires shipping, shipping calculations will be
            applied.
          example: false
          type: boolean
        unitLabel:
          default: unit
          description: The unit label, such as per `seat` or per `unit`.
          example: seat
          maxLength: 50
          type: string
        updatedTime:
          allOf:
            - $ref: "#/components/schemas/ServerTimestamp"
          description: The product updated time.
      required:
        - name
      type: object
    CommonScheduleInstruction:
      description: The calculation instruction of scheduled time.
      discriminator:
        mapping:
          auto: "#/components/schemas/auto"
          date-interval: "#/components/schemas/date-interval"
          day-of-month: "#/components/schemas/day-of-month"
          day-of-week: "#/components/schemas/day-of-week"
          immediately: "#/components/schemas/immediately"
          intelligent: "#/components/schemas/intelligent"
        propertyName: method
      properties:
        method:
          enum:
            - auto
            - intelligent
            - immediately
            - date-interval
            - day-of-month
            - day-of-week
          type: string
      required:
        - method
      type: object
    CommonSubscription:
      properties:
        activationTime:
          allOf:
            - $ref: "#/components/schemas/ServerTimestamp"
          description: Order activation time.
          x-sortable: true
        billingAddress:
          allOf:
            - $ref: "#/components/schemas/ContactObject"
          description: Order billing address.
          nullable: true
        billingStatus:
          description: |
            The billing status of the most recent invoice.  It may
            help you determine if you should change the service status
            such as suspending the service.
          enum:
            - unpaid
            - past-due
            - delinquent
            - paid
            - voided
            - refunded
            - disputed
            - voided
          readOnly: true
          type: string
        couponIds:
          description: >
            A list of coupons to redeem on the customer and restrict to this
            subscription.

            Read more about [coupons here](https://docs.rebilly.com/docs/dashboard/marketing/coupons-and-discounts/).


            This parameter respects the following logic:


            - When not passed then applied coupons will not be changed.


            - When empty array passed then all applied coupon redemptions will be canceled.


            - When list of coupons is passed then not applied yet coupons will be applied, already applied coupons

            will not change their state, applied coupons that are not presented in passed list will be canceled.


            If list of applied coupons on pending order will be changed due to this param during update order,
             Invoice for the order will be reissued.
          items:
            description: Coupon ID.
            type: string
          nullable: true
          type: array
          writeOnly: true
        deliveryAddress:
          allOf:
            - $ref: "#/components/schemas/ContactObject"
          description: Order delivery address.
          nullable: true
        id:
          allOf:
            - $ref: "#/components/schemas/ResourceId"
          description: The order identifier string.
          readOnly: true
        initialInvoiceId:
          allOf:
            - $ref: "#/components/schemas/ResourceId"
          description: The initial invoice identifier string.
          readOnly: true
        items:
          items:
            properties:
              isGrandfathered:
                description: Indicates if the plan's current revision is greater than this
                  item's plan revision.
                readOnly: true
                type: boolean
              isModified:
                description: Indicates if the plan information was modified for this
                  subscription.
                readOnly: true
                type: boolean
              plan:
                $ref: "#/components/schemas/FlexiblePlan"
              planId:
                allOf:
                  - $ref: "#/components/schemas/ResourceId"
                deprecated: true
                description: The plan identifier string.
                x-basic: true
              quantity:
                description: Number of units of the product on the given plan.
                type: integer
              revision:
                description: Increments with each override change to this specific item.
                readOnly: true
                type: integer
            required:
              - plan
            type: object
          minItems: 1
          type: array
        orderType:
          default: subscription-order
          description: |
            Specifies the type of order, a subscription or a one-time purchase.
          enum:
            - subscription-order
            - one-time-order
          type: string
        poNumber:
          description: Purchase order number, will be displayed on the issued invoices.
          example: PO123456
          nullable: true
          type: string
        recentInvoiceId:
          allOf:
            - $ref: "#/components/schemas/ResourceId"
          description: Most recently issued invoice identifier string. It might not be
            `paid` yet.
          readOnly: true
        voidTime:
          allOf:
            - $ref: "#/components/schemas/ServerTimestamp"
          description: Order void time.
        websiteId:
          allOf:
            - $ref: "#/components/schemas/ResourceId"
          description: The website identifier string.
          x-basic: true
          x-sortable: true
      type: object
    CommonSubscriptionOrder:
      allOf:
        - $ref: "#/components/schemas/CommonSubscription"
        - properties:
            autopay:
              default: true
              description: Autopay determines if a payment attempt will be automatic.
              type: boolean
            endTime:
              allOf:
                - $ref: "#/components/schemas/ServerTimestamp"
              description: Subscription end time.
              x-sortable: true
            inTrial:
              description: True if the subscription is currently in a trial period.
              readOnly: true
              type: boolean
            invoiceTimeShift:
              allOf:
                - $ref: "#/components/schemas/InvoiceTimeShift"
              description: >
                You can shift issue time and due time of invoices for this
                subscription.

                This setting overrides plan settings. To use plan settings, set `null`.

                To use multiple plans in one subscription they all must have the same billing period,

                this property allows to subscribe to different plans.
              example:
                $ref: "#/components/schemas/ReadyToPayMethods/example/2/feature"
              nullable: true
            isTrialOnly:
              default: false
              description: Whether a subscription ends after a trial period. Recurring
                settings are ignored if it's `true`.
              type: boolean
            lineItemSubtotal:
              description: Subtotal of line items in this subscription (signed value). If
                credits exceed debits, it will be a negative number.
              properties:
                amount:
                  example: 49.95
                  format: double
                  type: number
                  x-sortable: true
                  x-type: Money
                currency:
                  $ref: "#/components/schemas/CurrencyCode"
                  x-label: Currency
                  x-sortable: true
              readOnly: true
              type: object
            lineItems:
              allOf:
                - $ref: "#/components/schemas/UpcomingInvoiceItemCollection"
              description: Subscription line items which queue until the next renewal (or
                interim) invoice is issued for the subscription.
              readOnly: true
            rebillNumber:
              description: The current period number.
              readOnly: true
              type: integer
            recurringInterval:
              description: >
                The recurring interval to override plan settings. To use plan
                settings, set `null`.

                To use multiple plans in one subscription they all must have the same recurring period length,

                this property allows to subscribe to different plans.
              example:
                $ref: "#/components/schemas/ReadyToPayMethods/example/2/feature"
              nullable: true
              properties:
                periodAnchorInstruction:
                  $ref: "#/components/schemas/ServicePeriodAnchorInstruction"
              type: object
            renewalTime:
              description: Subscription renewal time.
              format: date-time
              type: string
              x-basic: true
              x-sortable: true
            startTime:
              description: Subscription start time.  When the value is sent as null, it will
                use the current time. This value can't be in past more than one
                service period.
              example:
                $ref: "#/components/schemas/ReadyToPayMethods/example/2/feature"
              format: date-time
              nullable: true
              type: string
              x-basic: true
              x-sortable: true
            status:
              description: |
                The status of the subscription service. A subscription starts
                in the `pending` status, and will become `active` when the
                service period begins.
              enum:
                - pending
                - active
                - canceled
                - churned
                - suspended
                - paused
                - abandoned
                - trial-ended
              readOnly: true
              type: string
            trial:
              description: To use plan defaults do not send the `trial` key, or send a `null`.
                value with it.
              properties:
                enabled:
                  description: Enable or disable the trial for this subscription. If enabled for
                    plans without trial prices, the trial will be free.
                  type: boolean
                endTime:
                  description: The time the trial should end.
                  format: date-time
                  type: string
              required:
                - endTime
              type: object
      type: object
    CommonTransaction:
      properties:
        3ds:
          allOf:
            - $ref: "#/components/schemas/ThreeDSecureResult"
        amount:
          description: The transaction's amount.
          format: double
          readOnly: true
          type: number
          x-basic: true
          x-sortable: true
          x-type: Money
        billingAddress:
          allOf:
            - $ref: "#/components/schemas/ContactObject"
          description: Billing address.
        billingDescriptor:
          description: >
            The billing descriptor that appears on the periodic billing
            statement. Commonly

            12 or fewer characters for a credit card statement.
          readOnly: true
          type: string
        childTransactions:
          description: The child transaction IDs.
          items:
            $ref: "#/components/schemas/ResourceId"
          readOnly: true
          type: array
        createdTime:
          allOf:
            - $ref: "#/components/schemas/ServerTimestamp"
          description: Transaction created time.
          x-label: Created On
          x-sortable: true
        currency:
          allOf:
            - $ref: "#/components/schemas/CurrencyCode"
          readOnly: true
        customFields:
          $ref: "#/components/schemas/ResourceCustomFields"
        customerId:
          allOf:
            - $ref: "#/components/schemas/ResourceId"
          description: The сustomer's ID.
          x-basic: true
        description:
          description: The payment description.
          maxLength: 255
          type: string
        gatewayName:
          allOf:
            - $ref: "#/components/schemas/GatewayName"
          description: >
            Payment Gateway name, available only after the gateway is selected
            for the transaction.
          readOnly: true
          x-basic: true
          x-label: Gateway account
        has3ds:
          readOnly: true
          type: boolean
        hasAmountAdjustment:
          description: True if transaction has amount adjustment.
          readOnly: true
          type: boolean
        id:
          allOf:
            - $ref: "#/components/schemas/ResourceId"
          description: The transaction ID.
          readOnly: true
        invoiceIds:
          description: The invoice IDs related to transaction.
          items:
            $ref: "#/components/schemas/ResourceId"
          readOnly: true
          type: array
        isRebill:
          readOnly: true
          type: boolean
        isRetry:
          description: True if this transaction is retry.
          readOnly: true
          type: boolean
        parentTransactionId:
          allOf:
            - $ref: "#/components/schemas/ResourceId"
          description: The parent's transaction ID.
          readOnly: true
        paymentInstrument:
          $ref: "#/components/schemas/InstrumentReference"
        planIds:
          description: The plan IDs related to transaction's order(s).
          items:
            $ref: "#/components/schemas/ResourceId"
          readOnly: true
          type: array
        processedTime:
          allOf:
            - $ref: "#/components/schemas/ServerTimestamp"
          description: Transaction processed time.
          x-basic: true
          x-sortable: true
        purchaseAmount:
          description: The amount actually purchased which may have differed from the
            originally requested amount in case of an adjustment.
          format: double
          readOnly: true
          type: number
          x-currency-field: purchaseCurrency
          x-sortable: true
          x-type: Money
        purchaseCurrency:
          allOf:
            - $ref: "#/components/schemas/CurrencyCode"
          readOnly: true
        rebillNumber:
          description: The transaction's rebill number.
          readOnly: true
          type: integer
        redirectUrl:
          description: The URL to redirect the end-user when an offsite transaction is
            completed. Defaults to the website's configured URL.
          format: uri
          type: string
        requestAmount:
          description: The amount in the payment request. If adjusted, the purchase amount
            and billing amount may vary from it.
          format: double
          readOnly: true
          type: number
          x-currency-field: requestCurrency
          x-type: Money
        requestCurrency:
          allOf:
            - $ref: "#/components/schemas/CurrencyCode"
          readOnly: true
        requestId:
          description: The transaction's request ID.  This ID must be unique within a 24
            hour period. Use this field to prevent duplicated transactions.
          type: string
          x-sortable: true
        result:
          description: Transaction result.
          enum:
            - abandoned
            - approved
            - canceled
            - declined
            - unknown
          readOnly: true
          type: string
          x-basic: true
        retryNumber:
          description: The position in the sequence of retries.
          readOnly: true
          type: integer
        status:
          description: Transaction status.
          enum:
            - completed
            - conn-error
            - disputed
            - never-sent
            - offsite
            - partially-refunded
            - pending
            - refunded
            - sending
            - suspended
            - timeout
            - voided
            - waiting-approval
            - waiting-capture
            - waiting-gateway
            - waiting-refund
          readOnly: true
          type: string
        subscriptionIds:
          description: The orders IDs related to transaction's invoice(s).
          items:
            $ref: "#/components/schemas/ResourceId"
          readOnly: true
          type: array
        type:
          description: Transaction type.
          enum:
            - 3ds-authentication
            - authorize
            - capture
            - credit
            - refund
            - sale
            - void
          readOnly: true
          type: string
          x-basic: true
        updatedTime:
          allOf:
            - $ref: "#/components/schemas/ServerTimestamp"
          description: Transaction updated time.
          x-label: Last update time
          x-sortable: true
        websiteId:
          allOf:
            - $ref: "#/components/schemas/ResourceId"
          description: The website ID.
          readOnly: true
      type: object
    CommonTransactionRequest:
      properties:
        amount:
          description: The transaction amount.
          example: 97.97
          format: double
          type: number
        billingAddress:
          allOf:
            - $ref: "#/components/schemas/ContactObject"
          description: Billing address. If not supplied, we use the billing address
            associated with the payment instrument, and then customer.
          nullable: true
        currency:
          allOf:
            - $ref: "#/components/schemas/CurrencyCode"
        customFields:
          $ref: "#/components/schemas/ResourceCustomFields"
        customerId:
          allOf:
            - $ref: "#/components/schemas/ResourceId"
          description: The customer identifier string.
        description:
          description: The payment description.
          maxLength: 255
          nullable: true
          type: string
        gatewayAccountId:
          allOf:
            - $ref: "#/components/schemas/ResourceId"
          description: Rebilly will select the appropriate payment gateway account for the
            transaction based on the properties of the transaction and the
            `gateway-account-requested` event rules configurations. If you wish
            to prevent Rebilly from making the gateway account selection, you
            may supply a gateway account id here, and it will be used instead.
            Only use this field if you intend to override the settings.
          nullable: true
        invoiceIds:
          description: The array of invoice identifiers.
          items:
            $ref: "#/components/schemas/ResourceId"
          nullable: true
          type: array
        isMerchantInitiated:
          default: false
          description: True if the transaction was initiated by the merchant.
          type: boolean
        isProcessedOutside:
          default: false
          description: True if transaction was processed outside Rebilly.
          type: boolean
        notificationUrl:
          description: >
            The URL where a server-to-server notification request type `POST`
            with a transaction payload will be sent when the transaction's
            result is finalized. Do not trust the notification; follow with a
            `GET` request to confirm the result of the transaction. Please
            respond with a `2xx` HTTP status code, or we will reattempt the
            request again. You may use `{id}` or `{result}` as placeholders in
            the URL and we will replace them with the transaction's id and
            result accordingly.
          format: uri
          nullable: true
          type: string
        paymentInstruction:
          allOf:
            - $ref: "#/components/schemas/PaymentInstruction"
          description: Payment instruction. If not supplied, customer's default payment
            instrument will be used.
        paymentInstrument:
          allOf:
            - $ref: "#/components/schemas/PaymentInstrument"
          deprecated: true
        processedTime:
          description: The time the transaction was processed. Can be specified only if
            transaction was processed outside Rebilly.
          format: date-time
          type: string
        redirectUrl:
          description: The URL to redirect the end-user when an offsite transaction is
            completed. Defaults to the website's configured URL. You may use
            `{id}` or `{result}` as placeholders in the URL and we will replace
            them with the transaction's id and result accordingly.
          format: uri
          nullable: true
          type: string
        requestId:
          description: The request id is **recommended**. It prevents duplicate
            transaction requests within a short period of time. If a duplicate
            request is sent with the same `requestId` it will be ignored to
            prevent double-billing anyone.  It must be unique within a 24-hour
            period.  We recommend generating a UUID v4 as its value.
          example: 44433322-2c4y-483z-a0a9-158621f77a21
          maxLength: 50
          nullable: true
          pattern: ^[\-\w]+$
          type: string
        riskMetadata:
          $ref: "#/components/schemas/RiskMetadata"
        websiteId:
          allOf:
            - $ref: "#/components/schemas/ResourceId"
          description: The website identifier string.
      required:
        - websiteId
        - customerId
        - currency
        - amount
      type: object
    CompositeToken:
      oneOf:
        - $ref: "#/components/schemas/PaymentCardToken"
        - $ref: "#/components/schemas/BankAccountToken"
        - $ref: "#/components/schemas/DigitalWalletToken"
        - $ref: "#/components/schemas/PlaidAccountToken"
        - $ref: "#/components/schemas/KhelocardCardToken"
        - $ref: "#/components/schemas/AlternativePaymentToken"
    Conekta:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              description: Conekta credentials object.
              properties:
                apiKey:
                  description: Conekta private API key.
                  format: password
                  type: string
              required:
                - apiKey
              type: object
          required:
            - credentials
          type: object
      description: Conekta config.
    ContactEmails:
      description: The list of emails.
      items:
        properties:
          label:
            description: The email label.
            example: main
            maxLength: 45
            type: string
          primary:
            description: True if email is primary.
            example: true
            type: boolean
          value:
            description: The email value.
            example: rebilly@example.com
            format: email
            maxLength: 255
            type: string
        required:
          - label
          - value
        type: object
      type: array
    ContactObject:
      properties:
        address:
          description: The contact street address.
          example: 36 Craven St
          maxLength: 60
          nullable: true
          pattern: ^[\w\s\-\/\pL,.#;:()']+$
          type: string
        address2:
          description: The contact street address (second line).
          maxLength: 60
          nullable: true
          pattern: ^[\w\s\-\/\pL,.#;:()']+$
          type: string
        city:
          description: The contact city.
          example: London
          maxLength: 45
          nullable: true
          pattern: ^[\w\s\-\pL,.']+$
          type: string
        country:
          description: The contact country ISO Alpha-2 code.
          example: GB
          maxLength: 2
          nullable: true
          pattern: ^[A-Z]{2}$
          type: string
        emails:
          $ref: "#/components/schemas/ContactEmails"
        firstName:
          description: The contact first name.
          example: Benjamin
          maxLength: 45
          nullable: true
          pattern: ^[\w\s\-\pL,.']+$
          type: string
        hash:
          description: A hash that can be used to compare multiple contacts for identical
            attribute values.
          example: 056ae6d97c788b9e98b049ebafd7b229bf852221
          maxLength: 40
          readOnly: true
          type: string
        lastName:
          description: The contact last name.
          example: Franklin
          maxLength: 45
          nullable: true
          pattern: ^[\w\s\-\pL,.']+$
          type: string
        organization:
          description: The contact organization.
          example:
            $ref: "#/components/schemas/ReadyToPayMethods/example/2/feature"
          maxLength: 255
          nullable: true
          pattern: ^[\w\s\-\pL,.']+$
          type: string
        phoneNumbers:
          $ref: "#/components/schemas/ContactPhoneNumbers"
        postalCode:
          description: The contact postal code.
          example: WC2N 5NF
          maxLength: 10
          nullable: true
          pattern: ^[\w\s\-]+$
          type: string
        region:
          description: The contact region (state).
          example: London
          maxLength: 45
          nullable: true
          pattern: ^[\w\s\-\/\pL,.#;:()']+$
          type: string
      type: object
    ContactPhoneNumbers:
      description: The list of phone numbers.
      items:
        properties:
          label:
            description: The phone label.
            example: main
            maxLength: 45
            type: string
          primary:
            description: True if phone is primary.
            example: true
            type: boolean
          value:
            description: The phone value.
            example: 512-710-1640
            maxLength: 50
            type: string
        required:
          - label
          - value
        type: object
      type: array
    Coppr:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              description: Coppr credentials object.
              properties:
                apiKey:
                  description: Coppr api key.
                  format: password
                  type: string
                organizationId:
                  description: Coppr Organization's ID.
                  type: string
              required:
                - organizationId
                - apiKey
              type: object
            settings:
              description: Coppr settings object.
              properties:
                rebillyPublishableKey:
                  description: Rebilly publishable api key. If provided a payment token will be
                    created for each transaction.
                  type: string
              type: object
          required:
            - credentials
          type: object
      description: Coppr config.
    CoreReadyToPay:
      allOf:
        - properties:
            customerId:
              allOf:
                - $ref: "#/components/schemas/ResourceId"
              description: The customer identifier string.
          type: object
        - $ref: "#/components/schemas/ReadyToPay"
    Coupon:
      description: Coupons and Discounts.
      properties:
        _links:
          description: The links related to resource.
          items:
            $ref: "#/components/schemas/SelfLink"
          minItems: 1
          readOnly: true
          type: array
        createdTime:
          allOf:
            - $ref: "#/components/schemas/ServerTimestamp"
          description: Coupon created time.
          x-label: Creation time
          x-sortable: true
        description:
          description: >
            Your coupon description. When it is not empty this is used for
            invoice discount item description, otherwise the item's description
            uses coupon's ID like 'Coupon "COUPON-ID"'.
          type: string
          x-basic: true
        discount:
          $ref: "#/components/schemas/Discount"
        expiredTime:
          description: Coupon's expire time (end time).
          format: date-time
          type: string
          x-basic: true
          x-label: Valid until
          x-sortable: true
        id:
          allOf:
            - $ref: "#/components/schemas/ResourceId"
          description: Coupon's ID a.k.a redemption code.
          readOnly: true
        issuedTime:
          description: Coupon's issued time (start time).
          format: date-time
          type: string
          x-basic: true
          x-label: Valid from
          x-sortable: true
        redemptionsCount:
          description: Coupon's redemptions count.
          minimum: 0
          readOnly: true
          type: integer
        restrictions:
          description: Coupon restrictions.
          items:
            $ref: "#/components/schemas/CouponRestriction"
          type: array
        status:
          description: If coupon enabled.
          enum:
            - draft
            - issued
            - expired
          readOnly: true
          type: string
        updatedTime:
          allOf:
            - $ref: "#/components/schemas/ServerTimestamp"
          description: Coupon updated time.
          x-label: Last update time
          x-sortable: true
      required:
        - discount
        - issuedTime
      type: object
    CouponExpiration:
      properties:
        expiredTime:
          description: The coupon's expiry time, must be greater than the issued time.
            Null or empty string will immediately expire the coupon.
          format: date-time
          type: string
      required:
        - expiredTime
      type: object
    CouponRedemption:
      description: Coupons redemption log.
      properties:
        _links:
          description: The links related to resource.
          items:
            $ref: "#/components/schemas/SelfLink"
          minItems: 1
          readOnly: true
          type: array
        additionalRestrictions:
          description: Additional restrictions for coupon's redemptions.
          items:
            $ref: "#/components/schemas/RedemptionRestriction"
          type: array
        canceledTime:
          allOf:
            - $ref: "#/components/schemas/ServerTimestamp"
          description: Coupon redemption canceled time.
          readOnly: true
          x-sortable: true
        couponId:
          allOf:
            - $ref: "#/components/schemas/ResourceId"
          description: Coupon's ID.
        createdTime:
          allOf:
            - $ref: "#/components/schemas/ServerTimestamp"
          description: Coupon redeem time.
          readOnly: true
        customerId:
          allOf:
            - $ref: "#/components/schemas/ResourceId"
          description: Customer's ID.
        id:
          allOf:
            - $ref: "#/components/schemas/ResourceId"
          readOnly: true
      type: object
    CouponRestriction:
      description: Coupon restrictions.
      discriminator:
        mapping:
          discounts-per-redemption: "#/components/schemas/discounts-per-redemption"
          minimum-order-amount: "#/components/schemas/minimum-order-amount"
          paid-by-time: "#/components/schemas/paid-by-time"
          redemptions-per-customer: "#/components/schemas/redemptions-per-customer"
          restrict-to-invoices: "#/components/schemas/restrict-to-invoices"
          restrict-to-plans: "#/components/schemas/restrict-to-plans"
          restrict-to-products: "#/components/schemas/restrict-to-products"
          restrict-to-subscriptions: "#/components/schemas/restrict-to-subscriptions"
          total-redemptions: "#/components/schemas/total-redemptions"
        propertyName: type
      properties:
        type:
          description: Coupon's restriction type.
          enum:
            - discounts-per-redemption
            - minimum-order-amount
            - redemptions-per-customer
            - restrict-to-invoices
            - restrict-to-plans
            - restrict-to-subscriptions
            - restrict-to-products
            - total-redemptions
            - paid-by-time
          type: string
      required:
        - type
      type: object
    Credential:
      properties:
        _links:
          description: The links related to resource.
          items:
            anyOf:
              - $ref: "#/components/schemas/SelfLink"
              - $ref: "#/components/schemas/CustomerLink"
          minItems: 1
          readOnly: true
          type: array
        customerId:
          description: The credential's customer ID.
          type: string
        expiredTime:
          description: The credential's expired time.
          format: date-time
          type: string
        id:
          allOf:
            - $ref: "#/components/schemas/ResourceId"
          description: The credential identifier string.
          readOnly: true
        password:
          description: The credential's password.
          format: password
          type: string
          writeOnly: true
        username:
          description: Credential's username.
          type: string
      required:
        - username
        - password
        - customerId
      type: object
    Credorax:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              properties:
                merchantId:
                  description: Credorax Gateway merchant ID.
                  type: string
                merchantMd5Signature:
                  description: Credorax Gateway md5 signature.
                  format: password
                  type: string
              required:
                - merchantId
                - merchantMd5Signature
              type: object
          required:
            - credentials
          type: object
      description: Credorax Gateway config.
    Cryptonator:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              description: Cryptonator credentials object.
              properties:
                merchant_id:
                  description: Cryptonator merchant ID.
                  type: string
                secret:
                  description: Cryptonator secret.
                  format: password
                  type: string
              required:
                - merchant_id
                - secret
              type: object
          required:
            - credentials
          type: object
      description: Cryptonator config.
    CurrencyCode:
      description: ISO 4217 alphabetic currency code.
      example: USD
      maxLength: 3
      minLength: 3
      type: string
    CustomEventScheduleInstruction:
      description: The calculation instruction of scheduled time.
      discriminator:
        mapping:
          date-interval: "#/components/schemas/date-interval"
          day-of-month: "#/components/schemas/day-of-month"
          day-of-week: "#/components/schemas/day-of-week"
        propertyName: method
      properties:
        method:
          enum:
            - date-interval
            - day-of-month
            - day-of-week
          type: string
      required:
        - method
      type: object
    CustomField:
      description: A separate Custom Field schema.
      properties:
        _links:
          description: The links related to resource.
          items:
            $ref: "#/components/schemas/SelfLink"
          minItems: 1
          readOnly: true
          type: array
        additionalSchema:
          description: >
            Additional parameters which can be added according to type:

            Parameter Name | Types         | Description

            -------------- | ------------- | -------------

            allowedValues  | string, array | List of allowed values maxLength      | string        | Maximum allowed length for the string, 255 by default, up to 4000

            The additional schema adds additional constrains for values.
        description:
          description: The custom field description.
          type: string
        name:
          description: The name of the custom field.
          readOnly: true
          type: string
        type:
          description: >
            Type value    | Description

            ------------- | -------------

            array         | An array of strings up to 255 characters, maximum size is 1000 elements boolean       | true or false date          | String of format "full-date" (YYYY-MM-DD) from RFC-3339 (full-date) datetime      | String of format "date-time" (YYYY-MM-DDTHH:MM:SSZ) from RFC-3339 (date-time) integer       | Cardinal value of -2^31..2^31-1 number        | Float value. It can take cardinal values also which are interpreted as float string        | Regular string up to 255 characters monetary      | A map of 3-letters currency code and amount, e.g. {"currency": "EUR", "amount": 25.30}

            The type cannot be changed.
          enum:
            - array
            - boolean
            - datetime
            - integer
            - number
            - string
            - monetary
          type: string
      required:
        - type
      type: object
    Customer:
      properties:
        _embedded:
          description: Any embedded objects available that are requested by the `expand`
            querystring parameter.
          items:
            anyOf:
              - $ref: "#/components/schemas/LeadSourceEmbed"
          minItems: 1
          readOnly: true
          type: array
        _links:
          description: The links related to resource.
          items:
            anyOf:
              - $ref: "#/components/schemas/SelfLink"
              - $ref: "#/components/schemas/DefaultPaymentInstrumentLink"
              - $ref: "#/components/schemas/LeadSourceLink"
              - $ref: "#/components/schemas/WebsiteLink"
          minItems: 3
          readOnly: true
          type: array
        averageValue:
          $ref: "#/components/schemas/CustomerAverageValue"
        createdTime:
          allOf:
            - $ref: "#/components/schemas/ServerTimestamp"
          description: The customer created time.
          x-label: Creation Time
          x-sortable: true
        customFields:
          $ref: "#/components/schemas/ResourceCustomFields"
        defaultPaymentInstrument:
          $ref: "#/components/schemas/PaymentInstrument"
        email:
          description: The customer's email.
          format: email
          readOnly: true
          type: string
          x-basic: true
          x-sortable: true
        firstName:
          description: The customer's first name.
          readOnly: true
          type: string
          x-basic: true
        id:
          allOf:
            - $ref: "#/components/schemas/ResourceId"
          description: The customer identifier string.
          readOnly: true
        invoiceCount:
          description: An auto-incrementing number based on the sequence of invoices. If
            set to 0, then this record is a Lead, otherwise is a Customer.
          readOnly: true
          type: integer
          x-sortable: true
        lastName:
          description: The customer's last name.
          readOnly: true
          type: string
          x-basic: true
          x-sortable: true
        lastPaymentTime:
          allOf:
            - $ref: "#/components/schemas/ServerTimestamp"
          description: The most recent time of an approved payment for the customer.
          x-basic: true
          x-label: Last Payment
          x-sortable: true
        lifetimeRevenue:
          $ref: "#/components/schemas/CustomerLifetimeRevenue"
        paymentCount:
          description: The number of approved payments for the customer.
          readOnly: true
          type: integer
          x-basic: true
          x-label: Payments
          x-sortable: true
        paymentToken:
          description: |
            A write-only payment token; if supplied, it will be converted into a
            payment instrument and be set as the `defaultPaymentInstrument`. The
            value of this property will override the `defaultPaymentInstrument`
            in the case that both are supplied. The token may only be used once
            before it is expired.
          type: string
          writeOnly: true
        primaryAddress:
          $ref: "#/components/schemas/ContactObject"
        revision:
          description: >
            The number of times the customer data has been modified.

            The revision is useful when analyzing webhook data to determine if the change takes precedence over the current representation.
          readOnly: true
          type: integer
        tags:
          description: A list of customer's tags.
          items:
            $ref: "#/components/schemas/Tag"
          readOnly: true
          type: array
        updatedTime:
          allOf:
            - $ref: "#/components/schemas/ServerTimestamp"
          description: The customer updated time.
          x-label: Last Update Time
          x-sortable: true
        websiteId:
          allOf:
            - $ref: "#/components/schemas/ResourceId"
          description: The website's ID.
          x-sortable: true
      type: object
    CustomerAverageValue:
      properties:
        amount:
          description: Average approved payment amount in Merchant's reporting currency.
          format: double
          type: number
          x-basic: true
          x-label: Average Value
          x-sortable: true
          x-type: Money
        amountUsd:
          description: Average approved payment amount in USD.
          format: double
          type: number
        currency:
          allOf:
            - $ref: "#/components/schemas/CurrencyCode"
          description: Merchant's reporting currency.
      readOnly: true
      type: object
    CustomerEmbed:
      description: Customer object.
      properties:
        customer:
          $ref: "#/components/schemas/Customer"
      readOnly: true
      type: object
    CustomerJWT:
      properties:
        _links:
          description: The links related to resource.
          items:
            $ref: "#/components/schemas/CustomerLink"
          minItems: 1
          readOnly: true
          type: array
        acl:
          $ref: "#/components/schemas/Acl"
        createdTime:
          description: Session created time.
          format: date-time
          readOnly: true
          type: string
        customClaims:
          additionalProperties: true
          example:
            documents:
              - identity-proof
              - address-proof
            redirectUrl: https://mywebsite.com
          type: object
        customerId:
          allOf:
            - $ref: "#/components/schemas/ResourceId"
          description: The customer's ID.
          readOnly: true
        expiredTime:
          description: Session expired time. Defaults to one hour.
          format: date-time
          type: string
        id:
          allOf:
            - $ref: "#/components/schemas/ResourceId"
          description: The session identifier string.
          readOnly: true
        invalidate:
          default: true
          description: Whether to invalidate token after exchange or not.
          example: true
          type: boolean
          writeOnly: true
        oneTimePassword:
          description: The one time password sent via an email. Should contain digits only.
          example: "123456"
          pattern: ^[0-9]{6}$
          type: string
          writeOnly: true
        token:
          description: The session's token used for authentication.
          readOnly: true
          type: string
        type:
          description: Session type.
          enum:
            - customer
          readOnly: true
          type: string
        updatedTime:
          allOf:
            - $ref: "#/components/schemas/ServerTimestamp"
          description: Session updated time.
      type: object
    CustomerLifetimeRevenue:
      properties:
        amount:
          description: Revenue amount in Merchant's reporting currency.
          format: double
          type: number
          x-basic: true
          x-label: Lifetime Revenue
          x-sortable: true
          x-type: Money
        amountUsd:
          description: Revenue amount in USD.
          format: double
          type: number
        currency:
          allOf:
            - $ref: "#/components/schemas/CurrencyCode"
          description: Merchant's reporting currency.
      readOnly: true
      type: object
    CustomerLink:
      allOf:
        - $ref: "#/components/schemas/Link"
      properties:
        rel:
          description: The link type.
          enum:
            - customer
            - targetCustomer
          type: string
      required:
        - rel
      type: object
    CustomerTimeline:
      properties:
        _links:
          description: The links related to resource.
          items:
            $ref: "#/components/schemas/SelfLink"
          minItems: 1
          readOnly: true
          type: array
        customData:
          description: Timeline custom event data. Used with `custom-event` type. Will be
            transformed to `extraData` two-column table in response.
          example:
            customAttribute: customValue
            otherAttribute: otherValue
          type: object
          writeOnly: true
        customEventType:
          description: Timeline custom event type. Used with `custom-event` type. Must be
            defined using [Customer Timeline custom event
            API](#operation/PostCustomerTimelineCustomEventType).
          maxLength: 255
          minLength: 1
          nullable: true
          type: string
        extraData:
          $ref: "#/components/schemas/TimelineExtraData"
        id:
          allOf:
            - $ref: "#/components/schemas/ResourceId"
          description: The Timeline message identifier string.
          readOnly: true
        message:
          description: The message that describes the message details.
          type: string
        occurredTime:
          allOf:
            - $ref: "#/components/schemas/ServerTimestamp"
          description: Timeline message time.
        triggeredBy:
          description: Shows who or what triggered the Timeline message.
          enum:
            - rebilly
            - app
            - direct-api
          readOnly: true
          type: string
        type:
          description: Timeline message type.
          enum:
            - customer-comment-created
            - customer-created
            - primary-address-changed
            - default-payment-instrument-changed
            - lead-source-changed
            - custom-fields-changed
            - coupon-applied
            - coupon-redeemed
            - coupon-redemption-canceled
            - kyc-document-created
            - kyc-document-accepted
            - kyc-document-manually-accepted
            - kyc-document-rejected
            - kyc-document-manually-rejected
            - kyc-document-modified
            - payment-card-expired
            - payment-instrument-created
            - payment-instrument-deactivated
            - customer-bank-account-blocked
            - customer-blocked
            - customer-payment-card-blocked
            - invoice-created
            - invoice-issued
            - invoice-abandoned
            - invoice-voided
            - invoice-past-due
            - invoice-paid
            - invoice-partially-paid
            - invoice-disputed
            - invoice-refunded
            - invoice-partially-refunded
            - order-created
            - order-renewed
            - order-activated
            - order-completed
            - order-reactivated
            - order-canceled
            - order-upgraded
            - order-downgraded
            - order-churned
            - order-paid-early
            - transaction-approved
            - transaction-canceled
            - transaction-declined
            - transaction-abandoned
            - transaction-refunded
            - transaction-voided
            - transaction-discrepancy-found
            - transaction-amount-discrepancy-found
            - email-message-sent
            - custom-event-processed
            - custom-event
            - transaction-waiting-gateway
            - aml-list-was-possibly-matched
            - experian-check-performed
          type: string
      type: object
    CustomerTimelineCustomEvent:
      properties:
        _links:
          description: The links related to resource.
          items:
            $ref: "#/components/schemas/SelfLink"
          minItems: 1
          readOnly: true
          type: array
        createdTime:
          allOf:
            - $ref: "#/components/schemas/ServerTimestamp"
          description: Customer Timeline Custom event created time.
        id:
          allOf:
            - $ref: "#/components/schemas/ResourceId"
          description: Customer Timeline Custom Event identifier string.
          readOnly: true
        name:
          description: Customer Timeline Custom Event type name. It must not be similar to
            any Rebilly system event.
          maxLength: 255
          minLength: 1
          type: string
        updatedTime:
          allOf:
            - $ref: "#/components/schemas/ServerTimestamp"
          description: Customer Timeline Custom event updated time.
      required:
        - name
      type: object
    CyberSource:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              description: CyberSource credentials object.
              properties:
                accessKey:
                  description: CyberSource access key.
                  type: string
                profileId:
                  description: CyberSource profile ID.
                  type: string
                secretKey:
                  description: CyberSource secret key.
                  format: password
                  type: string
              required:
                - accessKey
                - profileId
                - secretKey
              type: object
          required:
            - credentials
          type: object
      description: CyberSource config.
    DataCash:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              properties:
                client:
                  description: DataCash Gateway client.
                  type: string
                masterCardPayoutsClient:
                  description: DataCash Gateway client for MasterCard payouts (OCT).
                  type: string
                masterCardPayoutsPassword:
                  description: DataCash Gateway password for MasterCard payouts (OCT).
                  format: password
                  type: string
                password:
                  description: DataCash Gateway password.
                  format: password
                  type: string
                reportGroup:
                  description: DataCash report group.
                  type: string
                reportPassword:
                  description: DataCash report password.
                  format: password
                  type: string
                reportUser:
                  description: DataCash report user.
                  type: string
                visaPayoutsClient:
                  description: DataCash Gateway client for Visa payouts (OCT).
                  type: string
                visaPayoutsPassword:
                  description: DataCash Gateway password for Visa payouts (OCT).
                  format: password
                  type: string
              required:
                - client
                - password
              type: object
            settings:
              description: Datacash settings object.
              properties:
                delay:
                  default: 0
                  description: Auto Capture delay (in hours).
                  minimum: 0
                  type: integer
                policy:
                  default: 2
                  description: Policy.
                  maximum: 7
                  minimum: 0
                  type: integer
              type: object
            threeDSecureServer:
              $ref: "#/components/schemas/DataCash3dsServers"
          required:
            - credentials
          type: object
      description: DataCash Gateway config.
    DataCash3dsServer:
      allOf:
        - $ref: "#/components/schemas/DataCash3dsServers"
      description: DataCash Integrated.
    DataCash3dsServers:
      description: DataCash 3DS Servers.
      discriminator:
        mapping:
          DataCash3dsServer: "#/components/schemas/DataCash3dsServer"
        propertyName: name
      properties:
        name:
          allOf:
            - $ref: "#/components/schemas/ThreeDSecureServerName"
          enum:
            - DataCash3dsServer
      required:
        - name
      type: object
    DayOfWeekLong:
      enum:
        - Sunday
        - Monday
        - Tuesday
        - Wednesday
        - Thursday
        - Friday
        - Saturday
      type: string
    DefaultPaymentInstrumentLink:
      allOf:
        - $ref: "#/components/schemas/Link"
      properties:
        rel:
          description: The link type.
          enum:
            - defaultPaymentInstrument
          type: string
      required:
        - rel
      type: object
    Dengi:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              properties:
                projectId:
                  description: Dengi Gateway project ID.
                  type: string
                publicKey:
                  description: Dengi Gateway public key.
                  format: password
                  type: string
                refundKey:
                  description: Dengi Gateway refund key.
                  format: password
                  type: string
              required:
                - projectId
                - publicKey
                - refundKey
              type: object
          required:
            - credentials
          type: object
      description: Dengi Gateway config.
    DetailedProblem:
      allOf:
        - $ref: "#/components/schemas/BlankProblem"
        - properties:
            detail:
              description: A human-readable explanation specific to this occurrence of the
                problem.
              type: string
      type: object
    DigitalWalletToken:
      allOf:
        - $ref: "#/components/schemas/CommonPaymentToken"
      properties:
        billingAddress:
          allOf:
            - $ref: "#/components/schemas/ContactObject"
          description: The billing address object.
          readOnly: true
        method:
          description: The token payment method.
          enum:
            - digital-wallet
          type: string
        paymentInstrument:
          description: The payment instrument details.
          properties:
            amount:
              description: Authorized for the digital wallet amount.
              format: double
              type: number
            bin:
              description: Payment Card BIN (the PAN's first 6 digits).
              format: bin
              readOnly: true
              type: string
            brand:
              allOf:
                - $ref: "#/components/schemas/PaymentCardBrand"
              readOnly: true
            currency:
              allOf:
                - $ref: "#/components/schemas/CurrencyCode"
              description: Authorized for the digital wallet currency.
            descriptor:
              description: The descriptor for a payment.
              type: string
            expMonth:
              description: Payment Card expiration month.
              readOnly: true
              type: integer
            expYear:
              description: Payment Card expiration year.
              readOnly: true
              type: integer
            last4:
              description: Payment Card PAN's last 4 digits.
              readOnly: true
              type: string
            payload:
              description: The digital wallet encoded data. May contain the digital wallet
                billing address.
              type: object
              writeOnly: true
            type:
              description: The digital wallet type.
              enum:
                - Apple Pay
                - Google Pay
              type: string
          required:
            - type
            - amount
            - currency
            - descriptor
            - payload
          type: object
      required:
        - method
        - paymentInstrument
      title: Digital Wallet Token
      type: object
    DigitalWalletValidation:
      discriminator:
        mapping:
          Apple Pay: "#/components/schemas/ApplePayValidation"
        propertyName: type
      properties:
        type:
          description: Type of the digital wallet to validate.
          enum:
            - Apple Pay
          type: string
      required:
        - type
      type: object
    DigitalWallets:
      description: Configure which digital wallets are enabled.
      properties:
        applePay:
          description: The Apple Pay digital wallet configuration. Skip if not using Apple
            Pay.
          properties:
            isEnabled:
              default: false
              description: Set true if Apple Pay is enabled.
              type: boolean
          required:
            - isEnabled
          type: object
        googlePay:
          description: The Google Pay™ digital wallet configuration. Skip if not using
            Google Pay™.
          properties:
            isEnabled:
              default: false
              description: Set true if Google Pay is enabled.
              type: boolean
            merchantName:
              description: The merchant name in Google Pay. Leave blank if using FramePay.
              example: Test Merchant
              type: string
            merchantOrigin:
              description: The merchant origin in Google Pay. The fully qualified domain name.
                Leave blank if using FramePay.
              example: www.example.com
              type: string
          required:
            - isEnabled
          type: object
      title: Digital Wallets
      type: object
    Directa24:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              description: Directa24 credentials object.
              properties:
                secret_key:
                  description: Directa24 secret key.
                  format: password
                  type: string
                web_pay_login:
                  description: Directa24 web pay status login.
                  type: string
                web_pay_tran_key:
                  description: Directa24 web pay status password.
                  format: password
                  type: string
                x_login:
                  description: Directa24 login.
                  type: string
                x_tran_key:
                  description: Directa24 transaction key.
                  format: password
                  type: string
              required:
                - x_login
                - x_tran_key
                - secret_key
                - web_pay_login
                - web_pay_tran_key
              type: object
            settings:
              description: Directa24 settings object.
              properties:
                banks:
                  description: List of banks which will be shown to customers.
                  items:
                    $ref: "#/components/schemas/Directa24Banks"
                  type: array
                skipStep:
                  description: Skip step for user to enter their personal information.
                  type: boolean
              type: object
          required:
            - credentials
          type: object
      description: Directa24 config.
    Directa24Banks:
      enum:
        - AA
        - AL
        - AZ
        - B
        - BB
        - BC
        - BE
        - BL
        - BM
        - BN
        - BP
        - BQ
        - BU
        - BV
        - BW
        - BX
        - BZ
        - CA
        - CE
        - CI
        - CU
        - EF
        - EN
        - EY
        - FA
        - FB
        - FC
        - GC
        - GG
        - HC
        - I
        - IA
        - IB
        - JM
        - LC
        - LE
        - LL
        - MC
        - MD
        - MP
        - MT
        - NB
        - OM
        - OX
        - PC
        - PH
        - PL
        - SB
        - SC
        - SE
        - SF
        - SM
        - SS
        - ST
        - SU
        - TC
        - TG
        - TY
        - UB
        - UI
        - UL
        - US
        - VD
        - VI
        - WA
        - WP
        - WU
      type: string
    Discount:
      discriminator:
        mapping:
          fixed: "#/components/schemas/fixed"
          percent: "#/components/schemas/percent"
        propertyName: type
      properties:
        type:
          description: Discount type.
          enum:
            - fixed
            - percent
          type: string
          x-basic: true
          x-label: Type
          x-sortable: true
      type: object
    Dispute:
      properties:
        _embedded:
          description: Any embedded objects available that are requested by the `expand`
            querystring parameter.
          items:
            anyOf:
              - $ref: "#/components/schemas/TransactionEmbed"
          minItems: 1
          readOnly: true
          type: array
        _links:
          description: The links related to resource.
          items:
            anyOf:
              - $ref: "#/components/schemas/SelfLink"
              - $ref: "#/components/schemas/TransactionLink"
          minItems: 1
          readOnly: true
          type: array
        acquirerReferenceNumber:
          description: The dispute's acquirer reference number.
          type: string
        amount:
          description: The dispute amount.
          format: double
          type: number
        caseId:
          description: The case ID for the dispute.
          type: string
        category:
          description: The dispute's category.
          enum:
            - fraud
            - unrecognized
            - product-not-received
            - product-unacceptable
            - product-not-refunded
            - duplicate
            - subscription-canceled
            - uncategorized
          readOnly: true
          type: string
        createdTime:
          allOf:
            - $ref: "#/components/schemas/ServerTimestamp"
          description: Dispute created time.
        currency:
          allOf:
            - $ref: "#/components/schemas/CurrencyCode"
        customerId:
          description: The dispute's customer ID.
          readOnly: true
          type: string
        deadlineTime:
          description: Dispute deadline time.
          format: date-time
          type: string
        id:
          allOf:
            - $ref: "#/components/schemas/ResourceId"
          description: The dispute identifier string.
          readOnly: true
        postedTime:
          description: Dispute posted time.
          format: date-time
          type: string
        rawResponse:
          description: Dispute raw response from gateway.
          readOnly: true
          type: string
        reasonCode:
          description: The dispute's reason code.
          enum:
            - "1000"
            - "10.1"
            - "10.2"
            - "10.3"
            - "10.4"
            - "10.5"
            - "11.1"
            - "11.2"
            - "11.3"
            - "12"
            - "12.1"
            - "12.2"
            - "12.3"
            - "12.4"
            - "12.5"
            - "12.6"
            - "12.7"
            - "13.1"
            - "13.2"
            - "13.3"
            - "13.4"
            - "13.5"
            - "13.6"
            - "13.7"
            - "13.8"
            - "13.9"
            - "2"
            - "30"
            - "31"
            - "35"
            - "37"
            - "40"
            - "41"
            - "42"
            - "46"
            - "47"
            - "49"
            - "50"
            - "53"
            - "54"
            - "55"
            - "57"
            - "59"
            - "60"
            - "62"
            - "7"
            - "70"
            - "71"
            - "72"
            - "73"
            - "74"
            - "75"
            - "76"
            - "77"
            - "79"
            - "8"
            - "80"
            - "81"
            - "82"
            - "83"
            - "85"
            - "86"
            - "93"
            - "00"
            - "63"
            - A01
            - A02
            - A08
            - F10
            - F14
            - F22
            - F24
            - F29
            - C02
            - C04
            - C05
            - C08
            - C14
            - C18
            - C28
            - C31
            - C32
            - M10
            - M49
            - P01
            - P03
            - P04
            - P05
            - P07
            - P08
            - P22
            - P23
            - R03
            - R13
            - M01
            - FR1
            - FR4
            - FR6
            - AL
            - AP
            - AW
            - CA
            - CD
            - CR
            - DA
            - DP
            - DP1
            - EX
            - IC
            - IN
            - IS
            - LP
            - N
            - NA
            - NC
            - P
            - RG
            - RM
            - RN1
            - RN2
            - SV
            - TF
            - TNM
            - UA01
            - UA02
            - UA32
            - UA99
            - UA03
            - UA10
            - UA11
            - UA12
            - UA18
            - UA20
            - UA21
            - UA22
            - UA23
            - UA28
            - UA30
            - UA31
            - UA38
            - duplicate
            - fraudulent
            - subscription_canceled
            - product_unacceptable
            - product_not_received
            - unrecognized
            - credit_not_processed
            - customer_initiated
            - incorrect_account_details
            - insufficient_funds
            - bank_cannot_process
            - debit_not_authorized
            - general
            - pre-chargeback-alert
            - "0"
            - "1"
            - "2"
            - "3"
            - "4"
            - "5"
            - "6"
            - "7"
            - "9"
            - "51"
            - A
            - B
          type: string
        resolvedTime:
          allOf:
            - $ref: "#/components/schemas/ServerTimestamp"
          description: Dispute resolved time.
        status:
          description: The dispute's status.
          enum:
            - response-needed
            - under-review
            - forfeited
            - won
            - lost
            - unknown
          type: string
        transactionId:
          description: The dispute's transaction ID.
          type: string
        type:
          description: The dispute's type.
          enum:
            - information-request
            - first-chargeback
            - second-chargeback
            - arbitration
            - fraud
            - ethoca-alert
            - verifi-alert
          type: string
        updatedTime:
          allOf:
            - $ref: "#/components/schemas/ServerTimestamp"
          description: Dispute updated time.
      required:
        - currency
        - amount
        - transactionId
        - postedTime
        - type
        - status
        - reasonCode
      type: object
    DisputeLink:
      allOf:
        - $ref: "#/components/schemas/Link"
      properties:
        rel:
          description: The link type.
          enum:
            - dispute
          type: string
      required:
        - rel
      type: object
    DocumentedProblem:
      allOf:
        - properties:
            type:
              description: A URI reference [[RFC3986](https://tools.ietf.org/html/rfc3986)]
                that identifies the problem type. It should provide
                human-readable documentation for the problem type. When this
                member is not present, its value is assumed to be "about:blank".
              format: uri
              type: string
        - $ref: "#/components/schemas/BlankProblem"
      type: object
    Dragonphoenix:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              description: Dragonphoenix credentials object.
              properties:
                rcode:
                  description: Dragonphoenix rcode.
                  format: password
                  type: string
                sid:
                  description: Dragonphoenix site ID.
                  type: string
              required:
                - sid
                - rcode
              type: object
          required:
            - credentials
          type: object
      description: Dragonphoenix config.
    DueTimeShiftInstruction:
      default:
        duration: 1
        unit: hour
      description: >
        The calculation instruction of due time.

        This is used in conjunction with the **billing anchor** to calculate due time of invoice.

        The chronology of due time shift is always **after**.
      properties:
        duration:
          description: The number of the units.
          minimum: 1
          type: integer
        unit:
          oneOf:
            - $ref: "#/components/schemas/TimeUnit"
            - $ref: "#/components/schemas/TimePluralUnit"
      required:
        - duration
        - unit
      type: object
    DynamicIpnLink:
      allOf:
        - $ref: "#/components/schemas/Link"
      properties:
        rel:
          description: The link type.
          enum:
            - dynamicIpnUrl
          type: string
      required:
        - rel
      type: object
    EBANX:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              description: EBANX credentials object.
              properties:
                integrationKey:
                  description: EBANX integration key.
                  format: password
                  type: string
              required:
                - integrationKey
              type: object
          required:
            - credentials
          type: object
      description: EBANX config.
    EMS:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              description: EMS credentials object.
              properties:
                clientCertificate:
                  description: Client Certificate.
                  type: string
                  x-multiline: true
                clientCertificatePassword:
                  description: Client Certificate password.
                  format: password
                  type: string
                merchantName:
                  description: Merchant Name for SFTP reconciliation.
                  type: string
                password:
                  description: EMS password.
                  format: password
                  type: string
                privateKey:
                  description: Private Key.
                  format: password
                  type: string
                  x-multiline: true
                privateKeyPassword:
                  description: Private key password.
                  format: password
                  type: string
                serverCertificate:
                  description: Server Certificate.
                  type: string
                  x-multiline: true
                sftpPrivateKey:
                  description: SFTP reconciliation private key.
                  format: password
                  type: string
                  x-multiline: true
                storeId:
                  description: EMS store id.
                  type: string
                userId:
                  description: EMS account id.
                  type: string
              required:
                - storeId
                - userId
                - password
                - privateKey
                - privateKeyPassword
                - clientCertificate
                - clientCertificatePassword
                - serverCertificate
              type: object
            settings:
              description: EMS settings object.
              properties:
                delay:
                  description: Automatic capture delay in hours.
                  type: integer
              type: object
            threeDSecureServer:
              $ref: "#/components/schemas/EMS3dsServers"
          required:
            - credentials
          type: object
      description: EMS e-Commerce (XML) API config.
    EMS3dsServers:
      description: EMS 3DS Servers.
      discriminator:
        mapping:
          ThreeDSecureIO3dsServer: "#/components/schemas/ThreeDSecureIO3dsServer"
        propertyName: name
      properties:
        name:
          allOf:
            - $ref: "#/components/schemas/ThreeDSecureServerName"
          enum:
            - ThreeDSecureIO3dsServer
      required:
        - name
      type: object
    EPG:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              description: EPG credentials object.
              properties:
                merchantId:
                  description: Merchant ID.
                  type: string
                merchantKey:
                  description: Merchant key.
                  format: password
                  type: string
                merchantPassword:
                  description: Merchant password.
                  format: password
                  type: string
                productId:
                  description: Product ID.
                  type: string
              required:
                - merchantId
                - productId
                - merchantPassword
                - merchantKey
              type: object
          required:
            - credentials
          type: object
      description: EPG config.
    EPro:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              description: EPro credentials object.
              properties:
                apiSecretKey:
                  description: EPro API secret key.
                  format: password
                  type: string
              required:
                - apiSecretKey
              type: object
          required:
            - credentials
          type: object
      description: EPro config.
    EcorePay:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              properties:
                accountAuth:
                  description: EcorePay Account Auth.
                  format: password
                  type: string
                accountId:
                  description: EcorePay Account ID.
                  type: string
              required:
                - accountId
                - accountAuth
              type: object
          required:
            - credentials
          type: object
      description: EcorePay Gateway config.
    Elavon:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              description: Elavon credentials object.
              properties:
                ssl_merchant_id:
                  description: Elavon merchant ID.
                  type: string
                ssl_pin:
                  description: Elavon pin.
                  format: password
                  type: string
                ssl_user_id:
                  description: Elavon user ID.
                  type: string
              required:
                - ssl_merchant_id
                - ssl_user_id
                - ssl_pin
              type: object
          required:
            - credentials
          type: object
      description: Elavon config.
    Error:
      allOf:
        - $ref: "#/components/schemas/Problem"
        - properties:
            error:
              deprecated: true
              type: string
      type: object
    Euteller:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              description: Euteller credentials object.
              properties:
                password:
                  format: password
                  type: string
                username:
                  type: string
              required:
                - username
                - password
              type: object
          required:
            - credentials
          type: object
      description: Euteller config.
    File:
      properties:
        _links:
          description: The links related to resource.
          items:
            anyOf:
              - $ref: "#/components/schemas/SelfLink"
              - $ref: "#/components/schemas/FileDownloadLink"
              - $ref: "#/components/schemas/SignedLinkLink"
              - $ref: "#/components/schemas/PermalinkLink"
          minItems: 3
          readOnly: true
          type: array
        createdTime:
          allOf:
            - $ref: "#/components/schemas/ServerTimestamp"
          description: The upload date/time.
        description:
          description: The File description.
          type: string
        extension:
          description: The File extension.
          type: string
        height:
          description: Image height, applicable to images only.
          readOnly: true
          type: integer
        id:
          allOf:
            - $ref: "#/components/schemas/ResourceId"
          readOnly: true
        isPublic:
          description: Is the file available publicly (without authentication). If true,
            the permalink in the _links section contains the public URL.
          type: boolean
        mime:
          description: The mime type.
          enum:
            - image/png
            - image/jpeg
            - image/gif
            - application/pdf
            - audio/mpeg
          readOnly: true
          type: string
        name:
          description: Original File name.
          type: string
        sha1:
          description: Hash sum of the file.
          readOnly: true
          type: string
        size:
          description: The File size in bytes.
          readOnly: true
          type: integer
        tags:
          description: The tags list.
          items:
            type: string
          type: array
        updatedTime:
          allOf:
            - $ref: "#/components/schemas/ServerTimestamp"
          description: The latest update date/time.
        width:
          description: Image width, applicable to images only.
          readOnly: true
          type: integer
      type: object
    FileCreateFromInline:
      properties:
        description:
          description: The file description.
          example: My file description
          type: string
        file:
          description: The file in base64 encoded format.
          example: R0lGODlhAQABAIAAAAUEBAAAACwAAAAAAQABAAACAkQBADs=
          type: string
        isPublic:
          description: The File visibility. If public a permalink is provided.
          example: false
          type: boolean
        name:
          description: The file name used for downloading.
          example: logo.png
          type: string
        tags:
          description: The tags list.
          example:
            - test
            - tags
          items:
            type: string
          type: array
      required:
        - file
      type: object
    FileCreateFromUrl:
      properties:
        description:
          description: The file description.
          example: My file description
          type: string
        isPublic:
          description: The File visibility. If public a permalink is provided.
          example: false
          type: boolean
        name:
          description: The file name used for downloading.
          example: logo.png
          type: string
        tags:
          description: The tags list.
          example:
            - test
            - tags
          items:
            type: string
          type: array
        url:
          description: The URL of the file to upload.
          example: https://blog.rebilly.com/wp-content/uploads/2017/09/rb_LogoInverted_Small.png
          type: string
      required:
        - url
      type: object
    FileDownloadLink:
      allOf:
        - $ref: "#/components/schemas/Link"
      properties:
        rel:
          description: The link type.
          enum:
            - download
          type: string
      required:
        - rel
      type: object
    FileEmbed:
      description: File object.
      properties:
        file:
          $ref: "#/components/schemas/File"
      readOnly: true
      type: object
    FileLink:
      allOf:
        - $ref: "#/components/schemas/Link"
      properties:
        rel:
          description: The link type.
          enum:
            - file
          type: string
      required:
        - rel
      type: object
    FinTecSystems:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              description: FinTecSystems credentials object.
              properties:
                apiKey:
                  description: FinTecSystems api key.
                  format: password
                  type: string
              required:
                - apiKey
              type: object
            settings:
              description: FinTecSystems settings object.
              properties:
                recipientBIC:
                  description: BIC of the recipient account.
                  type: string
                recipientCountry:
                  description: Two letter country code.
                  enum:
                    - AT
                    - CH
                    - DE
                  type: string
                recipientHolder:
                  description: Account holder of the recipient account.
                  type: string
                recipientIBAN:
                  description: IBAN of the recipient account.
                  type: string
              required:
                - recipientIBAN
                - recipientBIC
                - recipientHolder
                - recipientCountry
              type: object
          required:
            - credentials
            - settings
          type: object
      description: FinTecSystems config.
    Finrax:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              description: Finrax credentials object.
              properties:
                apiKey:
                  description: Finrax API Key.
                  format: password
                  type: string
                apiSecret:
                  description: Finrax API Secret.
                  format: password
                  type: string
                businessId:
                  description: Finrax Business Id.
                  type: string
              required:
                - businessId
                - apiKey
                - apiSecret
              type: object
            settings:
              description: Finrax settings object.
              properties:
                tolerancePercentage:
                  $ref: "#/components/schemas/AmountAdjustmentTolerance"
              required:
                - tolerancePercentage
              type: object
          required:
            - credentials
          type: object
      description: Finrax config.
    Flexepin:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              properties:
                apiKey:
                  description: Flexepin API Key.
                  type: string
                apiSecret:
                  description: Flexepin API Secret.
                  format: password
                  type: string
              required:
                - apiKey
                - apiSecret
              type: object
          required:
            - credentials
          type: object
      description: Flexepin Gateway config.
    FlexiblePlan:
      allOf:
        - $ref: "#/components/schemas/CommonPlan"
      properties:
        id:
          allOf:
            - $ref: "#/components/schemas/ResourceId"
          description: The Plan identifier.
          readOnly: false
      required:
        - id
        - name
        - currency
        - productId
        - pricing
    Forte:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              properties:
                accountId:
                  description: Forte Gateway account ID.
                  type: string
                apiAccessId:
                  description: Forte Gateway api access ID.
                  format: password
                  type: string
                apiSecretKey:
                  description: Forte Gateway api secret key.
                  format: password
                  type: string
                locationId:
                  description: Forte Gateway location ID.
                  type: string
              required:
                - accountId
                - locationId
                - apiAccessId
                - apiSecretKey
              type: object
          required:
            - credentials
          type: object
      description: Forte Gateway config.
    FundSend:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              properties:
                clientId:
                  description: FundSend Gateway client ID.
                  type: string
                secretWord:
                  description: FundSend Gateway secret word.
                  format: password
                  type: string
              required:
                - clientId
                - secretWord
              type: object
          required:
            - credentials
          type: object
      description: FundSend Gateway config.
    GET:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              properties:
                accountId:
                  description: GET Gateway account ID.
                  type: string
              required:
                - accountId
              type: object
            threeDSecureServer:
              $ref: "#/components/schemas/GET3dsServers"
          required:
            - credentials
          type: object
      description: GET Gateway config.
    GET3dsServers:
      description: GET 3DS Servers.
      discriminator:
        mapping:
          Other: "#/components/schemas/Other"
          Paay3dsServer: "#/components/schemas/Paay3dsServer"
        propertyName: name
      properties:
        name:
          allOf:
            - $ref: "#/components/schemas/ThreeDSecureServerName"
          enum:
            - Paay3dsServer
            - Other
      required:
        - name
      type: object
    GatewayAccount:
      discriminator:
        mapping:
          A1Gateway: "#/components/schemas/A1Gateway"
          Adyen: "#/components/schemas/Adyen"
          Airpay: "#/components/schemas/Airpay"
          AmexVPC: "#/components/schemas/AmexVPC"
          ApcoPay: "#/components/schemas/ApcoPay"
          AsiaPaymentGateway: "#/components/schemas/AsiaPaymentGateway"
          AstroPayCard: "#/components/schemas/AstroPayCard"
          AuthorizeNet: "#/components/schemas/AuthorizeNet"
          Bambora: "#/components/schemas/Bambora"
          BitPay: "#/components/schemas/BitPay"
          BlueSnap: "#/components/schemas/BlueSnap"
          BraintreePayments: "#/components/schemas/BraintreePayments"
          CASHlib: "#/components/schemas/CASHlib"
          CCAvenue: "#/components/schemas/CCAvenue"
          CODVoucher: "#/components/schemas/CODVoucher"
          Cardknox: "#/components/schemas/Cardknox"
          CashToCode: "#/components/schemas/CashToCode"
          Cashflows: "#/components/schemas/Cashflows"
          CauriPayment: "#/components/schemas/CauriPayment"
          Cayan: "#/components/schemas/Cayan"
          Chase: "#/components/schemas/Chase"
          Circle: "#/components/schemas/Circle"
          Citadel: "#/components/schemas/Citadel"
          Clearhaus: "#/components/schemas/Clearhaus"
          CoinPayments: "#/components/schemas/CoinPayments"
          Conekta: "#/components/schemas/Conekta"
          Coppr: "#/components/schemas/Coppr"
          Credorax: "#/components/schemas/Credorax"
          Cryptonator: "#/components/schemas/Cryptonator"
          CyberSource: "#/components/schemas/CyberSource"
          DataCash: "#/components/schemas/DataCash"
          Dengi: "#/components/schemas/Dengi"
          Directa24: "#/components/schemas/Directa24"
          Dragonphoenix: "#/components/schemas/Dragonphoenix"
          EBANX: "#/components/schemas/EBANX"
          EMS: "#/components/schemas/EMS"
          EPG: "#/components/schemas/EPG"
          EPro: "#/components/schemas/EPro"
          EcorePay: "#/components/schemas/EcorePay"
          Elavon: "#/components/schemas/Elavon"
          Euteller: "#/components/schemas/Euteller"
          FinTecSystems: "#/components/schemas/FinTecSystems"
          Finrax: "#/components/schemas/Finrax"
          Flexepin: "#/components/schemas/Flexepin"
          Forte: "#/components/schemas/Forte"
          FundSend: "#/components/schemas/FundSend"
          GET: "#/components/schemas/GET"
          Gigadat: "#/components/schemas/Gigadat"
          GlobalOne: "#/components/schemas/GlobalOne"
          Gooney: "#/components/schemas/Gooney"
          Gpaysafe: "#/components/schemas/Gpaysafe"
          Greenbox: "#/components/schemas/Greenbox"
          HiPay: "#/components/schemas/HiPay"
          ICEPAY: "#/components/schemas/ICEPAY"
          INOVAPAY: "#/components/schemas/INOVAPAY"
          Ilixium: "#/components/schemas/Ilixium"
          Ingenico: "#/components/schemas/Ingenico"
          Inovio: "#/components/schemas/Inovio"
          InstaDebit: "#/components/schemas/InstaDebit"
          Intuit: "#/components/schemas/Intuit"
          IpayOptions: "#/components/schemas/IpayOptions"
          JetPay: "#/components/schemas/JetPay"
          Jeton: "#/components/schemas/Jeton"
          Khelocard: "#/components/schemas/Khelocard"
          Konnektive: "#/components/schemas/Konnektive"
          LPG: "#/components/schemas/LPG"
          MiFinity: "#/components/schemas/MiFinity"
          Moneris: "#/components/schemas/Moneris"
          MtaPay: "#/components/schemas/MtaPay"
          MuchBetter: "#/components/schemas/MuchBetter"
          MyFatoorah: "#/components/schemas/MyFatoorah"
          NGenius: "#/components/schemas/NGenius"
          NMI: "#/components/schemas/NMI"
          Neosurf: "#/components/schemas/Neosurf"
          Netbanking: "#/components/schemas/Netbanking"
          Neteller: "#/components/schemas/Neteller"
          NinjaWallet: "#/components/schemas/NinjaWallet"
          NuaPay: "#/components/schemas/NuaPay"
          OchaPay: "#/components/schemas/OchaPay"
          OnRamp: "#/components/schemas/OnRamp"
          Onlineueberweisen: "#/components/schemas/Onlineueberweisen"
          Pagsmile: "#/components/schemas/Pagsmile"
          Panamerican: "#/components/schemas/Panamerican"
          PandaGateway: "#/components/schemas/PandaGateway"
          ParamountEft: "#/components/schemas/ParamountEft"
          ParamountInterac: "#/components/schemas/ParamountInterac"
          Pay4Fun: "#/components/schemas/Pay4Fun"
          PayCash: "#/components/schemas/PayCash"
          PayClub: "#/components/schemas/PayClub"
          PayPal: "#/components/schemas/PayPal"
          PayTabs: "#/components/schemas/PayTabs"
          PayULatam: "#/components/schemas/PayULatam"
          Payeezy: "#/components/schemas/Payeezy"
          Payflow: "#/components/schemas/Payflow"
          PaymenTechnologies: "#/components/schemas/PaymenTechnologies"
          PaymentAsia: "#/components/schemas/PaymentAsia"
          PaymentsOS: "#/components/schemas/PaymentsOS"
          Paymero: "#/components/schemas/Paymero"
          Payr: "#/components/schemas/Payr"
          Paysafe: "#/components/schemas/Paysafe"
          Paysafecash: "#/components/schemas/Paysafecash"
          Payvision: "#/components/schemas/Payvision"
          Piastrix: "#/components/schemas/Piastrix"
          Plugnpay: "#/components/schemas/Plugnpay"
          PostFinance: "#/components/schemas/PostFinance"
          Prosa: "#/components/schemas/Prosa"
          RPN: "#/components/schemas/RPN"
          Rapyd: "#/components/schemas/Rapyd"
          Realex: "#/components/schemas/Realex"
          Realtime: "#/components/schemas/Realtime"
          Redsys: "#/components/schemas/Redsys"
          Rotessa: "#/components/schemas/Rotessa"
          SMSVoucher: "#/components/schemas/SMSVoucher"
          Sagepay: "#/components/schemas/Sagepay"
          SaltarPay: "#/components/schemas/SaltarPay"
          SeamlessChex: "#/components/schemas/SeamlessChex"
          SecureTrading: "#/components/schemas/SecureTrading"
          SecurionPay: "#/components/schemas/SecurionPay"
          Skrill: "#/components/schemas/Skrill"
          SmartInvoice: "#/components/schemas/SmartInvoice"
          Sofort: "#/components/schemas/Sofort"
          SparkPay: "#/components/schemas/SparkPay"
          StaticGateway: "#/components/schemas/StaticGateway"
          Stripe: "#/components/schemas/Stripe"
          TWINT: "#/components/schemas/TWINT"
          TestProcessor: "#/components/schemas/TestProcessor"
          ToditoCash: "#/components/schemas/ToditoCash"
          TrustPay: "#/components/schemas/TrustPay"
          Trustly: "#/components/schemas/Trustly"
          TrustsPay: "#/components/schemas/TrustsPay"
          UPayCard: "#/components/schemas/UPayCard"
          USAePay: "#/components/schemas/USAePay"
          VCreditos: "#/components/schemas/VCreditos"
          VantivLitle: "#/components/schemas/VantivLitle"
          Wallet88: "#/components/schemas/Wallet88"
          Walpay: "#/components/schemas/Walpay"
          Wirecard: "#/components/schemas/Wirecard"
          WorldlineAtosFrankfurt: "#/components/schemas/WorldlineAtosFrankfurt"
          Worldpay: "#/components/schemas/Worldpay"
          XPay: "#/components/schemas/XPay"
          Zimpler: "#/components/schemas/Zimpler"
          Zotapay: "#/components/schemas/Zotapay"
          dLocal: "#/components/schemas/dLocal"
          eMerchantPay: "#/components/schemas/eMerchantPay"
          eZeeWallet: "#/components/schemas/eZeeWallet"
          ecoPayz: "#/components/schemas/ecoPayz"
          ezyEFT: "#/components/schemas/ezyEFT"
          iCanPay: "#/components/schemas/iCanPay"
          iCheque: "#/components/schemas/iCheque"
          iDebit: "#/components/schemas/iDebit"
          loonie: "#/components/schemas/loonie"
          vegaaH: "#/components/schemas/vegaaH"
        propertyName: gatewayName
      properties:
        _links:
          description: The links related to resource.
          items:
            anyOf:
              - $ref: "#/components/schemas/SelfLink"
              - $ref: "#/components/schemas/OnBoardingUrlLink"
              - $ref: "#/components/schemas/DynamicIpnLink"
              - $ref: "#/components/schemas/StaticIpnLink"
          minItems: 1
          readOnly: true
          type: array
        acceptedCurrencies:
          description: Accepted currencies (array of the currency three letter codes).
          items:
            type: string
          type: array
        acquirerName:
          allOf:
            - $ref: "#/components/schemas/AcquirerName"
          default: Other
        additionalFilters:
          description: >
            The additional filters are used to determine whether the gateway
            account can be selected for the transaction to be processed.

            For example, the filter may put a maximum amount value. If the transaction is above that amount, this gateway account wouldn't be used.

            This follows our standard filter format.
          example: amount:1..100;bin:411111,444433
          type: string
        approvalWindowTtl:
          default: 3600
          description: The time window (in seconds) allotted for approving an offsite
            transaction before it is automatically `abandoned`.
          maximum: 16777215
          minimum: 300
          type: integer
        cityField:
          description: The gateway account's city field (also known as line 2 descriptor).
          type: string
        createdTime:
          allOf:
            - $ref: "#/components/schemas/ServerTimestamp"
          description: Gateway Account created time.
        dccForceCurrency:
          description: >
            Force dynamic currency conversion to the specified currency on each
            sale.

            Leave it empty to disable force DCC.
          type: string
        dccMarkup:
          description: Dynamic currency conversion markup in basis points.
          maximum: 10000
          minimum: -10000
          type: integer
        descriptor:
          description: The gateway account's descriptor.
          type: string
        digitalWallets:
          $ref: "#/components/schemas/DigitalWallets"
        dynamicDescriptor:
          default: false
          description: True, if Gateway Account allows dynamic descriptor.
          type: boolean
        excludedDccQuoteCurrencies:
          description: Excluded Dynamic Currency Conversion Quote Currencies.
          items:
            type: string
          type: array
        gatewayName:
          $ref: "#/components/schemas/GatewayName"
        id:
          allOf:
            - $ref: "#/components/schemas/ResourceId"
          description: The gateway identifier string.
          readOnly: true
        isDown:
          description: True if gateway is currently in downtime period.
          readOnly: true
          type: boolean
        merchantCategoryCode:
          default: "0000"
          description: The gateway account's merchant category code.
          pattern: ^[0-9]{4}$
          type: string
        method:
          $ref: "#/components/schemas/PaymentMethod"
        monthlyLimit:
          description: Monthly Limit.
          format: double
          minimum: 0
          type: number
        organizationId:
          allOf:
            - $ref: "#/components/schemas/ResourceId"
          deprecated: true
          description: Organization ID.
          readOnly: true
        paymentCardSchemes:
          description: Accepted payment card brands.
          items:
            $ref: "#/components/schemas/PaymentCardBrand"
          type: array
        reconciliationWindowEnabled:
          default: false
          description: If a transaction is not reconciled within the
            `reconciliationWindowTtl` time, then the transaction is marked as
            `abandoned`.
          type: boolean
        reconciliationWindowTtl:
          description: The time window (in seconds) allotted for a reconciliation to
            occur. If it is not reconciled in that time, then the transaction is
            marked as `abandoned`.
          maximum: 16777215
          minimum: 300
          type: integer
        status:
          description: The gateway account's status.
          enum:
            - active
            - inactive
            - pending
            - closed
          readOnly: true
          type: string
        sticky:
          default: true
          description: Customer's payment instrument will "stick" to the gateway account
            for future transactions when enabled.
          type: boolean
        threeDSecure:
          default: false
          description: True, if Gateway Account allows 3DSecure.
          type: boolean
        timeout:
          description: Gateway Account request timeout in seconds.
          maximum: 120
          minimum: 10
          nullable: true
          type: integer
        token:
          description: Gateway Account token.
          example: TwiX3f92k4AiBE27BzTbQ38hHjicBz_w
          readOnly: true
          type: string
        updatedTime:
          allOf:
            - $ref: "#/components/schemas/ServerTimestamp"
          description: Gateway Account updated time.
      required:
        - gatewayName
        - method
        - acceptedCurrencies
      type: object
    GatewayAccountEmbed:
      description: Gateway Account object.
      properties:
        gatewayAccount:
          $ref: "#/components/schemas/GatewayAccount"
      readOnly: true
      type: object
    GatewayAccountLimit:
      properties:
        _links:
          description: The links related to resource.
          items:
            $ref: "#/components/schemas/SelfLink"
          minItems: 1
          readOnly: true
          type: array
        cap:
          description: >
            The limit's value cap is the maximum desired value.

            If type is money, the currency is the report currency.

            The cap only applies to approved transactions of type `authorize` or `sale`.
          example: 1000
          type: integer
        createdTime:
          allOf:
            - $ref: "#/components/schemas/ServerTimestamp"
          description: Gateway account limit created time.
        endTime:
          description: The limit's current period end time. At this time, the limit will
            reset.
          format: date-time
          readOnly: true
          type: string
        frequency:
          description: The limit's period will reset according to the frequency.
          enum:
            - daily
            - monthly
          readOnly: true
          type: string
        id:
          allOf:
            - $ref: "#/components/schemas/ResourceId"
          description: The gateway account limit identifier.
          readOnly: true
        startTime:
          description: The limit's current period start time.
          format: date-time
          readOnly: true
          type: string
        status:
          description: The gateway account limit status.
          enum:
            - monitoring
            - reached
          readOnly: true
          type: string
        type:
          description: |
            The limit can be on `money` or `count` of transactions.
            If `money` is chosen, the currency is the report currency.
          enum:
            - count
            - money
          readOnly: true
          type: string
        updatedTime:
          allOf:
            - $ref: "#/components/schemas/ServerTimestamp"
          description: Gateway account limit updated time.
        usage:
          description: The limit's actual usage during this period.
          example: 375
          readOnly: true
          type: integer
      required:
        - cap
      type: object
    GatewayAccountLimitLink:
      allOf:
        - $ref: "#/components/schemas/Link"
      properties:
        rel:
          description: The link type.
          enum:
            - gatewayAccountLimit
          type: string
      required:
        - rel
      type: object
    GatewayAccountLink:
      allOf:
        - $ref: "#/components/schemas/Link"
      properties:
        rel:
          description: The link type.
          enum:
            - gatewayAccount
          type: string
      required:
        - rel
      type: object
    GatewayName:
      description: The payment gateway name.
      enum:
        - A1Gateway
        - Adyen
        - Airpay
        - AmexVPC
        - ApcoPay
        - AsiaPaymentGateway
        - AstroPayCard
        - AuthorizeNet
        - Bambora
        - BitPay
        - BlueSnap
        - BraintreePayments
        - Cardknox
        - Cashflows
        - CASHlib
        - CashToCode
        - CauriPayment
        - Cayan
        - CCAvenue
        - Chase
        - Circle
        - Citadel
        - Clearhaus
        - CODVoucher
        - CoinPayments
        - Conekta
        - Coppr
        - Credorax
        - Cryptonator
        - CyberSource
        - DataCash
        - Dengi
        - Dragonphoenix
        - Directa24
        - dLocal
        - EBANX
        - ecoPayz
        - EcorePay
        - Elavon
        - Euteller
        - eMerchantPay
        - EMS
        - EPG
        - EPro
        - eZeeWallet
        - ezyEFT
        - Finrax
        - Flexepin
        - FinTecSystems
        - FundSend
        - Forte
        - GET
        - Gigadat
        - GlobalOnePay
        - Gooney
        - Gpaysafe
        - Greenbox
        - HiPay
        - iCanPay
        - ICEPAY
        - iCheque
        - iDebit
        - Ilixium
        - Ingenico
        - INOVAPAY
        - Inovio
        - Intuit
        - InstaDebit
        - IpayOptions
        - JetPay
        - Jeton
        - Khelocard
        - Konnektive
        - loonie
        - LPG
        - MiFinity
        - Moneris
        - MtaPay
        - MuchBetter
        - MyFatoorah
        - Neosurf
        - Netbanking
        - Neteller
        - NGenius
        - NinjaWallet
        - NMI
        - NuaPay
        - OchaPay
        - Onlineueberweisen
        - OnRamp
        - Pagsmile
        - Panamerican
        - ParamountEft
        - ParamountInterac
        - PandaGateway
        - Pay4Fun
        - PayCash
        - PayClub
        - Payeezy
        - Payflow
        - PaymentAsia
        - PaymenTechnologies
        - PaymentsOS
        - Paymero
        - PayPal
        - Payr
        - Paysafe
        - Paysafecash
        - PayTabs
        - PayULatam
        - Payvision
        - Piastrix
        - Plugnpay
        - PostFinance
        - Prosa
        - Rapyd
        - Realex
        - Realtime
        - Redsys
        - Rotessa
        - RPN
        - SaltarPay
        - Sagepay
        - SeamlessChex
        - SecureTrading
        - SecurionPay
        - Skrill
        - SmartInvoice
        - SMSVoucher
        - Sofort
        - SparkPay
        - StaticGateway
        - Stripe
        - TestProcessor
        - ToditoCash
        - TrustPay
        - TrustsPay
        - Trustly
        - TWINT
        - UPayCard
        - USAePay
        - VantivLitle
        - vegaaH
        - VCreditos
        - Wallet88
        - Walpay
        - Wirecard
        - WorldlineAtosFrankfurt
        - Worldpay
        - XPay
        - Zimpler
        - Zotapay
      type: string
    Gigadat:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              description: Gigadat credentials object.
              properties:
                accessToken:
                  description: Gigadat access token.
                  format: password
                  type: string
                campaignId:
                  description: Gigadat campaign ID.
                  type: string
                securityToken:
                  description: Gigadat security token.
                  format: password
                  type: string
              required:
                - campaignId
                - accessToken
                - securityToken
              type: object
            settings:
              properties:
                sandbox:
                  default: false
                  description: True if gateway account is in sandbox mode.
                  type: boolean
              required:
                - sandbox
              type: object
          required:
            - credentials
          type: object
      description: Gigadat config.
    GlobalOne:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              properties:
                sharedSecret:
                  description: GlobalOne Gateway shared secret.
                  format: password
                  type: string
                terminalId:
                  description: GlobalOne Gateway terminal ID.
                  type: string
              required:
                - terminalId
                - sharedSecret
              type: object
          required:
            - credentials
          type: object
      description: GlobalOne Gateway config.
    GlobalWebhookEventType:
      description: Rebilly webhooks event type.
      enum:
        - aml-list-possibly-matched
        - customer-created
        - customer-merged
        - customer-one-time-password-requested
        - customer-updated
        - dispute-created
        - experian-check-performed
        - gateway-account-downtime-ended
        - gateway-account-downtime-started
        - gateway-account-limit-reached
        - gateway-account-requested
        - invoice-abandoned
        - invoice-created
        - invoice-issued
        - invoice-modified
        - invoice-paid
        - invoice-past-due
        - invoice-past-due-reminder
        - invoice-reissued
        - invoice-voided
        - kyc-document-accepted
        - kyc-document-created
        - kyc-document-modified
        - kyc-document-rejected
        - kyc-document-reviewed
        - lead-source-changed
        - nsf-response-received
        - offsite-payment-completed
        - order-completed
        - payment-card-created
        - payment-card-expiration-reminder
        - payment-card-expired
        - payment-instrument-modified
        - renewal-invoice-issued
        - renewal-invoice-payment-canceled
        - renewal-invoice-payment-declined
        - risk-score-changed
        - subscription-activated
        - subscription-canceled
        - subscription-modified
        - subscription-reactivated
        - subscription-renewal-reminder
        - subscription-renewed
        - subscription-trial-converted
        - subscription-trial-end-reminder
        - subscription-trial-ended
        - subscription-trial-end-changed
        - transaction-amount-discrepancy-found
        - transaction-declined
        - transaction-discrepancy-found
        - transaction-process-requested
        - transaction-processed
        - transaction-reconciled
        - transaction-timeout-resolved
        - waiting-gateway-transaction-completed
      type: string
    Gooney:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              description: Gooney credentials object.
              properties:
                apiKey:
                  description: Gooney API key.
                  type: string
                apiPassword:
                  description: Gooney API password.
                  format: password
                  type: string
                apiSecret:
                  description: Gooney API secret.
                  format: password
                  type: string
                apiUser:
                  description: Gooney API user.
                  type: string
              required:
                - username
                - password
                - apiKey
                - apiSecret
              type: object
          required:
            - credentials
          type: object
      description: Gooney config.
    Gpaysafe:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              properties:
                apiKey:
                  description: Gpaysafe apiKey.
                  type: string
              required:
                - apiKey
              type: object
          required:
            - credentials
          type: object
      description: Gpaysafe Gateway config.
    Greenbox:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              description: Greenbox credentials object.
              properties:
                clientId:
                  description: Greenbox client ID.
                  type: string
                clientSecret:
                  description: Greenbox client secret.
                  format: password
                  type: string
                locationId:
                  description: Greenbox location ID.
                  type: string
              required:
                - clientId
                - clientSecret
                - locationId
              type: object
          required:
            - credentials
          type: object
      description: Greenbox config.
    HiPay:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              description: HiPay credentials object.
              properties:
                apiPassword:
                  description: HiPay API password.
                  format: password
                  type: string
                apiUsername:
                  description: HiPay API user name.
                  type: string
              required:
                - apiUsername
                - apiPassword
              type: object
          required:
            - credentials
          type: object
      description: HiPay config.
    HttpHeaders:
      additionalProperties:
        type: string
      description: The HTTP headers.
      example:
        Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
        Content-Type: application/json
      type: object
    IBANInstrument:
      allOf:
        - $ref: "#/components/schemas/BankAccountInstrument"
        - properties:
            accountNumber:
              description: >
                Bank Account Number. Detailed information about all ISO
                13616-compliant national IBAN formats is available in [SWIFT
                IBAN
                Registry](https://www.swift.com/standards/data-standards/iban).
              type: string
              writeOnly: true
            bankName:
              description: Bank name.
              type: string
            bic:
              description: Bank Identifier Code.
              type: string
            last4:
              description: Bank Account Number's last 4 digits.
              readOnly: true
              type: string
          required:
            - accountNumber
          type: object
      description: Bank account IBAN instrument.
    IBANType:
      description: IBAN type object.
      properties:
        accountNumber:
          description: >
            Bank's account number. Detailed information about all ISO
            13616-compliant national IBAN formats is available in the [SWIFT
            IBAN Registry](https://www.swift.com/standards/data-standards/iban).
          type: string
        accountNumberType:
          default: BBAN
          description: >-
            Bank's Account Number type. A valid value is basic bank account
            number (BBAN) or international bank account number (IBAN).

            This is the object for the IBAN.
          enum:
            - IBAN
            - BBAN
          type: string
        bankName:
          description: Bank's name.
          type: string
        bic:
          description: Bank Identifier Code.
          type: string
        billingAddress:
          allOf:
            - $ref: "#/components/schemas/ContactObject"
          description: The billing address.
        customFields:
          $ref: "#/components/schemas/ResourceCustomFields"
        customerId:
          allOf:
            - $ref: "#/components/schemas/ResourceId"
          description: Customer's ID.
        method:
          description: The method of payment instrument.
          enum:
            - ach
          type: string
        riskMetadata:
          $ref: "#/components/schemas/RiskMetadata"
      required:
        - method
        - customerId
        - accountNumberType
        - accountNumber
        - billingAddress
      type: object
    ICEPAY:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              description: ICEPAY credentials object.
              properties:
                merchantId:
                  description: ICEPAY merchant ID.
                  format: password
                  type: string
                secretKey:
                  description: ICEPAY API secret key.
                  format: password
                  type: string
              required:
                - merchantId
                - secretKey
              type: object
          required:
            - credentials
          type: object
      description: ICEPAY config.
    INOVAPAY:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              description: INOVAPAY credentials object.
              properties:
                apiKey:
                  description: INOVAPAY API key.
                  type: string
                apiSecret:
                  description: INOVAPAY API secret.
                  format: password
                  type: string
              required:
                - apiKey
                - apiSecret
              type: object
          required:
            - credentials
          type: object
      description: INOVAPAY config.
    IdentityMatches:
      properties:
        containsImage:
          description: Flag that indicates if there is an image that contains a face on it.
          example: true
          type: boolean
        dateOfBirth:
          description: The date of birth found on the document, null if not found.
          format: date-time
          type: string
        expiryDate:
          description: The expiry date found on the document, null if not found.
          format: date-time
          type: string
        firstName:
          description: The customer first name if it was matched, null otherwise.
          example: John
          type: string
        hasMinimalAge:
          description: Checks the minimal age, 21+ for USA and 18+ for all other
            countries. Null if dateOfBirth could not be determined.
          example: true
          readOnly: true
          type: boolean
        isIdentityDocument:
          description: Flag that indicates if this looks like and ID.
          example: true
          type: boolean
        isPublishedOnline:
          description: If there is an exact match found online.
          example: false
          type: boolean
        issueDate:
          description: The issued date found on the document, null if not found.
          format: date-time
          type: string
        lastName:
          description: The customer last name if it was matched, null otherwise.
          example: Doe
          type: string
        nationality:
          description: The nationality found on the document, null otherwise.
          example: US
          maxLength: 3
          type: string
      type: object
    Ilixium:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              description: Ilixium credentials object.
              properties:
                accountId:
                  description: Ilixium Gateway account ID.
                  type: string
                digestPassword:
                  description: Ilixium Gateway digest password.
                  format: password
                  type: string
                merchantId:
                  description: Ilixium Gateway merchant ID.
                  type: string
              required:
                - merchantId
                - accountId
                - digestPassword
              type: object
            settings:
              description: Ilixium settings object.
              properties:
                platform:
                  default: itix
                  description: Direct API platform.
                  enum:
                    - itix
                    - tpg
                  type: string
                useCreditEndpoint:
                  description: Use previous approval credit endpoint for payouts.
                  type: boolean
                useIpFrame:
                  description: Force Ilixium to process via Ip Frame.
                  type: boolean
                useStandaloneCreditEndpoint:
                  description: Use standalone (token) credit endpoint for payouts.
                  type: boolean
              type: object
            threeDSecureServer:
              $ref: "#/components/schemas/Ilixium3dsServers"
          required:
            - credentials
          type: object
      description: Ilixium Gateway config.
    Ilixium3dsServer:
      allOf:
        - $ref: "#/components/schemas/Ilixium3dsServers"
      description: Ilixium Integrated.
    Ilixium3dsServers:
      description: Ilixium3dsServers 3DS Servers.
      discriminator:
        mapping:
          Ilixium3dsServer: "#/components/schemas/Ilixium3dsServer"
        propertyName: name
      properties:
        name:
          allOf:
            - $ref: "#/components/schemas/ThreeDSecureServerName"
          enum:
            - Ilixium3dsServer
      required:
        - name
      type: object
    Ingenico:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              properties:
                apiKeyId:
                  description: Ingenico Gateway api key ID.
                  type: string
                apiSecretKey:
                  description: Ingenico Gateway api secret key.
                  format: password
                  type: string
                merchantId:
                  description: Ingenico Gateway merchant ID.
                  type: string
                skipFraudService:
                  description: Ingenico skip fraud service.
                  type: boolean
              required:
                - merchantId
                - apiKeyId
                - apiSecretKey
              type: object
            threeDSecureServer:
              $ref: "#/components/schemas/Ingenico3dsServers"
          required:
            - credentials
          type: object
      description: Ingenico Gateway config.
    Ingenico3dsServer:
      allOf:
        - $ref: "#/components/schemas/Ingenico3dsServers"
      description: Ingenico Integrated.
    Ingenico3dsServers:
      description: Ingenico 3DS Servers.
      discriminator:
        mapping:
          Ingenico3dsServer: "#/components/schemas/Ingenico3dsServer"
        propertyName: name
      properties:
        name:
          allOf:
            - $ref: "#/components/schemas/ThreeDSecureServerName"
          enum:
            - Ingenico3dsServer
      required:
        - name
      type: object
    InitialInvoiceEmbed:
      description: Initial Invoice object.
      properties:
        initialInvoice:
          $ref: "#/components/schemas/Invoice"
      readOnly: true
      type: object
    InitialInvoiceLink:
      allOf:
        - $ref: "#/components/schemas/Link"
      properties:
        rel:
          description: The link type.
          enum:
            - initialInvoice
          type: string
      required:
        - rel
      type: object
    Inovio:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              description: Inovio credentials object.
              properties:
                password:
                  description: Inovio password.
                  format: password
                  type: string
                username:
                  description: Inovio username.
                  type: string
              required:
                - username
                - password
              type: object
            settings:
              description: Inovio settings object.
              properties:
                merchantAccountId:
                  description: Inovio merchant account ID.
                  type: string
                productId:
                  description: Inovio product ID.
                  type: string
                websiteId:
                  description: Inovio website ID.
                  type: string
              required:
                - websiteId
                - merchantAccountId
                - productId
              type: object
            threeDSecureServer:
              $ref: "#/components/schemas/Inovio3dsServers"
          required:
            - credentials
            - settings
          type: object
      description: Inovio config.
    Inovio3dsServer:
      allOf:
        - $ref: "#/components/schemas/Inovio3dsServers"
      description: Inovio Integrated.
    Inovio3dsServers:
      description: Inovio 3DS Servers.
      discriminator:
        mapping:
          Inovio3dsServer: "#/components/schemas/Inovio3dsServer"
        propertyName: name
      properties:
        name:
          allOf:
            - $ref: "#/components/schemas/ThreeDSecureServerName"
          enum:
            - Inovio3dsServer
      required:
        - name
      type: object
    InstaDebit:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              description: InstaDebit credentials object.
              properties:
                merchantId:
                  description: InstaDebit merchant account number.
                  type: string
                password:
                  description: InstaDebit merchant account password.
                  format: password
                  type: string
              required:
                - merchantId
                - password
              type: object
          required:
            - credentials
          type: object
      description: InstaDebit config.
    InstrumentReference:
      properties:
        method:
          $ref: "#/components/schemas/PaymentMethod"
        paymentInstrumentId:
          allOf:
            - $ref: "#/components/schemas/ResourceId"
          description: The payment instrument ID.
      required:
        - method
      type: object
    Intuit:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              properties:
                clientId:
                  description: The Intuit client_id key.
                  type: string
                clientSecret:
                  description: The Intuit client_secret key.
                  format: password
                  type: string
              required:
                - clientId
                - clientSecret
              type: object
          required:
            - credentials
          type: object
      description: Intuit Gateway config.
    InvalidError:
      allOf:
        - $ref: "#/components/schemas/Error"
        - $ref: "#/components/schemas/ValidationErrorExtensions"
      description: Invalid data was sent.
    Invoice:
      allOf:
        - $ref: "#/components/schemas/CommonInvoice"
        - required:
            - customerId
        - properties:
            _embedded:
              description: Any embedded objects available that are requested by the `expand`
                querystring parameter.
              items:
                anyOf:
                  - $ref: "#/components/schemas/CustomerEmbed"
                  - $ref: "#/components/schemas/WebsiteEmbed"
                  - $ref: "#/components/schemas/OrganizationEmbed"
                  - $ref: "#/components/schemas/LeadSourceEmbed"
              minItems: 1
              readOnly: true
              type: array
            _links:
              description: The links related to resource.
              items:
                anyOf:
                  - $ref: "#/components/schemas/SelfLink"
                  - $ref: "#/components/schemas/CustomerLink"
                  - $ref: "#/components/schemas/WebsiteLink"
                  - $ref: "#/components/schemas/OrganizationLink"
                  - $ref: "#/components/schemas/LeadSourceLink"
                  - $ref: "#/components/schemas/TransactionAllocationsLink"
                  - $ref: "#/components/schemas/RecalculateInvoiceLink"
                  - $ref: "#/components/schemas/SubscriptionLink"
              minItems: 1
              readOnly: true
              type: array
            customerId:
              allOf:
                - $ref: "#/components/schemas/ResourceId"
              description: The сustomer's ID.
              x-basic: true
            dueReminderNumber:
              description: Number of past due reminder events triggered.
              readOnly: true
              type: integer
            dueReminderTime:
              allOf:
                - $ref: "#/components/schemas/ServerTimestamp"
              description: Time past due reminder event will be triggered.
              nullable: true
            retryInstruction:
              description: The invoice retry instruction.
              properties:
                afterAttemptPolicies:
                  description: The policy on the attempt finishes.
                  items:
                    enum:
                      - change-subscription-renewal-time
                    type: string
                  type: array
                afterRetryEndPolicies:
                  description: The policy on the retry ends.
                  items:
                    enum:
                      - abandon-invoice
                      - cancel-subscription
                    type: string
                  type: array
                attempts:
                  items:
                    properties:
                      scheduleInstruction:
                        $ref: "#/components/schemas/InvoiceRetryScheduleInstruction"
                    required:
                      - scheduleInstruction
                    type: object
                  minItems: 1
                  type: array
              required:
                - attempts
                - afterAttemptPolicies
                - afterRetryEndPolicies
              type: object
            revision:
              description: >
                The number of times the invoice data has been modified.

                The revision is useful when analyzing webhook data to determine if the change takes precedence over the current representation.
              readOnly: true
              type: integer
            transactions:
              description: Invoice transactions array.
              items:
                $ref: "#/components/schemas/Transaction"
              readOnly: true
              type: array
            type:
              description: Invoice type.
              enum:
                - initial
                - renewal
                - interim
                - cancellation
                - one-time
                - refund
                - charge
              readOnly: true
              type: string
    InvoiceDiscount:
      properties:
        amount:
          description: Total amount that was discounted by this Coupon.
          format: double
          type: number
        couponId:
          allOf:
            - $ref: "#/components/schemas/ResourceId"
          description: Coupon's ID.
        description:
          description: Discount description.
          type: string
        redemptionId:
          allOf:
            - $ref: "#/components/schemas/ResourceId"
          description: Redemption ID.
      readOnly: true
      type: object
    InvoiceIssue:
      properties:
        dueTime:
          description: Invoice due time. Will be set same as `issuedTime` if `null` or
            omitted.
          format: date-time
          nullable: true
          type: string
        issuedTime:
          description: Invoice issued time. Will be issued immediately if `null` or omitted.
          format: date-time
          nullable: true
          type: string
      type: object
    InvoiceItem:
      properties:
        _embedded:
          description: Any embedded objects available that are requested by the `expand`
            querystring parameter.
          items:
            anyOf:
              - $ref: "#/components/schemas/ProductEmbed"
              - $ref: "#/components/schemas/PlanEmbed"
          minItems: 1
          readOnly: true
          type: array
        _links:
          description: The links related to resource.
          items:
            anyOf:
              - $ref: "#/components/schemas/SelfLink"
              - $ref: "#/components/schemas/ProductLink"
          minItems: 1
          readOnly: true
          type: array
        createdTime:
          allOf:
            - $ref: "#/components/schemas/ServerTimestamp"
          description: Invoice item created time.
        description:
          description: Invoice item's description.
          type: string
        discountAmount:
          description: Invoice item discount amount.
          format: double
          readOnly: true
          type: number
        id:
          allOf:
            - $ref: "#/components/schemas/ResourceId"
          description: The website identifier string.
          readOnly: true
        periodEndTime:
          description: End time.
          format: date-time
          type: string
        periodNumber:
          description: Invoice item subscription order period number.
          type: integer
        periodStartTime:
          description: Start time.
          format: date-time
          type: string
        price:
          description: Invoice item's total price.
          format: double
          readOnly: true
          type: number
        productId:
          allOf:
            - $ref: "#/components/schemas/ResourceId"
          description: The product's ID.
        quantity:
          description: Invoice item's quantity.
          type: integer
        type:
          description: Invoice item's type.
          enum:
            - debit
            - credit
          type: string
          x-basic: true
        unitPrice:
          description: Invoice item's price.
          format: double
          type: number
        updatedTime:
          allOf:
            - $ref: "#/components/schemas/ServerTimestamp"
          description: Invoice item updated time.
      required:
        - type
        - unitPrice
      type: object
    InvoiceLink:
      allOf:
        - $ref: "#/components/schemas/Link"
      properties:
        rel:
          description: The link type.
          enum:
            - invoice
          type: string
      required:
        - rel
      type: object
    InvoiceReissue:
      properties:
        dueTime:
          description: Invoice due time. Will be set as current date-time if `null` or
            omitted.
          format: date-time
          nullable: true
          type: string
      type: object
    InvoiceRetryScheduleInstruction:
      description: The calculation instruction of scheduled time.
      discriminator:
        mapping:
          date-interval: "#/components/schemas/date-interval"
          day-of-month: "#/components/schemas/day-of-month"
          day-of-week: "#/components/schemas/day-of-week"
          immediately: "#/components/schemas/immediately"
          intelligent: "#/components/schemas/intelligent"
        propertyName: method
      properties:
        method:
          enum:
            - intelligent
            - immediately
            - date-interval
            - day-of-month
            - day-of-week
          type: string
      required:
        - method
      type: object
    InvoiceShipping:
      description: Invoice shipping.
      discriminator:
        mapping:
          manual: "#/components/schemas/manual"
          rebilly: "#/components/schemas/rebilly"
        propertyName: calculator
      properties:
        calculator:
          description: Shipping calculator.
          enum:
            - manual
            - rebilly
          type: string
      required:
        - calculator
      type: object
    InvoiceTax:
      description: Invoice taxes.
      discriminator:
        mapping:
          manual: "#/components/schemas/manual-2"
          rebilly: "#/components/schemas/rebilly-taxjar"
        propertyName: calculator
      properties:
        amount:
          description: A sum of all invoice taxes.
          type: integer
          x-sortable: true
          x-type: Money
        calculator:
          description: Tax calculator.
          enum:
            - manual
            - rebilly-taxjar
          type: string
      required:
        - calculator
      type: object
    InvoiceTaxItem:
      properties:
        amount:
          description: Tax amount.
          format: double
          type: number
        description:
          description: Tax description.
          type: string
      type: object
    InvoiceTimeShift:
      description: >
        The invoice time shift in conjunction with `billingTiming` allows
        to setup different billing use cases such as:

        - Bill immediately when the service period _starts_

        - Bill immediately after the service period _ends_

        - Bill _interval of time_ before the service period _starts_

        - Bill _interval of time_ after the service period _starts_

        - Bill _interval of time_ before the service period _ends_

        - Bill _interval of time_ after the service period _ends_

        It allows to control the billing time.
      properties:
        dueTimeShift:
          $ref: "#/components/schemas/DueTimeShiftInstruction"
        issueTimeShift:
          $ref: "#/components/schemas/IssueTimeShiftInstruction"
      type: object
    InvoiceTimeline:
      properties:
        _links:
          description: The links related to resource.
          items:
            $ref: "#/components/schemas/SelfLink"
          minItems: 1
          readOnly: true
          type: array
        extraData:
          $ref: "#/components/schemas/TimelineExtraData"
        id:
          allOf:
            - $ref: "#/components/schemas/ResourceId"
          description: The Timeline message identifier string.
          readOnly: true
        message:
          description: The message that describes the message details.
          type: string
        occurredTime:
          allOf:
            - $ref: "#/components/schemas/ServerTimestamp"
          description: Timeline message time.
          readOnly: true
        triggeredBy:
          description: Shows who or what triggered the Timeline event.
          enum:
            - rebilly
            - app
            - direct-api
          readOnly: true
          type: string
        type:
          description: Timeline message type.
          enum:
            - timeline-comment-created
            - invoice-created
            - invoice-issued
            - invoice-abandoned
            - invoice-voided
            - invoice-past-due
            - invoice-paid
            - invoice-partially-paid
            - invoice-disputed
            - invoice-refunded
            - invoice-partially-refunded
            - invoice-renewal-payment-declined
            - email-message-sent
            - coupon-applied
            - transaction-approved
            - transaction-abandoned
            - transaction-canceled
            - transaction-declined
            - transaction-initiated
            - transaction-refunded
            - transaction-voided
          readOnly: true
          type: string
      type: object
    InvoiceTransaction:
      properties:
        amount:
          description: >
            Amount which needs to be applied to the invoice. Can't be more than
            the transaction's amount. If omitted, the lesser of the
            transaction's unused amount or the invoice's amount due will be
            used.
          format: double
          type: number
        transactionId:
          description: Transaction to be applied to the invoice.
          type: string
      required:
        - transactionId
      type: object
    InvoiceTransactionAllocation:
      properties:
        _links:
          description: The links related to resource.
          items:
            anyOf:
              - $ref: "#/components/schemas/InvoiceLink"
              - $ref: "#/components/schemas/TransactionLink"
          maxItems: 2
          minItems: 2
          readOnly: true
          type: array
        amount:
          type: number
        currency:
          allOf:
            - $ref: "#/components/schemas/CurrencyCode"
        invoiceId:
          $ref: "#/components/schemas/ResourceId"
        transactionId:
          $ref: "#/components/schemas/ResourceId"
      type: object
    InvoicesEmbed:
      description: Invoices collection.
      properties:
        invoices:
          items:
            $ref: "#/components/schemas/Invoice"
          type: array
      readOnly: true
      type: object
    InvoicesLink:
      allOf:
        - $ref: "#/components/schemas/Link"
      properties:
        rel:
          description: The link type.
          enum:
            - invoices
          type: string
      required:
        - rel
      type: object
    IpayOptions:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              description: Ipay Options credentials object.
              properties:
                rcode:
                  description: Ipay Options rcode.
                  format: password
                  type: string
                sid:
                  description: Ipay Options website ID.
                  type: string
              required:
                - sid
                - rcode
              type: object
            settings:
              description: Ipay Options settings object.
              properties:
                cardType:
                  description: Manually set the card_type for iDEAL.
                  enum:
                    - ideal
                    - idealqr
                    - sofort
                  type: string
                extraStep:
                  description: Show extra step for user to enter their email and DNI number.
                  type: boolean
                platform:
                  description: Platform which IpayOptions will process.
                  enum:
                    - SOAP
                    - TxHandler
                    - SecureHosted
                  type: string
                subdomain:
                  description: Subdomain to use when sending request to IpayOptions.
                  enum:
                    - miglite
                    - w88asiapay
                  type: string
              type: object
          required:
            - credentials
            - settings
          type: object
      description: Ipay Options config.
    IssueTimeShiftInstruction:
      description: >
        The calculation instruction of billing time.

        This is used in conjunction with the **service period anchor** to calculate the time the invoice is issued.
      properties:
        chronology:
          description: The chronology of the billing time relatively to the service period
            start.
          enum:
            - before
          type: string
        duration:
          description: The number of the units.
          minimum: 1
          type: integer
        unit:
          oneOf:
            - $ref: "#/components/schemas/TimeUnit"
            - $ref: "#/components/schemas/TimePluralUnit"
      required:
        - chronology
        - duration
        - unit
      type: object
    JetPay:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              properties:
                TerminalID:
                  description: JetPay Gateway terminal ID.
                  type: string
              required:
                - TerminalID
              type: object
          required:
            - credentials
          type: object
      description: JetPay Gateway config.
    Jeton:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              properties:
                apiKey:
                  description: Jeton apiKey.
                  format: password
                  type: string
              required:
                - apiKey
              type: object
            settings:
              properties:
                method:
                  description: Jeton's method.
                  enum:
                    - CHECKOUT
                    - DIRECT
                    - QR
                    - JETGO
                  type: string
              required:
                - method
              type: object
          required:
            - credentials
          type: object
      description: Jeton Gateway config.
    Khelocard:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              description: Credentials object.
              properties:
                apiKey:
                  description: API key.
                  format: password
                  type: string
                apiSecret:
                  description: API secret.
                  format: password
                  type: string
                merchantId:
                  description: Merchant ID.
                  type: string
                referrer:
                  description: The referrer URL registered on Khelocard.
                  format: uri
                  type: string
              required:
                - merchantId
                - referrer
                - apiKey
                - apiSecret
              type: object
          required:
            - credentials
          type: object
      description: Khelocard config.
    KhelocardCard:
      properties:
        _embedded:
          description: Any embedded objects available that are requested by the `expand`
            querystring parameter.
          items:
            anyOf:
              - $ref: "#/components/schemas/CustomerEmbed"
          minItems: 1
          readOnly: true
          type: array
        _links:
          description: Links related to the resource.
          items:
            anyOf:
              - $ref: "#/components/schemas/SelfLink"
              - $ref: "#/components/schemas/CustomerLink"
          minItems: 1
          readOnly: true
          type: array
        billingAddress:
          allOf:
            - $ref: "#/components/schemas/ContactObject"
          description: The billing address.
        createdTime:
          allOf:
            - $ref: "#/components/schemas/ServerTimestamp"
          description: The payment instrument created time.
        customFields:
          $ref: "#/components/schemas/ResourceCustomFields"
        customerId:
          allOf:
            - $ref: "#/components/schemas/ResourceId"
          description: Customer's ID.
        expMonth:
          description: Khelocard card's expiration month.
          type: integer
        expYear:
          description: Khelocard card's expiration year.
          type: integer
        fingerprint:
          description: A unique value to identify the payment instrument regardless of
            variable values. It contains alphanumeric values.
          type: string
        id:
          allOf:
            - $ref: "#/components/schemas/ResourceId"
          description: The payment instrument ID.
        last4:
          description: The number's last 4 digits.
          type: string
        method:
          description: The method of payment instrument.
          enum:
            - Khelocard
          type: string
        number:
          description: Khelocard card's masked number.
          type: string
        riskMetadata:
          $ref: "#/components/schemas/RiskMetadata"
        status:
          description: The payment instrument status.
          enum:
            - active
            - deactivated
          type: string
        updatedTime:
          allOf:
            - $ref: "#/components/schemas/ServerTimestamp"
          description: The payment instrument updated time.
      title: Khelocard Card
      type: object
    KhelocardCardToken:
      allOf:
        - $ref: "#/components/schemas/CommonPaymentToken"
      properties:
        billingAddress:
          allOf:
            - $ref: "#/components/schemas/ContactObject"
          description: The billing address object.
        method:
          description: The token method.
          enum:
            - Khelocard
          type: string
        paymentInstrument:
          description: The token instrument details.
          properties:
            cvv:
              description: Khelocard card CVV.
              type: string
              writeOnly: true
            expMonth:
              description: Khelocard card expiration month.
              type: integer
            expYear:
              description: Khelocard card expiration year.
              type: integer
            last4:
              description: Khelocard card number's last 4 digits.
              readOnly: true
              type: string
            number:
              description: Khelocard card number.
              type: string
              writeOnly: true
          required:
            - number
            - cvv
            - expYear
            - expMonth
          type: object
      required:
        - method
        - billingAddress
        - paymentInstrument
      title: Khelocard card token
      type: object
    Konnektive:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              description: Credentials object.
              properties:
                loginId:
                  description: Konnektive API login ID.
                  type: string
                password:
                  description: Konnektive API password.
                  format: password
                  type: string
              required:
                - loginId
                - password
              type: object
            settings:
              description: Settings object.
              properties:
                campaignId:
                  description: Konnektive campaign ID for which the order is being placed.
                  type: string
                productId:
                  description: Konnektive campaign product ID for which the order is being placed.
                  type: string
              required:
                - campaignId
                - productId
              type: object
          required:
            - credentials
            - settings
          type: object
      description: Konnektive config.
    KycDocument:
      allOf:
        - $ref: "#/components/schemas/CommonKycDocument"
        - properties:
            customerId:
              allOf:
                - $ref: "#/components/schemas/ResourceId"
              description: The сustomer's ID.
            matchLevel:
              description: The level of strictness for the document matches.
              example: 2
              maximum: 2
              minimum: 1
              type: integer
            notes:
              description: Reviewer notes.
              nullable: true
              type: string
            reason:
              description: Reason for uploading.
              type: string
            reviewTime:
              allOf:
                - $ref: "#/components/schemas/ServerTimestamp"
              description: Date and time of manual review.
              nullable: true
            reviewerId:
              allOf:
                - $ref: "#/components/schemas/ResourceId"
              description: Reviewer's user ID.
              nullable: true
              readOnly: true
              type: string
            reviewerName:
              description: Reviewer's first and last name.
              nullable: true
              readOnly: true
              type: string
    KycDocument-2:
      discriminator:
        mapping:
          address-proof: "#/components/schemas/ProofOfAddress"
          funds-proof: "#/components/schemas/ProofOfFunds"
          identity-proof: "#/components/schemas/ProofOfIdentity"
          purchase-proof: "#/components/schemas/ProofOfPurchase"
        propertyName: documentType
      oneOf:
        - $ref: "#/components/schemas/ProofOfIdentity"
        - $ref: "#/components/schemas/ProofOfAddress"
        - $ref: "#/components/schemas/ProofOfFunds"
        - $ref: "#/components/schemas/ProofOfPurchase"
    KycDocumentLink:
      allOf:
        - $ref: "#/components/schemas/Link"
      properties:
        rel:
          description: The link type.
          enum:
            - kycDocument
          type: string
      required:
        - rel
      type: object
    KycDocumentRejection:
      properties:
        message:
          description: The rejection message.
          example: Provided document is unreadable
          type: string
        type:
          enum:
            - document-unreadable
            - document-expired
            - document-not-matching
            - underage-person
            - other
          type: string
      readOnly: true
      type: object
    KycDocumentSubtypes:
      enum:
        - passport
        - id-card
        - driver-license
        - birth-certificate
        - utility-bill
        - rental-receipt
        - lease-agreement
        - copy-credit-card
        - credit-card-statement
        - bank-statement
        - inheritance-documentation
        - tax-return
        - salary-slip
        - sale-of-assets
        - public-health-card
        - proof-of-age-card
        - reverse-of-id
        - public-service
        - ewallet-holder-details
        - ewallet-transaction-statement
        - other
      type: string
    KycDocumentTypes:
      enum:
        - identity-proof
        - address-proof
        - funds-proof
        - purchase-proof
      type: string
    KycDocumentsLink:
      allOf:
        - $ref: "#/components/schemas/Link"
      properties:
        rel:
          description: The link type.
          enum:
            - kycDocuments
          type: string
      required:
        - rel
      type: object
    KycGathererLink:
      allOf:
        - $ref: "#/components/schemas/Link"
      properties:
        rel:
          description: The link type.
          enum:
            - kycGatherer
          type: string
      required:
        - rel
      type: object
    KycRequest:
      allOf:
        - $ref: "#/components/schemas/CommonKycRequest"
        - properties:
            _links:
              description: The links related to resource.
              items:
                anyOf:
                  - $ref: "#/components/schemas/SelfLink"
                  - $ref: "#/components/schemas/KycDocumentsLink"
                  - $ref: "#/components/schemas/KycGathererLink"
              minItems: 1
              readOnly: true
              type: array
            customerId:
              allOf:
                - $ref: "#/components/schemas/ResourceId"
              description: The сustomer's ID.
            matchLevel:
              description: The level of strictness for the document matches.
              example: 2
              maximum: 2
              minimum: 1
              type: integer
            reason:
              description: Reason for uploading.
              type: string
          required:
            - customerId
    LPG:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              description: LPG credentials object.
              properties:
                payoutPassword:
                  description: LPG payout account password.
                  format: password
                  type: string
                payoutUsername:
                  description: LPG payout account username.
                  format: password
                  type: string
                publicKey:
                  description: LPG public API key.
                  type: string
                secureKey:
                  description: LPG secure API key.
                  format: password
                  type: string
              required:
                - publicKey
                - secureKey
              type: object
          required:
            - credentials
          type: object
      description: LPG config.
    LanguageIsoCode:
      description: Language (two letter ISO 639-1 code).
      example: US
      pattern: "[a-zA-Z]{2}"
      type: string
    LeadSource:
      allOf:
        - $ref: "#/components/schemas/LeadSourceData"
        - properties:
            original:
              allOf:
                - $ref: "#/components/schemas/LeadSourceData"
              readOnly: true
          type: object
    LeadSourceData:
      properties:
        _links:
          description: The links related to resource.
          items:
            anyOf:
              - $ref: "#/components/schemas/SelfLink"
              - $ref: "#/components/schemas/CustomerLink"
          minItems: 1
          readOnly: true
          type: array
        affiliate:
          description: Lead source affiliate (eg 123, Bob Smith).
          type: string
        campaign:
          description: Lead source campaign (eg go-big-123).
          type: string
        clickId:
          description: Lead source click id (may come from an ad server).
          type: string
        content:
          description: Lead source content (eg smiley faces).
          type: string
        createdTime:
          allOf:
            - $ref: "#/components/schemas/ServerTimestamp"
          description: Lead source created time.
        medium:
          description: Lead source medium (eg search, display).
          type: string
        path:
          description: Lead source path url (eg www.example.com/some/landing/path).
          type: string
        referrer:
          description: Lead source [`referer`
            url](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referer)
            as determined (eg www.example.com/some/landing/path).
          type: string
        salesAgent:
          description: Lead source sales agent (eg James Bond).
          type: string
        source:
          description: Lead source origin (eg google, yahoo).
          type: string
        subAffiliate:
          description: Lead source sub-affiliate also called a sub-id or click id in some
            circles (eg 123456).
          type: string
        term:
          description: Lead source term (eg salt shakers).
          type: string
      type: object
    LeadSourceEmbed:
      description: Lead Source object.
      properties:
        leadSource:
          $ref: "#/components/schemas/LeadSource"
      readOnly: true
      type: object
    LeadSourceLink:
      allOf:
        - $ref: "#/components/schemas/Link"
      properties:
        rel:
          description: The link type.
          enum:
            - leadSource
          type: string
      required:
        - rel
      type: object
    Link:
      properties:
        href:
          description: The link URL.
          type: string
      required:
        - href
      type: object
    MiFinity:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              description: MiFinity credentials object.
              properties:
                accountHolderId:
                  type: string
                apiKey:
                  format: password
                  type: string
                mifinityAccountNumber:
                  format: password
                  type: string
              required:
                - apiKey
                - mifinityAccountNumber
                - accountHolderId
              type: object
          required:
            - credentials
          type: object
      description: MiFinity config.
    Moneris:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              properties:
                apiToken:
                  description: Moneris Gateway api token.
                  format: password
                  type: string
                storeId:
                  description: Moneris Gateway store ID.
                  type: string
              required:
                - storeId
                - apiToken
              type: object
          required:
            - credentials
          type: object
      description: Moneris Gateway config.
    Money:
      properties:
        amount:
          $ref: "#/components/schemas/MoneyAmount"
        currency:
          $ref: "#/components/schemas/CurrencyCode"
      required:
        - amount
        - currency
      type: object
    MoneyAmount:
      example: 10
      format: double
      type: number
      x-type: Money
    MtaPay:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              properties:
                accountId:
                  description: MTA Pay Gateway account ID.
                  type: string
                md5key:
                  description: MTA Pay Gateway md5key.
                  format: password
                  type: string
                partyId:
                  description: MTA Pay Gateway party ID.
                  type: string
              required:
                - accountId
                - partyId
                - md5key
              type: object
            settings:
              description: MTA Pay settings object.
              properties:
                goods:
                  description: MTA Pay Gateway goods.
                  type: string
                mobilePay:
                  description: MTA Pay Gateway mobile pay param.
                  type: string
              required:
                - mobilePay
                - goods
              type: object
          required:
            - credentials
            - settings
          type: object
      description: MTA Pay Gateway config.
    MuchBetter:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              description: MuchBetter credentials object.
              properties:
                apiKey:
                  description: MuchBetter api key.
                  format: password
                  type: string
                merchantAccountId:
                  description: MuchBetter merchant account ID.
                  type: string
              required:
                - merchantAccountId
                - apiKey
              type: object
            settings:
              description: MuchBetter settings object.
              properties:
                brandName:
                  description: MuchBetter brand name used for reporting and logo.
                  type: string
                hasPhoneNumberRequest:
                  default: false
                  description: Request phone number before submitting the request to MuchBetter.
                  type: boolean
              type: object
          required:
            - credentials
          type: object
      description: MuchBetter config.
    MyFatoorah:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              description: MyFatoorah credentials object.
              properties:
                apiKey:
                  description: MyFatoorah api key.
                  format: password
                  type: string
              required:
                - apiKey
              type: object
          required:
            - credentials
          type: object
      description: MyFatoorah config.
    NGenius:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              description: NGenius credentials object.
              properties:
                apiKey:
                  description: NGenius API key.
                  format: password
                  type: string
                outletId:
                  description: NGenius outlet ID.
                  type: string
              required:
                - outletId
                - apiKey
              type: object
            threeDSecureServer:
              $ref: "#/components/schemas/NGenius3dsServers"
          required:
            - credentials
          type: object
      description: NGenius config.
    NGenius3dsServer:
      allOf:
        - $ref: "#/components/schemas/NGenius3dsServers"
      description: NGenius Integrated.
    NGenius3dsServers:
      description: NGenius 3DS Servers.
      discriminator:
        mapping:
          NGenius3dsServer: "#/components/schemas/NGenius3dsServer"
        propertyName: name
      properties:
        name:
          allOf:
            - $ref: "#/components/schemas/ThreeDSecureServerName"
          enum:
            - NGenius3dsServer
      required:
        - name
      type: object
    NMI:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              properties:
                password:
                  description: NMI Gateway store ID.
                  format: password
                  type: string
                username:
                  description: NMI Gateway api token.
                  type: string
              required:
                - username
                - password
              type: object
            settings:
              properties:
                disableStoredCredentials:
                  default: false
                  description: Disable NMI Stored Credentials (CIT/MIT).
                  type: boolean
              type: object
            threeDSecureServer:
              $ref: "#/components/schemas/NMI3dsServers"
          required:
            - credentials
          type: object
      description: NMI Gateway config.
    NMI3dsServers:
      description: NMI 3DS Servers.
      discriminator:
        mapping:
          Other: "#/components/schemas/Other"
          Paay3dsServer: "#/components/schemas/Paay3dsServer"
        propertyName: name
      properties:
        name:
          allOf:
            - $ref: "#/components/schemas/ThreeDSecureServerName"
          enum:
            - Paay3dsServer
            - Other
      required:
        - name
      type: object
    Neosurf:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              description: Neosurf credentials object.
              properties:
                merchantId:
                  description: Neosurf merchant ID.
                  type: string
                secretKey:
                  description: Neosurf API secret key.
                  format: password
                  type: string
              required:
                - merchantId
                - secretKey
              type: object
          required:
            - credentials
          type: object
      description: Neosurf config.
    Netbanking:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              description: Netbanking credentials object.
              properties:
                midcode:
                  description: Netbanking MID code.
                  type: string
                midsecret:
                  description: Netbanking MID secret key.
                  format: password
                  type: string
              required:
                - midcode
                - midsecret
              type: object
          required:
            - credentials
          type: object
      description: Netbanking config.
    Neteller:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              description: Neteller credentials object.
              properties:
                paysafePaymentsApiPassword:
                  description: Neteller App Paysafe Payments API Password for a private key.
                  format: password
                  type: string
                paysafePaymentsApiUsername:
                  description: Neteller App Paysafe Payments API Username for a private key.
                  type: string
              required:
                - paysafePaymentsApiUsername
                - paysafePaymentsApiPassword
              type: object
            settings:
              properties:
                populateCustomerEmail:
                  description: Populate customer email for payment.
                  type: boolean
              type: object
          required:
            - credentials
          type: object
      description: Neteller Gateway config.
    NinjaWallet:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              description: NinjaWallet credentials object.
              properties:
                apiKey:
                  description: NinjaWallet api key.
                  format: password
                  type: string
                passphrase:
                  description: NinjaWallet passphrase.
                  format: password
                  type: string
                secret:
                  description: NinjaWallet secret.
                  format: password
                  type: string
              required:
                - apiKey
                - secret
                - passphrase
              type: object
          required:
            - credentials
          type: object
      description: NinjaWallet config.
    NuaPay:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              description: NuaPay credentials object.
              properties:
                nuaPayAccountId:
                  description: NuaPay account ID.
                  type: string
                nuaPayApiKey:
                  description: NuaPay api key.
                  format: password
                  type: string
                nuaPayCommonName:
                  description: NuaPay common name.
                  type: string
                nuaPayOriginatorIban:
                  description: NuaPay origiantor IBAN.
                  format: password
                  type: string
                nuaPayPrivateKey:
                  description: NuaPay private key.
                  format: password
                  type: string
                  x-multiline: true
                nuaPaySerialNumber:
                  description: NuaPay serial number.
                  type: string
              required:
                - nuaPayCommonName
                - nuaPaySerialNumber
                - nuaPayAccountId
                - nuaPayOriginatorIban
                - nuaPayApiKey
                - nuaPayPrivateKey
              type: object
          required:
            - credentials
          type: object
      description: NuaPay Gateway config.
    OchaPay:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              properties:
                apiPassword:
                  description: OchaPay Gateway api password.
                  format: password
                  type: string
                apiUsername:
                  description: OchaPay Gateway username.
                  type: string
                secretWord:
                  description: OchaPay Gateway secret word.
                  format: password
                  type: string
              required:
                - apiUsername
                - apiPassword
                - secretWord
              type: object
          required:
            - credentials
          type: object
      description: OchaPay Gateway config.
    OnBoardingUrlLink:
      allOf:
        - $ref: "#/components/schemas/Link"
      properties:
        rel:
          description: The link type.
          enum:
            - onBoardingUrl
          type: string
      required:
        - rel
      type: object
    OnRamp:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              description: OnRamp credentials object.
              properties:
                apiKey:
                  format: password
                  type: string
              required:
                - apiKey
              type: object
          required:
            - credentials
          type: object
      description: OnRamp config.
    OneTimeOrder:
      allOf:
        - $ref: "#/components/schemas/CommonOneTimeOrder"
        - properties:
            customerId:
              allOf:
                - $ref: "#/components/schemas/ResourceId"
              description: The customer identifier string.
              x-basic: true
        - $ref: "#/components/schemas/SubscriptionMetadata"
      required:
        - orderType
        - customerId
        - websiteId
        - items
      type: object
    Onlineueberweisen:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              description: Onlineueberweisen credentials object.
              properties:
                apiKey:
                  description: Onlineueberweisen API Key.
                  format: password
                  type: string
                nuaPayAccountId:
                  description: NuaPay account ID for reconciliation.
                  type: string
                nuaPayApiKey:
                  description: NuaPay API Key for reconciliation.
                  format: password
                  type: string
              required:
                - apiKey
              type: object
            settings:
              description: Onlineueberweisen settings object.
              properties:
                payformCode:
                  default: default
                  description: Onlineueberweisen payform code to use customized Payform template.
                  type: string
              type: object
          required:
            - credentials
            - settings
          type: object
      description: Onlineueberweisen config.
    OrderTimeline:
      properties:
        _links:
          description: The links related to resource.
          items:
            $ref: "#/components/schemas/SelfLink"
          minItems: 1
          readOnly: true
          type: array
        extraData:
          $ref: "#/components/schemas/TimelineExtraData"
        id:
          allOf:
            - $ref: "#/components/schemas/ResourceId"
          description: The Timeline message identifier string.
          readOnly: true
        message:
          description: The message that describes the message details.
          type: string
        occurredTime:
          allOf:
            - $ref: "#/components/schemas/ServerTimestamp"
          description: Timeline message time.
          readOnly: true
        triggeredBy:
          description: Shows who or what triggered the Timeline message.
          enum:
            - rebilly
            - app
            - direct-api
          readOnly: true
          type: string
        type:
          description: Timeline message type.
          enum:
            - timeline-comment-created
            - order-renewed
            - order-activated
            - order-completed
            - order-reactivated
            - order-canceled
            - order-upgraded
            - order-downgraded
            - order-billing-address-changed
            - order-delivery-address-changed
            - order-renewal-time-changed
            - order-churned
            - order-custom-fields-changed
            - order-items-changed
            - order-billing-anchor-changed
            - order-recurring-interval-changed
            - order-risk-metadata-changed
            - order-paid-early
            - order-quantity-changed
            - email-message-sent
            - coupon-applied
            - invoice-created
            - invoice-issued
            - invoice-abandoned
            - invoice-voided
            - invoice-past-due
            - invoice-paid
            - invoice-partially-paid
            - invoice-disputed
            - invoice-refunded
            - invoice-partially-refunded
            - invoice-renewal-payment-declined
          readOnly: true
          type: string
      type: object
    Organization:
      properties:
        _links:
          description: The links related to resource.
          items:
            $ref: "#/components/schemas/SelfLink"
          minItems: 1
          readOnly: true
          type: array
        address:
          description: The organization street address.
          maxLength: 60
          type: string
        address2:
          description: The organization street address.
          maxLength: 60
          type: string
        city:
          description: The organization city.
          maxLength: 45
          type: string
        country:
          description: The organization country ISO Alpha-2 code.
          pattern: ^[A-Z]{2}$
          type: string
        createdTime:
          allOf:
            - $ref: "#/components/schemas/ServerTimestamp"
          description: The organization created time.
        emails:
          $ref: "#/components/schemas/ContactEmails"
        id:
          allOf:
            - $ref: "#/components/schemas/ResourceId"
          description: The organization identifier string.
          readOnly: true
        invoiceTimeZone:
          description: Invoice will use this time zone to display time otherwise UTC will
            be used. Example "America/New_York".
          maxLength: 50
          type: string
        isPrimary:
          description: True, if Organization is primary (available to set as true only,
            other organizations will become as isPrimary=false).
          type: boolean
        name:
          description: The organization name.
          maxLength: 60
          type: string
        phoneNumbers:
          $ref: "#/components/schemas/ContactPhoneNumbers"
        postalCode:
          description: The organization postal code.
          maxLength: 10
          type: string
        questionnaire:
          $ref: "#/components/schemas/OrganizationQuestionnaire"
        region:
          description: The organization region (state).
          maxLength: 45
          type: string
        taxDescriptor:
          description: The organization's tax label. This will be displayed on the invoice.
          maxLength: 255
          type: string
        updatedTime:
          allOf:
            - $ref: "#/components/schemas/ServerTimestamp"
          description: The organization updated time.
      required:
        - name
        - country
      type: object
    OrganizationEmbed:
      description: Organization object.
      properties:
        organization:
          $ref: "#/components/schemas/Organization"
      readOnly: true
      type: object
    OrganizationLink:
      allOf:
        - $ref: "#/components/schemas/Link"
      properties:
        rel:
          description: The link type.
          enum:
            - organization
          type: string
      required:
        - rel
      type: object
    OrganizationQuestionnaire:
      properties:
        integrationType:
          description: What kind of integration organization looks for.
          type: string
        launchTiming:
          description: Desired time to go live.
          type: string
        monthlyTransactions:
          description: The amount of monthly processed transaction.
          type: string
        products:
          description: The list of products organization is interested in.
          items:
            type: string
          type: array
        role:
          description: The role of the owner.
          type: string
      type: object
    Other:
      allOf:
        - $ref: "#/components/schemas/A1Gateway3dsServers"
        - $ref: "#/components/schemas/eMerchantPay3dsServers"
        - $ref: "#/components/schemas/GET3dsServers"
        - $ref: "#/components/schemas/NMI3dsServers"
        - $ref: "#/components/schemas/Payvision3dsServers"
        - $ref: "#/components/schemas/VantivLitle3dsServers"
        - $ref: "#/components/schemas/Walpay3dsServers"
        - $ref: "#/components/schemas/Worldpay3dsServers"
      description: Other.
    Paay3dsServer:
      allOf:
        - $ref: "#/components/schemas/A1Gateway3dsServers"
        - $ref: "#/components/schemas/eMerchantPay3dsServers"
        - $ref: "#/components/schemas/GET3dsServers"
        - $ref: "#/components/schemas/NMI3dsServers"
        - $ref: "#/components/schemas/Payvision3dsServers"
        - $ref: "#/components/schemas/VantivLitle3dsServers"
        - $ref: "#/components/schemas/Walpay3dsServers"
        - $ref: "#/components/schemas/Worldpay3dsServers"
        - properties:
            apiKey:
              description: Paay ApiKey.
              type: string
            mpiUrl:
              description: Paay 3DS Server url.
              type: string
            sandboxMpiUrl:
              description: Paay sandbox 3DS Server url.
              type: string
            secret:
              description: Paay secret.
              format: password
              type: string
          required:
            - apiKey
            - secret
            - mpiUrl
            - sandboxMpiUrl
          type: object
      description: Paay.
    Pagsmile:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              properties:
                appId:
                  description: Pagsmile app ID.
                  type: string
                merchantId:
                  description: Pagsmile merchant ID.
                  type: string
                secretKey:
                  description: Pagsmile secret key.
                  format: password
                  type: string
              required:
                - merchantId
                - appId
                - secretKey
              type: object
          required:
            - credentials
          type: object
      description: Pagsmile Gateway config.
    Panamerican:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              description: Panamerican credentials object.
              properties:
                key:
                  description: Panamerican's key.
                  type: string
                password:
                  description: Panamerican's Password.
                  format: password
                  type: string
              required:
                - key
                - password
              type: object
            settings:
              description: Panamerican settings object.
              properties:
                convertToAscii:
                  description: Will convert all chars to ascii.
                  type: boolean
                extraStep:
                  description: Show extra step for user to enter their ID number.
                  type: boolean
              required:
                - extraStep
              type: object
            threeDSecureServer:
              $ref: "#/components/schemas/Panamerican3dsServers"
          required:
            - credentials
            - settings
          type: object
      description: Panamerican config.
    Panamerican3dsServer:
      allOf:
        - $ref: "#/components/schemas/Panamerican3dsServers"
      description: Panamerican Integrated.
    Panamerican3dsServers:
      description: Panamerican 3DS Servers.
      discriminator:
        mapping:
          Panamerican3dsServer: "#/components/schemas/Panamerican3dsServer"
        propertyName: name
      properties:
        name:
          allOf:
            - $ref: "#/components/schemas/ThreeDSecureServerName"
          enum:
            - Panamerican3dsServer
      required:
        - name
      type: object
    PandaGateway:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              properties:
                apiCode:
                  description: Panda Gateway api code.
                  type: string
                merchantCode:
                  description: Panda Gateway merchant code.
                  type: string
                signKey:
                  description: Panda Gateway sign key.
                  format: password
                  type: string
              required:
                - merchantCode
                - apiCode
                - signKey
              type: object
          required:
            - credentials
          type: object
      description: Panda Gateway config.
    ParamountEft:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              description: Paramount credentials object.
              properties:
                merchant_id:
                  description: Merchant account ID.
                  type: string
                merchant_pass:
                  description: Merchant account password.
                  format: password
                  type: string
                payee:
                  description: Merchant name/descriptor.
                  type: string
              required:
                - merchant_id
                - merchant_pass
                - payee
              type: object
          required:
            - credentials
          type: object
      description: Paramount config.
    ParamountInterac:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              description: ParamountInterac credentials object.
              properties:
                encryptionKey:
                  description: ParamountInterac encryption key.
                  format: password
                  type: string
                merchantId:
                  description: ParamountInterac merchant ID.
                  type: string
                password:
                  description: ParamountInterac password for query.
                  format: password
                  type: string
              required:
                - merchantId
                - encryptionKey
                - password
              type: object
            settings:
              properties:
                sandbox:
                  default: false
                  description: True if gateway account is in sandbox mode.
                  type: boolean
              required:
                - sandbox
              type: object
          required:
            - credentials
          type: object
      description: ParamountInterac config.
    ParentTransactionEmbed:
      description: Retried Transaction object.
      properties:
        parentTransaction:
          $ref: "#/components/schemas/Transaction"
      readOnly: true
      type: object
    ParentTransactionLink:
      allOf:
        - $ref: "#/components/schemas/Link"
      properties:
        rel:
          description: The link type.
          enum:
            - parentTransaction
          type: string
      required:
        - rel
      type: object
    Pay4Fun:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              description: Pay4Fun credentials object.
              properties:
                merchantId:
                  description: Pay4Fun merchant ID.
                  type: string
                merchantKey:
                  description: Pay4Fun merchant key.
                  format: password
                  type: string
                merchantSecret:
                  description: Pay4Fun merchant secret.
                  format: password
                  type: string
              required:
                - merchantId
                - merchantSecret
                - merchantKey
              type: object
          required:
            - credentials
          type: object
      description: Pay4Fun config.
    PayCash:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              description: PayCash credentials object.
              properties:
                emisor:
                  description: Identify of the company.
                  type: string
                token:
                  description: Token.
                  format: password
                  type: string
              required:
                - emisor
                - token
              type: object
          required:
            - credentials
          type: object
      description: PayCash config.
    PayClub:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              description: PayClub credentials object.
              properties:
                accountNumber:
                  type: string
                merchantId:
                  type: string
                signKey:
                  format: password
                  type: string
              required:
                - apiKey
                - accountNumber
                - signKey
              type: object
            settings:
              properties:
                use3DSChannel:
                  description: Use 3DS channel.
                  type: boolean
              type: object
          required:
            - credentials
          type: object
      description: PayClub config.
    PayPal:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            settings:
              description: PayPal settings object.
              properties:
                enableGuestCheckout:
                  default: false
                  description: Allow users without PayPal accounts to pay using credit or debit
                    cards.
                  type: boolean
                redirectUrl:
                  description: The URL where the user will be redirected after authorizing the
                    account on PayPal.
                  format: url
                  type: string
              required:
                - redirectUrl
              type: object
          required:
            - settings
          type: object
      description: PayPal Gateway config.
    PayPalAccount:
      allOf:
        - $ref: "#/components/schemas/CommonPayPalAccount"
        - properties:
            _embedded:
              description: Any embedded objects available that are requested by the `expand`
                querystring parameter.
              items:
                anyOf:
                  - $ref: "#/components/schemas/AuthTransactionEmbed"
                  - $ref: "#/components/schemas/CustomerEmbed"
              minItems: 1
              readOnly: true
              type: array
            _links:
              description: The links related to resource.
              items:
                anyOf:
                  - $ref: "#/components/schemas/SelfLink"
                  - $ref: "#/components/schemas/CustomerLink"
                  - $ref: "#/components/schemas/AuthTransactionLink"
                  - $ref: "#/components/schemas/ApprovalUrlLink"
              minItems: 1
              readOnly: true
              type: array
    PayTabs:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              description: PayTabs credentials object.
              properties:
                clientKey:
                  type: string
                profileId:
                  type: string
                serverKey:
                  format: password
                  type: string
              required:
                - profileId
                - clientKey
                - serverKey
              type: object
          required:
            - credentials
          type: object
      description: PayTabs config.
    PayULatam:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              description: PayULatam credentials object.
              properties:
                accountId:
                  description: PayULatam account id.
                  type: string
                apiKey:
                  description: PayULatam API key.
                  format: password
                  type: string
                apiLogin:
                  description: PayULatam API login.
                  type: string
                merchantId:
                  description: PayULatam merchant id.
                  type: string
              required:
                - merchantId
                - accountId
                - apiLogin
                - apiKey
              type: object
          required:
            - credentials
          type: object
      description: PayULatam config.
    Payeezy:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              properties:
                apiKey:
                  description: API Key.
                  type: string
                apiSecret:
                  description: API Secret.
                  format: password
                  type: string
                merchantId:
                  description: Payeezy Merchant ID.
                  type: string
                merchantToken:
                  description: Merchant Token.
                  format: password
                  type: string
              required:
                - merchantId
                - merchantToken
                - apiKey
                - apiSecret
              type: object
          required:
            - credentials
          type: object
      description: Payeezy Gateway config.
    Payflow:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              description: Payflow credentials object.
              properties:
                password:
                  description: The password you defined while registering for the account.
                  format: password
                  type: string
                user:
                  description: If you set up one or more additional users on the account, this
                    value is the ID of the user authorized to process
                    transactions. If, however, you have not set up additional
                    users, USER has the same value as VENDOR.
                  type: string
                vendor:
                  description: Your merchant login ID created when you registered for the account.
                  type: string
              required:
                - user
                - vendor
                - password
              type: object
          required:
            - credentials
          type: object
      description: Payflow config.
    PaymenTechnologies:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              properties:
                apiKey:
                  description: PaymenTechnologies API key required for query operations.
                  format: password
                  type: string
                authenticateId:
                  description: PaymenTechnologies Gateway authenticate ID.
                  type: string
                authenticatePw:
                  description: PaymenTechnologies Gateway authenticate password.
                  format: password
                  type: string
                publicKey:
                  description: PaymenTechnologies Gateway API public key.
                  type: string
                secretKey:
                  description: PaymenTechnologies Gateway API secret key.
                  format: password
                  type: string
              required:
                - authenticateId
                - authenticatePw
                - publicKey
                - secretKey
                - apiKey
              type: object
            settings:
              properties:
                use3DSEndpoint:
                  description: Use 3DS endpoint.
                  type: boolean
              type: object
          required:
            - credentials
          type: object
      description: PaymenTechnologies Gateway config.
    PaymentAsia:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              description: PaymentAsia credentials object.
              properties:
                apiKey:
                  format: password
                  type: string
              required:
                - apiKey
              type: object
          required:
            - credentials
          type: object
      description: PaymentAsia config.
    PaymentCard:
      allOf:
        - $ref: "#/components/schemas/CommonPaymentCard"
        - properties:
            _embedded:
              description: Any embedded objects available that are requested by the `expand`
                querystring parameter.
              items:
                anyOf:
                  - $ref: "#/components/schemas/AuthTransactionEmbed"
                  - $ref: "#/components/schemas/CustomerEmbed"
              minItems: 1
              readOnly: true
              type: array
            _links:
              description: The links related to resource.
              items:
                anyOf:
                  - $ref: "#/components/schemas/SelfLink"
                  - $ref: "#/components/schemas/CustomerLink"
                  - $ref: "#/components/schemas/AuthTransactionLink"
                  - $ref: "#/components/schemas/ApprovalUrlLink"
              minItems: 1
              readOnly: true
              type: array
            expirationReminderNumber:
              description: Number of expiration reminder events triggered.
              readOnly: true
              type: integer
            expirationReminderTime:
              allOf:
                - $ref: "#/components/schemas/ServerTimestamp"
              description: Time expiration reminder event will be triggered.
              nullable: true
            stickyGatewayAccountId:
              description: Default gateway account ID used for transactions.
              readOnly: true
              type: string
    PaymentCardBrand:
      description: Payment Card brand.
      enum:
        - Visa
        - MasterCard
        - American Express
        - Discover
        - Maestro
        - Solo
        - Electron
        - JCB
        - Voyager
        - Diners Club
        - Switch
        - Laser
        - China UnionPay
        - AstroPay Card
      type: string
    PaymentCardCreatePlain:
      properties:
        billingAddress:
          allOf:
            - $ref: "#/components/schemas/ContactObject"
          description: The billing address.
        customFields:
          $ref: "#/components/schemas/ResourceCustomFields"
        customerId:
          allOf:
            - $ref: "#/components/schemas/ResourceId"
          description: The Customer's ID.
        cvv:
          description: Card's cvv (card verification value).
          type: string
          writeOnly: true
        expMonth:
          description: Card's expiration month.
          type: integer
        expYear:
          description: Card's expiration year.
          type: integer
        method:
          description: The method of payment instrument.
          enum:
            - payment-card
          type: string
        pan:
          description: The card PAN (Primary Account Number).
          type: string
          writeOnly: true
        riskMetadata:
          $ref: "#/components/schemas/RiskMetadata"
      required:
        - method
        - customerId
        - pan
        - expYear
        - expMonth
        - billingAddress
      type: object
    PaymentCardCreateToken:
      properties:
        customFields:
          $ref: "#/components/schemas/ResourceCustomFields"
        customerId:
          allOf:
            - $ref: "#/components/schemas/ResourceId"
          description: The Customer's ID.
        token:
          description: PaymentCardToken ID.
          type: string
      required:
        - customerId
        - token
      type: object
    PaymentCardDigitalWalletFeature:
      properties:
        name:
          description: The feature name.
          enum:
            - Google Pay
            - Apple Pay
          type: string
      title: Digital Wallet
      type: object
    PaymentCardEmbed:
      description: Payment Card object.
      properties:
        paymentCard:
          $ref: "#/components/schemas/PaymentCard"
      readOnly: true
      type: object
    PaymentCardLink:
      allOf:
        - $ref: "#/components/schemas/Link"
      properties:
        rel:
          description: The link type.
          enum:
            - paymentCard
          type: string
      required:
        - rel
      type: object
    PaymentCardToken:
      allOf:
        - $ref: "#/components/schemas/CommonPaymentToken"
      properties:
        billingAddress:
          allOf:
            - $ref: "#/components/schemas/ContactObject"
          description: The billing address object.
        method:
          description: The token payment method.
          enum:
            - payment-card
          type: string
        paymentInstrument:
          description: The payment card instrument details.
          properties:
            bin:
              description: Payment Card BIN (the PAN's first 6 digits).
              format: bin
              readOnly: true
              type: string
            brand:
              allOf:
                - $ref: "#/components/schemas/PaymentCardBrand"
              readOnly: true
            cvv:
              description: Payment Card CVV/CVC.
              type: string
              writeOnly: true
            expMonth:
              description: Payment Card expiration month.
              type: integer
            expYear:
              description: Payment Card expiration year.
              type: integer
            last4:
              description: Payment Card PAN's last 4 digits.
              readOnly: true
              type: string
            pan:
              description: Payment Card PAN (Primary Account Number).
              type: string
              writeOnly: true
          type: object
      required:
        - method
        - paymentInstrument
      title: Payment Card Token
      type: object
    PaymentCardUpdatePlain:
      properties:
        billingAddress:
          allOf:
            - $ref: "#/components/schemas/ContactObject"
          description: The billing address.
        customFields:
          $ref: "#/components/schemas/ResourceCustomFields"
        cvv:
          description: Card's cvv (card verification value).
          type: string
        expMonth:
          description: Card's expiration month.
          type: integer
        expYear:
          description: Card's expiration year.
          type: integer
        stickyGatewayAccountId:
          allOf:
            - $ref: "#/components/schemas/ResourceId"
          description: Sticky gateway account ID.
      type: object
    PaymentInstruction:
      oneOf:
        - $ref: "#/components/schemas/PaymentToken"
        - $ref: "#/components/schemas/PaymentInstrument-3"
        - $ref: "#/components/schemas/PaymentMethods"
    PaymentInstrument:
      oneOf:
        - $ref: "#/components/schemas/VaultedInstrument"
        - $ref: "#/components/schemas/AlternativePaymentInstrument"
        - $ref: "#/components/schemas/CashInstrument"
        - $ref: "#/components/schemas/CheckInstrument"
      type: object
    PaymentInstrument-2:
      oneOf:
        - $ref: "#/components/schemas/PaymentCard"
        - $ref: "#/components/schemas/BankAccount"
        - $ref: "#/components/schemas/PayPalAccount"
        - $ref: "#/components/schemas/KhelocardCard"
        - $ref: "#/components/schemas/AlternativePaymentInstrument-2"
    PaymentInstrument-3:
      properties:
        paymentInstrumentId:
          allOf:
            - $ref: "#/components/schemas/ResourceId"
          description: The Payment Instrument identifier string.
      required:
        - paymentInstrumentId
      title: Payment Instrument
      type: object
    PaymentInstrumentCreateToken:
      properties:
        customFields:
          $ref: "#/components/schemas/ResourceCustomFields"
        customerId:
          allOf:
            - $ref: "#/components/schemas/ResourceId"
          description: The customer's ID.
        token:
          description: Payment token ID.
          type: string
      required:
        - customerId
        - token
      type: object
    PaymentInstrumentUpdateToken:
      properties:
        billingAddress:
          allOf:
            - $ref: "#/components/schemas/ContactObject"
          description: The billing address (if supplied – overrides billing address from
            token).
        customFields:
          $ref: "#/components/schemas/ResourceCustomFields"
        token:
          description: Payment token ID.
          type: string
      type: object
    PaymentMethod:
      description: The payment method.
      enum:
        - payment-card
        - ach
        - cash
        - check
        - paypal
        - AdvCash
        - Airpay
        - Alfa-click
        - Alipay
        - Apple Pay
        - AstroPay Card
        - AstroPay-GO
        - bank-transfer
        - bank-transfer-2
        - bank-transfer-3
        - bank-transfer-4
        - bank-transfer-5
        - bank-transfer-6
        - bank-transfer-7
        - bank-transfer-8
        - bank-transfer-9
        - Beeline
        - Belfius-direct-net
        - bitcoin
        - Boleto
        - Boleto-2
        - Boleto-3
        - cash-deposit
        - CASHlib
        - CashToCode
        - CCAvenue
        - China UnionPay
        - CODVoucher
        - Conekta-oxxo
        - Conekta-spei
        - cryptocurrency
        - Cupon-de-pagos
        - CyberSource
        - domestic-cards
        - echeck
        - ecoPayz
        - ecoVoucher
        - EPS
        - ePay.bg
        - Ethereum
        - e-wallet
        - ezyEFT
        - eZeeWallet
        - Flexepin
        - Giropay
        - Google Pay
        - Gpaysafe
        - iDebit
        - iDEAL
        - ING-homepay
        - INOVAPAY-pin
        - INOVAPAY-wallet
        - InstaDebit
        - instant-bank-transfer
        - Interac-online
        - Interac-eTransfer
        - Interac-express-connect
        - Interac
        - invoice
        - iWallet
        - Jeton
        - jpay
        - Khelocard
        - Klarna
        - Litecoin
        - loonie
        - LPG-online
        - LPG-payment-card
        - Megafon
        - MiFinity-eWallet
        - miscellaneous
        - Bancontact
        - MTS
        - MuchBetter
        - MyFatoorah
        - Neosurf
        - Netbanking
        - Neteller
        - Nordea-Solo
        - OchaPay
        - online-bank-transfer
        - Onlineueberweisen
        - oriental-wallet
        - OXXO
        - Pagsmile-lottery
        - Pagsmile-deposit-express
        - PayCash
        - Payeer
        - PaymentAsia-crypto
        - Paysafecard
        - PayTabs
        - Pay4Fun
        - Paymero
        - Paymero-QR
        - PayULatam
        - Perfect-money
        - Piastrix
        - PIX
        - PinPay
        - phone
        - PhonePe
        - POLi
        - PostFinance-card
        - PostFinance-e-finance
        - Przelewy24
        - QIWI
        - QQPay
        - Resurs
        - SEPA
        - Siirto
        - Skrill
        - Skrill Rapid Transfer
        - SMSVoucher
        - Sofort
        - SparkPay
        - swift-dbt
        - Tele2
        - Terminaly-RF
        - Tether
        - ToditoCash-card
        - Trustly
        - TWINT
        - UniCrypt
        - UPayCard
        - UPI
        - VCreditos
        - VenusPoint
        - voucher
        - voucher-2
        - voucher-3
        - voucher-4
        - Webmoney
        - Webpay
        - Webpay-2
        - Webpay Card
        - WeChat Pay
        - XPay-P2P
        - XPay-QR
        - Yandex-money
        - Zotapay
        - Zimpler
      type: string
    PaymentMethods:
      properties:
        methods:
          description: >
            The list of available payment methods.

            Only payment methods with at least one active gateway account are allowed.


            If not specified all available payment methods will be displayed.


            Customer can choose any of those as well as the payment instrument for them.

            Additional steps will occur via a redirect to `approvalUrl`.
          items:
            $ref: "#/components/schemas/PaymentMethod"
          type: array
      title: Payment Methods
      type: object
    PaymentRetry:
      properties:
        afterAttemptPolicy:
          description: The policy on the attempt finishes.
          enum:
            - none
            - change-subscription-renewal-time
          type: string
        afterRetryEndPolicy:
          description: The policy on the retry ends.
          enum:
            - none
            - cancel-subscription
          type: string
        attempts:
          items:
            properties:
              paymentInstruction:
                $ref: "#/components/schemas/AmountAdjustment"
              scheduleInstruction:
                $ref: "#/components/schemas/CommonScheduleInstruction"
            required:
              - scheduleInstruction
              - paymentInstruction
            type: object
          minItems: 1
          type: array
      required:
        - attempts
        - afterAttemptPolicy
        - afterRetryEndPolicy
      type: object
    PaymentToken:
      properties:
        token:
          description: Payment Token ID.
          type: string
      required:
        - token
      title: Payment Token
      type: object
    PaymentsOS:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              properties:
                appId:
                  type: string
                privateKey:
                  format: password
                  type: string
              required:
                - appId
                - privateKey
              type: object
          required:
            - credentials
          type: object
      description: PaymentsOS config.
    Paymero:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              description: Paymero credentials object.
              properties:
                apiKey:
                  description: Paymero API key.
                  format: password
                  type: string
              required:
                - apiKey
              type: object
            settings:
              description: Paymero settings object.
              properties:
                amountExceeded:
                  default: false
                  description: Decline transactions when the amount received exceeds the amount
                    requested.
                  type: boolean
                mainCurrency:
                  description: This will be the blockchain on which currency runs.
                  enum:
                    - TRX
                    - ETH
                  type: string
                targetCurrency:
                  description: This will be the currency to which you want to auto-convert the
                    received cryptocurrency in to.
                  example: USD
                  maxLength: 3
                  minLength: 3
                  type: string
              type: object
          required:
            - credentials
          type: object
      description: Paymero config.
    PayoutRequest:
      allOf:
        - $ref: "#/components/schemas/CommonTransactionRequest"
    Payr:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              properties:
                apiSecurityToken:
                  description: Hash of the password for the Alliance API (transaction reporting).
                  format: password
                  type: string
                apiUserId:
                  description: Username for the Alliance API (transaction reporting).
                  type: string
                clientId:
                  description: Payr Gateway client ID.
                  type: string
                secretWord:
                  description: Payr Gateway secret word.
                  format: password
                  type: string
              required:
                - clientId
                - secretWord
              type: object
          required:
            - credentials
          type: object
      description: Payr Gateway config.
    Paysafe:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              properties:
                accountNum:
                  description: Paysafe Gateway account number.
                  type: string
                storeId:
                  description: Paysafe Gateway store ID.
                  type: string
                storePwd:
                  description: Paysafe Gateway store password.
                  format: password
                  type: string
              required:
                - storeId
                - storePwd
                - accountNum
              type: object
            threeDSecureServer:
              $ref: "#/components/schemas/Paysafe3dsServers"
          required:
            - credentials
          type: object
      description: Paysafe Gateway config.
    Paysafe3dsServer:
      allOf:
        - $ref: "#/components/schemas/Paysafe3dsServers"
      description: Paysafe Integrated.
    Paysafe3dsServers:
      description: Paysafe 3DS Servers.
      discriminator:
        mapping:
          Paysafe3dsServer: "#/components/schemas/Paysafe3dsServer"
        propertyName: name
      properties:
        name:
          allOf:
            - $ref: "#/components/schemas/ThreeDSecureServerName"
          enum:
            - Paysafe3dsServer
      required:
        - name
      type: object
    Paysafecash:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              properties:
                apiKey:
                  description: Paysafecash API key.
                  format: password
                  type: string
              required:
                - apiKey
              type: object
          required:
            - credentials
          type: object
      description: Paysafecash Gateway config.
    Payvision:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              properties:
                memberGuid:
                  description: Payvision Gateway member guid.
                  format: password
                  type: string
                memberId:
                  description: Payvision Gateway member id.
                  type: string
              required:
                - memberId
                - memberGuid
              type: object
            settings:
              description: Payvision settings object.
              properties:
                avs:
                  description: Payvision Gateway avs.
                  type: boolean
                delay:
                  description: Payvision Gateway delay.
                  type: integer
                merchantAccountType:
                  description: Payvision merchant account type.
                  type: integer
              required:
                - merchantAccountType
              type: object
            threeDSecureServer:
              $ref: "#/components/schemas/Payvision3dsServers"
          required:
            - credentials
          type: object
      description: Payvision Gateway config.
    Payvision3dsServer:
      allOf:
        - $ref: "#/components/schemas/Payvision3dsServers"
      description: Payvision Integrated.
    Payvision3dsServers:
      description: Payvision 3DS Servers.
      discriminator:
        mapping:
          CardinalCommerce3dsServer: "#/components/schemas/CardinalCommerce3dsServer"
          Other: "#/components/schemas/Other"
          Paay3dsServer: "#/components/schemas/Paay3dsServer"
          Payvision3dsServer: "#/components/schemas/Payvision3dsServer"
          ThreeDSecureIO3dsServer: "#/components/schemas/ThreeDSecureIO3dsServer"
        propertyName: name
      properties:
        name:
          allOf:
            - $ref: "#/components/schemas/ThreeDSecureServerName"
          enum:
            - Payvision3dsServer
            - Payvision3ds2Server
            - CardinalCommerce3dsServer
            - Paay3dsServer
            - ThreeDSecureIO3dsServer
            - Other
      required:
        - name
      type: object
    PermalinkLink:
      allOf:
        - $ref: "#/components/schemas/Link"
      properties:
        rel:
          description: The link type.
          enum:
            - permalink
          type: string
      required:
        - rel
      type: object
    Piastrix:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              description: Piastrix credentials object.
              properties:
                secretKey:
                  description: Secret Key.
                  format: password
                  type: string
                shopId:
                  description: Shop ID.
                  type: string
              required:
                - shopId
                - secretKey
              type: object
            settings:
              description: Piastrix settings object.
              properties:
                tolerancePercentage:
                  description: Tolerance percentage for settled amount.
                  example: 5
                  maximum: 5
                  minimum: 0
                  type: integer
              type: object
            threeDSecureServer:
              $ref: "#/components/schemas/Piastrix3dsServers"
          required:
            - credentials
          type: object
      description: Piastrix config.
    Piastrix3dsServer:
      allOf:
        - $ref: "#/components/schemas/Piastrix3dsServers"
      description: Piastrix Integrated.
    Piastrix3dsServers:
      description: Piastrix 3DS Servers.
      discriminator:
        mapping:
          Piastrix3dsServer: "#/components/schemas/Piastrix3dsServer"
        propertyName: name
      properties:
        name:
          allOf:
            - $ref: "#/components/schemas/ThreeDSecureServerName"
          enum:
            - Piastrix3dsServer
      required:
        - name
      type: object
    PlaidAccountToken:
      allOf:
        - $ref: "#/components/schemas/CommonPaymentToken"
      properties:
        billingAddress:
          allOf:
            - $ref: "#/components/schemas/ContactObject"
          description: The billing address object.
        method:
          description: The token method.
          enum:
            - plaid-account
          type: string
        paymentInstrument:
          description: The Plaid payment instrument details.
          properties:
            accountId:
              description: The Plaid account ID.
              type: string
            credentialHash:
              allOf:
                - $ref: "#/components/schemas/ResourceId"
              description: The Plaid credentials hash.
            publicToken:
              description: The Plaid public token.
              type: string
          required:
            - credentialHash
            - publicToken
            - accountId
          type: object
      required:
        - method
        - billingAddress
        - paymentInstrument
      title: Plaid Account Token
      type: object
    Plan:
      allOf:
        - $ref: "#/components/schemas/CommonPlan"
        - properties:
            _links:
              description: The links related to resource.
              items:
                $ref: "#/components/schemas/SelfLink"
              minItems: 1
              readOnly: true
              type: array
            invoiceTimeShift:
              allOf:
                - $ref: "#/components/schemas/InvoiceTimeShift"
              description: You can shift issue time and due time of invoices for this plan.
    PlanBillingTiming:
      default: prepaid
      description: >
        The billing timing in relation to the service period.

        For `prepaid` plans the customer pays when the service period starts,

        whereas, for `postpaid` plans, the customer pays when the service period ends.
      enum:
        - prepaid
        - postpaid
      type: string
    PlanEmbed:
      description: Plan object.
      properties:
        plan:
          $ref: "#/components/schemas/Plan"
      readOnly: true
      type: object
    PlanPeriod:
      properties:
        length:
          description: The length of time.
          type: integer
        unit:
          description: The unit of time.
          enum:
            - day
            - week
            - month
            - year
          type: string
      required:
        - unit
        - length
      type: object
    PlanPriceFormula:
      discriminator:
        mapping:
          fixed-fee: "#/components/schemas/fixed-fee"
          flat-rate: "#/components/schemas/flat-rate"
          stairstep: "#/components/schemas/stairstep"
          tiered: "#/components/schemas/tiered"
          volume: "#/components/schemas/volume"
        propertyName: formula
      properties:
        formula:
          description: >
            The price formula determines what algorithm is used to calculate
            the invoice price based on a few factors,

            - the quantity in the order (which may be variable if usage pricing, otherwise determined when creating the order)

            - the price brackets data


            To determine which formula is correct, please see the price formula documentation.
          enum:
            - fixed-fee
            - flat-rate
            - stairstep
            - tiered
            - volume
          type: string
      required:
        - formula
      type: object
    Plugnpay:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              properties:
                publisher-name:
                  description: Plugnpay Gateway member id.
                  type: string
                publisher-password:
                  description: Plugnpay Gateway avs.
                  format: password
                  type: string
              required:
                - publisher-name
                - publisher-password
              type: object
          required:
            - credentials
          type: object
      description: Plugnpay Gateway config.
    PostFinance:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              description: PostFinance credentials object.
              properties:
                keyPassphrase:
                  format: password
                  type: string
                merchantId:
                  type: string
                privateKey:
                  format: password
                  type: string
                  x-multiline: true
                pspId:
                  type: string
                publicKey:
                  type: string
                  x-multiline: true
                sftpKeyPassphrase:
                  format: password
                  type: string
                sftpPrivateKey:
                  format: password
                  type: string
                  x-multiline: true
                sftpUsername:
                  type: string
              required:
                - pspId
                - merchantId
                - sftpUsername
                - publicKey
                - privateKey
                - keyPassphrase
                - sftpPrivateKey
                - sftpKeyPassphrase
              type: object
          required:
            - credentials
          type: object
      description: PostFinance config.
    PriceBasedShippingRate:
      properties:
        _links:
          description: The links related to resource.
          items:
            $ref: "#/components/schemas/SelfLink"
          minItems: 1
          readOnly: true
          type: array
        currency:
          allOf:
            - $ref: "#/components/schemas/CurrencyCode"
        maxOrderSubtotal:
          description: Maximum order subtotal for which this shipping rate is applicable
            (NULL if no maximum).
          format: double
          type: number
        minOrderSubtotal:
          default: 0
          description: Minimum order subtotal for which this shipping rate is applicable,
            defaults to 0.00.
          format: double
          type: number
        name:
          description: The shipping rate name.
          maxLength: 255
          type: string
        price:
          description: The shipping price - 0 is a valid value (for free).
          format: double
          type: number
      required:
        - name
        - currency
        - price
      type: object
    Problem:
      allOf:
        - $ref: "#/components/schemas/DocumentedProblem"
        - $ref: "#/components/schemas/DetailedProblem"
      type: object
    Product:
      allOf:
        - $ref: "#/components/schemas/CommonProduct"
        - properties:
            _links:
              description: The links related to resource.
              items:
                $ref: "#/components/schemas/SelfLink"
              minItems: 1
              readOnly: true
              type: array
            accountingCode:
              description: The product accounting code.
              example: "4010"
              type: string
            taxCategoryId:
              description: The product's tax category identifier string.
              enum:
                - "00000"
                - "99999"
                - "20010"
                - "40030"
                - "51020"
                - "51010"
                - "31000"
                - "30070"
              type: string
    ProductEmbed:
      description: Product object.
      properties:
        product:
          $ref: "#/components/schemas/Product"
      readOnly: true
      type: object
    ProductLink:
      allOf:
        - $ref: "#/components/schemas/Link"
      properties:
        rel:
          description: The link type.
          enum:
            - product
          type: string
      required:
        - rel
      type: object
    ProofOfAddress:
      allOf:
        - $ref: "#/components/schemas/KycDocument"
        - properties:
            _links:
              description: The links related to resource.
              items:
                anyOf:
                  - $ref: "#/components/schemas/SelfLink"
                  - $ref: "#/components/schemas/FileLink"
                  - $ref: "#/components/schemas/CustomerLink"
              minItems: 3
              readOnly: true
              type: array
            documentMatches:
              properties:
                data:
                  $ref: "#/components/schemas/AddressMatches"
                score:
                  description: The calculated score that represents the % of confidence that this
                    proof of address represents the given customer.
                  example: 0.75
                  format: double
                  type: number
              readOnly: true
              type: object
            parsedData:
              properties:
                data:
                  $ref: "#/components/schemas/AddressMatches"
                score:
                  description: The calculated score that represents the % of confidence that this
                    proof of address represents the given customer.
                  example: 0.75
                  format: double
                  type: number
              readOnly: true
              type: object
    ProofOfFunds:
      allOf:
        - $ref: "#/components/schemas/KycDocument"
    ProofOfIdentity:
      allOf:
        - $ref: "#/components/schemas/KycDocument"
        - properties:
            _links:
              description: The links related to resource.
              items:
                anyOf:
                  - $ref: "#/components/schemas/SelfLink"
                  - $ref: "#/components/schemas/FileLink"
                  - $ref: "#/components/schemas/CustomerLink"
              minItems: 3
              readOnly: true
              type: array
            documentMatches:
              properties:
                data:
                  $ref: "#/components/schemas/IdentityMatches"
                score:
                  description: The calculated score that represents the % of confidence that this
                    ID represents the given customer.
                  example: 0.75
                  format: double
                  type: number
              readOnly: true
              type: object
            parsedData:
              properties:
                data:
                  $ref: "#/components/schemas/IdentityMatches"
                score:
                  description: The calculated score that represents the % of confidence that this
                    ID represents the given customer.
                  example: 0.75
                  format: double
                  type: number
              readOnly: true
              type: object
    ProofOfPurchase:
      allOf:
        - $ref: "#/components/schemas/KycDocument"
    Prosa:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              description: Prosa credentials object.
              properties:
                accessToken:
                  description: Access token.
                  format: password
                  type: string
                entityId:
                  description: Entity ID.
                  type: string
              required:
                - entityId
                - accessToken
              type: object
          required:
            - credentials
          type: object
      description: Prosa config.
    PurchaseBumpOffer:
      properties:
        bumpAmount:
          allOf:
            - $ref: "#/components/schemas/MoneyAmount"
          description: Bump amount.
        bumpAmountInUsd:
          allOf:
            - $ref: "#/components/schemas/MoneyAmount"
          description: Bump amount in USD.
          readOnly: true
        customFields:
          $ref: "#/components/schemas/ResourceCustomFields"
        offerId:
          description: Offer ID.
          type: string
        offerType:
          description: Offer Type.
          example: bonus
          type: string
      required:
        - offerId
        - offerType
        - bumpAmount
      type: object
    PurchaseBumpOfferList:
      items:
        $ref: "#/components/schemas/PurchaseBumpOffer"
      minItems: 1
      type: array
    PurchaseBumpSplitVersionName:
      description: The name of bump offer version, useful to make split tests.
      type: string
    PurchaseBumpStatus:
      description: Bump offer status.
      enum:
        - presented
        - rejected
        - selected
        - unknown
      type: string
    QueryUrlLink:
      allOf:
        - $ref: "#/components/schemas/Link"
      properties:
        rel:
          description: The link type.
          enum:
            - queryUrl
          type: string
      required:
        - rel
      type: object
    RPN:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              properties:
                key:
                  description: RPN Key.
                  format: password
                  type: string
                mid:
                  description: RPN MID.
                  type: string
              required:
                - mid
                - key
              type: object
          required:
            - credentials
          type: object
      description: RPN Gateway config.
    Rapyd:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              description: Rapyd credentials object.
              properties:
                accessKey:
                  type: string
                secretKey:
                  format: password
                  type: string
              required:
                - accessKey
                - secretKey
              type: object
          required:
            - credentials
          type: object
      description: Rapyd config.
    ReadyToPay:
      oneOf:
        - $ref: "#/components/schemas/ReadyToPayAmount"
        - $ref: "#/components/schemas/ReadyToPayItems"
      properties:
        billingAddress:
          allOf:
            - $ref: "#/components/schemas/ContactObject"
          description: The billing address.
          writeOnly: true
        riskMetadata:
          $ref: "#/components/schemas/RiskMetadata"
        websiteId:
          allOf:
            - $ref: "#/components/schemas/ResourceId"
          description: The website identifier string.
      required:
        - websiteId
        - riskMetadata
      type: object
    ReadyToPayAchMethod:
      properties:
        feature:
          description: >
            The specific feature (eg. digital wallet or a processor) of this
            method. If method doesn't have any features – will be null.
          nullable: true
          oneOf:
            - $ref: "#/components/schemas/AchPlaidFeature"
          type: object
        filters:
          description: >
            For the method to be applicable any of the following filters should
            match.

            If no filters sent – no restrictions applied. This follows our standard filter format.
          items:
            type: string
          type: array
        method:
          description: The payment method.
          enum:
            - ach
          type: string
      required:
        - method
      title: ACH
      type: object
    ReadyToPayAmount:
      properties:
        amount:
          description: The amount.
          format: double
          type: number
        currency:
          $ref: "#/components/schemas/CurrencyCode"
      required:
        - currency
        - amount
      title: With amount
      type: object
    ReadyToPayGenericMethod:
      properties:
        filters:
          description: >
            For the method to be applicable any of the following filters should
            match.

            If no filters sent – no restrictions applied. This follows our standard filter format.
          items:
            type: string
          type: array
        method:
          allOf:
            - $ref: "#/components/schemas/AlternativePaymentMethods"
          description: The payment method.
      required:
        - method
      title: Generic
      type: object
    ReadyToPayItems:
      properties:
        items:
          items:
            properties:
              planId:
                allOf:
                  - $ref: "#/components/schemas/ResourceId"
                description: The plan identifier string.
              quantity:
                description: Number of units of the product on the given plan.
                type: integer
            required:
              - planId
              - quantity
            type: object
          minItems: 1
          type: array
      required:
        - items
      title: With items
      type: object
    ReadyToPayMethods:
      example:
        - brands:
            - Visa
            - MasterCard
          feature:
            name: Google Pay
          filters:
            - brand:Visa,MasterCard;bin:!411111
          method: payment-card
        - feature:
            expirationTime: 2006-01-02T15:04:05Z
            linkToken: some-random-link_token-for-plaid
            name: Plaid
          method: ach
        - brands:
            - Visa
          feature: null
          filters:
            - brand:Visa;bin:411111,444433
          method: payment-card
        - feature:
            $ref: "#/components/schemas/ReadyToPayMethods/example/2/feature"
          filters: []
          method: ach
        - filters: []
          method: paypal
        - filters: []
          method: Skrill
      items:
        oneOf:
          - $ref: "#/components/schemas/ReadyToPayPaymentCardMethod"
          - $ref: "#/components/schemas/ReadyToPayAchMethod"
          - $ref: "#/components/schemas/ReadyToPayGenericMethod"
      type: array
    ReadyToPayPaymentCardMethod:
      properties:
        brands:
          description: The list of supported brands.
          items:
            $ref: "#/components/schemas/PaymentCardBrand"
          minItems: 1
          type: array
        feature:
          description: >
            The specific feature (eg. digital wallet or a processor) of this
            method. If method doesn't have any features – will be null.
          nullable: true
          oneOf:
            - $ref: "#/components/schemas/PaymentCardDigitalWalletFeature"
          type: object
        filters:
          description: >
            For the method to be applicable any of the following filters should
            match.

            If no filters sent – no restrictions applied. This follows our standard filter format.
          items:
            type: string
          type: array
        method:
          description: The payment method.
          enum:
            - payment-card
          type: string
      required:
        - method
      title: Payment Card
      type: object
    Realex:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              properties:
                account:
                  description: Realex Gateway account.
                  type: string
                merchantId:
                  description: Realex Gateway merchant id.
                  type: string
                rebatePassword:
                  description: Realex Gateway rebate password.
                  format: password
                  type: string
                secretKey:
                  description: Realex Gateway secret key.
                  format: password
                  type: string
              required:
                - merchantId
                - secretKey
                - rebatePassword
                - account
              type: object
          required:
            - credentials
          type: object
      description: Realex Gateway config.
    Realtime:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              properties:
                clientId:
                  description: Realtime Gateway client ID.
                  type: string
                secretWord:
                  description: Realtime Gateway secret word.
                  format: password
                  type: string
              required:
                - clientId
                - secretWord
              type: object
          required:
            - credentials
          type: object
      description: Realtime Gateway config.
    RecalculateInvoiceLink:
      allOf:
        - $ref: "#/components/schemas/Link"
      properties:
        rel:
          description: The link type.
          enum:
            - recalculateInvoice
          type: string
      required:
        - rel
      type: object
    RecentInvoiceEmbed:
      description: Recent Invoice object.
      properties:
        recentInvoice:
          $ref: "#/components/schemas/Invoice"
      readOnly: true
      type: object
    RecentInvoiceLink:
      allOf:
        - $ref: "#/components/schemas/Link"
      properties:
        rel:
          description: The link type.
          enum:
            - recentInvoice
          type: string
      required:
        - rel
      type: object
    RedemptionRestriction:
      description: Redemption restrictions.
      discriminator:
        mapping:
          discounts-per-redemption: "#/components/schemas/discounts-per-redemption"
          minimum-order-amount: "#/components/schemas/minimum-order-amount"
          paid-by-time: "#/components/schemas/paid-by-time"
          restrict-to-invoices: "#/components/schemas/restrict-to-invoices"
          restrict-to-plans: "#/components/schemas/restrict-to-plans"
          restrict-to-products: "#/components/schemas/restrict-to-products"
          restrict-to-subscriptions: "#/components/schemas/restrict-to-subscriptions"
        propertyName: type
      properties:
        type:
          description: Redemption's additional restriction type.
          enum:
            - discounts-per-redemption
            - minimum-order-amount
            - restrict-to-invoices
            - restrict-to-plans
            - restrict-to-subscriptions
            - restrict-to-products
            - paid-by-time
          type: string
      required:
        - type
      type: object
    Redsys:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              properties:
                merchantCode:
                  description: Redsys Gateway merchant code.
                  format: password
                  type: string
                secretCode:
                  description: Redsys Gateway secret code.
                  format: password
                  type: string
              required:
                - merchantCode
                - secretCode
              type: object
          required:
            - credentials
          type: object
      description: Redsys Gateway config.
    RefundUrlLink:
      allOf:
        - $ref: "#/components/schemas/Link"
      properties:
        rel:
          description: The link type.
          enum:
            - refundUrl
          type: string
      required:
        - rel
      type: object
    ResetPasswordToken:
      properties:
        _links:
          description: The links related to resource.
          items:
            $ref: "#/components/schemas/SelfLink"
          minItems: 1
          readOnly: true
          type: array
        credentialId:
          description: Token's credential ID.
          readOnly: true
          type: string
        expiredTime:
          description: Password expired time.
          format: date-time
          type: string
        token:
          description: The token's identifier string.
          readOnly: true
          type: string
        username:
          description: The token's username.
          type: string
      required:
        - username
        - password
      type: object
    ResourceCustomFields:
      default: {}
      description: >
        Custom Fields list as a map `{"custom field name": "custom field
        value", ...}`. The format must follow the saved format (see Custom
        Fields section for the formats).
      example:
        foo: bar
      type: object
    ResourceId:
      description: The resource ID. Defaults to UUID v4.
      example: 4f6cf35x-2c4y-483z-a0a9-158621f77a21
      maxLength: 50
      type: string
    RetriedTransactionEmbed:
      description: Parent Transaction object.
      properties:
        retriedTransaction:
          $ref: "#/components/schemas/Transaction"
      readOnly: true
      type: object
    RetriedTransactionLink:
      allOf:
        - $ref: "#/components/schemas/Link"
      properties:
        rel:
          description: The link type.
          enum:
            - retriedTransaction
          type: string
      required:
        - rel
      type: object
    RiskMetadata:
      description: Risk metadata used for 3DS and risk scoring.
      properties:
        accuracyRadius:
          description: Accuracy radius for specified ipAddress (kilometers).
          readOnly: true
          type: integer
        browserData:
          $ref: "#/components/schemas/BrowserData"
        city:
          description: City for specified ipAddress.
          example: New York
          readOnly: true
          type: string
        country:
          description: Country ISO Alpha-2 code for specified ipAddress.
          example: US
          maxLength: 2
          readOnly: true
          type: string
        deviceVelocity:
          description: Number of transactions for this device (based on fingerprint) in
            the last 24 hours.
          readOnly: true
          type: integer
        distance:
          description: Distance between IP Address and Billing Address geolocation
            (kilometers).
          readOnly: true
          type: integer
        fingerprint:
          description: The fingerprint.
          example: pIUt3xbgX3l9g3YDiLbx
          maxLength: 50
          type: string
        hasMismatchedBankCountry:
          description: True if the bank country and geo-IP address are not the same.
          readOnly: true
          type: boolean
        hasMismatchedBillingAddressCountry:
          description: True if the billing address country and geo-IP address are not the
            same.
          readOnly: true
          type: boolean
        hasMismatchedHolderName:
          description: True if the customer's name from billing address and from
            customer's primary address are not the same.
          readOnly: true
          type: boolean
        hasMismatchedTimeZone:
          description: True if the browser time zone and IP address associated time zone
            are not the same.
          readOnly: true
          type: boolean
        httpHeaders:
          $ref: "#/components/schemas/HttpHeaders"
        ipAddress:
          description: The customer's IP.
          example: 93.92.91.90
          format: ipv4 or ipv6
          type: string
        isHosting:
          description: True if customer's ip address is related to hosting.
          readOnly: true
          type: boolean
        isProxy:
          description: True if customer's ip address is related to proxy.
          readOnly: true
          type: boolean
        isTor:
          description: True if customer's ip address is related to TOR.
          readOnly: true
          type: boolean
        isVpn:
          description: True if customer's ip address is related to VPN.
          readOnly: true
          type: boolean
        isp:
          description: Internet Service Provider name, if available.
          readOnly: true
          type: string
        latitude:
          description: Latitude for specified ipAddress.
          format: double
          readOnly: true
          type: number
        longitude:
          description: Longitude for specified ipAddress.
          format: double
          readOnly: true
          type: number
        paymentInstrumentVelocity:
          description: Number of transactions for this payment instrument (based on
            fingerprint) in the last 24 hours.
          readOnly: true
          type: integer
        postalCode:
          description: Postal code for specified ipAddress.
          maxLength: 10
          readOnly: true
          type: string
        region:
          description: Region for specified ipAddress.
          example: NY
          readOnly: true
          type: string
        score:
          description: Risk score computed per all the factors.
          readOnly: true
          type: integer
        timeZone:
          description: Time zone for specified ipAddress.
          example: America/New_York
          readOnly: true
          type: string
        vpnServiceName:
          description: VPN service name, if available.
          readOnly: true
          type: string
      title: Risk metadata
      type: object
    Rotessa:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              description: Rotessa credentials object.
              properties:
                apiKey:
                  description: Rotessa api key.
                  format: password
                  type: string
              required:
                - apiKey
              type: object
            settings:
              description: Rotessa settings object.
              properties:
                delay:
                  description: Rotessa Gateway time delay for them to process transaction.
                  type: integer
              required:
                - delay
              type: object
          required:
            - credentials
            - settings
          type: object
      description: Rotessa config.
    SMSVoucher:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              properties:
                AppId:
                  description: SMSVoucher AppId.
                  type: string
              required:
                - AppId
              type: object
          required:
            - credentials
          type: object
      description: SMSVoucher Gateway config.
    Sagepay:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              properties:
                M_ID:
                  description: Sagepay Gateway merchant ID.
                  type: string
                M_KEY:
                  description: Sagepay Gateway merchant key.
                  format: password
                  type: string
              required:
                - M_ID
                - M_KEY
              type: object
          required:
            - credentials
          type: object
      description: Sagepay Gateway config.
    SaltarPay:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              description: SaltarPay credentials object.
              properties:
                apiKey:
                  description: SaltarPay API key.
                  format: password
                  type: string
                secretKey:
                  description: SaltarPay secret key.
                  format: password
                  type: string
              required:
                - apiKey
                - secretKey
              type: object
          required:
            - credentials
          type: object
      description: SaltarPay config.
    SeamlessChex:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              description: SeamlessChex credentials object.
              properties:
                publicKey:
                  description: SeamlessChex publishable key.
                  type: string
                secretKey:
                  description: SeamlessChex secret key.
                  format: password
                  type: string
              required:
                - publicKey
                - secretKey
              type: object
          required:
            - credentials
          type: object
      description: SeamlessChex config.
    Search:
      properties:
        customers:
          description: List of returned customers.
          items:
            allOf:
              - $ref: "#/components/schemas/Customer"
          readOnly: true
          type: array
        invoices:
          description: List of returned invoices.
          items:
            allOf:
              - $ref: "#/components/schemas/Invoice"
          readOnly: true
          type: array
        orders:
          description: List of returned orders.
          items:
            allOf:
              - $ref: "#/components/schemas/Subscription"
          readOnly: true
          type: array
        searched:
          description: Names of searched resources, even if they returned nothing.
          items:
            type: string
          readOnly: true
          type: array
        transactions:
          description: List of returned transactions.
          items:
            allOf:
              - $ref: "#/components/schemas/Transaction"
          readOnly: true
          type: array
      type: object
    SecureTrading:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              description: SecureTrading credentials object.
              properties:
                password:
                  description: SecureTrading web service password.
                  format: password
                  type: string
                username:
                  description: SecureTrading web service username.
                  type: string
                websiteId:
                  description: Website ID.
                  type: string
              required:
                - websiteId
                - username
                - password
              type: object
            threeDSecureServer:
              $ref: "#/components/schemas/SecureTrading3dsServers"
          required:
            - credentials
          type: object
      description: SecureTrading config.
    SecureTrading3dsServer:
      allOf:
        - $ref: "#/components/schemas/SecureTrading3dsServers"
      description: SecureTrading 3DS Server.
    SecureTrading3dsServers:
      description: SecureTrading 3DS Servers.
      discriminator:
        mapping:
          SecureTrading3dsServer: "#/components/schemas/SecureTrading3dsServer"
        propertyName: name
      properties:
        name:
          allOf:
            - $ref: "#/components/schemas/ThreeDSecureServerName"
          enum:
            - SecureTrading3dsServer
      required:
        - name
      type: object
    SecurionPay:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              description: SecurionPay credentials object.
              properties:
                secretApiKey:
                  format: password
                  type: string
              required:
                - secretApiKey
              type: object
            threeDSecureServer:
              $ref: "#/components/schemas/SecurionPay3dsServers"
          required:
            - credentials
          type: object
      description: SecurionPay config.
    SecurionPay3dsServers:
      description: SecurionPay 3DS Servers.
      discriminator:
        mapping:
          ThreeDSecureIO3dsServer: "#/components/schemas/ThreeDSecureIO3dsServer"
        propertyName: name
      properties:
        name:
          allOf:
            - $ref: "#/components/schemas/ThreeDSecureServerName"
          enum:
            - ThreeDSecureIO3dsServer
      required:
        - name
      type: object
    SelfLink:
      allOf:
        - $ref: "#/components/schemas/Link"
      properties:
        rel:
          description: The link type.
          enum:
            - self
          type: string
      required:
        - rel
      type: object
    ServerTimestamp:
      description: Read-only timestamp, automatically assigned on back-end.
      format: date-time
      readOnly: true
      type: string
    ServicePeriodAnchorInstruction:
      default:
        method: immediately
      description: >
        Instruction for calculating the service period anchor.

        This is used in conjunction with the **subscription start** to calculate the time the service period starts and ends.
      discriminator:
        mapping:
          day-of-month: "#/components/schemas/day-of-month"
          day-of-week: "#/components/schemas/day-of-week"
          immediately: "#/components/schemas/immediately"
        propertyName: method
      properties:
        method:
          default: immediately
          enum:
            - immediately
            - day-of-month
            - day-of-week
          type: string
      required:
        - method
      type: object
    ShippingZone:
      properties:
        _links:
          description: The links related to resource.
          items:
            $ref: "#/components/schemas/SelfLink"
          minItems: 1
          readOnly: true
          type: array
        countries:
          description: >
            Countries covered by the shipping zone. A country can only belong
            to one shipping zone (no overlapping).

            This property can be empty or null to create a default shipping zone for countries that were not specified in other zones.
          items:
            description: Country ISO Alpha-2 code.
            pattern: ^[A-Z]{2}$
            type: string
          type: array
        createdTime:
          allOf:
            - $ref: "#/components/schemas/ServerTimestamp"
          description: The shipping zone created time.
        id:
          allOf:
            - $ref: "#/components/schemas/ResourceId"
          description: The shipping zone identifier string.
          readOnly: true
        isDefault:
          description: Is this Shipping Zone default.
          readOnly: true
        name:
          description: The shipping zone name.
          maxLength: 255
          type: string
        rates:
          description: Price-based shipping rate instructions.
          items:
            allOf:
              - $ref: "#/components/schemas/PriceBasedShippingRate"
            description: Price based shipping rate instruction.
          type: array
        updatedTime:
          allOf:
            - $ref: "#/components/schemas/ServerTimestamp"
          description: The shipping zone updated time.
      required:
        - name
      type: object
    SignedLinkLink:
      allOf:
        - $ref: "#/components/schemas/Link"
      properties:
        rel:
          description: The link type.
          enum:
            - signedLink
          type: string
      required:
        - rel
      type: object
    Skrill:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              description: Skrill credentials object.
              properties:
                accountEmail:
                  description: Email address of your Skrill merchant account.
                  type: string
                mqiPassword:
                  description: Password used during MQI/API requests.
                  format: password
                  type: string
                secretWord:
                  description: Secret word used for MD5 signature verifications.
                  format: password
                  type: string
              required:
                - accountEmail
                - secretWord
              type: object
          required:
            - credentials
          type: object
      description: Skrill config.
    SmartInvoice:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              description: SmartInvoice credentials object.
              properties:
                applicationId:
                  description: SmartInvoice application UID.
                  format: password
                  type: string
                merchantId:
                  description: SmartInvoice merchant account UID.
                  type: string
              required:
                - merchantId
                - applicationId
              type: object
            threeDSecureServer:
              $ref: "#/components/schemas/SmartInvoice3dsServers"
          required:
            - credentials
          type: object
      description: SmartInvoice config.
    SmartInvoice3dsServer:
      allOf:
        - $ref: "#/components/schemas/SmartInvoice3dsServers"
      description: SmartInvoice Integrated.
    SmartInvoice3dsServers:
      description: SmartInvoice 3DS Servers.
      discriminator:
        mapping:
          SmartInvoice3dsServer: "#/components/schemas/SmartInvoice3dsServer"
        propertyName: name
      properties:
        name:
          allOf:
            - $ref: "#/components/schemas/ThreeDSecureServerName"
          enum:
            - SmartInvoice3dsServer
      required:
        - name
      type: object
    Sofort:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              description: Sofort credentials object.
              properties:
                configKey:
                  description: Sofort configuration key.
                  format: password
                  type: string
                nuaPayAccountId:
                  description: NuaPay account ID for reconciliation.
                  type: string
                nuaPayApiKey:
                  description: NuaPay API Key for reconciliation.
                  format: password
                  type: string
              required:
                - configKey
              type: object
          required:
            - credentials
          type: object
      description: Sofort config.
    SparkPay:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              description: SparkPay credentials object.
              properties:
                secretKey:
                  description: SparkPay secret key.
                  format: password
                  type: string
                shopId:
                  description: SparkPay shop ID.
                  type: string
              required:
                - shopId
                - secretKey
              type: object
          required:
            - credentials
          type: object
      description: SparkPay config.
    StaticGateway:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - type: object
      description: StaticGateway Gateway config.
    StaticIpnLink:
      allOf:
        - $ref: "#/components/schemas/Link"
      properties:
        rel:
          description: The link type.
          enum:
            - staticIpnUrl
          type: string
      required:
        - rel
      type: object
    Stripe:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            settings:
              description: Stripe settings object.
              properties:
                enforceOffSession:
                  default: false
                  description: If `true`, `off_session` param will always be `true` in Stripe
                    requests.
                  type: boolean
                redirectUrl:
                  description: The URL where the user will be redirected after authorizing the
                    account on Stripe.
                  format: url
                  type: string
                usePaymentIntents:
                  default: false
                  description: If `true` the `PaymentIntents` API will be used instead of
                    `Charges` API.
                  type: boolean
              required:
                - redirectUrl
              type: object
            threeDSecureServer:
              $ref: "#/components/schemas/Stripe3dsServers"
          required:
            - settings
          type: object
      description: Stripe Gateway config.
    Stripe3dsServer:
      allOf:
        - $ref: "#/components/schemas/Stripe3dsServers"
        - properties:
            enforceThreeDSecure:
              description: >
                If true, Stripe will attempt to perform 3D Secure

                and overrides any [dynamic 3D Secure Radar rules](https://stripe.com/docs/radar/rules#request-3ds).
              type: boolean
          type: object
      description: Stripe Integrated.
    Stripe3dsServers:
      description: Stripe 3DS Servers.
      discriminator:
        mapping:
          Stripe3dsServer: "#/components/schemas/Stripe3dsServer"
        propertyName: name
      properties:
        name:
          allOf:
            - $ref: "#/components/schemas/ThreeDSecureServerName"
          enum:
            - Stripe3dsServer
      type: object
    Subscription:
      discriminator:
        mapping:
          one-time-order: "#/components/schemas/OneTimeOrder"
          subscription-order: "#/components/schemas/SubscriptionOrder"
        propertyName: orderType
      properties:
        orderType:
          description: |
            Specifies the type of order, a subscription or a one-time purchase.
          enum:
            - subscription-order
            - one-time-order
          type: string
          x-basic: true
      type: object
    SubscriptionCancellation:
      properties:
        _links:
          description: The links related to resource.
          items:
            $ref: "#/components/schemas/SelfLink"
          minItems: 1
          readOnly: true
          type: array
        appliedInvoiceId:
          allOf:
            - $ref: "#/components/schemas/ResourceId"
          description: The identifier of the invoice where the cancellation fees or
            credits are applied.
          readOnly: true
        canceledBy:
          default: customer
          description: Who did the cancellation.
          enum:
            - merchant
            - customer
          type: string
        canceledTime:
          description: The cancellation time (when the status is confirmed which is by
            default unless specified "draft").
          format: date-time
          readOnly: true
          type: string
        churnTime:
          description: The time when the subscription will be deactivated.
          format: date-time
          type: string
        createdTime:
          allOf:
            - $ref: "#/components/schemas/ServerTimestamp"
          description: The time of resource creation (when it is posted).
        description:
          description: Cancel reason description in free form.
          maxLength: 255
          type: string
        id:
          allOf:
            - $ref: "#/components/schemas/ResourceId"
          description: Cancellation identifier.
          readOnly: true
        lineItemSubtotal:
          description: Subtotal of the line items which will be added after the
            subscription's cancellation.
          example: 49.95
          readOnly: true
          type: number
        lineItems:
          allOf:
            - $ref: "#/components/schemas/UpcomingInvoiceItemCollection"
          description: Items to be added to the new invoice. Proration item is generated
            and added automatically.
        prorated:
          default: false
          description: >
            Defines if the customer gets a pro-rata credit for the time
            remaining between `churnTime` and

            subscription's next renewal time.
          type: boolean
        proratedInvoiceId:
          allOf:
            - $ref: "#/components/schemas/ResourceId"
          description: Identifier of the invoice on which the cancellation proration is
            calculated.
          readOnly: true
        reason:
          default: other
          description: Cancellation reason.
          enum:
            - did-not-use
            - did-not-want
            - missing-features
            - bugs-or-problems
            - do-not-remember
            - risk-warning
            - contract-expired
            - too-expensive
            - other
            - billing-failure
          type: string
        status:
          default: confirmed
          description: >
            "draft" defines that the cancellation isn't applied on an invoice
            and subscription but

            can be inspected to see the charge.

            "confirmed" will set a subscription to be canceled when the `churnTime` is reached.

            "completed" is a read-only status which is set by the system when the churnTime is reached.

            The cancellation may not be changed or deleted when the status is "completed".
          enum:
            - draft
            - confirmed
            - completed
            - revoked
          type: string
        subscriptionId:
          allOf:
            - $ref: "#/components/schemas/ResourceId"
          description: Identifier of the canceled subscription order.
      required:
        - subscriptionId
        - churnTime
      type: object
    SubscriptionCancellationState:
      properties:
        cancelCategory:
          description: Cancel category.
          enum:
            - billing-failure
            - did-not-use
            - did-not-want
            - missing-features
            - bugs-or-problems
            - do-not-remember
            - risk-warning
            - contract-expired
            - too-expensive
            - never-started
            - switched-plan
            - other
          readOnly: true
          type: string
        cancelDescription:
          description: Cancel reason description in free form.
          maxLength: 255
          readOnly: true
          type: string
        canceledBy:
          description: Canceled by.
          enum:
            - merchant
            - customer
            - rebilly
          readOnly: true
          type: string
        canceledTime:
          allOf:
            - $ref: "#/components/schemas/ServerTimestamp"
          description: Subscription order canceled time.
          x-basic: true
          x-label: Cancellation time
          x-sortable: true
      type: object
    SubscriptionChange:
      properties:
        effectiveTime:
          description: The date from which the renewal time (for `reset` operations) and
            proration calculations are made.  If omitted, it will default to the
            current time.
          format: date-time
          type: string
        items:
          items:
            description: A new set of items for the subscription. To remove an item, you
              include the items array without the items you wish to remove.
            properties:
              plan:
                $ref: "#/components/schemas/FlexiblePlan"
              quantity:
                description: Number of units of the product on the given plan.
                type: integer
            required:
              - plan
              - quantity
            type: object
          minItems: 1
          type: array
        keepTrial:
          default: false
          description: If set to true and the subscription order has an active trial, it
            will use that trial further. Works with 'retain' renewalPolicy only.
          type: boolean
        preview:
          default: false
          description: If set to true, it will not change the subscription.  It allows for
            a way to preview the changes that would be made to a subscription.
          type: boolean
        prorated:
          description: >
            Whether or not to give a pro rata credit for the amount of time
            remaining between the `effectiveTime` and the end of the current
            period.

            In addition, if the `renewalTime` is retained (by setting the `renewalPolicy` to `retain`), then a pro rata debit will occur as well,

            for the amount between the `effectiveTime` and the `renewalTime` as a percentage of the normal period size.
          type: boolean
        renewalPolicy:
          description: The value determines whether the subscription retains its current
            `renewalTime` or resets it to a newly calculated `renewalTime`.
          enum:
            - reset
            - retain
          type: string
      required:
        - items
        - renewalPolicy
        - prorated
      type: object
    SubscriptionInvoice:
      properties:
        transactionId:
          allOf:
            - $ref: "#/components/schemas/ResourceId"
          description: If present, applies a payment to the invoice created.  If the
            payment is for the invoice total, it would be marked as paid.
      type: object
    SubscriptionLink:
      allOf:
        - $ref: "#/components/schemas/Link"
      properties:
        rel:
          description: The link type.
          enum:
            - subscription
          type: string
      required:
        - rel
      type: object
    SubscriptionMetadata:
      properties:
        _embedded:
          description: Any embedded objects available that are requested by the `expand`
            querystring parameter.
          items:
            anyOf:
              - $ref: "#/components/schemas/RecentInvoiceEmbed"
              - $ref: "#/components/schemas/InitialInvoiceEmbed"
              - $ref: "#/components/schemas/CustomerEmbed"
              - $ref: "#/components/schemas/WebsiteEmbed"
              - $ref: "#/components/schemas/LeadSourceEmbed"
          minItems: 1
          readOnly: true
          type: array
        _links:
          description: The links related to resource.
          items:
            anyOf:
              - $ref: "#/components/schemas/SelfLink"
              - $ref: "#/components/schemas/CustomerLink"
              - $ref: "#/components/schemas/InitialInvoiceLink"
              - $ref: "#/components/schemas/RecentInvoiceLink"
              - $ref: "#/components/schemas/WebsiteLink"
              - $ref: "#/components/schemas/ApprovalUrlLink"
          minItems: 1
          readOnly: true
          type: array
        createdTime:
          allOf:
            - $ref: "#/components/schemas/ServerTimestamp"
          description: Order created time.
          x-label: Creation time
          x-sortable: true
        customFields:
          $ref: "#/components/schemas/ResourceCustomFields"
        revision:
          description: >
            The number of times the order data has been modified.

            The revision is useful when analyzing webhook data to determine if the change takes precedence over the current representation.
          readOnly: true
          type: integer
        riskMetadata:
          allOf:
            - $ref: "#/components/schemas/RiskMetadata"
          description: Risk metadata. If null, the value would coalesce to the risk
            metadata captured when creating the payment token.
          example:
            $ref: "#/components/schemas/ReadyToPayMethods/example/2/feature"
          nullable: true
        updatedTime:
          allOf:
            - $ref: "#/components/schemas/ServerTimestamp"
          description: Order updated time.
          x-label: Last update time
          x-sortable: true
      type: object
    SubscriptionOrder:
      allOf:
        - $ref: "#/components/schemas/CommonSubscriptionOrder"
        - properties:
            customerId:
              allOf:
                - $ref: "#/components/schemas/ResourceId"
              description: The customer identifier string.
              x-basic: true
            renewalReminderNumber:
              description: Number of renewal reminder events triggered.
              readOnly: true
              type: integer
            renewalReminderTime:
              allOf:
                - $ref: "#/components/schemas/ServerTimestamp"
              description: Time renewal reminder event will be triggered.
              nullable: true
            trialReminderNumber:
              description: Number of renewal reminder events triggered.
              readOnly: true
              type: integer
            trialReminderTime:
              allOf:
                - $ref: "#/components/schemas/ServerTimestamp"
              description: Time renewal reminder event will be triggered.
              nullable: true
        - $ref: "#/components/schemas/SubscriptionCancellationState"
        - $ref: "#/components/schemas/SubscriptionMetadata"
      required:
        - orderType
        - customerId
        - websiteId
        - items
      type: object
    SubscriptionReactivation:
      properties:
        _links:
          description: The links related to resource.
          items:
            $ref: "#/components/schemas/SelfLink"
          minItems: 1
          readOnly: true
          type: array
        cancellationId:
          allOf:
            - $ref: "#/components/schemas/ResourceId"
          description: Identifier of the related cancellation.
          readOnly: true
        createdTime:
          description: The time of resource creation (when it is posted).
          format: date-time
          readOnly: true
          type: string
        description:
          description: Reactivation reason description in free form.
          maxLength: 255
          type: string
        effectiveTime:
          description: >
            The date from which the service period would start, unless the
            subscription is canceled but still active.

            In case the susbcription is still active, the subscription will continue the current service period.

            If omitted, it will default to the current time.
          format: date-time
          type: string
        id:
          allOf:
            - $ref: "#/components/schemas/ResourceId"
          description: Reactivation identifier.
          readOnly: true
        renewalTime:
          description: >
            The time of the next subscription renewal. If omitted then it is
            computed from the effective time.

            If the subscription is canceled but active it is ignored, so the next renewal will happen as scheduled.
          format: date-time
          type: string
        subscriptionId:
          allOf:
            - $ref: "#/components/schemas/ResourceId"
          description: Identifier of the reactivated subscription.
      required:
        - subscriptionId
      type: object
    TWINT:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              description: TWINT credentials object.
              properties:
                cashRegisterId:
                  description: Cash register ID.
                  type: string
                keyPassphrase:
                  description: TWINT key's passphrase.
                  format: password
                  type: string
                privateKey:
                  description: TWINT private key.
                  format: password
                  type: string
                  x-multiline: true
                publicKey:
                  description: TWINT public key.
                  type: string
                  x-multiline: true
                storeUuid:
                  description: TWINT store UUID.
                  type: string
              required:
                - storeUuid
                - cashRegisterId
                - publicKey
                - privateKey
                - keyPassphrase
              type: object
            settings:
              description: TWINT settings object.
              properties:
                cashRegisterType:
                  description: TWINT cash register type.
                  type: string
              required:
                - cashRegisterType
              type: object
          required:
            - credentials
            - settings
          type: object
      description: TWINT config.
    Tag:
      description: Tag.
      properties:
        _links:
          description: The links related to resource.
          items:
            anyOf:
              - $ref: "#/components/schemas/SelfLink"
          minItems: 1
          readOnly: true
          type: array
        createdTime:
          allOf:
            - $ref: "#/components/schemas/ServerTimestamp"
          description: The tag's created time.
        id:
          allOf:
            - $ref: "#/components/schemas/ResourceId"
          description: The tag's identifier string.
          readOnly: true
        name:
          description: The tag is unique name, which is case-insensitive.
          example: New
          maxLength: 255
          pattern: ^[@~\-\.\w\s]+$
          type: string
        updatedTime:
          allOf:
            - $ref: "#/components/schemas/ServerTimestamp"
          description: The tag's updated time.
      required:
        - name
      type: object
    TestProcessor:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            threeDSecureServer:
              $ref: "#/components/schemas/TestProcessor3dsServers"
          type: object
      description: TestProcessor Gateway config.
    TestProcessor3dsServer:
      allOf:
        - $ref: "#/components/schemas/TestProcessor3dsServers"
      description: TestProcessor Integrated.
    TestProcessor3dsServers:
      description: TestProcessor3dsServers 3DS Servers.
      discriminator:
        mapping:
          TestSandbox3dsServer: "#/components/schemas/TestProcessor3dsServer"
          ThreeDSecureIO3dsServer: "#/components/schemas/ThreeDSecureIO3dsServer"
        propertyName: name
      properties:
        name:
          allOf:
            - $ref: "#/components/schemas/ThreeDSecureServerName"
          enum:
            - TestSandbox3dsServer
            - ThreeDSecureIO3dsServer
      required:
        - name
      type: object
    ThreeDSecure:
      properties:
        _links:
          description: The links related to resource.
          items:
            $ref: "#/components/schemas/SelfLink"
          minItems: 1
          readOnly: true
          type: array
        amount:
          description: Transaction amount.
          format: double
          type: number
        cavv:
          description: The 3D Secure entry cardholder authentication verification value.
          type: string
        createdTime:
          allOf:
            - $ref: "#/components/schemas/ServerTimestamp"
          description: The 3D Secure entry created time.
        currency:
          allOf:
            - $ref: "#/components/schemas/CurrencyCode"
        customerId:
          allOf:
            - $ref: "#/components/schemas/ResourceId"
          description: Related customer ID.
        eci:
          description: The 3D Secure entry electronic commerce indicator.
          type: integer
        enrolled:
          description: Is the cardholder enrolled in 3DSecure.
          enum:
            - Y
            - N
            - U
          type: string
        enrollmentEci:
          description: The 3D Secure entry enrollment eci.
          type: string
        gatewayAccountId:
          allOf:
            - $ref: "#/components/schemas/ResourceId"
          description: Related gateway account ID.
        id:
          allOf:
            - $ref: "#/components/schemas/ResourceId"
          description: The 3D Secure entry identifier string.
          readOnly: true
        payerAuthResponseStatus:
          description: The 3D Secure entry Auth Response Status.
          enum:
            - Y
            - N
            - U
            - A
          type: string
        paymentCardId:
          allOf:
            - $ref: "#/components/schemas/ResourceId"
          description: Related payment card ID.
        signatureVerification:
          description: If signature was verified.
          enum:
            - Y
            - N
          type: string
        websiteId:
          allOf:
            - $ref: "#/components/schemas/ResourceId"
          description: Related Website ID.
        xid:
          description: The 3D Secure entry transaction Id.
          type: string
      required:
        - enrolled
        - enrollmentEci
        - customerId
        - gatewayAccountId
        - paymentCardId
        - websiteId
        - currency
        - amount
      type: object
    ThreeDSecureIO3dsServer:
      allOf:
        - $ref: "#/components/schemas/WorldlineAtosFrankfurt3dsServers"
        - $ref: "#/components/schemas/TestProcessor3dsServers"
        - $ref: "#/components/schemas/EMS3dsServers"
        - properties:
            merchantAcquirerBinMastercard:
              description: Mastercard Acquirer BIN.
              maxLength: 11
              minLength: 6
              type: string
            merchantAcquirerBinVisa:
              description: Visa Acquirer BIN.
              maxLength: 11
              minLength: 6
              type: string
            merchantCountry:
              description: Merchant Country ISO Alpha-2 Code.
              example: US
              maxLength: 2
              type: string
            merchantId:
              description: Merchant Id.
              maxLength: 35
              type: string
            merchantName:
              description: Merchant Name.
              maxLength: 40
              type: string
            merchantUrl:
              description: Merchant URL.
              maxLength: 2048
              type: string
            transactionType:
              description: |
                01 - Goods/Service Purchase
                03 - Check Acceptance
                10 - Account Funding
                11 - Quasi-Cash Transaction
                28 - Prepaid Activation and Load

                Identifies the type of transaction being authenticated.
              enum:
                - "01"
                - "03"
                - "10"
                - "11"
                - "28"
              type: string
            v1:
              description: |
                Value determines if requests can use version 1 of 3DS.
                In case both v1 and v2 are enabled it will prefer v2.
                If v2 is not supported for the issuer, it will coalesce to v1.
              type: boolean
            v2:
              description: |
                Value determines if requests will attempt version 2 of 3DS.
                In case both v1 and v2 are enabled it will prefer v2.
                If v2 is not supported for the issuer, it will coalesce to v1.
              type: boolean
          required:
            - merchantId
            - merchantName
            - merchantAcquirerBinVisa
            - merchantAcquirerBinMastercard
            - merchantCountry
            - merchantUrl
          type: object
      description: ThreeDSecureIO3dsServer.
    ThreeDSecureResult:
      properties:
        authenticated:
          description: 3D Secure authentication response status.
          enum:
            - yes
            - no
            - not applicable
            - attempted
          type: string
        enrolled:
          description: Is the cardholder enrolled in 3D Secure.
          enum:
            - yes
            - no
            - invalid card/timeout
            - unavailable
          type: string
        flow:
          description: 3D Secure 2 authentication flow.
          enum:
            - frictionless
            - challenge
          type: string
        isDowngraded:
          default: false
          description: If 3D Secure 2 was attempted but downgraded to 3D Secure 1.
          type: boolean
        liability:
          enum:
            - protected
            - not protected
            - protected (attempt)
          type: string
        version:
          description: 3D Secure version.
          enum:
            - 1.0.2
            - 2.1.0
            - 2.2.0
          type: string
      readOnly: true
      required:
        - enrolled
        - authenticated
        - liability
        - isDowngraded
      type: object
    ThreeDSecureServerName:
      description: The Merchant plug-in Name.
      enum:
        - Payvision3dsServer
        - Wirecard3dsServer
        - Ilixium3dsServer
        - DataCash3dsServer
        - Paysafe3dsServer
        - Ingenico3dsServer
        - CardinalCommerce3dsServer
        - Paay3dsServer
        - Panamerican3dsServer
        - eMerchantPay3dsServer
        - SecureTrading3dsServer
        - Clearhaus3dsServer
        - Other
        - ThreeDSecureIO3dsServer
        - WorldlineAtosFrankfurt3dsServer
        - Piastrix3dsServer
        - NGenius3dsServer
        - Stripe3dsServer
      type: string
    TimeIso8601Extended:
      description: Extended ISO-8601 format of time.
      pattern: ^(([01][0-9]|2[0-3]):([0-5][0-9])(?::([0-5][0-9]))?)((?:[+-](?:0[0-9]|1[12])(?::?[0-5][0-9])?)|Z)?$
      type: string
    TimePluralUnit:
      enum:
        - seconds
        - minutes
        - hours
        - days
        - months
        - years
      type: string
    TimeUnit:
      enum:
        - second
        - minute
        - hour
        - day
        - month
        - year
      type: string
    TimelineAction:
      discriminator:
        mapping:
          redemption-cancel: "#/components/schemas/redemption-cancel"
          resend-email: "#/components/schemas/resend-email"
          ruleset-restore: "#/components/schemas/ruleset-restore"
        propertyName: action
      properties:
        action:
          enum:
            - resend-email
            - redemption-cancel
            - ruleset-restore
          type: string
      readOnly: true
      type: object
    TimelineExtraData:
      description: Additional data.
      properties:
        actions:
          description: Actions available to a Timeline message. Can be empty in case no
            actions are available for a message.
          items:
            $ref: "#/components/schemas/TimelineAction"
          minItems: 0
          type: array
        author:
          description: Timeline comment author data.
          properties:
            userFullName:
              type: string
            userId:
              type: string
          type: object
        links:
          items:
            properties:
              placeholder:
                example: KYC Document
                type: string
              resourceId:
                $ref: "#/components/schemas/ResourceId"
              resourceType:
                enum:
                  - kyc-document
                  - invoice
                  - subscription
                  - transaction
                  - email-message
                  - dispute
                  - coupon
                type: string
            type: object
          type: array
        mentions:
          additionalProperties:
            example:
              "@test@mail.com": userId-1
            type: string
          type: object
        tables:
          items:
            $ref: "#/components/schemas/TimelineTable"
          minItems: 0
          type: array
      readOnly: true
      type: object
    TimelineTable:
      description: Additional information about Timeline message.
      discriminator:
        mapping:
          list: "#/components/schemas/list"
          one-column: "#/components/schemas/one-column"
          three-columns: "#/components/schemas/three-columns"
          two-columns: "#/components/schemas/two-columns"
        propertyName: type
      properties:
        footer:
          description: Data table footer.
          type: string
        title:
          description: Data table title.
          type: string
        type:
          enum:
            - list
            - one-columns
            - two-columns
            - three-columns
          type: string
      type: object
    ToditoCash:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              description: ToditoCash credentials object.
              properties:
                apiKey:
                  description: ToditoCash API key.
                  format: password
                  type: string
              required:
                - apiKey
              type: object
          required:
            - credentials
          type: object
      description: ToditoCash config.
    Transaction:
      allOf:
        - $ref: "#/components/schemas/CommonTransaction"
        - properties:
            _embedded:
              description: Any embedded objects available that are requested by the `expand`
                querystring parameter.
              items:
                anyOf:
                  - $ref: "#/components/schemas/ParentTransactionEmbed"
                  - $ref: "#/components/schemas/RetriedTransactionEmbed"
                  - $ref: "#/components/schemas/GatewayAccountEmbed"
                  - $ref: "#/components/schemas/CustomerEmbed"
                  - $ref: "#/components/schemas/LeadSourceEmbed"
                  - $ref: "#/components/schemas/WebsiteEmbed"
                  - $ref: "#/components/schemas/PaymentCardEmbed"
                  - $ref: "#/components/schemas/BankAccountEmbed"
                  - $ref: "#/components/schemas/InvoicesEmbed"
              minItems: 1
              readOnly: true
              type: array
            _links:
              description: The links related to resource.
              items:
                anyOf:
                  - $ref: "#/components/schemas/SelfLink"
                  - $ref: "#/components/schemas/WebsiteLink"
                  - $ref: "#/components/schemas/CustomerLink"
                  - $ref: "#/components/schemas/GatewayAccountLink"
                  - $ref: "#/components/schemas/PaymentCardLink"
                  - $ref: "#/components/schemas/ParentTransactionLink"
                  - $ref: "#/components/schemas/RetriedTransactionLink"
                  - $ref: "#/components/schemas/LeadSourceLink"
                  - $ref: "#/components/schemas/ApprovalUrlLink"
                  - $ref: "#/components/schemas/RefundUrlLink"
                  - $ref: "#/components/schemas/TransactionUpdateUrlLink"
                  - $ref: "#/components/schemas/DisputeLink"
                  - $ref: "#/components/schemas/InvoicesLink"
                  - $ref: "#/components/schemas/QueryUrlLink"
              minItems: 1
              readOnly: true
              type: array
            acquirerName:
              allOf:
                - $ref: "#/components/schemas/AcquirerName"
              description: Acquirer name, available only when transaction use gateway, else
                null.
              readOnly: true
            arn:
              description: The acquirer reference number.
              example: "74836950144358910018150"
              readOnly: true
              type: string
              x-label: ARN
            bin:
              description: Payment Card BIN.
              format: bin
              readOnly: true
              type: string
              x-label: BIN
            bumpOffer:
              description: Bump offer information. Null if hasBumpOffer is false.
              properties:
                language:
                  allOf:
                    - $ref: "#/components/schemas/LanguageIsoCode"
                  description: The language of the bump offer that was displayed to user (useful
                    for finding any translation problems).
                order:
                  allOf:
                    - $ref: "#/components/schemas/Money"
                  description: Initial amount and currency.
                outcome:
                  $ref: "#/components/schemas/PurchaseBumpStatus"
                presentedOffers:
                  allOf:
                    - $ref: "#/components/schemas/PurchaseBumpOfferList"
                  description: Offers presented to a customer.
                selectedOffer:
                  allOf:
                    - $ref: "#/components/schemas/PurchaseBumpOffer"
                  description: Offer selected by a customer. Null if bump offer outcome is not
                    `selected`.
                version:
                  allOf:
                    - $ref: "#/components/schemas/PurchaseBumpSplitVersionName"
                  description: The name of the version that was picked (useful for measuring split
                    tests).
              readOnly: true
              type: object
            dcc:
              description: Dynamic Currency Conversion detailed information. Null if hasDcc is
                false.
              properties:
                base:
                  allOf:
                    - $ref: "#/components/schemas/Money"
                  description: Initial amount and currency to convert from.
                outcome:
                  description: Dynamic Currency Conversion outcome.
                  enum:
                    - rejected
                    - selected
                    - unknown
                  type: string
                quote:
                  allOf:
                    - $ref: "#/components/schemas/Money"
                  description: Suggested amount and currency to convert to.
                usdMarkup:
                  allOf:
                    - $ref: "#/components/schemas/MoneyAmount"
                  description: The amount of markup translated to USD.
              readOnly: true
              type: object
            discrepancyTime:
              description: The time of the most recent discrepancy on the transaction.
              format: date-time
              nullable: true
              readOnly: true
              type: string
              x-sortable: true
            disputeStatus:
              description: The dispute's status, else null.
              enum:
                - response-needed
                - under-review
                - forfeited
                - won
                - lost
                - unknown
              nullable: true
              readOnly: true
              type: string
            disputeTime:
              description: Time the dispute was created, else null.
              format: date-time
              nullable: true
              readOnly: true
              type: string
              x-sortable: true
            gateway:
              description: The related gateway information.
              properties:
                avsResponse:
                  description: The AVS gateway's response.
                  properties:
                    code:
                      description: The response code.
                      type: string
                    message:
                      description: The response message.
                      type: string
                    originalCode:
                      description: The raw response code.
                      type: string
                    originalMessage:
                      description: The raw response message.
                      type: string
                  type: object
                cvvResponse:
                  description: The CVV gateway's response.
                  properties:
                    code:
                      description: The response code.
                      type: string
                    message:
                      description: The response message.
                      type: string
                    originalCode:
                      description: The raw response code.
                      type: string
                    originalMessage:
                      description: The raw response message.
                      type: string
                  type: object
                response:
                  description: The gateway's response.
                  properties:
                    code:
                      description: The gateway's response code.
                      type: string
                    message:
                      description: The gateway's response message.
                      type: string
                    originalCode:
                      description: The raw, unmapped gateway's response code.
                      type: string
                    originalMessage:
                      description: The raw, unmapped gateway's response message.
                      type: string
                    type:
                      description: The gateway's response type.
                      type: string
                  type: object
              readOnly: true
              type: object
            gatewayAccountId:
              allOf:
                - $ref: "#/components/schemas/ResourceId"
              description: The transaction's Gateway Account ID.
              readOnly: true
            gatewayTransactionId:
              allOf:
                - $ref: "#/components/schemas/ResourceId"
              description: The gateway's transaction ID.
              readOnly: true
            hadDiscrepancy:
              description: True if the transaction has been updated due to a discrepancy with
                its. source of truth.
              readOnly: true
              type: boolean
            hasBumpOffer:
              description: True if transaction has a Bump offer.
              readOnly: true
              type: boolean
            hasDcc:
              description: True if transaction has Dynamic Currency Conversion applied.
              readOnly: true
              type: boolean
            isDisputed:
              description: True if transaction is disputed.
              readOnly: true
              type: boolean
            isMerchantInitiated:
              description: True if the transaction was initiated by the merchant.
              type: boolean
            isProcessedOutside:
              description: True if the transaction was processed outside of Rebilly.
              type: boolean
            isReconciled:
              description: True if the transaction has been verified with gateway batch data.
              readOnly: true
              type: boolean
            method:
              allOf:
                - $ref: "#/components/schemas/PaymentMethod"
              deprecated: true
              description: Payment Method. Use `paymentInstrument.method` instead.
            notificationUrl:
              $ref: "#/components/schemas/TransactionNotificationUrl"
            orderId:
              deprecated: true
              description: The transaction's order ID.  This ID must be unique within a 24
                hour period. This field was renamed to the `requestId`.
              type: string
              x-sortable: true
            paymentInstrument:
              $ref: "#/components/schemas/PaymentInstrument"
            referenceData:
              additionalProperties:
                type: string
              description: Transaction reference data.
              example:
                gatewayTransactionId: GAT123
              nullable: true
              readOnly: true
              type: object
            reportAmount:
              description: Transaction amount converted to organization&nbsp;selected report
                currency.
              format: double
              readOnly: true
              type: number
              x-currency-field: reportCurrency
              x-sortable: true
              x-type: Money
            reportCurrency:
              allOf:
                - $ref: "#/components/schemas/CurrencyCode"
              readOnly: true
            retriedTransactionId:
              allOf:
                - $ref: "#/components/schemas/ResourceId"
              description: The retried transaction ID.
              readOnly: true
            retriesResult:
              description: Retries sequence result.
              enum:
                - approved
                - canceled
                - declined
                - scheduled
              readOnly: true
              type: string
            retryInstruction:
              $ref: "#/components/schemas/PaymentRetry"
            revision:
              description: >
                The number of times the transaction data has been modified.

                The revision is useful when analyzing webhook data to determine if the change takes precedence over the current representation.
              readOnly: true
              type: integer
            riskMetadata:
              allOf:
                - $ref: "#/components/schemas/RiskMetadata"
              description: Risk metadata.
            riskScore:
              description: The transaction's risk score.
              readOnly: true
              type: integer
            scheduledTime:
              description: The time the transaction is scheduled for collection.
              format: date-time
              type: string
            settlementTime:
              description: The time that the transaction was settled by the banking
                instuition.
              format: date-time
              nullable: true
              readOnly: true
              type: string
              x-sortable: true
            velocity:
              description: The number of transactions by the same customer in the past 24
                hours.
              type: integer
    TransactionAllocationsLink:
      allOf:
        - $ref: "#/components/schemas/Link"
      properties:
        rel:
          description: The link type.
          enum:
            - transactionAllocations
          type: string
      required:
        - rel
      type: object
    TransactionEmbed:
      description: Transaction object.
      properties:
        transaction:
          $ref: "#/components/schemas/Transaction"
      readOnly: true
      type: object
    TransactionLink:
      allOf:
        - $ref: "#/components/schemas/Link"
      properties:
        rel:
          description: The link type.
          enum:
            - transaction
          type: string
      required:
        - rel
      type: object
    TransactionNotificationUrl:
      description: >
        The URL where a server-to-server POST notification will be
        sent.  It  will be sent when the

        transaction's result is finalized after a timeout or an offsite interaction. Do not trust the

        notification; follow with a GET request to confirm the result of the transaction. Please

        respond with a 2xx HTTP status code, or we will reattempt the request again.

        The 2 placeholders are available to use in this URI: `{id}` and `{result}`.
      format: uri
      type: string
    TransactionQuery:
      properties:
        amount:
          description: The transaction's amount.
          format: double
          readOnly: true
          type: number
        currency:
          allOf:
            - $ref: "#/components/schemas/CurrencyCode"
          readOnly: true
        result:
          description: Transaction result.
          enum:
            - abandoned
            - approved
            - canceled
            - declined
            - unknown
          readOnly: true
          type: string
        status:
          description: Transaction status.
          enum:
            - completed
            - conn-error
            - disputed
            - never-sent
            - offsite
            - partially-refunded
            - pending
            - refunded
            - sending
            - suspended
            - timeout
            - voided
            - waiting-approval
            - waiting-capture
            - waiting-gateway
            - waiting-refund
          readOnly: true
          type: string
      type: object
    TransactionRefund:
      properties:
        amount:
          description: Refund amount.
          format: double
          type: number
      required:
        - amount
      type: object
    TransactionRequest:
      allOf:
        - $ref: "#/components/schemas/CommonTransactionRequest"
        - required:
            - type
        - properties:
            type:
              description: >
                The type of transaction requested.

                You should always include the type within your API request.

                This supports a limited subset of Transaction types.  To refund or void, use the refund endpoint.

                To `capture` use the `sale` type. If any existing `authorize` transactions are eligible, then they will be captured and the `sale` will be converted to a `capture` type.
              enum:
                - 3ds-authentication
                - sale
                - authorize
              type: string
    TransactionTimeline:
      properties:
        _links:
          description: The links related to resource.
          items:
            $ref: "#/components/schemas/SelfLink"
          minItems: 1
          readOnly: true
          type: array
        extraData:
          $ref: "#/components/schemas/TimelineExtraData"
        id:
          allOf:
            - $ref: "#/components/schemas/ResourceId"
          description: The Timeline message identifier string.
          readOnly: true
        message:
          description: The message that describes the message details.
          type: string
        occurredTime:
          allOf:
            - $ref: "#/components/schemas/ServerTimestamp"
          description: Timeline message time.
          readOnly: true
        triggeredBy:
          description: Shows who or what triggered the Timeline message.
          enum:
            - rebilly
            - app
            - direct-api
          readOnly: true
          type: string
        type:
          description: Timeline message type.
          enum:
            - amount-adjusted
            - blocklist-matched
            - bump-offer-accepted
            - bump-offer-presented
            - bump-offer-rejected
            - customer-redirected-offsite
            - customer-returned
            - dcc-offer-accepted
            - dcc-offer-forced
            - dcc-offer-presented
            - dcc-offer-rejected
            - dispute-changed
            - dispute-created
            - dispute-forfeited
            - dispute-lost
            - dispute-responded
            - dispute-won
            - gateway-connection-failed
            - gateway-connection-timed-out
            - gateway-response-received
            - risk-score-changed
            - timeline-comment-created
            - transaction-abandoned
            - transaction-amount-discrepancy-found
            - transaction-approved
            - transaction-canceled
            - transaction-capture-delayed
            - transaction-captured
            - transaction-declined
            - transaction-discrepancy-found
            - transaction-initiated
            - transaction-reconciled
            - transaction-refunded
            - transaction-retried
            - transaction-rules-processed
            - transaction-scheduled-time-changed
            - transaction-timeout-resolved
            - transaction-voided
            - transaction-waiting-gateway
            - transaction-queried
            - transaction-updated
          readOnly: true
          type: string
      type: object
    TransactionUpdate:
      description: Update a Transaction manually to completed status with given result
        with optional currency and amount.
      properties:
        amount:
          description: The transaction amount.
          format: double
          type: number
        currency:
          allOf:
            - $ref: "#/components/schemas/CurrencyCode"
          description: The transaction currency.
        result:
          description: Transaction result.
          enum:
            - abandoned
            - approved
            - canceled
            - declined
          type: string
      required:
        - result
      type: object
    TransactionUpdateUrlLink:
      allOf:
        - $ref: "#/components/schemas/Link"
      properties:
        rel:
          description: The link type.
          enum:
            - updateUrl
          type: string
      required:
        - rel
      type: object
    TrustPay:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              description: TrustPay credentials object.
              properties:
                accessToken:
                  format: password
                  type: string
                entityId:
                  type: string
              required:
                - entityId
                - accessToken
              type: object
          required:
            - credentials
          type: object
      description: TrustPay config.
    Trustly:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              description: Trustly credentials object.
              properties:
                password:
                  description: Trustly password.
                  format: password
                  type: string
                privateKey:
                  description: Trustly private key.
                  format: password
                  type: string
                  x-multiline: true
                publicKey:
                  description: Trustly public key.
                  type: string
                  x-multiline: true
                username:
                  description: Trustly username.
                  type: string
              required:
                - usernmae
                - password
                - publicKey
                - privateKey
              type: object
          required:
            - credentials
          type: object
      description: Trustly config.
    TrustsPay:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              description: TrustsPay credentials object.
              properties:
                gatewayNo:
                  type: string
                merchantNo:
                  type: string
                signkey:
                  format: password
                  type: string
              required:
                - merchantNo
                - gatewayNo
                - signkey
              type: object
          required:
            - credentials
          type: object
      description: TrustsPay config.
    UPayCard:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              properties:
                key:
                  description: merchant key.
                  format: password
                  type: string
                receiver_account:
                  description: merchant receiver account.
                  type: string
                secret:
                  description: merchant secret.
                  format: password
                  type: string
              required:
                - receiver_account
                - key
                - secret
              type: object
            settings:
              description: UpayCard settings object.
              properties:
                tolerancePercentage:
                  $ref: "#/components/schemas/AmountAdjustmentTolerance"
              required:
                - tolerancePercentage
              type: object
          required:
            - credentials
          type: object
      description: UPayCard Gateway config.
    USAePay:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              properties:
                pin:
                  description: USAePay Gateway pin.
                  format: password
                  type: string
                sourceKey:
                  description: USAePay Gateway source key.
                  format: password
                  type: string
              required:
                - sourceKey
                - pin
              type: object
          required:
            - credentials
          type: object
      description: USAePay Gateway config.
    UpcomingInvoiceItem:
      description: Line item.
      properties:
        createdTime:
          allOf:
            - $ref: "#/components/schemas/ServerTimestamp"
          description: Date-time when the item was added to the subscription.
        description:
          description: Description of line item.
          type: string
        periodEndTime:
          description: Date-time when the period ends for this item.
          format: date-time
          type: string
        periodStartTime:
          description: Date-time when the period begins for this item.
          format: date-time
          type: string
        quantity:
          description: Quantity of line item.
          example: 1
          type: integer
        type:
          description: Type of line item.
          enum:
            - debit
            - credit
          type: string
        unitPriceAmount:
          description: Unit price of the line item.
          example: 49.95
          format: double
          type: number
        unitPriceCurrency:
          allOf:
            - $ref: "#/components/schemas/CurrencyCode"
      required:
        - type
        - unitPriceAmount
        - unitPriceCurrency
        - quantity
      type: object
    UpcomingInvoiceItemCollection:
      items:
        $ref: "#/components/schemas/UpcomingInvoiceItem"
      type: array
    VCreditos:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              description: VCreditos credentials object.
              properties:
                publicKey:
                  description: VCreditos API public key.
                  type: string
                secretKey:
                  description: VCreditos API secret key.
                  format: password
                  type: string
              required:
                - publicKey
                - secretKey
              type: object
          required:
            - credentials
          type: object
      description: VCreditos config.
    ValidationErrorExtensions:
      properties:
        invalidFields:
          example:
            - field: field1
              message: field1 is invalid
            - field: subObject.field2
              message: field2 is invalid
            - field: subObject.field2
              message: another error in the field2
          items:
            properties:
              field:
                description: The field name. Dot notation is used for nested object field names.
                type: string
              message:
                type: string
            type: object
          type: array
      type: object
    VantivLitle:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              properties:
                merchantId:
                  description: VantivLitle Gateway merchant ID.
                  type: string
                password:
                  description: VantivLitle Gateway password.
                  format: password
                  type: string
                username:
                  description: VantivLitle Gateway username.
                  type: string
              required:
                - username
                - password
                - merchantId
              type: object
            threeDSecureServer:
              $ref: "#/components/schemas/VantivLitle3dsServers"
          required:
            - credentials
          type: object
      description: VantivLitle Gateway config.
    VantivLitle3dsServers:
      description: VantivLitle 3DS Servers.
      discriminator:
        mapping:
          Other: "#/components/schemas/Other"
          Paay3dsServer: "#/components/schemas/Paay3dsServer"
        propertyName: name
      properties:
        name:
          allOf:
            - $ref: "#/components/schemas/ThreeDSecureServerName"
          enum:
            - Paay3dsServer
            - Other
      required:
        - name
      type: object
    VaultedInstrument:
      description: Vaulted payment instrument.
      properties:
        method:
          allOf:
            - $ref: "#/components/schemas/PaymentMethod"
          description: >
            The payment method supported vault.

            See [Payment Instruments API](https://api-reference.rebilly.com/tag/Payment-Instruments).
          enum:
            - payment-card
            - ach
            - paypal
          type: string
        paymentInstrumentId:
          allOf:
            - $ref: "#/components/schemas/ResourceId"
          description: The payment instrument identifier.
      required:
        - method
        - paymentInstrumentId
      title: Vaulted instrument
    Wallet88:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              description: Wallet88 credentials object.
              properties:
                password:
                  description: Wallet88 API password.
                  format: password
                  type: string
                username:
                  description: Wallet88 API user.
                  type: string
              required:
                - username
                - password
              type: object
          required:
            - credentials
          type: object
      description: Wallet88 config.
    Walpay:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              properties:
                merchantName:
                  description: Walpay Gateway merchant name.
                  type: string
                merchantPin:
                  description: Walpay Gateway merchant pin.
                  format: password
                  type: string
              required:
                - merchantName
                - merchantPin
              type: object
            threeDSecureServer:
              $ref: "#/components/schemas/Walpay3dsServers"
          required:
            - credentials
          type: object
      description: Walpay Gateway config.
    Walpay3dsServers:
      description: Walpay 3DS Servers.
      discriminator:
        mapping:
          Other: "#/components/schemas/Other"
          Paay3dsServer: "#/components/schemas/Paay3dsServer"
        propertyName: name
      properties:
        name:
          allOf:
            - $ref: "#/components/schemas/ThreeDSecureServerName"
          enum:
            - Paay3dsServer
            - Other
      required:
        - name
      type: object
    WebsiteEmbed:
      description: Website object.
      properties:
        website:
          type: object
      readOnly: true
      type: object
    WebsiteLink:
      allOf:
        - $ref: "#/components/schemas/Link"
      properties:
        rel:
          description: The link type.
          enum:
            - website
          type: string
      required:
        - rel
      type: object
    Wirecard:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              properties:
                businessSignature:
                  description: Wirecard Gateway merchant business case signature.
                  format: password
                  type: string
                delay:
                  description: Wirecard Gateway delay.
                  type: integer
                merchantPassword:
                  description: Wirecard Gateway merchant password.
                  format: password
                  type: string
                merchantUsername:
                  description: Wirecard Gateway merchant username.
                  type: string
                sftpPrivateKey:
                  description: Wirecard sftp private key.
                  format: password
                  type: string
                  x-multiline: true
                sftpUsername:
                  description: Wirecard sftp username.
                  type: string
              required:
                - merchantUsername
                - merchantPassword
                - businessSignature
                - delay
              type: object
            threeDSecureServer:
              $ref: "#/components/schemas/Wirecard3dsServers"
          required:
            - credentials
          type: object
      description: Wirecard Gateway config.
    Wirecard3dsServer:
      allOf:
        - $ref: "#/components/schemas/Wirecard3dsServers"
      description: Wirecard Integrated.
    Wirecard3dsServers:
      description: Wirecard 3DS Servers.
      discriminator:
        mapping:
          Wirecard3dsServer: "#/components/schemas/Wirecard3dsServer"
        propertyName: name
      properties:
        name:
          allOf:
            - $ref: "#/components/schemas/ThreeDSecureServerName"
          enum:
            - Wirecard3dsServer
      required:
        - name
      type: object
    WorldlineAtosFrankfurt:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              description: WorldlineAtosFrankfurt credentials.
              properties:
                acquiringInstitutionIdentificationCode:
                  description: Acquiring Institution Identification Code.
                  type: string
                cardAcceptorIdCode:
                  description: Card Acceptor ID Code.
                  type: string
              required:
                - cardAcceptorIdCode
                - acquiringInstitutionIdentificationCode
              type: object
            settings:
              description: WorldlineAtosFrankfurt settings.
              properties:
                cardAcceptorCountryCode:
                  description: Card Acceptor Country Code.
                  type: string
                cardAcceptorLocation:
                  description: Card Acceptor Location.
                  type: string
                cardAcceptorName:
                  description: Card Acceptor Name.
                  type: string
              required:
                - cardAcceptorName
                - cardAcceptorLocation
                - cardAcceptorCountryCode
              type: object
            threeDSecureServer:
              $ref: "#/components/schemas/WorldlineAtosFrankfurt3dsServers"
          required:
            - credentials
            - settings
          type: object
      description: WorldlineAtosFrankfurt Gateway config.
    WorldlineAtosFrankfurt3dsServers:
      description: WorldlineAtosFrankfurt 3DS Servers.
      discriminator:
        mapping:
          ThreeDSecureIO3dsServer: "#/components/schemas/ThreeDSecureIO3dsServer"
        propertyName: name
      properties:
        name:
          allOf:
            - $ref: "#/components/schemas/ThreeDSecureServerName"
          enum:
            - ThreeDSecureIO3dsServer
      required:
        - name
      type: object
    Worldpay:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              properties:
                merchantCode:
                  description: Worldpay Gateway merchant code.
                  format: password
                  type: string
                merchantPassword:
                  description: Worldpay Gateway merchant password.
                  format: password
                  type: string
                payoutMerchantCode:
                  description: Optional alternate merchant code for payouts.
                  format: password
                  type: string
                payoutMerchantPassword:
                  description: Optional alternate merchant password for payouts.
                  format: password
                  type: string
              required:
                - merchantCode
                - merchantPassword
              type: object
            settings:
              properties:
                delay:
                  default: 0
                  description: Auto Capture delay (in hours).
                  minimum: 0
                  type: integer
                enableStoredCredentials:
                  default: false
                  description: True to enable Stored Credentials.
                  type: boolean
                merchantInitiatedReason:
                  default: UNSCHEDULED
                  description: The value of merchantInitiatedReason to send with
                    merchant-initiated transactions.
                  enum:
                    - UNSCHEDULED
                    - RECURRING
                    - INSTALMENT
                    - REAUTH
                    - DELAYED
                    - INCREMENTAL
                    - RESUBMISSION
                    - NOSHOW
                  type: string
              type: object
            threeDSecureServer:
              $ref: "#/components/schemas/Worldpay3dsServers"
          required:
            - credentials
          type: object
      description: Worldpay Gateway config.
    Worldpay3dsServers:
      description: Worldpay 3DS Servers.
      discriminator:
        mapping:
          Other: "#/components/schemas/Other"
          Paay3dsServer: "#/components/schemas/Paay3dsServer"
          ThreeDSecureIO3dsServer: "#/components/schemas/ThreeDSecureIO3dsServer"
        propertyName: name
      properties:
        name:
          allOf:
            - $ref: "#/components/schemas/ThreeDSecureServerName"
          enum:
            - Paay3dsServer
            - ThreeDSecureIO3dsServer
            - Other
      required:
        - name
      type: object
    XPay:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              description: XPay credentials object.
              properties:
                encryptionKey:
                  format: password
                  type: string
                merchantId:
                  type: string
              required:
                - merchantId
                - encryptionKey
              type: object
          required:
            - credentials
          type: object
      description: XPay config.
    Zimpler:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              description: Zimpler credentials object.
              properties:
                apiKey:
                  description: Zimpler API key.
                  format: password
                  type: string
                merchantId:
                  description: Zimpler merchant id.
                  type: string
              required:
                - merchantId
                - apiKey
              type: object
          required:
            - credentials
          type: object
      description: Zimpler config.
    Zotapay:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              properties:
                endpointId:
                  description: Zotapay's endpoint ID.
                  type: string
                merchantId:
                  description: Zotapay's merchant ID.
                  type: string
                merchantSecretKey:
                  description: Zotapay's merchant secret key.
                  format: password
                  type: string
              required:
                - endpointId
                - merchantId
                - merchantSecretKey
              type: object
          required:
            - credentials
          type: object
      description: Zotapay Gateway config.
    auto:
      allOf:
        - $ref: "#/components/schemas/CommonScheduleInstruction"
    dLocal:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              properties:
                secretKey:
                  format: password
                  type: string
                xLogin:
                  type: string
                xTransKey:
                  type: string
              required:
                - xLogin
                - xTransKey
                - secretKey
              type: object
            settings:
              description: dLocal settings object.
              properties:
                createInstallmentPlan:
                  default: false
                  description: Create installment plan and use it for payment.
                  type: boolean
              type: object
          required:
            - credentials
          type: object
      description: dLocal config.
    date-interval:
      allOf:
        - $ref: "#/components/schemas/CommonScheduleInstruction"
        - $ref: "#/components/schemas/CustomEventScheduleInstruction"
        - $ref: "#/components/schemas/InvoiceRetryScheduleInstruction"
        - properties:
            duration:
              description: The number of the units.
              minimum: 1
              type: integer
            unit:
              oneOf:
                - $ref: "#/components/schemas/TimeUnit"
                - $ref: "#/components/schemas/TimePluralUnit"
          required:
            - duration
            - unit
          type: object
    day-of-month:
      allOf:
        - $ref: "#/components/schemas/CommonScheduleInstruction"
        - $ref: "#/components/schemas/CustomEventScheduleInstruction"
        - $ref: "#/components/schemas/ServicePeriodAnchorInstruction"
        - $ref: "#/components/schemas/InvoiceRetryScheduleInstruction"
        - properties:
            day:
              description: |
                The day of the month when event will be scheduled.
                Be aware if the month has less days,
                the last day of the month will be selected.
              maximum: 31
              minimum: 1
              type: integer
            time:
              $ref: "#/components/schemas/TimeIso8601Extended"
          required:
            - day
          type: object
    day-of-week:
      allOf:
        - $ref: "#/components/schemas/CommonScheduleInstruction"
        - $ref: "#/components/schemas/CustomEventScheduleInstruction"
        - $ref: "#/components/schemas/ServicePeriodAnchorInstruction"
        - $ref: "#/components/schemas/InvoiceRetryScheduleInstruction"
        - properties:
            day:
              $ref: "#/components/schemas/DayOfWeekLong"
            time:
              $ref: "#/components/schemas/TimeIso8601Extended"
            week:
              default: next
              enum:
                - next
                - first-in-month
                - last-in-month
              type: string
          required:
            - day
          type: object
    discount:
      allOf:
        - $ref: "#/components/schemas/AmountAdjustment"
        - properties:
            type:
              description: The payment amount discount type.
              enum:
                - percent
                - fixed
              type: string
            value:
              description: The payment amount discount.
              format: float
              type: number
          required:
            - value
            - type
          type: object
    discounts-per-redemption:
      allOf:
        - $ref: "#/components/schemas/CouponRestriction"
        - $ref: "#/components/schemas/RedemptionRestriction"
        - properties:
            quantity:
              description: Restriction quantity.
              type: integer
          required:
            - quantity
          type: object
      description: discounts-per-redemption restrictions.
    eMerchantPay:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              properties:
                apiKey:
                  description: eMerchantPay Gateway api key.
                  format: password
                  type: string
                clientId:
                  description: eMerchantPay Gateway client ID.
                  type: string
                password:
                  description: eMerchantPay password for Genesis platform.
                  format: password
                  type: string
                token:
                  description: eMerchantPay token for Genesis platform.
                  type: string
                username:
                  description: eMerchantPay username for Genesis platform.
                  type: string
              type: object
            settings:
              description: eMerchantPay settings object.
              properties:
                platform:
                  default: IPG
                  description: eMerchantPay platform to process payment.
                  enum:
                    - IPG
                    - Genesis
                  type: string
              type: object
            threeDSecureServer:
              $ref: "#/components/schemas/eMerchantPay3dsServers"
          required:
            - credentials
          type: object
      description: eMerchantPay Gateway config.
    eMerchantPay3dsServer:
      allOf:
        - $ref: "#/components/schemas/eMerchantPay3dsServers"
      description: eMerchantPay 3DS Server.
    eMerchantPay3dsServers:
      description: eMerchantPay 3DS Servers.
      discriminator:
        mapping:
          Other: "#/components/schemas/Other"
          Paay3dsServer: "#/components/schemas/Paay3dsServer"
          ThreeDSecureIO3dsServer: "#/components/schemas/ThreeDSecureIO3dsServer"
          eMerchantPay3dsServer: "#/components/schemas/eMerchantPay3dsServer"
        propertyName: name
      properties:
        name:
          allOf:
            - $ref: "#/components/schemas/ThreeDSecureServerName"
          enum:
            - eMerchantPay3dsServer
            - ThreeDSecureIO3dsServer
            - Paay3dsServer
            - Other
      required:
        - name
      type: object
    eZeeWallet:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              description: eZeeWallet credentials object.
              properties:
                apiPassword:
                  description: eZeeWallet API password.
                  format: password
                  type: string
                apiUsername:
                  description: eZeeWallet API username.
                  format: password
                  type: string
              required:
                - apiUsername
                - apiPassword
              type: object
          required:
            - credentials
          type: object
      description: eZeeWallet config.
    ecoPayz:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              description: ecoPayz credentials object.
              properties:
                merchantAccountNumber:
                  description: ecoPayz merchant account number.
                  type: string
                merchantPassword:
                  description: ecoPayz merchant password.
                  format: password
                  type: string
                paymentPageId:
                  description: ecoPayz payment page ID.
                  type: string
              required:
                - paymentPageId
                - merchantAccountNumber
                - merchantPassword
              type: object
            settings:
              description: ecoPayz settings object.
              properties:
                validCurrency:
                  description: Three letter currency code.
                  enum:
                    - CAD
                    - EUR
                    - GBP
                    - USD
                  type: string
              required:
                - validCurrency
              type: object
          required:
            - credentials
          type: object
      description: ecoPayz config.
    ezyEFT:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              description: ezyEFT credentials object.
              properties:
                merchantId:
                  type: string
                merchantToken:
                  format: password
                  type: string
              required:
                - merchantId
                - merchantToken
              type: object
          required:
            - credentials
          type: object
      description: ezyEFT config.
    fixed:
      allOf:
        - $ref: "#/components/schemas/Discount"
        - properties:
            amount:
              description: Discount amount.
              exclusiveMinimum: true
              format: double
              minimum: 0
              type: number
            currency:
              allOf:
                - $ref: "#/components/schemas/CurrencyCode"
          required:
            - amount
            - currency
          type: object
      description: Coupon fixed amount discount.
    fixed-fee:
      allOf:
        - $ref: "#/components/schemas/PlanPriceFormula"
        - properties:
            price:
              description: >
                For the very simple price when it's fixed and does not depend on
                the quantity chosen by customer.


                If the price is 0, it's free.
              example: 99.95
              format: double
              type: number
          required:
            - price
          type: object
    flat-rate:
      allOf:
        - $ref: "#/components/schemas/PlanPriceFormula"
        - properties:
            maxQuantity:
              description: If the value is `null`, it''s assumed to be infinite.
              example: 1
              type: integer
            price:
              description: |
                Flat-rate pricing is represented in a simple price per unit.
                Some examples:

                - $30 per unit
                - $0.10 per transaction
                - $50 per period

                If the price is 0, it's free.
              example: 99.95
              format: double
              type: number
          required:
            - price
          type: object
    iCanPay:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              properties:
                authenticateId:
                  description: iCanPay Gateway authenticate ID.
                  type: string
                authenticatePw:
                  description: iCanPay Gateway authenticate password.
                  format: password
                  type: string
                publicKey:
                  description: iCanPay Gateway API public key.
                  type: string
                secretKey:
                  description: iCanPay Gateway API secret key.
                  format: password
                  type: string
              required:
                - authenticateId
                - authenticatePw
                - publicKey
                - secretKey
              type: object
            settings:
              properties:
                use3DSEndpoint:
                  description: Use 3DS endpoint.
                  type: boolean
              type: object
          required:
            - credentials
          type: object
      description: iCanPay Gateway config.
    iCheque:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              properties:
                apiSecurityToken:
                  description: Hash of the password for the Alliance API (transaction reporting).
                  format: password
                  type: string
                apiUserId:
                  description: Username for the Alliance API (transaction reporting).
                  type: string
                clientId:
                  description: iCheque Gateway client ID.
                  type: string
                secretWord:
                  description: iCheque Gateway secret word.
                  format: password
                  type: string
              required:
                - clientId
                - secretWord
              type: object
          required:
            - credentials
          type: object
      description: iCheque Gateway config.
    iDebit:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              description: iDebit credentials object.
              properties:
                merchantId:
                  description: iDebit merchant account number.
                  type: string
                password:
                  description: iDebit merchant account password.
                  format: password
                  type: string
              required:
                - merchantId
                - password
              type: object
          required:
            - credentials
          type: object
      description: iDebit config.
    immediately:
      allOf:
        - $ref: "#/components/schemas/CommonScheduleInstruction"
        - $ref: "#/components/schemas/ServicePeriodAnchorInstruction"
        - $ref: "#/components/schemas/InvoiceRetryScheduleInstruction"
    intelligent:
      allOf:
        - $ref: "#/components/schemas/CommonScheduleInstruction"
        - $ref: "#/components/schemas/CustomEventScheduleInstruction"
        - $ref: "#/components/schemas/InvoiceRetryScheduleInstruction"
        - properties:
            duration:
              description: The number of the units.
              minimum: 1
              type: integer
            unit:
              oneOf:
                - $ref: "#/components/schemas/TimeUnit"
                - $ref: "#/components/schemas/TimePluralUnit"
          required:
            - duration
            - unit
          type: object
    list:
      allOf:
        - $ref: "#/components/schemas/TimelineTable"
        - properties:
            data:
              description: Table data. Each array element represents a line.
              items:
                type: string
              type: array
          type: object
    loonie:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              description: loonie credentials object.
              properties:
                merchantId:
                  type: string
                merchantToken:
                  format: password
                  type: string
              required:
                - merchantId
                - merchantToken
              type: object
          required:
            - credentials
          type: object
      description: loonie config.
    manual:
      allOf:
        - $ref: "#/components/schemas/InvoiceShipping"
        - properties:
            amount:
              description: The invoice's shipping amount.
              type: integer
              x-type: Money
          required:
            - amount
          type: object
      description: Manually set shipping amount.
    manual-2:
      allOf:
        - $ref: "#/components/schemas/InvoiceTax"
        - properties:
            items:
              description: Taxes applied to this invoice.
              items:
                allOf:
                  - $ref: "#/components/schemas/InvoiceTaxItem"
              type: array
          required:
            - amount
          type: object
      description: Manually set tax items.
    minimum-order-amount:
      allOf:
        - $ref: "#/components/schemas/CouponRestriction"
        - $ref: "#/components/schemas/RedemptionRestriction"
        - properties:
            amount:
              description: Minimum order quantity.
              type: integer
            currency:
              allOf:
                - $ref: "#/components/schemas/CurrencyCode"
          required:
            - amount
            - currency
          type: object
      description: minimum-order-amount restrictions.
    one-column:
      allOf:
        - $ref: "#/components/schemas/TimelineTable"
        - properties:
            data:
              description: Table data. Each array element represents a table row.
              items:
                example:
                  attribute: Who
                  value: John Doe
                properties:
                  attribute:
                    type: string
                  value:
                    type: string
                type: object
              type: array
          type: object
    paid-by-time:
      allOf:
        - $ref: "#/components/schemas/CouponRestriction"
        - $ref: "#/components/schemas/RedemptionRestriction"
        - properties:
            time:
              description: The time when the coupon's redemption is no longer valid and
                removed from unpaid invoices if applied. Note that this datetime
                cannot be changed.
              format: date-time
              type: string
          required:
            - time
          type: object
      description: paid-by-time restrictions.
    partial:
      allOf:
        - $ref: "#/components/schemas/AmountAdjustment"
        - properties:
            type:
              description: The payment amount type.
              enum:
                - percent
                - fixed
              type: string
            value:
              description: The payment amount.
              format: float
              type: number
          required:
            - value
            - type
          type: object
    password:
      allOf:
        - $ref: "#/components/schemas/AuthenticationToken"
        - properties:
            customerId:
              allOf:
                - $ref: "#/components/schemas/ResourceId"
              description: The token's customer ID.
              readOnly: true
            password:
              description: The token's password.
              format: password
              type: string
              writeOnly: true
            username:
              description: The token's username.
              type: string
        - $ref: "#/components/schemas/AuthenticationTokenMetadata"
      required:
        - username
        - password
    passwordless:
      allOf:
        - $ref: "#/components/schemas/AuthenticationToken"
        - properties:
            customerId:
              allOf:
                - $ref: "#/components/schemas/ResourceId"
              description: The token's customer ID.
        - $ref: "#/components/schemas/AuthenticationTokenMetadata"
      required:
        - customerId
    percent:
      allOf:
        - $ref: "#/components/schemas/Discount"
        - properties:
            value:
              description: Discount percent.
              exclusiveMinimum: true
              format: double
              maximum: 100
              minimum: 0
              type: number
          required:
            - value
          type: object
      description: Coupon percent discount.
    rebilly:
      allOf:
        - $ref: "#/components/schemas/InvoiceShipping"
        - properties:
            amount:
              description: The invoice's shipping amount which is calculated from [Shipping
                Zones](#tag/Shipping-Zones).
              readOnly: true
              type: integer
          type: object
      description: Rebilly-based shipping which is calculated by shipping zones.
    rebilly-taxjar:
      allOf:
        - $ref: "#/components/schemas/InvoiceTax"
        - properties:
            items:
              description: >
                Taxes applied to this invoice and calculated based on the related
                Product's `taxCategoryId`.
              items:
                allOf:
                  - $ref: "#/components/schemas/InvoiceTaxItem"
              readOnly: true
              type: array
          type: object
      description: Taxjar-based taxes.
    redemption-cancel:
      allOf:
        - $ref: "#/components/schemas/TimelineAction"
        - properties:
            redemptionId:
              allOf:
                - $ref: "#/components/schemas/ResourceId"
          type: object
      description: Cancel Redemption.
    redemptions-per-customer:
      allOf:
        - $ref: "#/components/schemas/CouponRestriction"
        - $ref: "#/components/schemas/RedemptionRestriction"
        - properties:
            quantity:
              description: Restriction value.
              type: integer
          required:
            - quantity
          type: object
      description: Quantity per Customer restrictions.
    resend-email:
      allOf:
        - $ref: "#/components/schemas/TimelineAction"
        - properties:
            messageId:
              allOf:
                - $ref: "#/components/schemas/ResourceId"
          type: object
      description: Resend Email action.
    restrict-to-invoices:
      allOf:
        - $ref: "#/components/schemas/CouponRestriction"
        - $ref: "#/components/schemas/RedemptionRestriction"
        - properties:
            invoiceIds:
              description: Invoice IDs coupon can be applied to.
              items:
                type: string
              type: array
          required:
            - invoiceIds
          type: object
      description: restrict-to-invoices restrictions.
    restrict-to-plans:
      allOf:
        - $ref: "#/components/schemas/CouponRestriction"
        - $ref: "#/components/schemas/RedemptionRestriction"
        - properties:
            planIds:
              description: Plan IDs coupon can be applied to.
              items:
                type: string
              type: array
          required:
            - planIds
          type: object
      description: restrict-to-plans restrictions.
    restrict-to-products:
      allOf:
        - $ref: "#/components/schemas/CouponRestriction"
        - $ref: "#/components/schemas/RedemptionRestriction"
        - properties:
            productIds:
              description: Product IDs coupon can be applied to.
              items:
                type: string
              type: array
          required:
            - productIds
          type: object
      description: restrict-to-products restrictions.
    restrict-to-subscriptions:
      allOf:
        - $ref: "#/components/schemas/CouponRestriction"
        - $ref: "#/components/schemas/RedemptionRestriction"
        - properties:
            subscriptionIds:
              description: Order IDs coupon can be applied to.
              items:
                type: string
              type: array
          required:
            - subscriptionIds
          type: object
      description: restrict-to-subscriptions restrictions.
    ruleset-restore:
      allOf:
        - $ref: "#/components/schemas/TimelineAction"
        - properties:
            version:
              description: Rulset version to restore.
              type: integer
          type: object
      description: Restore ruleset version.
    stairstep:
      allOf:
        - $ref: "#/components/schemas/PlanPriceFormula"
        - properties:
            brackets:
              description: >
                The price brackets, along with the price formula,

                is used to calculate the amount to charge for the product on this plan on the invoice.


                The "stairstep" example:


                Price total | Max quantity | Description

                ------------|--------------|------------

                $5          | 1            | 1

                $13         | 5            | 2 to 5

                $30         | null         | 6 or more


                If someone bought 1 apple, it would be $5.


                If someone bought 2 apples, it would be $13. For 2 to 5 apples, the price is $13 in any case.
              items:
                properties:
                  maxQuantity:
                    description: >
                      If the value is `null`, it's assumed to be infinite.  It starts at
                      the end of the previous bracket.

                      If there is no previous bracket, it starts at 1.
                    example: 1
                    type: integer
                  price:
                    description: If the price is 0, it is free.
                    example: 99.95
                    format: double
                    type: number
                type: object
              minItems: 1
              type: array
          required:
            - brackets
          type: object
    three-columns:
      allOf:
        - $ref: "#/components/schemas/TimelineTable"
        - properties:
            data:
              description: Table data. Each array element represents a table row.
              items:
                example:
                  attribute: Descriptor
                  newValue: new-test.com
                  previousValue: test.com
                properties:
                  attribute:
                    type: string
                  newValue:
                    type: string
                  previousValue:
                    type: string
                type: object
              type: array
          type: object
    tiered:
      allOf:
        - $ref: "#/components/schemas/PlanPriceFormula"
        - properties:
            brackets:
              description: >
                The price brackets, along with the price formula,

                is used to calculate the amount to charge for the product on this plan on the invoice.


                The "tiered" example:


                Price per apple | Max quantity | Description

                ----------------|--------------|------------

                $5              | 1            | 1

                $4              | 5            | 2 to 5

                $3              | null         | 6 or more


                If someone bought 1 apple, it would be $5.


                If someone bought 2 apples, it would be $9. $5 per apple for the first apple, then $4 per apple for the 2nd to 5th apple.
              items:
                properties:
                  maxQuantity:
                    description: >
                      If the value is `null`, it's assumed to be infinite.  It starts at
                      the end of the previous bracket.

                      If there is no previous bracket, it starts at 1.
                    example: 1
                    type: integer
                  price:
                    description: If the price is 0, it is free.
                    example: 99.95
                    format: double
                    type: number
                type: object
              minItems: 1
              type: array
          required:
            - brackets
          type: object
    total-redemptions:
      allOf:
        - $ref: "#/components/schemas/CouponRestriction"
        - $ref: "#/components/schemas/RedemptionRestriction"
        - properties:
            quantity:
              description: Total redemptions quantity.
              type: integer
          required:
            - quantity
          type: object
      description: total-redemptions restrictions.
    two-columns:
      allOf:
        - $ref: "#/components/schemas/TimelineTable"
        - properties:
            data:
              description: Table data. Each array element represents a table row.
              items:
                example:
                  attribute: Who
                  value: John Doe
                properties:
                  attribute:
                    type: string
                  value:
                    type: string
                type: object
              type: array
          type: object
    vegaaH:
      allOf:
        - $ref: "#/components/schemas/GatewayAccount"
        - properties:
            credentials:
              properties:
                password:
                  description: vegaaH Gateway password.
                  format: password
                  type: string
                terminalId:
                  description: vegaaH Gateway terminal ID.
                  type: string
              required:
                - terminalId
                - password
              type: object
          required:
            - credentials
          type: object
      description: vegaaH Gateway config.
    volume:
      allOf:
        - $ref: "#/components/schemas/PlanPriceFormula"
        - properties:
            brackets:
              description: >
                The price brackets, along with the price formula,

                is used to calculate the amount to charge for the product on this plan on the invoice.


                The "volume" example:


                Price per apple | Max quantity | Description

                ----------------|--------------|------------

                $5              | 1            | 1

                $4              | 5            | 2 to 5

                $3              | null         | 6 or more


                If someone bought 1 apple, it would be $5.


                If someone bought 2 apples, it would be $8. For 2 to 5 apples, the price is $4 per apple.
              items:
                properties:
                  maxQuantity:
                    description: >
                      If the value is `null`, it's assumed to be infinite.  It starts at
                      the end of the previous bracket.

                      If there is no previous bracket, it starts at 1.
                    example: 1
                    type: integer
                  price:
                    description: If the price is 0, it is free.
                    example: 99.95
                    format: double
                    type: number
                type: object
              minItems: 1
              type: array
          required:
            - brackets
          type: object
  securitySchemes:
    JWT:
      bearerFormat: JWT
      description: >
        You can create a JSON Web Token (JWT) via our [JWT Session
        resource](https://user-api-docs.rebilly.com/#operation/PostSigninRequest).

        Usage format: `Bearer &lt;JWT&gt;`.
      scheme: bearer
      type: http
    PublishableApiKey:
      description: >
        Only for the Tokens resource.

        You can create a Publishable API Key via our [API Keys resource](https://user-api-docs.rebilly.com/#tag/API-Keys), by specifying the type as `publishable`.
      in: header
      name: Authorization
      type: apiKey
    SecretApiKey:
      description: >
        When you sign up for an account, you are given your first secret
        API key.

        To do so please [follow this link.](https://app.rebilly.com/signup)

        Also you can generate additional API keys, and delete API keys (as you may

        need to rotate your keys in the future). All API keys can be restricted to a

        small set of permissions (restricted API keys).
      in: header
      name: REB-APIKEY
      type: apiKey
x-tagGroups:
  - name: Customers
    tags:
      - Customers
      - Customer Authentication
      - KYC Documents
      - AML
      - Tags
      - Customers Timeline
  - name: Payment Instruments
    tags:
      - Payment Instruments
      - Payment Tokens
      - Payment Cards
      - Bank Accounts
      - PayPal Accounts
  - name: Payments
    tags:
      - Transactions
      - 3D Secure
      - Disputes
      - Blocklists
  - name: Orders &amp; Invoices
    tags:
      - Orders
      - Invoices
      - Plans
      - Products
      - Coupons
      - Shipping Zones
      - Taxes
  - name: Misc
    tags:
      - Custom Fields
      - Files
      - Reports
      - Search
      - Users
x-webhooks:
  aml-list-possibly-matched:
    post:
      operationId: aml-list-possibly-matched
      requestBody:
        $ref: "#/components/requestBodies/Customer-2"
      responses:
        2xx:
          description: Return any 2xx status to indicate that the data was received
            successfully.
      summary: AML list possibly matched
      tags:
        - AML
  customer-created:
    post:
      operationId: customer-created
      requestBody:
        $ref: "#/components/requestBodies/Customer-2"
      responses:
        2xx:
          description: Return any 2xx status to indicate that the data was received
            successfully.
      summary: Customer created
      tags:
        - Customers
  customer-merged:
    post:
      operationId: customer-merged
      requestBody:
        $ref: "#/components/requestBodies/MergedCustomer"
      responses:
        2xx:
          description: Return any 2xx status to indicate that the data was received
            successfully.
      summary: Customer merged
      tags:
        - Customers
  customer-one-time-password-requested:
    post:
      operationId: customer-one-time-password-requested
      requestBody:
        $ref: "#/components/requestBodies/Customer-2"
      responses:
        2xx:
          description: Return any 2xx status to indicate that the data was received
            successfully.
      summary: Customer one-time-password requested
      tags:
        - Customers
  customer-updated:
    post:
      operationId: customer-updated
      requestBody:
        $ref: "#/components/requestBodies/Customer-2"
      responses:
        2xx:
          description: Return any 2xx status to indicate that the data was received
            successfully.
      summary: Customer updated
      tags:
        - Customers
  dispute-created:
    post:
      operationId: dispute-created
      requestBody:
        $ref: "#/components/requestBodies/Dispute-2"
      responses:
        2xx:
          description: Return any 2xx status to indicate that the data was received
            successfully.
      summary: Dispute created
      tags:
        - Disputes
  experian-check-performed:
    post:
      operationId: experian-check-performed
      requestBody:
        $ref: "#/components/requestBodies/ExperianCheckPerformed"
      responses:
        2xx:
          description: Return any 2xx status to indicate that the data was received
            successfully.
      summary: Experian check performed
      tags:
        - Customers
  gateway-account-downtime-ended:
    post:
      operationId: gateway-account-downtime-ended
      requestBody:
        $ref: "#/components/requestBodies/GatewayAccount"
      responses:
        2xx:
          description: Return any 2xx status to indicate that the data was received
            successfully.
      summary: Gateway account downtime ended
      tags:
        - Gateway Accounts
  gateway-account-downtime-started:
    post:
      operationId: gateway-account-downtime-started
      requestBody:
        $ref: "#/components/requestBodies/GatewayAccount"
      responses:
        2XX:
          description: Return any 2XX status to indicate that the data was received
            successfully.
      summary: Gateway account downtime started
      tags:
        - Gateway Accounts
  gateway-account-limit-reached:
    post:
      operationId: gateway-account-limit-reached
      requestBody:
        $ref: "#/components/requestBodies/GatewayAccountAndGatewayAccountLimit"
      responses:
        2XX:
          description: Return any 2XX status to indicate that the data was received
            successfully.
      summary: Gateway account limit reached
      tags:
        - Gateway Accounts
  gateway-account-requested:
    post:
      operationId: gateway-account-requested
      requestBody:
        $ref: "#/components/requestBodies/Transaction"
      responses:
        2xx:
          description: Return any 2xx status to indicate that the data was received
            successfully.
      summary: Gateway account requested
      tags:
        - Transactions
  invoice-abandoned:
    post:
      operationId: invoice-abandoned
      requestBody:
        $ref: "#/components/requestBodies/Invoice-2"
      responses:
        2xx:
          description: Return any 2xx status to indicate that the data was received
            successfully.
      summary: Invoice abandoned
      tags:
        - Invoices
  invoice-created:
    post:
      operationId: invoice-created
      requestBody:
        $ref: "#/components/requestBodies/Invoice-2"
      responses:
        2xx:
          description: Return any 2xx status to indicate that the data was received
            successfully.
      summary: Invoice created
      tags:
        - Invoices
  invoice-issued:
    post:
      operationId: invoice-issued
      requestBody:
        $ref: "#/components/requestBodies/Invoice-2"
      responses:
        2xx:
          description: Return any 2xx status to indicate that the data was received
            successfully.
      summary: Invoice issued
      tags:
        - Invoices
  invoice-modified:
    post:
      operationId: invoice-modified
      requestBody:
        $ref: "#/components/requestBodies/Invoice-2"
      responses:
        2xx:
          description: Return any 2xx status to indicate that the data was received
            successfully.
      summary: Invoice modified
      tags:
        - Invoices
  invoice-paid:
    post:
      operationId: invoice-paid
      requestBody:
        $ref: "#/components/requestBodies/Invoice-2"
      responses:
        2xx:
          description: Return any 2xx status to indicate that the data was received
            successfully.
      summary: Invoice paid
      tags:
        - Invoices
  invoice-past-due:
    post:
      operationId: invoice-past-due
      requestBody:
        $ref: "#/components/requestBodies/Invoice-2"
      responses:
        2xx:
          description: Return any 2xx status to indicate that the data was received
            successfully.
      summary: Invoice past due
      tags:
        - Invoices
  invoice-past-due-reminder:
    post:
      operationId: invoice-past-due-reminder
      requestBody:
        $ref: "#/components/requestBodies/Invoice-2"
      responses:
        2xx:
          description: Return any 2xx status to indicate that the data was received
            successfully.
      summary: Invoice past due reminder
      tags:
        - Invoices
  invoice-reissued:
    post:
      operationId: invoice-reissued
      requestBody:
        $ref: "#/components/requestBodies/Invoice-2"
      responses:
        2xx:
          description: Return any 2xx status to indicate that the data was received
            successfully.
      summary: Invoice reissued
      tags:
        - Invoices
  invoice-voided:
    post:
      operationId: invoice-voided
      requestBody:
        $ref: "#/components/requestBodies/Invoice-2"
      responses:
        2xx:
          description: Return any 2xx status to indicate that the data was received
            successfully.
      summary: Invoice voided
      tags:
        - Invoices
  kyc-document-accepted:
    post:
      operationId: kyc-document-accepted
      requestBody:
        $ref: "#/components/requestBodies/KycDocument"
      responses:
        2xx:
          description: Return any 2xx status to indicate that the data was received
            successfully.
      summary: KYC document accepted
      tags:
        - KYC Documents
  kyc-document-modified:
    post:
      operationId: kyc-document-modified
      requestBody:
        $ref: "#/components/requestBodies/KycDocument"
      responses:
        2xx:
          description: Return any 2xx status to indicate that the data was received
            successfully.
      summary: KYC document modified
      tags:
        - KYC Documents
  kyc-document-rejected:
    post:
      operationId: kyc-document-rejected
      requestBody:
        $ref: "#/components/requestBodies/KycDocument"
      responses:
        2xx:
          description: Return any 2xx status to indicate that the data was received
            successfully.
      summary: KYC document rejected
      tags:
        - KYC Documents
  kyc-document-reviewed:
    post:
      operationId: kyc-document-reviewed
      requestBody:
        $ref: "#/components/requestBodies/KycDocument"
      responses:
        2xx:
          description: Return any 2xx status to indicate that the data was received
            successfully.
      summary: KYC document reviewed
      tags:
        - KYC Documents
  nsf-response-received:
    post:
      operationId: nsf-response-received
      requestBody:
        $ref: "#/components/requestBodies/Transaction"
      responses:
        2xx:
          description: Return any 2xx status to indicate that the data was received
            successfully.
      summary: NSF response received
      tags:
        - Transactions
  offsite-payment-completed:
    post:
      operationId: offsite-payment-completed
      requestBody:
        $ref: "#/components/requestBodies/Transaction"
      responses:
        2xx:
          description: Return any 2xx status to indicate that the data was received
            successfully.
      summary: Offsite payment completed
      tags:
        - Transactions
  order-completed:
    post:
      operationId: order-completed
      requestBody:
        $ref: "#/components/requestBodies/Subscription-2"
      responses:
        2xx:
          description: Return any 2xx status to indicate that the data was received
            successfully.
      summary: Order completed
      tags:
        - Orders
  payment-card-created:
    post:
      operationId: payment-card-created
      requestBody:
        $ref: "#/components/requestBodies/PaymentCard"
      responses:
        2xx:
          description: Return any 2xx status to indicate that the data was received
            successfully.
      summary: Payment card created
      tags:
        - Payment Cards
  payment-card-expiration-reminder:
    post:
      operationId: payment-card-expiration-reminder
      requestBody:
        $ref: "#/components/requestBodies/PaymentCard"
      responses:
        2xx:
          description: Return any 2xx status to indicate that the data was received
            successfully.
      summary: Payment card expiration reminder
      tags:
        - Payment Cards
  payment-card-expired:
    post:
      operationId: payment-card-expired
      requestBody:
        $ref: "#/components/requestBodies/PaymentCard"
      responses:
        2xx:
          description: Return any 2xx status to indicate that the data was received
            successfully.
      summary: Payment card expired
      tags:
        - Payment Cards
  renewal-invoice-issued:
    post:
      operationId: renewal-invoice-issued
      requestBody:
        $ref: "#/components/requestBodies/InvoiceAndSubscription"
      responses:
        2xx:
          description: Return any 2xx status to indicate that the data was received
            successfully.
      summary: Renewal invoice issued
      tags:
        - Orders
  renewal-invoice-payment-canceled:
    post:
      operationId: renewal-invoice-payment-canceled
      requestBody:
        $ref: "#/components/requestBodies/InvoiceAndTransaction"
      responses:
        2xx:
          description: Return any 2xx status to indicate that the data was received
            successfully.
      summary: Renewal invoice payment canceled
      tags:
        - Invoices
  renewal-invoice-payment-declined:
    post:
      operationId: renewal-invoice-payment-declined
      requestBody:
        $ref: "#/components/requestBodies/InvoiceAndTransaction"
      responses:
        2xx:
          description: Return any 2xx status to indicate that the data was received
            successfully.
      summary: Renewal invoice payment declined
      tags:
        - Invoices
  risk-score-changed:
    post:
      operationId: risk-score-changed
      requestBody:
        $ref: "#/components/requestBodies/Transaction"
      responses:
        2xx:
          description: Return any 2xx status to indicate that the data was received
            successfully.
      summary: Risk score changed
      tags:
        - Transactions
  subscription-activated:
    post:
      operationId: subscription-activated
      requestBody:
        $ref: "#/components/requestBodies/Subscription-2"
      responses:
        2xx:
          description: Return any 2xx status to indicate that the data was received
            successfully.
      summary: Order activated
      tags:
        - Orders
  subscription-canceled:
    post:
      operationId: subscription-canceled
      requestBody:
        $ref: "#/components/requestBodies/Subscription-2"
      responses:
        2xx:
          description: Return any 2xx status to indicate that the data was received
            successfully.
      summary: Subscription order canceled
      tags:
        - Orders
  subscription-modified:
    post:
      operationId: subscription-modified
      requestBody:
        $ref: "#/components/requestBodies/Subscription-2"
      responses:
        2xx:
          description: Return any 2xx status to indicate that the data was received
            successfully.
      summary: Order modified
      tags:
        - Orders
  subscription-reactivated:
    post:
      operationId: subscription-reactivated
      requestBody:
        $ref: "#/components/requestBodies/Subscription-2"
      responses:
        2xx:
          description: Return any 2xx status to indicate that the data was received
            successfully.
      summary: Subscription reactivated
      tags:
        - Orders
  subscription-renewal-reminder:
    post:
      operationId: subscription-renewal-reminder
      requestBody:
        $ref: "#/components/requestBodies/Subscription-2"
      responses:
        2xx:
          description: Return any 2xx status to indicate that the data was received
            successfully.
      summary: Subscription renewal reminder
      tags:
        - Orders
  subscription-renewed:
    post:
      operationId: subscription-renewed
      requestBody:
        $ref: "#/components/requestBodies/Subscription-2"
      responses:
        2xx:
          description: Return any 2xx status to indicate that the data was received
            successfully.
      summary: Subscription renewed
      tags:
        - Orders
  subscription-trial-converted:
    post:
      operationId: subscription-trial-converted
      requestBody:
        $ref: "#/components/requestBodies/Subscription-2"
      responses:
        2xx:
          description: Return any 2xx status to indicate that the data was received
            successfully.
      summary: Subscription trial converted
      tags:
        - Orders
  subscription-trial-end-changed:
    post:
      operationId: subscription-trial-end-changed
      requestBody:
        $ref: "#/components/requestBodies/Subscription-2"
      responses:
        2xx:
          description: Return any 2xx status to indicate that the data was received
            successfully.
      summary: Subscription trial end changed
      tags:
        - Orders
  subscription-trial-end-reminder:
    post:
      operationId: subscription-trial-end-reminder
      requestBody:
        $ref: "#/components/requestBodies/Subscription-2"
      responses:
        2xx:
          description: Return any 2xx status to indicate that the data was received
            successfully.
      summary: Subscription trial end reminder
      tags:
        - Orders
  subscription-trial-ended:
    post:
      operationId: subscription-trial-ended
      requestBody:
        $ref: "#/components/requestBodies/Subscription-2"
      responses:
        2xx:
          description: Return any 2xx status to indicate that the data was received
            successfully.
      summary: Subscription trial ended
      tags:
        - Orders
  transaction-amount-discrepancy-found:
    post:
      operationId: transaction-amount-discrepancy-found
      requestBody:
        $ref: "#/components/requestBodies/Transaction"
      responses:
        2xx:
          description: Return any 2xx status to indicate that the data was received
            successfully.
      summary: Transaction amount discrepancy found
      tags:
        - Transactions
  transaction-declined:
    post:
      operationId: transaction-declined
      requestBody:
        $ref: "#/components/requestBodies/Transaction"
      responses:
        2xx:
          description: Return any 2xx status to indicate that the data was received
            successfully.
      summary: Transaction declined
      tags:
        - Transactions
  transaction-discrepancy-found:
    post:
      operationId: transaction-discrepancy-found
      requestBody:
        $ref: "#/components/requestBodies/Transaction"
      responses:
        2xx:
          description: Return any 2xx status to indicate that the data was received
            successfully.
      summary: Transaction discrepancy found
      tags:
        - Transactions
  transaction-process-requested:
    post:
      operationId: transaction-process-requested
      requestBody:
        $ref: "#/components/requestBodies/Transaction"
      responses:
        2xx:
          description: Return any 2xx status to indicate that the data was received
            successfully.
      summary: Transaction process requested
      tags:
        - Transactions
  transaction-processed:
    post:
      operationId: transaction-processed
      requestBody:
        $ref: "#/components/requestBodies/Transaction"
      responses:
        2xx:
          description: Return any 2xx status to indicate that the data was received
            successfully.
      summary: Transaction processed
      tags:
        - Transactions
  transaction-timeout-resolved:
    post:
      operationId: transaction-timeout-resolved
      requestBody:
        $ref: "#/components/requestBodies/Transaction"
      responses:
        2xx:
          description: Return any 2xx status to indicate that the data was received
            successfully.
      summary: Transaction timeout resolved
      tags:
        - Transactions
  waiting-gateway-transaction-completed:
    post:
      operationId: waiting-gateway-transaction-completed
      requestBody:
        $ref: "#/components/requestBodies/Transaction"
      responses:
        2xx:
          description: Return any 2xx status to indicate that the data was received
            successfully.
      summary: Waiting gateway transaction completed
      tags:
        - Transactions
