Rentle Stores API

Store-related queries

OpenAPI Specification

rentle-stores-api-openapi.yml Raw ↑
openapi: 3.0.0
info:
  title: Twice Admin API Keys Stores 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: Stores
  description: Store-related queries
paths:
  /stores/{id}:
    get:
      description: Get a single store by id.
      operationId: store_get
      parameters:
      - name: id
        required: true
        in: path
        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: Store
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StoreDTO'
        '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 single store
      tags:
      - Stores
  /stores:
    get:
      description: Get all stores of the authenticated account.
      operationId: store_list
      parameters:
      - name: limit
        required: false
        in: query
        description: How many objects to retrieve.
        x-nestjs_zod-parent-metadata:
          title: Parameters for listing stores
        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.
        x-nestjs_zod-parent-metadata:
          title: Parameters for listing stores
        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 stores
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PagedStoresDTO'
        '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 stores
      tags:
      - Stores
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.
    StoreDTO:
      type: object
      properties:
        id:
          description: Store ID.
          type: string
        name:
          description: Store name.
          type: string
        address:
          description: Store address.
          type: object
          properties:
            address:
              description: Street address.
              type: string
            zipCode:
              description: Zip code.
              type: string
            city:
              description: City.
              type: string
            country:
              description: Country.
              type: string
            state:
              description: State.
              type: string
            details:
              description: Additional address details.
              type: string
          required:
          - address
        phone:
          description: Store phone number.
          type: string
        email:
          description: Store email.
          type: string
        channels:
          description: Channels where the store is visible. If not set, the store is visible in all channels.
          type: array
          items:
            type: string
            enum:
            - admin
            - check_in
            - online
        isDefault:
          description: True for the default store, i.e., the merchant's primary location. False otherwise.
          type: boolean
      required:
      - id
      - name
      - address
      - isDefault
      title: Store
    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.
    PagedStoresDTO:
      type: object
      properties:
        data:
          description: List of returned resources
          type: array
          items:
            title: Store
            type: object
            properties:
              id:
                description: Store ID.
                type: string
              name:
                description: Store name.
                type: string
              address:
                description: Store address.
                type: object
                properties:
                  address:
                    description: Street address.
                    type: string
                  zipCode:
                    description: Zip code.
                    type: string
                  city:
                    description: City.
                    type: string
                  country:
                    description: Country.
                    type: string
                  state:
                    description: State.
                    type: string
                  details:
                    description: Additional address details.
                    type: string
                required:
                - address
              phone:
                description: Store phone number.
                type: string
              email:
                description: Store email.
                type: string
              channels:
                description: Channels where the store is visible. If not set, the store is visible in all channels.
                type: array
                items:
                  type: string
                  enum:
                  - admin
                  - check_in
                  - online
              isDefault:
                description: True for the default store, i.e., the merchant's primary location. False otherwise.
                type: boolean
            required:
            - id
            - name
            - address
            - isDefault
        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 stores
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