Shift4 Payments Cards API

Manage saved cards on customer records.

Documentation

Specifications

Schemas & Data

Other Resources

OpenAPI Specification

shift4-payments-cards-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: Shift4 Payments Blacklist Cards API
  description: The Shift4 Payments API enables merchants and platforms to accept and manage payments, including one-time charges, refunds, customers, cards, tokenization, subscriptions, plans, payment methods, payment links, checkout sessions, fraud warnings, blacklist rules, disputes, file uploads, payouts, webhook endpoints, and events. Endpoints, parameters, and resource shapes are extracted from the public Shift4 documentation at https://dev.shift4.com/docs/api and the official open-source Shift4 SDKs (Java, Node, Python, Ruby, PHP, .NET, iOS, Android, WooCommerce, Salesforce B2C) maintained at https://github.com/shift4developer.
  version: '1.0'
  contact:
    name: Shift4 Developer Support
    email: devsupport@shift4.com
    url: https://dev.shift4.com
  license:
    name: Documentation
    url: https://dev.shift4.com/docs
servers:
- url: https://api.shift4.com
  description: Production
security:
- BasicAuth: []
tags:
- name: Cards
  description: Manage saved cards on customer records.
paths:
  /customers/{customerId}/cards:
    parameters:
    - name: customerId
      in: path
      required: true
      schema:
        type: string
    post:
      tags:
      - Cards
      summary: Create a Card
      operationId: createCard
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CardRequest'
      responses:
        '200':
          description: Card created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Card'
    get:
      tags:
      - Cards
      summary: List Cards
      operationId: listCards
      parameters:
      - $ref: '#/components/parameters/Limit'
      responses:
        '200':
          description: A list of cards.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CardList'
  /customers/{customerId}/cards/{cardId}:
    parameters:
    - name: customerId
      in: path
      required: true
      schema:
        type: string
    - name: cardId
      in: path
      required: true
      schema:
        type: string
    get:
      tags:
      - Cards
      summary: Retrieve a Card
      operationId: getCard
      responses:
        '200':
          description: A card object.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Card'
    post:
      tags:
      - Cards
      summary: Update a Card
      operationId: updateCard
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CardUpdateRequest'
      responses:
        '200':
          description: Updated card.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Card'
    delete:
      tags:
      - Cards
      summary: Delete a Card
      operationId: deleteCard
      responses:
        '200':
          description: Deletion result.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeleteResponse'
components:
  schemas:
    ListResponseCard:
      type: object
      properties:
        list:
          type: array
          items:
            $ref: '#/components/schemas/Card'
        hasMore:
          type: boolean
        totalCount:
          type: integer
    CardList:
      $ref: '#/components/schemas/ListResponseCard'
    DeleteResponse:
      type: object
      properties:
        id:
          type: string
        deleted:
          type: boolean
    CardUpdateRequest:
      type: object
      properties:
        cardholderName:
          type: string
        expMonth:
          type: string
        expYear:
          type: string
        addressLine1:
          type: string
        addressLine2:
          type: string
        addressCity:
          type: string
        addressState:
          type: string
        addressZip:
          type: string
        addressCountry:
          type: string
    CardRequest:
      type: object
      properties:
        cardholderName:
          type: string
        number:
          type: string
        expMonth:
          type: string
        expYear:
          type: string
        cvc:
          type: string
        addressLine1:
          type: string
        addressLine2:
          type: string
        addressCity:
          type: string
        addressState:
          type: string
        addressZip:
          type: string
        addressCountry:
          type: string
    Card:
      type: object
      properties:
        id:
          type: string
        created:
          type: integer
          format: int64
          description: Unix timestamp.
        deleted:
          type: boolean
        first6:
          type: string
        last4:
          type: string
        fingerprint:
          type: string
        expMonth:
          type: string
        expYear:
          type: string
        cardholderName:
          type: string
        customerId:
          type: string
        brand:
          type: string
          description: Card brand.
          enum:
          - Visa
          - MasterCard
          - AmericanExpress
          - Discover
          - JCB
          - DinersClub
          - UnionPay
          - Other
        type:
          type: string
          enum:
          - Credit
          - Debit
          - Prepaid
          - Other
        country:
          type: string
        addressLine1:
          type: string
        addressLine2:
          type: string
        addressCity:
          type: string
        addressState:
          type: string
        addressZip:
          type: string
        addressCountry:
          type: string
        issuer:
          type: string
        merchantAccountId:
          type: string
  parameters:
    Limit:
      name: limit
      in: query
      schema:
        type: integer
        minimum: 1
        maximum: 100
        default: 10
      description: A limit on the number of objects to be returned.
  securitySchemes:
    BasicAuth:
      type: http
      scheme: basic
      description: Use your secret API key as the username with an empty password.