PAY.JP Cards API

The Cards API from PAY.JP — 2 operation(s) for cards.

OpenAPI Specification

payjp-cards-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: PAY.JP 3D Secure Cards API
  description: PAY.JP is an online payment service operated by PAY, Inc. (PAY株式会社) in Japan. The REST API creates charges, tokenizes cards, manages customers, runs subscriptions (定期課金), and reports transfers (入金) and balances in Japanese yen. Authentication is HTTP Basic with a secret key (sk_test_ / sk_live_) as the username and an empty password. All amounts are integer JPY.
  termsOfService: https://pay.jp/terms
  contact:
    name: PAY.JP Support
    url: https://help.pay.jp/
  version: '1.0'
servers:
- url: https://api.pay.jp/v1
  description: PAY.JP REST API (HTTPS only)
security:
- basicAuth: []
tags:
- name: Cards
paths:
  /customers/{id}/cards:
    parameters:
    - $ref: '#/components/parameters/id'
    get:
      operationId: listCustomerCards
      tags:
      - Cards
      summary: List a customer's cards
      responses:
        '200':
          $ref: '#/components/responses/List'
    post:
      operationId: createCustomerCard
      tags:
      - Cards
      summary: Attach a card to a customer
      requestBody:
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              properties:
                card:
                  type: string
                  description: Token id (tok_xxx)
              required:
              - card
      responses:
        '200':
          $ref: '#/components/responses/Card'
  /customers/{id}/cards/{card_id}:
    parameters:
    - $ref: '#/components/parameters/id'
    - $ref: '#/components/parameters/card_id'
    get:
      operationId: retrieveCustomerCard
      tags:
      - Cards
      summary: Retrieve a customer's card
      responses:
        '200':
          $ref: '#/components/responses/Card'
    post:
      operationId: updateCustomerCard
      tags:
      - Cards
      summary: Update a customer's card
      responses:
        '200':
          $ref: '#/components/responses/Card'
    delete:
      operationId: deleteCustomerCard
      tags:
      - Cards
      summary: Delete a customer's card
      responses:
        '200':
          $ref: '#/components/responses/Deleted'
components:
  schemas:
    List:
      type: object
      properties:
        object:
          type: string
          example: list
        count:
          type: integer
        has_more:
          type: boolean
        url:
          type: string
        data:
          type: array
          items:
            $ref: '#/components/schemas/Object'
    Card:
      type: object
      properties:
        id:
          type: string
          example: car_xxxxxxxxxxxxxxxx
        object:
          type: string
          example: card
        brand:
          type: string
          example: Visa
        last4:
          type: string
          example: '4242'
        exp_month:
          type: integer
        exp_year:
          type: integer
        name:
          type: string
          nullable: true
        three_d_secure_status:
          type: string
          nullable: true
        created:
          type: integer
    Object:
      type: object
      properties:
        id:
          type: string
        object:
          type: string
        livemode:
          type: boolean
        created:
          type: integer
          description: Unix timestamp
      additionalProperties: true
  responses:
    Deleted:
      description: A deletion confirmation
      content:
        application/json:
          schema:
            type: object
            properties:
              id:
                type: string
              object:
                type: string
                example: charge
              deleted:
                type: boolean
                example: true
    Card:
      description: A Card object
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Card'
    List:
      description: A paginated list object
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/List'
  parameters:
    card_id:
      name: card_id
      in: path
      required: true
      schema:
        type: string
    id:
      name: id
      in: path
      required: true
      schema:
        type: string
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic
      description: HTTP Basic authentication. Use the secret key (sk_test_ / sk_live_) as the username and leave the password empty.