Commerce Layer api_credentials API

resource type

Documentation

Specifications

Schemas & Data

Other Resources

OpenAPI Specification

commerce-layer-api-credentials-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Commerce Layer addresses api_credentials API
  version: 7.10.1
  contact:
    name: API Support
    url: https://commercelayer.io
    email: support@commercelayer.io
  description: Headless Commerce for Global Brands.
servers:
- url: https://{your_organization_slug}.commercelayer.io/api
  description: API
- url: https://core.commercelayer.io/users/sign_in
  description: Sign in
- url: https://docs.commercelayer.io/api
  description: API reference
security:
- bearerAuth: []
tags:
- name: api_credentials
  description: resource type
paths:
  /api_credentials:
    post:
      operationId: POST/api_credentials
      summary: Creates an API credential
      description: Creates an API credential
      tags:
      - api_credentials
      requestBody:
        required: true
        content:
          application/vnd.api+json:
            schema:
              $ref: '#/components/schemas/apiCredentialCreate'
      responses:
        '201':
          description: The created API credential object
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/apiCredentialResponse'
    get:
      operationId: GET/api_credentials
      summary: List all API credentials
      description: List all API credentials
      tags:
      - api_credentials
      responses:
        '200':
          description: A list of API credential objects
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/apiCredentialResponseList'
  /api_credentials/{apiCredentialId}:
    get:
      operationId: GET/api_credentials/apiCredentialId
      summary: Retrieve an API credential
      description: Retrieve an API credential
      parameters:
      - name: apiCredentialId
        in: path
        schema:
          type: string
        required: true
        description: The ID of the resource.
      tags:
      - api_credentials
      responses:
        '200':
          description: The API credential object
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/apiCredentialResponse'
    patch:
      operationId: PATCH/api_credentials/apiCredentialId
      summary: Updates an API credential
      description: Updates an API credential
      tags:
      - api_credentials
      parameters:
      - name: apiCredentialId
        in: path
        schema:
          type: string
        required: true
        description: The ID of the resource.
      requestBody:
        required: true
        content:
          application/vnd.api+json:
            schema:
              $ref: '#/components/schemas/apiCredentialUpdate'
      responses:
        '200':
          description: The updated API credential object
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/apiCredentialResponse'
    delete:
      operationId: DELETE/api_credentials/apiCredentialId
      summary: Delete an API credential
      description: Delete an API credential
      tags:
      - api_credentials
      parameters:
      - name: apiCredentialId
        in: path
        schema:
          type: string
        required: true
        description: The ID of the resource.
      responses:
        '204':
          description: No content
  /application_memberships/{applicationMembershipId}/api_credential:
    get:
      operationId: GET/applicationMembershipId/api_credential
      summary: Related application membership
      description: Related application membership
      tags:
      - api_credentials
      parameters:
      - name: applicationMembershipId
        in: path
        schema:
          type: string
        required: true
        description: The ID of the resource.
      responses:
        '200':
          description: The api_credential associated to the application membership
  /organizations/{organizationId}/api_credentials:
    get:
      operationId: GET/organizationId/api_credentials
      summary: Related organization
      description: Related organization
      tags:
      - api_credentials
      parameters:
      - name: organizationId
        in: path
        schema:
          type: string
        required: true
        description: The ID of the resource.
      responses:
        '200':
          description: The api_credentials associated to the organization
  /roles/{roleId}/api_credentials:
    get:
      operationId: GET/roleId/api_credentials
      summary: Related role
      description: Related role
      tags:
      - api_credentials
      parameters:
      - name: roleId
        in: path
        schema:
          type: string
        required: true
        description: The ID of the resource.
      responses:
        '200':
          description: The api_credentials associated to the role
components:
  schemas:
    apiCredentialResponse:
      type: object
      properties:
        data:
          type: object
          properties:
            id:
              type: string
              description: The ID of the resource.
              example: XGZwpOSrWL
            type:
              type: string
              description: The resource's type.
              enum:
              - api_credentials
            links:
              type: object
              properties:
                self:
                  type: string
                  description: URL
            attributes:
              $ref: '#/components/schemas/apiCredential/properties/data/properties/attributes'
            relationships:
              type: object
              properties:
                organization:
                  type: object
                  properties:
                    links:
                      type: object
                      properties:
                        self:
                          type: string
                          description: URL
                        related:
                          type: string
                          description: URL
                    data:
                      type: object
                      properties:
                        type:
                          type: string
                          description: The resource's type.
                          enum:
                          - organization
                        id:
                          type: string
                          description: The ID of the resource.
                role:
                  type: object
                  properties:
                    links:
                      type: object
                      properties:
                        self:
                          type: string
                          description: URL
                        related:
                          type: string
                          description: URL
                    data:
                      type: object
                      properties:
                        type:
                          type: string
                          description: The resource's type.
                          enum:
                          - role
                        id:
                          type: string
                          description: The ID of the resource.
    apiCredentialUpdate:
      required:
      - data
      type: object
      properties:
        data:
          type: object
          required:
          - type
          - id
          - attributes
          properties:
            type:
              type: string
              description: The resource's type.
              enum:
              - api_credentials
            id:
              type: string
              description: The ID of the resource.
              example: XGZwpOSrWL
            attributes:
              type: object
              properties:
                name:
                  type: string
                  description: The API credential internal name.
                  example: My app
                  nullable: false
                redirect_uri:
                  type: string
                  description: The API credential redirect URI.
                  example: https://bluebrand.com/img/logo.svg
                  nullable: true
                expires_in:
                  type: integer
                  description: The lifetime of the access token in seconds (min. `7200`, max. `31536000`. Default is `14400` for Sales channels and `7200` for other client types).
                  example: 7200
                  nullable: true
                reference:
                  type: string
                  description: A string that you can use to add any external identifier to the resource. This can be useful for integrating the resource to an external system, like an ERP, a marketing tool, a CRM, or whatever.
                  example: ANY-EXTERNAL-REFEFERNCE
                  nullable: true
                reference_origin:
                  type: string
                  description: Any identifier of the third party system that defines the reference code.
                  example: ANY-EXTERNAL-REFEFERNCE-ORIGIN
                  nullable: true
                metadata:
                  type: object
                  description: Set of key-value pairs that you can attach to the resource. This can be useful for storing additional information about the resource in a structured format.
                  example:
                    foo: bar
                  nullable: true
            relationships:
              type: object
              properties:
                role:
                  required:
                  - data
                  type: object
                  properties:
                    data:
                      type: object
                      properties:
                        type:
                          type: string
                          description: The resource's type.
                          enum:
                          - roles
                        id:
                          type: string
                          description: The ID of the resource.
                          example: XGZwpOSrWL
    apiCredentialCreate:
      required:
      - data
      type: object
      properties:
        data:
          type: object
          required:
          - type
          - attributes
          properties:
            type:
              type: string
              description: The resource's type.
              enum:
              - api_credentials
            attributes:
              type: object
              properties:
                name:
                  type: string
                  description: The API credential internal name.
                  example: My app
                kind:
                  type: string
                  description: 'The API credential kind, can be one of: `webapp`, `sales_channel`, `integration` or the kind of app you want to fork (e.g. `orders`, `imports`, etc.).'
                  example: sales_channel
                redirect_uri:
                  type: string
                  description: The API credential redirect URI.
                  example: https://bluebrand.com/img/logo.svg
                expires_in:
                  type: integer
                  description: The lifetime of the access token in seconds (min. `7200`, max. `31536000`. Default is `14400` for Sales channels and `7200` for other client types).
                  example: 7200
                mode:
                  type: string
                  description: Indicates the environment the resource belongs to (one of `test` or `live`).
                  example: test
                custom:
                  type: boolean
                  description: Indicates if the API credential is used to create a custom app (e.g. fork a hosted app).
                  example: false
                reference:
                  type: string
                  description: A string that you can use to add any external identifier to the resource. This can be useful for integrating the resource to an external system, like an ERP, a marketing tool, a CRM, or whatever.
                  example: ANY-EXTERNAL-REFEFERNCE
                reference_origin:
                  type: string
                  description: Any identifier of the third party system that defines the reference code.
                  example: ANY-EXTERNAL-REFEFERNCE-ORIGIN
                metadata:
                  type: object
                  description: Set of key-value pairs that you can attach to the resource. This can be useful for storing additional information about the resource in a structured format.
                  example:
                    foo: bar
              required:
              - name
              - kind
            relationships:
              type: object
              properties:
                organization:
                  required:
                  - data
                  type: object
                  properties:
                    data:
                      type: object
                      properties:
                        type:
                          type: string
                          description: The resource's type.
                          enum:
                          - organizations
                        id:
                          type: string
                          description: The ID of the resource.
                          example: XGZwpOSrWL
                role:
                  required:
                  - data
                  type: object
                  properties:
                    data:
                      type: object
                      properties:
                        type:
                          type: string
                          description: The resource's type.
                          enum:
                          - roles
                        id:
                          type: string
                          description: The ID of the resource.
                          example: XGZwpOSrWL
              required:
              - organization
    apiCredentialResponseList:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/apiCredentialResponse/properties/data'
    apiCredential:
      properties:
        data:
          properties:
            attributes:
              type: object
              properties:
                name:
                  type: string
                  description: The API credential internal name.
                  example: My app
                  nullable: false
                kind:
                  type: string
                  description: 'The API credential kind, can be one of: `webapp`, `sales_channel`, `integration` or the kind of app you want to fork (e.g. `orders`, `imports`, etc.).'
                  example: sales_channel
                  nullable: false
                confidential:
                  type: boolean
                  description: Indicates if the API credential it's confidential.
                  example: true
                  readOnly: true
                redirect_uri:
                  type: string
                  description: The API credential redirect URI.
                  example: https://bluebrand.com/img/logo.svg
                  nullable: true
                client_id:
                  type: string
                  description: The API credential unique ID.
                  example: xxxx-yyyy-zzzz
                  readOnly: true
                client_secret:
                  type: string
                  description: The API credential unique secret.
                  example: xxxx-yyyy-zzzz
                  readOnly: true
                scopes:
                  type: string
                  description: The API credential scopes.
                  example: market:all market:9 market:122 market:6 stock_location:6 stock_location:33
                  readOnly: true
                expires_in:
                  type: integer
                  description: The lifetime of the access token in seconds (min. `7200`, max. `31536000`. Default is `14400` for Sales channels and `7200` for other client types).
                  example: 7200
                  nullable: true
                mode:
                  type: string
                  description: Indicates the environment the resource belongs to (one of `test` or `live`).
                  example: test
                  nullable: true
                custom:
                  type: boolean
                  description: Indicates if the API credential is used to create a custom app (e.g. fork a hosted app).
                  example: false
                  nullable: true
                created_at:
                  type: string
                  description: Time at which the resource was created.
                  example: '2018-01-01T12:00:00.000Z'
                  readOnly: true
                updated_at:
                  type: string
                  description: Time at which the resource was last updated.
                  example: '2018-01-01T12:00:00.000Z'
                  readOnly: true
                reference:
                  type: string
                  description: A string that you can use to add any external identifier to the resource. This can be useful for integrating the resource to an external system, like an ERP, a marketing tool, a CRM, or whatever.
                  example: ANY-EXTERNAL-REFEFERNCE
                  nullable: true
                reference_origin:
                  type: string
                  description: Any identifier of the third party system that defines the reference code.
                  example: ANY-EXTERNAL-REFEFERNCE-ORIGIN
                  nullable: true
                metadata:
                  type: object
                  description: Set of key-value pairs that you can attach to the resource. This can be useful for storing additional information about the resource in a structured format.
                  example:
                    foo: bar
                  nullable: true
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT