Rentle API Keys API

API Key-related queries

OpenAPI Specification

rentle-api-keys-api-openapi.yml Raw ↑
openapi: 3.0.0
info:
  title: Twice Admin API Keys 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: API Keys
  description: API Key-related queries
paths:
  /key:
    get:
      description: Get details of the API key in use.
      operationId: key_list
      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
      responses:
        '200':
          description: API Key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiKeyDTO'
        '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 API key information
      tags:
      - API Keys
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
    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.
    ApiKeyDTO:
      type: object
      properties:
        id:
          description: Unique identifier of the API key.
          type: string
        merchantId:
          description: Merchant ID that this API key is valid for.
          type: string
        createdAt:
          title: ISO 8601 date-time
          description: Creation date of the API key.
          type: string
        label:
          description: Label of the API key.
          type: string
        scopes:
          description: List of scopes that this API key has access to.
          type: array
          items:
            type: string
            enum:
            - products:read
            - products:create
            - products:update
            - products:delete
            - stores:read
            - orders:read
            - orders:create
            - orders:update
            - orders:delete
            - customers:read
            - inventory-article-events:read
            - inventory-article-events:create
            - inventory-article-events:update
            - inventory-article-events:delete
            - inventory-articles:read
            - inventory-articles:create
            - inventory-articles:update
            - inventory-articles:delete
            - inventory-fields:read
            - inventory-fields:create
            - inventory-fields:update
            - inventory-fields:delete
            - inventory-skus:read
            - inventory-skus:create
            - inventory-skus:update
            - inventory-skus:delete
            - categories:read
            - discount-codes:read
            - discount-codes:create
            - discount-codes:update
            - discount-codes:delete
            - merchant:read
            - webhooks:read
            - webhooks:create
            - webhooks:update
            - webhooks:delete
            - availability:read
        rateLimit:
          description: Rate limit of the API key.
          type: integer
          minimum: 0
          maximum: 9007199254740991
        rateLimitUsed:
          description: How many calls have been used of the rate limit. Rate limit usage resets periodically.
          type: integer
          minimum: 0
          maximum: 9007199254740991
        rateLimitRemaining:
          description: Remaining calls before reaching the rate limit.
          type: integer
          minimum: 0
          maximum: 9007199254740991
      required:
      - id
      - merchantId
      - createdAt
      - label
      - scopes
      - rateLimit
      - rateLimitUsed
      - rateLimitRemaining
      title: API Key
    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
    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