Virto Commerce Webhooks API

Register HTTP webhooks against the platform domain-event catalog, compose the payload from selected entity properties (including previous values), fire test deliveries, and audit every delivery attempt through the webhook feed.

OpenAPI Specification

virto-commerce-webhooks-api-openapi.yml Raw ↑
openapi: 3.0.4
info:
  title: Virto Commerce Webhooks API
  version: v1
  description: 'Manage user defined webhooks: subscribe to platform domain events and deliver HTTP POST
    notifications to configured endpoints.'
paths:
  /api/webhooks/{id}:
    get:
      tags:
      - Webhooks
      summary: Gets VirtoCommerce.WebhooksModule.Core.Models.Webhook by id.
      operationId: WebHooks_GetWebhookById
      parameters:
      - name: id
        in: path
        description: ''
        required: true
        schema:
          type: string
      responses:
        '200':
          description: OK
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/Webhook'
            application/json:
              schema:
                $ref: '#/components/schemas/Webhook'
            text/json:
              schema:
                $ref: '#/components/schemas/Webhook'
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
      security:
      - oauth2:
        - webhooks:read
      - api_key:
        - webhooks:read
      - api_key_header:
        - webhooks:read
      - http-signature:
        - webhooks:read
      - basic:
        - webhooks:read
      x-virtocommerce-module-id: VirtoCommerce.WebHooks
  /api/webhooks/search:
    post:
      tags:
      - Webhooks
      summary: Searches webhooks by certain criteria
      operationId: WebHooks_Search
      requestBody:
        description: ''
        content:
          application/json-patch+json:
            schema:
              allOf:
              - $ref: '#/components/schemas/WebhookSearchCriteria'
          application/json:
            schema:
              allOf:
              - $ref: '#/components/schemas/WebhookSearchCriteria'
          text/json:
            schema:
              allOf:
              - $ref: '#/components/schemas/WebhookSearchCriteria'
      responses:
        '200':
          description: OK
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/WebhookSearchResult'
            application/json:
              schema:
                $ref: '#/components/schemas/WebhookSearchResult'
            text/json:
              schema:
                $ref: '#/components/schemas/WebhookSearchResult'
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
      security:
      - oauth2:
        - webhooks:read
      - api_key:
        - webhooks:read
      - api_key_header:
        - webhooks:read
      - http-signature:
        - webhooks:read
      - basic:
        - webhooks:read
      x-virtocommerce-module-id: VirtoCommerce.WebHooks
  /api/webhooks/feed/search:
    post:
      tags:
      - Webhooks
      summary: Searches webhook logs by certain criteria
      operationId: WebHooks_SearchWebhookFeed
      requestBody:
        description: ''
        content:
          application/json-patch+json:
            schema:
              allOf:
              - $ref: '#/components/schemas/WebhookFeedSearchCriteria'
          application/json:
            schema:
              allOf:
              - $ref: '#/components/schemas/WebhookFeedSearchCriteria'
          text/json:
            schema:
              allOf:
              - $ref: '#/components/schemas/WebhookFeedSearchCriteria'
      responses:
        '200':
          description: OK
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/WebHookFeedSearchResult'
            application/json:
              schema:
                $ref: '#/components/schemas/WebHookFeedSearchResult'
            text/json:
              schema:
                $ref: '#/components/schemas/WebHookFeedSearchResult'
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
      security:
      - oauth2:
        - webhooks:feed:read
      - api_key:
        - webhooks:feed:read
      - api_key_header:
        - webhooks:feed:read
      - http-signature:
        - webhooks:feed:read
      - basic:
        - webhooks:feed:read
      x-virtocommerce-module-id: VirtoCommerce.WebHooks
  /api/webhooks/feed:
    delete:
      tags:
      - Webhooks
      summary: Delete webHookFeeds by ids.
      operationId: WebHooks_DeleteWebHookFeeds
      parameters:
      - name: ids
        in: query
        description: WebHook Feeds ids to delete.
        schema:
          type: array
          items:
            type: string
      responses:
        '200':
          description: OK
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
      security:
      - oauth2:
        - webhooks:delete
      - api_key:
        - webhooks:delete
      - api_key_header:
        - webhooks:delete
      - http-signature:
        - webhooks:delete
      - basic:
        - webhooks:delete
      x-virtocommerce-module-id: VirtoCommerce.WebHooks
  /api/webhooks:
    post:
      tags:
      - Webhooks
      summary: Creates or updates the webhooks.
      operationId: WebHooks_SaveWebhooks
      requestBody:
        description: Webhooks to save.
        content:
          application/json-patch+json:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/Webhook'
          application/json:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/Webhook'
          text/json:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/Webhook'
      responses:
        '200':
          description: OK
          content:
            text/plain:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Webhook'
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Webhook'
            text/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Webhook'
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
      security:
      - oauth2:
        - webhooks:update
      - api_key:
        - webhooks:update
      - api_key_header:
        - webhooks:update
      - http-signature:
        - webhooks:update
      - basic:
        - webhooks:update
      x-virtocommerce-module-id: VirtoCommerce.WebHooks
    delete:
      tags:
      - Webhooks
      summary: Deletes webhooks by ids.
      operationId: WebHooks_DeleteWebHooks
      parameters:
      - name: ids
        in: query
        description: Webhook ids to delete.
        schema:
          type: array
          items:
            type: string
      responses:
        '200':
          description: OK
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
      security:
      - oauth2:
        - webhooks:delete
      - api_key:
        - webhooks:delete
      - api_key_header:
        - webhooks:delete
      - http-signature:
        - webhooks:delete
      - basic:
        - webhooks:delete
      x-virtocommerce-module-id: VirtoCommerce.WebHooks
  /api/webhooks/send:
    post:
      tags:
      - Webhooks
      summary: Sends request with given params to webhook and returns result
      operationId: WebHooks_Run
      requestBody:
        description: Request params.
        content:
          application/json-patch+json:
            schema:
              allOf:
              - $ref: '#/components/schemas/Webhook'
          application/json:
            schema:
              allOf:
              - $ref: '#/components/schemas/Webhook'
          text/json:
            schema:
              allOf:
              - $ref: '#/components/schemas/Webhook'
      responses:
        '200':
          description: OK
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/WebhookSendResponse'
            application/json:
              schema:
                $ref: '#/components/schemas/WebhookSendResponse'
            text/json:
              schema:
                $ref: '#/components/schemas/WebhookSendResponse'
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
      security:
      - oauth2: []
      - api_key: []
      - api_key_header: []
      - http-signature: []
      - basic: []
      x-virtocommerce-module-id: VirtoCommerce.WebHooks
  /api/webhooks/events:
    get:
      tags:
      - Webhooks
      summary: Gets all registered events that could trigger webhook notification.
      operationId: WebHooks_GetAllRegisteredEvents
      responses:
        '200':
          description: OK
          content:
            text/plain:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/RegisteredEvent'
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/RegisteredEvent'
            text/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/RegisteredEvent'
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
      security:
      - oauth2:
        - webhooks:read
      - api_key:
        - webhooks:read
      - api_key_header:
        - webhooks:read
      - http-signature:
        - webhooks:read
      - basic:
        - webhooks:read
      x-virtocommerce-module-id: VirtoCommerce.WebHooks
  /api/webhooks/properties:
    get:
      tags:
      - Webhooks
      operationId: WebHooks_GetEventObjectProperties
      parameters:
      - name: objectType
        in: query
        schema:
          type: string
      responses:
        '200':
          description: OK
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/EventObjectProperties'
            application/json:
              schema:
                $ref: '#/components/schemas/EventObjectProperties'
            text/json:
              schema:
                $ref: '#/components/schemas/EventObjectProperties'
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
      security:
      - oauth2:
        - webhooks:read
      - api_key:
        - webhooks:read
      - api_key_header:
        - webhooks:read
      - http-signature:
        - webhooks:read
      - basic:
        - webhooks:read
      x-virtocommerce-module-id: VirtoCommerce.WebHooks
components:
  schemas:
    AuthenticationType:
      enum:
      - None
      - Basic
      - BearerToken
      - CustomHeader
      type: string
    EventObjectProperties:
      type: object
      properties:
        discovered:
          type: boolean
        properties:
          type: array
          items:
            type: string
          nullable: true
      additionalProperties: false
    RegisteredEvent:
      type: object
      properties:
        eventType:
          type: string
          nullable: true
        displayName:
          type: string
          nullable: true
        id:
          type: string
          nullable: true
      additionalProperties: false
    SortDirection:
      enum:
      - Ascending
      - Descending
      type: string
    SortInfo:
      type: object
      properties:
        sortColumn:
          type: string
          nullable: true
        sortDirection:
          allOf:
          - $ref: '#/components/schemas/SortDirection'
      additionalProperties: false
    WebHookFeedSearchResult:
      type: object
      properties:
        totalCount:
          type: integer
          format: int32
        results:
          type: array
          items:
            $ref: '#/components/schemas/WebhookFeedEntry'
          nullable: true
      additionalProperties: false
    WebHookPayload:
      type: object
      properties:
        eventPropertyName:
          type: string
          nullable: true
        webHookId:
          type: string
          nullable: true
        createdDate:
          type: string
          format: date-time
        modifiedDate:
          type: string
          format: date-time
          nullable: true
        createdBy:
          maxLength: 64
          minLength: 0
          type: string
          nullable: true
        modifiedBy:
          maxLength: 64
          minLength: 0
          type: string
          nullable: true
        id:
          type: string
          nullable: true
      additionalProperties: false
    Webhook:
      type: object
      properties:
        name:
          type: string
          nullable: true
        url:
          type: string
          nullable: true
        contentType:
          type: string
          nullable: true
        authType:
          allOf:
          - $ref: '#/components/schemas/AuthenticationType'
        basicUsername:
          type: string
          nullable: true
        basicPassword:
          type: string
          nullable: true
        bearerToken:
          type: string
          nullable: true
        customHttpHeaderName:
          type: string
          nullable: true
        customHttpHeaderValue:
          type: string
          nullable: true
        isActive:
          type: boolean
        successCount:
          type: integer
          format: int64
        errorCount:
          type: integer
          format: int64
        events:
          type: array
          items:
            $ref: '#/components/schemas/WebhookEvent'
          nullable: true
        requestParams:
          allOf:
          - $ref: '#/components/schemas/WebhookHttpParams'
          nullable: true
        payloads:
          type: array
          items:
            $ref: '#/components/schemas/WebHookPayload'
          nullable: true
        createdDate:
          type: string
          format: date-time
        modifiedDate:
          type: string
          format: date-time
          nullable: true
        createdBy:
          maxLength: 64
          minLength: 0
          type: string
          nullable: true
        modifiedBy:
          maxLength: 64
          minLength: 0
          type: string
          nullable: true
        id:
          type: string
          nullable: true
      additionalProperties: false
    WebhookEvent:
      type: object
      properties:
        webHookId:
          type: string
          nullable: true
        eventId:
          type: string
          nullable: true
        displayName:
          type: string
          nullable: true
        createdDate:
          type: string
          format: date-time
        modifiedDate:
          type: string
          format: date-time
          nullable: true
        createdBy:
          maxLength: 64
          minLength: 0
          type: string
          nullable: true
        modifiedBy:
          maxLength: 64
          minLength: 0
          type: string
          nullable: true
        id:
          type: string
          nullable: true
      additionalProperties: false
    WebhookFeedEntry:
      type: object
      properties:
        webHookId:
          type: string
          nullable: true
        eventId:
          type: string
          nullable: true
        attemptCount:
          type: integer
          format: int32
        status:
          type: integer
          format: int32
        recordType:
          type: integer
          format: int32
        error:
          type: string
          nullable: true
        requestHeaders:
          type: string
          nullable: true
        requestBody:
          type: string
          nullable: true
        responseHeaders:
          type: string
          nullable: true
        responseBody:
          type: string
          nullable: true
        createdDate:
          type: string
          format: date-time
        modifiedDate:
          type: string
          format: date-time
          nullable: true
        createdBy:
          maxLength: 64
          minLength: 0
          type: string
          nullable: true
        modifiedBy:
          maxLength: 64
          minLength: 0
          type: string
          nullable: true
        id:
          type: string
          nullable: true
      additionalProperties: false
    WebhookFeedSearchCriteria:
      type: object
      properties:
        webHookIds:
          type: array
          items:
            type: string
          nullable: true
        eventIds:
          type: array
          items:
            type: string
          nullable: true
        statuses:
          type: array
          items:
            type: integer
            format: int32
          nullable: true
        recordTypes:
          type: array
          items:
            type: integer
            format: int32
          nullable: true
        responseGroup:
          type: string
          nullable: true
        objectType:
          type: string
          nullable: true
        objectTypes:
          type: array
          items:
            type: string
          nullable: true
        objectIds:
          type: array
          items:
            type: string
          nullable: true
        keyword:
          type: string
          nullable: true
        searchPhrase:
          type: string
          nullable: true
        languageCode:
          type: string
          nullable: true
        sort:
          type: string
          nullable: true
        sortInfos:
          type: array
          items:
            $ref: '#/components/schemas/SortInfo'
          nullable: true
          readOnly: true
        skip:
          type: integer
          format: int32
        take:
          type: integer
          format: int32
      additionalProperties: false
    WebhookHttpParams:
      type: object
      properties:
        headers:
          type: object
          additionalProperties:
            type: string
            nullable: true
          nullable: true
        body:
          type: string
          nullable: true
      additionalProperties: false
    WebhookSearchCriteria:
      type: object
      properties:
        isActive:
          type: boolean
          nullable: true
        eventIds:
          type: array
          items:
            type: string
          nullable: true
        responseGroup:
          type: string
          nullable: true
        objectType:
          type: string
          nullable: true
        objectTypes:
          type: array
          items:
            type: string
          nullable: true
        objectIds:
          type: array
          items:
            type: string
          nullable: true
        keyword:
          type: string
          nullable: true
        searchPhrase:
          type: string
          nullable: true
        languageCode:
          type: string
          nullable: true
        sort:
          type: string
          nullable: true
        sortInfos:
          type: array
          items:
            $ref: '#/components/schemas/SortInfo'
          nullable: true
          readOnly: true
        skip:
          type: integer
          format: int32
        take:
          type: integer
          format: int32
      additionalProperties: false
    WebhookSearchResult:
      type: object
      properties:
        totalCount:
          type: integer
          format: int32
        results:
          type: array
          items:
            $ref: '#/components/schemas/Webhook'
          nullable: true
      additionalProperties: false
    WebhookSendResponse:
      type: object
      properties:
        statusCode:
          type: integer
          format: int32
        error:
          type: string
          nullable: true
        responseParams:
          allOf:
          - $ref: '#/components/schemas/WebhookHttpParams'
          nullable: true
        isSuccessfull:
          type: boolean
      additionalProperties: false
  securitySchemes:
    oauth2:
      type: oauth2
      description: OAuth2 Resource Owner Password Grant flow
      flows:
        password:
          tokenUrl: /connect/token
          scopes: {}
        clientCredentials:
          tokenUrl: /connect/token
          scopes: {}
    api_key:
      type: apiKey
      description: API Key authentication
      name: api_key
      in: query
    api_key_header:
      type: apiKey
      description: API Key authentication (alternative via header)
      name: api_key
      in: header
    http-signature:
      type: http
      description: HTTP Signature authentication using Authorization header
      scheme: signature
    basic:
      type: http
      description: Basic authentication using username and password
      scheme: basic
tags:
- name: Webhooks
  description: Manage user defined webhooks