Shift4 Payments Customers API

Create, retrieve, update, delete, and list customers.

Documentation

Specifications

Schemas & Data

Other Resources

OpenAPI Specification

shift4-payments-customers-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: Shift4 Payments Blacklist Customers 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: Customers
  description: Create, retrieve, update, delete, and list customers.
paths:
  /customers:
    post:
      tags:
      - Customers
      summary: Create a Customer
      operationId: createCustomer
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CustomerRequest'
      responses:
        '200':
          description: Customer created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Customer'
    get:
      tags:
      - Customers
      summary: List Customers
      operationId: listCustomers
      parameters:
      - $ref: '#/components/parameters/Limit'
      responses:
        '200':
          description: A list of customers.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerList'
  /customers/{customerId}:
    parameters:
    - name: customerId
      in: path
      required: true
      schema:
        type: string
    get:
      tags:
      - Customers
      summary: Retrieve a Customer
      operationId: getCustomer
      responses:
        '200':
          description: A customer object.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Customer'
    post:
      tags:
      - Customers
      summary: Update a Customer
      operationId: updateCustomer
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CustomerRequest'
      responses:
        '200':
          description: Updated customer.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Customer'
    delete:
      tags:
      - Customers
      summary: Delete a Customer
      operationId: deleteCustomer
      responses:
        '200':
          description: Deletion result.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeleteResponse'
components:
  schemas:
    Billing:
      type: object
      properties:
        name:
          type: string
        email:
          type: string
          format: email
        address:
          $ref: '#/components/schemas/Address'
        vatNumber:
          type: string
    Customer:
      type: object
      properties:
        id:
          type: string
        created:
          type: integer
          format: int64
        deleted:
          type: boolean
        email:
          type: string
          format: email
        phoneNumber:
          type: string
        description:
          type: string
        defaultCardId:
          type: string
        cards:
          type: array
          items:
            $ref: '#/components/schemas/Card'
        billing:
          $ref: '#/components/schemas/Billing'
        metadata:
          type: object
          additionalProperties:
            type: string
    Address:
      type: object
      properties:
        line1:
          type: string
        line2:
          type: string
        zip:
          type: string
        city:
          type: string
        state:
          type: string
        country:
          type: string
          description: ISO 3166-1 alpha-2 country code.
    ListResponseCustomer:
      type: object
      properties:
        list:
          type: array
          items:
            $ref: '#/components/schemas/Customer'
        hasMore:
          type: boolean
        totalCount:
          type: integer
    DeleteResponse:
      type: object
      properties:
        id:
          type: string
        deleted:
          type: boolean
    CustomerRequest:
      type: object
      properties:
        email:
          type: string
          format: email
        phoneNumber:
          type: string
        description:
          type: string
        billing:
          $ref: '#/components/schemas/Billing'
        metadata:
          type: object
          additionalProperties:
            type: string
        card:
          oneOf:
          - $ref: '#/components/schemas/CardRequest'
          - 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
    CustomerList:
      $ref: '#/components/schemas/ListResponseCustomer'
  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.