# List Payment Methods

> Management API · Payment

```http
GET https://app.mk.io/api/v1/organization/paymentMethods
```

## Listing, Sorting and Filtering Payment Methods

This endpoint returns the list of payment methods.

### Sorting

The results from this endpoint can be ordered using the `$orderby` query parameter. Specify a list of field names, separated by commas where each one can optionally specify `asc` or `desc`.

Sorting is valid on the following fields: `aws/awsAccountId`, `azure/azureSaasSubscriptionId`, `azure/azureSaasSubscriptionName`, `created`, `createdBy`, `displayName`, `id`, `type`

### Filtering

The `$filter` query parameter allows for payment methods to be filtered on the basis of fields in the schema using OData query syntax. See [this document](https://learn.microsoft.com/en-us/odata/concepts/queryoptions-overview#filter) for more details on the syntax used.

Filters are valid on the following fields: `aws/awsAccountId`, `azure/azureSaasSubscriptionId`, `azure/azureSaasSubscriptionName`, `created`, `createdBy`, `createdByEmail`, `createdByName`, `displayName`, `id`, `type`

### Examples:

`?$top=10` - Returns only the first 10 payment methods from the list.

`?$orderby=created desc` - Sorts payment methods by creation date in descending order.

`?$filter=created ge 2021-01-01T00:00:00Z` - Returns payment methods created after January 1, 2021.

RBAC Capability Required: `core.subscription.get`

## Authentication

- `Authorization` header — Bearer authentication of the form `Bearer <token>`.

## Query parameters

| Name          | Type   | Required | Description                                                                                                                                         |
|---------------|--------|----------|-----------------------------------------------------------------------------------------------------------------------------------------------------|
| `$orderby`    | string | No       | Specifies the key by which the result collection should be ordered.                                                                               |
| `$filter`     | string | No       | Restricts the set of items returned.                                                                                                              |
| `$top`        | string | No       | Specifies a non-negative integer `n` that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value `n`.|
| `$skiptoken`  | string | No       | Specifies a start offset to support paginated results. Use `@odata.nextLink` in the result object to enumerate the collection - it will be present only if there's more than one page of entities.|

## Example request

```bash
curl -X GET "https://app.mk.io/api/v1/organization/paymentMethods" \
  -H "Authorization: Bearer <token>"
```

## Responses

### 200 — A list of all payment methods

- `@odata.nextLink` · string · Optional — @odata.nextLink URL if the page length and number of items match.
- `supplemental` · object · **Required** — Supplemental info
  - `count` · integer · **Required** — Number of items returned
  - `kind` · string · **Required** — Type of items in the list
  - `operation` · string · **Required** — Operation type. Should always say 'list'
  - `pagination` · object · **Required** — Pagination info
    - `end` · integer · **Required** — Position of the last item in the list
    - `records` · integer · **Required** — Total number of items returned in the list
    - `start` · integer · **Required** — Position of the first item in the list
    - `total` · integer · **Required** — Total number of items in the project
  - `subscription` · object · Optional — Project info
    - `id` · string · **Required** — Project ID
    - `name` · string · **Required** — Project name
- `value` · list of objects · **Required** — Method list.
  - Array items (object):
    - `metadata` · object · Optional — Metadata.
      - `created` · string · Optional · _format: date-time_ — The time when the resource was created
      - `createdBy` · string · Optional · _format: uuid_ — ID of the user who created the resource
      - `createdByEmail` · string · Optional — Email of the user who created the resource
      - `displayName` · string · Optional — The display name of the resource
      - `id` · string · **Required** · _format: uuid_ — The ID of the resource
      - `organizationId` · string or null · **Required** · _format: uuid_ — The ID of the organization this Payment Method belongs to.
    - `related` · object · Optional — Related data.
      - `projects` · list of strings · **Required** — List of project names which are billed using this payment method.
        - Array items (string):
    - `spec` · object · **Required** — Specification.
      - One of the following variants, selected by `type`:
        - **azure** (object)
          - `allowedOrganizations` · list of strings or null · Optional — If set, only these organization IDs are allowed to use this payment method.
            - Array items (string):
          - `autoPurchaseBeamLicenses` · boolean · **Required** — Specifies whether Beam usage should be billed through monthly charges (true) or by the minute (false).
          - `azureOfferId` · string or null · Optional — The Azure offer ID.
          - `azurePlanName` · string or null · Optional — The Azure plan name.
          - `azurePrivateOfferId` · string · Optional · _format: uuid_ — The Partner Center private offer UUID. Present only for azure_private_offer payment methods.
          - `azureSaasSubscriptionAutoRenew` · boolean or null · Optional
          - `azureSaasSubscriptionEnd` · string or null · Optional
          - `azureSaasSubscriptionId` · string or null · Optional
          - `azureSaasSubscriptionName` · string or null · Optional
          - `azureSaasSubscriptionStart` · string or null · Optional
          - `azureSaasSubscriptionStatus` · string or null · Optional
          - `endDate` · string or null · **Required** · _format: date_ — The date this payment method expires, in yyyy-mm-dd format. It is not valid on this day. If not set, this payment method never expires. If startDate is also set, endDate must be after startDate.
          - `notes` · string · Optional · _<=256 characters_ — Note to the customer.
          - `productPublicationName` · string · **Required** — The name of the product publication that details the pricing for this payment method.
          - `startDate` · string or null · **Required** · _format: date_ — The date this payment method becomes eligible to be active, in yyyy-mm-dd format. It is valid on this day. If not set, there is no lower bound. If both startDate and endDate are set, endDate must be after startDate.
          - `type` · string · **Required** — Payment method type. Defaults to `direct` if not specified.
        - **aws** (object)
          - `allowedOrganizations` · list of strings or null · Optional — If set, only these organization IDs are allowed to use this payment method.
            - Array items (string):
          - `autoPurchaseBeamLicenses` · boolean · **Required** — Specifies whether Beam usage should be billed through monthly charges (true) or by the minute (false).
          - `awsAccountId` · string · Optional — The AWS account ID.
          - `awsCustomerId` · string or null · Optional — Unique AWS account identifier specific to AWS SaaS Marketplace.
          - `awsOfferId` · string · Optional — Unique AWS private offer identifier.
          - `awsProductCode` · string · Optional — The MK.IO product code in the AWS SaaS Marketplace.
          - `awsStatus` · string or null · Optional
          - `endDate` · string or null · **Required** · _format: date_ — The date this payment method expires, in yyyy-mm-dd format. It is not valid on this day. If not set, this payment method never expires. If startDate is also set, endDate must be after startDate.
          - `notes` · string · Optional · _<=256 characters_ — Note to the customer.
          - `productPublicationName` · string · **Required** — The name of the product publication that details the pricing for this payment method.
          - `startDate` · string or null · **Required** · _format: date_ — The date this payment method becomes eligible to be active, in yyyy-mm-dd format. It is valid on this day. If not set, there is no lower bound. If both startDate and endDate are set, endDate must be after startDate.
          - `type` · string · **Required** — Payment method type. Defaults to `direct` if not specified.
        - **direct** (object)
          - `allowedOrganizations` · list of strings or null · Optional — If set, only these organization IDs are allowed to use this payment method.
            - Array items (string):
          - `autoPurchaseBeamLicenses` · boolean · **Required** — Specifies whether Beam usage should be billed through monthly charges (true) or by the minute (false).
          - `endDate` · string or null · **Required** · _format: date_ — The date this payment method expires, in yyyy-mm-dd format. It is not valid on this day. If not set, this payment method never expires. If startDate is also set, endDate must be after startDate.
          - `notes` · string · Optional · _<=256 characters_ — Note to the customer.
          - `productPublicationName` · string · **Required** — The name of the product publication that details the pricing for this payment method.
          - `redeemedBy` · string or null · Optional — The email of the user who redeemed this sales order.
          - `salesOrderNumber` · string · Optional — The document number from NetSuite, SOxxx
          - `startDate` · string or null · **Required** · _format: date_ — The date this payment method becomes eligible to be active, in yyyy-mm-dd format. It is valid on this day. If not set, there is no lower bound. If both startDate and endDate are set, endDate must be after startDate.
          - `status` · string · Optional — The status of the purchase order in MediaKind's systems.
          - `type` · string · **Required** — Payment method type. Defaults to `direct` if not specified.
    - `status` · object · Optional — Status.
      - `isActive` · boolean · **Required** — Is payment method active
      - `termsAndConditionsAccepted` · boolean · **Required** — Whether the Terms & Conditions of this payment method have been accepted.

### 400 — Bad Request

- `error` · object · **Required** — Pertinent information about the error
  - `code` · string · **Required** — The error code.
  - `detail` · string · **Required** — The error message.
  - `extraDetail` · map from strings to any · Optional — Extra information regarding this error.
    - `[any key]` · any — map of additional properties
- `ref` · string · **Required** — A reference to the request that caused the error.
- `status` · integer · **Required** — The HTTP status code

### 401 — Unauthorized

### 403 — Forbidden

### 404 — Not Found

### 429 — Too Many Requests

### 500 — Internal Server Error

---

Source spec: `management-api` · operationId: `[get]_/api/v1/organization/paymentMethods`
