Marqeta Card Group API

The Card Group API from Marqeta — 2 operation(s) for card group.

OpenAPI Specification

marqeta-card-group-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  contact:
    email: support@marqeta.com
    name: Marqeta
  description: Marqeta's Core API endpoints, conveniently annotated to enable code generation (including SDKs), test cases, and documentation. Currently in beta.
  termsOfService: https://www.marqeta.com/api-terms
  title: Core accepted countries Card Group API
  version: 3.0.39
servers:
- url: /v3
security:
- mqAppAndAccessToken: []
tags:
- name: Card Group
paths:
  /cardgroups:
    get:
      description: Get a list of all card groups in the program
      operationId: listCardGroups
      parameters:
      - description: list of unique card identifiers to retrieve.
        explode: true
        in: query
        name: card_tokens
        required: false
        schema:
          items:
            type: string
          type: array
        style: form
      - description: Number of card group resources to retrieve.
        explode: true
        in: query
        name: count
        required: false
        schema:
          maximum: 10
          minimum: 1
          type: integer
        style: form
      - description: Sort order index of the first resource in the returned array.
        explode: true
        in: query
        name: start_index
        required: false
        schema:
          minimum: 0
          type: integer
        style: form
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CardGroupPage'
          description: Expected response to a valid request.
        default:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Unexpected error
      summary: List Card Groups
      tags:
      - Card Group
    post:
      description: Create a new card group object
      operationId: createCardGroup
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CardGroupReq'
        description: Card group to create.
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CardGroup'
          description: Expected response
        default:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Unexpected error
      summary: Create Card Group
      tags:
      - Card Group
  /cardgroups/{token}:
    get:
      description: Retrieves the Card Group with the given token
      operationId: retrieveCardGroup
      parameters:
      - description: Unique identifier of the card group to retrieve
        explode: false
        in: path
        name: token
        required: true
        schema:
          type: string
        style: simple
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CardGroup'
          description: A JSON object containing `card_group` information.
        default:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Unexpected error
      summary: Retrieve Card Group
      tags:
      - Card Group
components:
  schemas:
    Error:
      properties:
        code:
          type: integer
        message:
          type: string
      type: object
    CardGroup:
      description: Request body for a Card Group object
      properties:
        card_tokens:
          description: Array of card tokens associated with group. There will be at least one card token in the array.
          items:
            type: string
          type: array
        created_time:
          description: 'Date and time the card group was created in the system.

            The date and time is provided in ISO 8601 format.'
          format: date-time
          type: string
        last_issued_card_token:
          description: Unique identifier of the last reissued card token associated with group. It may be empty if there is no reissued card.
          maxLength: 36
          minLength: 1
          type: string
        source_card_token:
          description: 'Unique identifier of the card token associated with group. This is the card that will be used to create the card group.

            The Card Group Service will send a request to JCard to verify that this card is not a reissue or replacement.'
          maxLength: 36
          minLength: 1
          type: string
        token:
          description: 'Unique identifier of the card group.


            If you do not include a token, the system will generate one automatically.

            This token is necessary for use in other API calls, so we recommend that rather than let the system generate one, you use a simple string that is easy to remember.

            This value cannot be updated.'
          maxLength: 36
          minLength: 1
          type: string
        updated_time:
          description: 'Date and time the card group was last updated in the system.

            The date and time is provided in ISO 8601 format.'
          format: date-time
          type: string
        user_token:
          description: Unique identifier of the user this card group belongs to.
          maxLength: 36
          minLength: 1
          type: string
      required:
      - source_card_token
      - token
      type: object
    CardGroupPage:
      properties:
        count:
          description: 'Number of resources retrieved.


            This field is returned if there are resources in your returned array.'
          format: int32
          type: integer
        data:
          description: 'Array of Card Group objects.


            Objects are returned as appropriate to your query.'
          items:
            $ref: '#/components/schemas/CardGroup'
          type: array
        end_index:
          description: 'Sort order index of the last resource in the returned array.


            This field is returned if there are resources in your returned array.'
          format: int32
          type: integer
        is_more:
          default: false
          description: 'A value of `true` indicates that more unreturned resources exist.

            A value of `false` indicates that no more unreturned resources exist.


            This field is returned if there are resources in your returned array.'
          type: boolean
        start_index:
          description: 'Sort order index of the first resource in the returned array.


            This field is returned if there are resources in your returned array.'
          format: int32
          type: integer
      type: object
    CardGroupReq:
      description: Request body for creating a new Card Group object
      properties:
        card_token:
          description: Unique identifier token of the card token to be associated with the group.
          maxLength: 36
          minLength: 1
          type: string
      required:
      - card_token
      type: object
  securitySchemes:
    mqAppAndAccessToken:
      scheme: basic
      type: http