Culqi Customers API

Stored customer (cliente) profiles.

OpenAPI Specification

culqi-customers-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: Culqi API v2 3DS Customers API
  description: Culqi is a Peruvian online payments platform (a Grupo Credicorp / Krealo company) that lets businesses accept card, Yape, PagoEfectivo, mobile wallet and Cuotealo (installment) payments. The REST API v2 exposes tokenization, charges (cargos), orders, refunds, customers, cards, plans, subscriptions, webhook events, card-BIN (iin) lookup and transfers. Card data is tokenized client-side against the PCI-scoped secure host; all money-movement and management operations run against the server host with a secret key. Amounts are integers in the currency minor unit (cents); supported currencies are PEN (Peruvian Sol) and USD.
  termsOfService: https://culqi.com/terminos_y_condiciones/
  contact:
    name: Culqi Developer Support
    url: https://docs.culqi.com/
  version: '2.0'
servers:
- url: https://api.culqi.com/v2
  description: Server-side host for charges, orders, refunds, customers, cards, plans, subscriptions, events, iins and transfers (authenticated with a secret key, sk_).
- url: https://secure.culqi.com/v2
  description: PCI-scoped host for card tokenization and 3DS charge confirmation (authenticated with a public key, pk_).
tags:
- name: Customers
  description: Stored customer (cliente) profiles.
paths:
  /customers:
    post:
      operationId: createCustomer
      tags:
      - Customers
      summary: Create a customer
      security:
      - secretKey: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateCustomerRequest'
      responses:
        '201':
          description: Customer created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Customer'
        '400':
          $ref: '#/components/responses/Error'
    get:
      operationId: listCustomers
      tags:
      - Customers
      summary: List customers
      security:
      - secretKey: []
      parameters:
      - $ref: '#/components/parameters/Limit'
      - $ref: '#/components/parameters/Before'
      - $ref: '#/components/parameters/After'
      responses:
        '200':
          description: A paginated list of customers
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerList'
  /customers/{id}:
    parameters:
    - $ref: '#/components/parameters/ResourceId'
    get:
      operationId: getCustomer
      tags:
      - Customers
      summary: Retrieve a customer
      security:
      - secretKey: []
      responses:
        '200':
          description: Customer object
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Customer'
        '404':
          $ref: '#/components/responses/Error'
    patch:
      operationId: updateCustomer
      tags:
      - Customers
      summary: Update a customer
      security:
      - secretKey: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateCustomerRequest'
      responses:
        '200':
          description: Updated customer
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Customer'
    delete:
      operationId: deleteCustomer
      tags:
      - Customers
      summary: Delete a customer
      security:
      - secretKey: []
      responses:
        '200':
          description: Deletion result
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Deleted'
components:
  schemas:
    Card:
      type: object
      properties:
        object:
          type: string
          example: card
        id:
          type: string
          example: crd_test_xxxxxxxxxxxx
        customer_id:
          type: string
        source:
          type: object
          additionalProperties: true
        creation_date:
          type: integer
        metadata:
          $ref: '#/components/schemas/Metadata'
    Metadata:
      type: object
      description: Arbitrary key/value metadata attached to a resource.
      additionalProperties:
        type: string
    Customer:
      type: object
      properties:
        object:
          type: string
          example: customer
        id:
          type: string
          example: cus_test_xxxxxxxxxxxx
        first_name:
          type: string
        last_name:
          type: string
        email:
          type: string
        creation_date:
          type: integer
        cards:
          type: array
          items:
            $ref: '#/components/schemas/Card'
        metadata:
          $ref: '#/components/schemas/Metadata'
    PaginatedList:
      type: object
      properties:
        object:
          type: string
          example: list
        data:
          type: array
          items:
            type: object
            additionalProperties: true
        paging:
          type: object
          properties:
            previous:
              type: string
              nullable: true
            next:
              type: string
              nullable: true
            cursors:
              type: object
              properties:
                before:
                  type: string
                  nullable: true
                after:
                  type: string
                  nullable: true
    CreateCustomerRequest:
      type: object
      required:
      - first_name
      - last_name
      - email
      - address
      - address_city
      - country_code
      - phone_number
      properties:
        first_name:
          type: string
        last_name:
          type: string
        email:
          type: string
          format: email
        address:
          type: string
        address_city:
          type: string
        country_code:
          type: string
          description: ISO 3166-1 alpha-2 country code, e.g. PE.
          example: PE
        phone_number:
          type: string
        metadata:
          $ref: '#/components/schemas/Metadata'
    CustomerList:
      $ref: '#/components/schemas/PaginatedList'
    Error:
      type: object
      properties:
        object:
          type: string
          example: error
        type:
          type: string
          example: card_error
        merchant_message:
          type: string
        user_message:
          type: string
        param:
          type: string
        code:
          type: string
    Deleted:
      type: object
      properties:
        deleted:
          type: boolean
        id:
          type: string
        merchant_message:
          type: string
  parameters:
    ResourceId:
      name: id
      in: path
      required: true
      description: The unique resource identifier.
      schema:
        type: string
    Limit:
      name: limit
      in: query
      required: false
      description: Number of records to return (max 100).
      schema:
        type: integer
        default: 10
        maximum: 100
    Before:
      name: before
      in: query
      required: false
      description: Cursor - return records created before this id.
      schema:
        type: string
    After:
      name: after
      in: query
      required: false
      description: Cursor - return records created after this id.
      schema:
        type: string
  responses:
    Error:
      description: Error response
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    secretKey:
      type: http
      scheme: bearer
      bearerFormat: sk_live_/sk_test_ secret key
      description: 'Server-side secret key sent as an HTTP Bearer token in the Authorization header, e.g. `Authorization: Bearer sk_live_...`.'
    publicKey:
      type: http
      scheme: bearer
      bearerFormat: pk_live_/pk_test_ public key
      description: 'Public key sent as an HTTP Bearer token for tokenization and 3DS confirm on the secure host, e.g. `Authorization: Bearer pk_live_...`.'