Rentle Categories API

Category-related queries

OpenAPI Specification

rentle-categories-api-openapi.yml Raw ↑
openapi: 3.0.0
info:
  title: Twice Admin API Keys Categories API
  description: API documentation for Twice Admin API
  version: '2023-02-01'
  contact: {}
  x-logo:
    url: https://firebasestorage.googleapis.com/v0/b/rentle-prod.appspot.com/o/logos%2Ftwice-logo-outline-black-padded.png?alt=media&token=c6731aba-03c9-4ce9-a9f0-a68478924fe0
servers:
- url: https://api.twicecommerce.com/admin
  description: Production API
tags:
- name: Categories
  description: Category-related queries
paths:
  /categories/{id}:
    get:
      description: Get a single category by id.
      operationId: categories_get
      parameters:
      - name: id
        required: true
        in: path
        description: The id of the category to retrieve
        schema:
          type: string
      - name: x-rentle-version
        in: header
        description: API Version, e.g `2023-02-01`. See [versioning](/#tag/versioning) page for more details.
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Category
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CategoryDTO'
        '400':
          description: Bad request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestExceptionDTO'
        '403':
          description: Forbidden.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ForbiddenExceptionDTO'
        '404':
          description: Not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundExceptionDTO'
        '409':
          description: Conflict.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConflictExceptionDTO'
        '429':
          description: Quota exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/QuotaExceededExceptionDTO'
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalServerErrorExceptionDTO'
      summary: Get category
      tags:
      - Categories
  /categories:
    get:
      description: Get all categories that belong to a merchant.
      operationId: categories_list
      parameters:
      - name: limit
        required: false
        in: query
        description: How many objects to retrieve.
        schema:
          minimum: 1
          maximum: 100
          type: integer
      - name: pageToken
        required: false
        in: query
        description: Token to retrieve the next page of results. This is returned in the paged response.
        schema:
          minLength: 1
          type: string
      - name: x-rentle-version
        in: header
        description: API Version, e.g `2023-02-01`. See [versioning](/#tag/versioning) page for more details.
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Paginated list of categories
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PagedCategoriesDTO'
        '400':
          description: Bad request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestExceptionDTO'
        '403':
          description: Forbidden.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ForbiddenExceptionDTO'
        '404':
          description: Not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundExceptionDTO'
        '409':
          description: Conflict.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConflictExceptionDTO'
        '429':
          description: Quota exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/QuotaExceededExceptionDTO'
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalServerErrorExceptionDTO'
      summary: Get all categories
      tags:
      - Categories
components:
  schemas:
    ConflictExceptionDTO:
      type: object
      properties:
        error:
          type: object
          properties:
            status:
              description: HTTP status code of the response.
              type: number
            code:
              description: Internal text code that represents the type of error.
              type: string
            message:
              description: Human-friendly description of the error
              type: string
            details:
              description: Details about errors in the request body
              type: array
              items:
                type: object
                properties:
                  path:
                    description: Path to the key in the request body, splitted by parts.
                    type: array
                    items:
                      type: string
                  message:
                    description: Specific errors in the value of the field.
                    type: string
                required:
                - path
                - message
          required:
          - status
          - code
          - message
      required:
      - error
      title: Conflict
      example:
        error:
          status: 409
          code: CONFLICT
          message: Conflict error
    PagedCategoriesDTO:
      type: object
      properties:
        data:
          description: List of returned resources
          type: array
          items:
            title: Category
            example:
              id: cQeLIOAZdOElKFEWYaYo
              name:
                def: Bicycles
                en: Bicycles
              description:
                def: Great bicycles to get around town
                en: Great bicycles to get around town
              images:
              - url_string
              order: 1
            type: object
            properties:
              id:
                description: Unique identifier of the category.
                type: string
              name:
                title: Localized field
                description: Category name.
                allOf:
                - additionalProperties:
                    type: string
                    description: The property name is the locale code, and the value is the translated text in that locale.
                  type: object
                - type: object
                  properties:
                    def:
                      description: The value in default locale.
                      type: string
                  required:
                  - def
              description:
                description: Category description.
                title: Localized field
                allOf:
                - additionalProperties:
                    type: string
                    description: The property name is the locale code, and the value is the translated text in that locale.
                  type: object
                - type: object
                  properties:
                    def:
                      description: The value in default locale.
                      type: string
                  required:
                  - def
              images:
                description: List of category image URLs.
                type: array
                items:
                  type: string
                  format: uri
              order:
                description: Order of the category compared to other categories. Smaller number means higher priority.
                type: integer
                minimum: 0
                maximum: 9007199254740991
              bookingBuffer:
                title: Booking buffer
                description: Defines how far in advance a booking can be made.
                example:
                  daysBefore: 1
                  latestTime: 18
                type: object
                properties:
                  daysBefore:
                    description: The number of days before a booking can be made
                    type: integer
                    minimum: 0
                    maximum: 9007199254740991
                  minutesBefore:
                    description: The number of minutes before a booking can be made. If daysBefore is more than 0, the minutesBefore are not taken into account.
                    type: integer
                    minimum: 0
                    maximum: 60
                  latestTime:
                    description: The latest time of day a booking can be made, in 24 hour format. If daysBefore is 0, the latestTime is not taken into account.
                    example: 18
                    type: integer
                    minimum: 0
                    maximum: 23
                required:
                - daysBefore
              terms:
                description: Category-specific terms.
                type: object
                properties:
                  name:
                    description: File name
                    type: string
                  url:
                    description: File URL
                    type: string
                    format: uri
                required:
                - name
                - url
            required:
            - id
            - name
            - images
            - order
        count:
          description: Number of returned resources
          type: number
        total:
          description: Total number of resources
          type: number
        nextPageToken:
          description: This can be used in the next request to retrieve the next page of results.
          type: string
      required:
      - data
      - count
      - total
      title: Paginated list of categories
    NotFoundExceptionDTO:
      type: object
      properties:
        error:
          type: object
          properties:
            status:
              description: HTTP status code of the response.
              type: number
            code:
              description: Internal text code that represents the type of error.
              type: string
            message:
              description: Human-friendly description of the error
              type: string
            details:
              description: Details about errors in the request body
              type: array
              items:
                type: object
                properties:
                  path:
                    description: Path to the key in the request body, splitted by parts.
                    type: array
                    items:
                      type: string
                  message:
                    description: Specific errors in the value of the field.
                    type: string
                required:
                - path
                - message
          required:
          - status
          - code
          - message
      required:
      - error
      title: Not Found
      example:
        error:
          status: 404
          code: NOT_FOUND
          message: Object not found
    QuotaExceededExceptionDTO:
      type: object
      properties:
        error:
          type: object
          properties:
            status:
              description: HTTP status code of the response.
              type: number
            code:
              description: Internal text code that represents the type of error.
              type: string
            message:
              description: Human-friendly description of the error
              type: string
            details:
              description: Details about errors in the request body
              type: array
              items:
                type: object
                properties:
                  path:
                    description: Path to the key in the request body, splitted by parts.
                    type: array
                    items:
                      type: string
                  message:
                    description: Specific errors in the value of the field.
                    type: string
                required:
                - path
                - message
          required:
          - status
          - code
          - message
      required:
      - error
      title: Quota Exceeded
      example:
        error:
          status: 429
          code: RATE_LIMIT_HIT
          message: Your API key has exceeded the rate limit. Please wait a moment before making new requests.
    ForbiddenExceptionDTO:
      type: object
      properties:
        error:
          type: object
          properties:
            status:
              description: HTTP status code of the response.
              type: number
            code:
              description: Internal text code that represents the type of error.
              type: string
            message:
              description: Human-friendly description of the error
              type: string
            details:
              description: Details about errors in the request body
              type: array
              items:
                type: object
                properties:
                  path:
                    description: Path to the key in the request body, splitted by parts.
                    type: array
                    items:
                      type: string
                  message:
                    description: Specific errors in the value of the field.
                    type: string
                required:
                - path
                - message
          required:
          - status
          - code
          - message
      required:
      - error
      title: Forbidden
      example:
        error:
          status: 403
          code: FORBIDDEN
          message: You are do not have permission to perform this action. The problem could be missing API scopes or an expired/invalid API token.
    BadRequestExceptionDTO:
      type: object
      properties:
        error:
          type: object
          properties:
            status:
              description: HTTP status code of the response.
              type: number
            code:
              description: Internal text code that represents the type of error.
              type: string
            message:
              description: Human-friendly description of the error
              type: string
            details:
              description: Details about errors in the request body
              type: array
              items:
                type: object
                properties:
                  path:
                    description: Path to the key in the request body, splitted by parts.
                    type: array
                    items:
                      type: string
                  message:
                    description: Specific errors in the value of the field.
                    type: string
                required:
                - path
                - message
          required:
          - status
          - code
          - message
      required:
      - error
      title: Bad Request
      example:
        error:
          status: 400
          code: INVALID_ARGUMENTS
          details:
          - path:
            - startDate
            message: Required
          - path:
            - duration
            message: Required
          message: Your request contained invalid arguments
    CategoryDTO:
      type: object
      properties:
        id:
          description: Unique identifier of the category.
          type: string
        name:
          title: Localized field
          description: Category name.
          allOf:
          - additionalProperties:
              type: string
              description: The property name is the locale code, and the value is the translated text in that locale.
            type: object
          - type: object
            properties:
              def:
                description: The value in default locale.
                type: string
            required:
            - def
        description:
          description: Category description.
          title: Localized field
          allOf:
          - additionalProperties:
              type: string
              description: The property name is the locale code, and the value is the translated text in that locale.
            type: object
          - type: object
            properties:
              def:
                description: The value in default locale.
                type: string
            required:
            - def
        images:
          description: List of category image URLs.
          type: array
          items:
            type: string
            format: uri
        order:
          description: Order of the category compared to other categories. Smaller number means higher priority.
          type: integer
          minimum: 0
          maximum: 9007199254740991
        bookingBuffer:
          title: Booking buffer
          description: Defines how far in advance a booking can be made.
          example:
            daysBefore: 1
            latestTime: 18
          type: object
          properties:
            daysBefore:
              description: The number of days before a booking can be made
              type: integer
              minimum: 0
              maximum: 9007199254740991
            minutesBefore:
              description: The number of minutes before a booking can be made. If daysBefore is more than 0, the minutesBefore are not taken into account.
              type: integer
              minimum: 0
              maximum: 60
            latestTime:
              description: The latest time of day a booking can be made, in 24 hour format. If daysBefore is 0, the latestTime is not taken into account.
              example: 18
              type: integer
              minimum: 0
              maximum: 23
          required:
          - daysBefore
        terms:
          description: Category-specific terms.
          type: object
          properties:
            name:
              description: File name
              type: string
            url:
              description: File URL
              type: string
              format: uri
          required:
          - name
          - url
      required:
      - id
      - name
      - images
      - order
      title: Category
      example:
        id: cQeLIOAZdOElKFEWYaYo
        name:
          def: Bicycles
          en: Bicycles
        description:
          def: Great bicycles to get around town
          en: Great bicycles to get around town
        images:
        - url_string
        order: 1
    InternalServerErrorExceptionDTO:
      type: object
      properties:
        error:
          type: object
          properties:
            status:
              description: HTTP status code of the response.
              type: number
            code:
              description: Internal text code that represents the type of error.
              type: string
            message:
              description: Human-friendly description of the error
              type: string
            details:
              description: Details about errors in the request body
              type: array
              items:
                type: object
                properties:
                  path:
                    description: Path to the key in the request body, splitted by parts.
                    type: array
                    items:
                      type: string
                  message:
                    description: Specific errors in the value of the field.
                    type: string
                required:
                - path
                - message
          required:
          - status
          - code
          - message
      required:
      - error
      title: Internal Server Error
      example:
        error:
          status: 500
          code: INTERNAL_SERVER_ERROR
          message: An unexpected error occurred. Please try again later.
x-webhooks:
  productCreated:
    post:
      summary: Product created
      operationId: productCreated
      tags:
      - Product
      description: Occurs when a new product is created.
      parameters:
      - name: x-rentle-version
        in: header
        description: API Version, e.g '2023-02-01'. See [versioning](#tag/Versioning) page for more details.
        required: true
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProductWebhookDTO'
      responses:
        '200':
          description: Return 200 OK to indicate the data was received successfully
  productUpdated:
    post:
      summary: Product updated
      operationId: productUpdated
      tags:
      - Product
      description: Occurs when a product is updated.
      parameters:
      - name: x-rentle-version
        in: header
        description: API Version, e.g '2023-02-01'. See [versioning](#tag/Versioning) page for more details.
        required: true
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProductWebhookDTO'
      responses:
        '200':
          description: Return 200 OK to indicate the data was received successfully
  productDeleted:
    post:
      summary: Product deleted
      operationId: productDeleted
      tags:
      - Product
      description: Occurs when a product is deleted.
      parameters:
      - name: x-rentle-version
        in: header
        description: API Version, e.g '2023-02-01'. See [versioning](#tag/Versioning) page for more details.
        required: true
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProductWebhookDTO'
      responses:
        '200':
          description: Return 200 OK to indicate the data was received successfully
  orderCreated:
    post:
      summary: Order created
      operationId: orderCreated
      tags:
      - Order
      description: Occurs when a new order is created.
      parameters:
      - name: x-rentle-version
        in: header
        description: API Version, e.g '2023-02-01'. See [versioning](#tag/Versioning) page for more details.
        required: true
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OrderWebhookDTO'
      responses:
        '200':
          description: Return 200 OK to indicate the data was received successfully
  orderUpdated:
    post:
      summary: Order updated
      operationId: orderUpdated
      tags:
      - Order
      description: Occurs when an order is updated.
      parameters:
      - name: x-rentle-version
        in: header
        description: API Version, e.g '2023-02-01'. See [versioning](#tag/Versioning) page for more details.
        required: true
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OrderWebhookDTO'
      responses:
        '200':
          description: Return 200 OK to indicate the data was received successfully
  orderPrepared:
    post:
      summary: Order prepared
      operationId: orderPrepared
      tags:
      - Order
      description: Occurs when an order is marked as prepared.
      parameters:
      - name: x-rentle-version
        in: header
        description: API Version, e.g '2023-02-01'. See [versioning](#tag/Versioning) page for more details.
        required: true
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OrderWebhookDTO'
      responses:
        '200':
          description: Return 200 OK to indicate the data was received successfully
  orderStarted:
    post:
      summary: Order started
      operationId: orderStarted
      tags:
      - Order
      description: Occurs when an order is started.
      parameters:
      - name: x-rentle-version
        in: header
        description: API Version, e.g '2023-02-01'. See [versioning](#tag/Versioning) page for more details.
        required: true
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OrderWebhookDTO'
      responses:
        '200':
          description: Return 200 OK to indicate the data was received successfully
  orderReturned:
    post:
      summary: Order returned
      operationId: orderReturned
      tags:
      - Order
      description: Occurs when an order is marked as returned.
      parameters:
      - name: x-rentle-version
        in: header
        description: API Version, e.g '2023-02-01'. See [versioning](#tag/Versioning) page for more details.
        required: true
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OrderWebhookDTO'
      responses:
        '200':
          description: Return 200 OK to indicate the data was received successfully
  orderReturning-soon:
    post:
      summary: Order returning-soon
      operationId: orderReturning-soon
      tags:
      - Order
      description: Occurs X time before the order should return.
      parameters:
      - name: x-rentle-version
        in: header
        description: API Version, e.g '2023-02-01'. See [versioning](#tag/Versioning) page for more details.
        required: true
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OrderWebhookDTO'
      responses:
        '200':
          description: Return 200 OK to indicate the data was received successfully
x-tagGroups:
- name: Introduction
  tags:
  - Introduction
  - Versioning
  - Authentication
  - RateLimiting
  - Responses
  - Feedback
- name: Operations
  tags:
  - OperationsOverview
  - API Keys
  - Categories
  - Customers
  - Discount Codes
  - Inventory Articles
  - Inventory SKUs
  - Merchant
  - Orders
  - Products
  - Stores
  - Webhooks
- name: Webhooks
  tags:
  - WebhooksOverview
  - Order
  - Product
- name: Models
  tags:
  - ModelsOverview
  - ApiKeyDTO
  - CategoryDTO
  - CustomerDTO
  - DiscountCodeDTO
  - InventoryArticleDTO
  - MerchantDTO
  - OrderDTO
  - OrderWebhookDTO
  - PagedCategoriesDTO
  - PagedCustomersDTO
  - PagedDiscountCodesDTO
  - PagedInventoryArticlesDTO
  - PagedOrdersDTO
  - PagedProductsDTO
  - PagedSkusDTO
  - PagedStoresDTO
  - PagedWebhooksDTO
  - ProductDTO
  - ProductWebhookDTO
  - SkuDTO
  - StoreDTO
- name: Errors
  tags:
  - ErrorsOverview
  - BadRequestExceptionDTO
  - ConflictExceptionDTO
  - ForbiddenExceptionDTO
  - InternalServerErrorExceptionDTO
  - NotFoundExceptionDTO
  - QuotaExceededExceptionDTO