Tiendanube Customers API

The Customers API from Tiendanube — 2 operation(s) for customers.

OpenAPI Specification

tiendanube-customers-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: Tiendanube / Nuvemshop Categories Customers API
  description: Representative OpenAPI description of the Tiendanube (Nuvemshop) REST API for app partners. All requests are scoped to a single store via the {store_id} path segment, authenticated with an OAuth 2.0 access token sent in the Authentication header, and MUST include a descriptive User-Agent header identifying the app. The Brazil deployment mirrors this API at https://api.nuvemshop.com.br/v1/{store_id}.
  termsOfService: https://www.tiendanube.com/terminos-de-uso
  contact:
    name: Tiendanube Developers
    url: https://tiendanube.github.io/api-documentation/
  version: '1.0'
servers:
- url: https://api.tiendanube.com/v1/{store_id}
  description: Tiendanube (Spanish-speaking Latin America)
  variables:
    store_id:
      default: '0'
      description: Numeric ID of the store the app is operating on.
- url: https://api.nuvemshop.com.br/v1/{store_id}
  description: Nuvemshop (Brazil)
  variables:
    store_id:
      default: '0'
      description: Numeric ID of the store the app is operating on.
security:
- AuthenticationToken: []
tags:
- name: Customers
paths:
  /customers:
    get:
      operationId: listCustomers
      tags:
      - Customers
      summary: List customers
      parameters:
      - $ref: '#/components/parameters/Page'
      - $ref: '#/components/parameters/PerPage'
      - name: q
        in: query
        schema:
          type: string
      responses:
        '200':
          description: A list of customers.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Customer'
    post:
      operationId: createCustomer
      tags:
      - Customers
      summary: Create a customer
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CustomerInput'
      responses:
        '201':
          description: Customer created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Customer'
  /customers/{id}:
    parameters:
    - $ref: '#/components/parameters/Id'
    get:
      operationId: getCustomer
      tags:
      - Customers
      summary: Get a customer
      responses:
        '200':
          description: The customer.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Customer'
components:
  schemas:
    Address:
      type: object
      properties:
        name:
          type: string
        address:
          type: string
        number:
          type: string
        floor:
          type: string
          nullable: true
        locality:
          type: string
          nullable: true
        city:
          type: string
        province:
          type: string
        country:
          type: string
        zipcode:
          type: string
        phone:
          type: string
          nullable: true
    Customer:
      type: object
      properties:
        id:
          type: integer
        name:
          type: string
        email:
          type: string
          format: email
        phone:
          type: string
          nullable: true
        identification:
          type: string
          nullable: true
        total_spent:
          $ref: '#/components/schemas/Money'
        total_spent_currency:
          type: string
        addresses:
          type: array
          items:
            $ref: '#/components/schemas/Address'
        default_address:
          $ref: '#/components/schemas/Address'
        created_at:
          type: string
          format: date-time
    Money:
      type: string
      description: Decimal amount serialized as a string, e.g. "199.90".
    CustomerInput:
      type: object
      required:
      - name
      - email
      properties:
        name:
          type: string
        email:
          type: string
          format: email
        phone:
          type: string
        identification:
          type: string
  parameters:
    Page:
      name: page
      in: query
      schema:
        type: integer
        default: 1
    PerPage:
      name: per_page
      in: query
      schema:
        type: integer
        default: 30
        maximum: 200
    Id:
      name: id
      in: path
      required: true
      schema:
        type: integer
  securitySchemes:
    AuthenticationToken:
      type: apiKey
      in: header
      name: Authentication
      description: 'OAuth 2.0 access token obtained via the authorization-code flow, sent as "Authentication: bearer {access_token}". A descriptive User-Agent header is also required on every request.'