> ## Documentation Index
> Fetch the complete documentation index at: https://developer.accessrc.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Subscribe Event



## OpenAPI

````yaml POST /api/Event/Subscribe
openapi: 3.0.4
info:
  title: ServiceProvider API
  version: v1
servers: []
security:
  - ApiKeyAuth: []
paths:
  /api/Event/Subscribe:
    post:
      tags:
        - Event
      requestBody:
        content:
          application/json-patch+json:
            schema:
              $ref: '#/components/schemas/EventSubscribeRequest'
            examples:
              No Authentication:
                summary: Subscription without authentication.
                value:
                  eventType: DELIVERY_CHANNEL_STATUS_UPDATED
                  callbackUrl: https://partner.example.com/webhook
                  auth: null
              API Key (header):
                summary: Subscription with API key in a custom header.
                value:
                  eventType: DELIVERY_CHANNEL_STATUS_UPDATED
                  callbackUrl: https://partner.example.com/webhook
                  auth:
                    type: header
                    headerName: X-API-Key
                    headerValue: my-api-key
                    username: null
                    password: null
                    secret: null
              Basic Auth:
                summary: Subscription secured with HTTP Basic authentication.
                value:
                  eventType: DELIVERY_CHANNEL_STATUS_UPDATED
                  callbackUrl: https://partner.example.com/webhook
                  auth:
                    type: basic
                    headerName: null
                    headerValue: null
                    username: webhook-user
                    password: securepass
                    secret: null
              HMAC:
                summary: Subscription signed with an HMAC secret.
                value:
                  eventType: DELIVERY_CHANNEL_STATUS_UPDATED
                  callbackUrl: https://partner.example.com/webhook
                  auth:
                    type: hmac
                    headerName: null
                    headerValue: null
                    username: null
                    password: null
                    secret: mysecretkey
          application/json:
            schema:
              $ref: '#/components/schemas/EventSubscribeRequest'
            examples:
              No Authentication:
                summary: Subscription without authentication.
                value:
                  eventType: DELIVERY_CHANNEL_STATUS_UPDATED
                  callbackUrl: https://partner.example.com/webhook
                  auth: null
              API Key (header):
                summary: Subscription with API key in a custom header.
                value:
                  eventType: DELIVERY_CHANNEL_STATUS_UPDATED
                  callbackUrl: https://partner.example.com/webhook
                  auth:
                    type: header
                    headerName: X-API-Key
                    headerValue: my-api-key
                    username: null
                    password: null
                    secret: null
              Basic Auth:
                summary: Subscription secured with HTTP Basic authentication.
                value:
                  eventType: DELIVERY_CHANNEL_STATUS_UPDATED
                  callbackUrl: https://partner.example.com/webhook
                  auth:
                    type: basic
                    headerName: null
                    headerValue: null
                    username: webhook-user
                    password: securepass
                    secret: null
              HMAC:
                summary: Subscription signed with an HMAC secret.
                value:
                  eventType: DELIVERY_CHANNEL_STATUS_UPDATED
                  callbackUrl: https://partner.example.com/webhook
                  auth:
                    type: hmac
                    headerName: null
                    headerValue: null
                    username: null
                    password: null
                    secret: mysecretkey
          text/json:
            schema:
              $ref: '#/components/schemas/EventSubscribeRequest'
            examples:
              No Authentication:
                summary: Subscription without authentication.
                value:
                  eventType: DELIVERY_CHANNEL_STATUS_UPDATED
                  callbackUrl: https://partner.example.com/webhook
                  auth: null
              API Key (header):
                summary: Subscription with API key in a custom header.
                value:
                  eventType: DELIVERY_CHANNEL_STATUS_UPDATED
                  callbackUrl: https://partner.example.com/webhook
                  auth:
                    type: header
                    headerName: X-API-Key
                    headerValue: my-api-key
                    username: null
                    password: null
                    secret: null
              Basic Auth:
                summary: Subscription secured with HTTP Basic authentication.
                value:
                  eventType: DELIVERY_CHANNEL_STATUS_UPDATED
                  callbackUrl: https://partner.example.com/webhook
                  auth:
                    type: basic
                    headerName: null
                    headerValue: null
                    username: webhook-user
                    password: securepass
                    secret: null
              HMAC:
                summary: Subscription signed with an HMAC secret.
                value:
                  eventType: DELIVERY_CHANNEL_STATUS_UPDATED
                  callbackUrl: https://partner.example.com/webhook
                  auth:
                    type: hmac
                    headerName: null
                    headerValue: null
                    username: null
                    password: null
                    secret: mysecretkey
          application/*+json:
            schema:
              $ref: '#/components/schemas/EventSubscribeRequest'
            examples:
              No Authentication:
                summary: Subscription without authentication.
                value:
                  eventType: DELIVERY_CHANNEL_STATUS_UPDATED
                  callbackUrl: https://partner.example.com/webhook
                  auth: null
              API Key (header):
                summary: Subscription with API key in a custom header.
                value:
                  eventType: DELIVERY_CHANNEL_STATUS_UPDATED
                  callbackUrl: https://partner.example.com/webhook
                  auth:
                    type: header
                    headerName: X-API-Key
                    headerValue: my-api-key
                    username: null
                    password: null
                    secret: null
              Basic Auth:
                summary: Subscription secured with HTTP Basic authentication.
                value:
                  eventType: DELIVERY_CHANNEL_STATUS_UPDATED
                  callbackUrl: https://partner.example.com/webhook
                  auth:
                    type: basic
                    headerName: null
                    headerValue: null
                    username: webhook-user
                    password: securepass
                    secret: null
              HMAC:
                summary: Subscription signed with an HMAC secret.
                value:
                  eventType: DELIVERY_CHANNEL_STATUS_UPDATED
                  callbackUrl: https://partner.example.com/webhook
                  auth:
                    type: hmac
                    headerName: null
                    headerValue: null
                    username: null
                    password: null
                    secret: mysecretkey
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  Error:
                    type: object
                    properties:
                      Code:
                        type: integer
                        format: int32
                      Type:
                        type: string
                      Message:
                        type: string
                      Title:
                        type: string
                  Data:
                    type: object
                    properties:
                      Error:
                        type: object
                        properties:
                          Code:
                            type: integer
                            format: int32
                          Type:
                            type: string
                          Message:
                            type: string
                          Title:
                            type: string
                      Data:
                        $ref: '#/components/schemas/BaseResponse'
                      Paging:
                        type: object
                        properties:
                          Skip:
                            type: integer
                            format: int32
                          Take:
                            type: integer
                            format: int32
                          Total:
                            type: integer
                            format: int32
                      Token:
                        type: object
              example:
                error: null
                data:
                  message: Webhook successfully subscribed
                  subscriptionId: c79f8f33-0042-4c25-bd5e-0dc1982f8cea
                  callbackUrl: https://partner.example.com/webhook
                  eventType: DELIVERY_REQUEST_SENT
                  date: '2025-04-07T07:51:38Z'
                status: success
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  Error:
                    type: object
                    properties:
                      Code:
                        type: integer
                        format: int32
                      Type:
                        type: string
                      Message:
                        type: string
                      Title:
                        type: string
                  Data:
                    type: object
                    properties:
                      Error:
                        type: object
                        properties:
                          Code:
                            type: integer
                            format: int32
                          Type:
                            type: string
                          Message:
                            type: string
                          Title:
                            type: string
                      Data:
                        $ref: '#/components/schemas/BaseResponse'
                      Paging:
                        type: object
                        properties:
                          Skip:
                            type: integer
                            format: int32
                          Take:
                            type: integer
                            format: int32
                          Total:
                            type: integer
                            format: int32
                      Token:
                        type: object
              example:
                error:
                  guid: 95bd740b-755b-4f95-8549-fa9acfc31a41
                  code: 400
                  type: ValidationError
                  message: >-
                    Invalid request body format. Please check your request
                    format from AccessRC API specifications.
                  title: Invalid Request Body
                data: null
                status: failed
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  Error:
                    type: object
                    properties:
                      Code:
                        type: integer
                        format: int32
                      Type:
                        type: string
                      Message:
                        type: string
                      Title:
                        type: string
                  Data:
                    type: object
                    properties:
                      Error:
                        type: object
                        properties:
                          Code:
                            type: integer
                            format: int32
                          Type:
                            type: string
                          Message:
                            type: string
                          Title:
                            type: string
                      Data:
                        $ref: '#/components/schemas/BaseResponse'
                      Paging:
                        type: object
                        properties:
                          Skip:
                            type: integer
                            format: int32
                          Take:
                            type: integer
                            format: int32
                          Total:
                            type: integer
                            format: int32
                      Token:
                        type: object
              example:
                error:
                  guid: 2c77f4b6-6ff8-4017-8bb8-1d7a5c8e01f3
                  code: 401
                  type: Unauthorized
                  message: null
                  title: API Key is missing
                data: null
                status: failed
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  Error:
                    type: object
                    properties:
                      Code:
                        type: integer
                        format: int32
                      Type:
                        type: string
                      Message:
                        type: string
                      Title:
                        type: string
                  Data:
                    type: object
                    properties:
                      Error:
                        type: object
                        properties:
                          Code:
                            type: integer
                            format: int32
                          Type:
                            type: string
                          Message:
                            type: string
                          Title:
                            type: string
                      Data:
                        $ref: '#/components/schemas/BaseResponse'
                      Paging:
                        type: object
                        properties:
                          Skip:
                            type: integer
                            format: int32
                          Take:
                            type: integer
                            format: int32
                          Total:
                            type: integer
                            format: int32
                      Token:
                        type: object
              example:
                error:
                  guid: 2c77f4b6-6ff8-4017-8bb8-1d7a5c8e01f3
                  code: 500
                  type: Exception
                  message: null
                  title: Internal Server Error
                data: null
                status: failed
components:
  schemas:
    EventSubscribeRequest:
      required:
        - callbackUrl
      type: object
      properties:
        eventType:
          enum:
            - 'NULL'
            - DELIVERY_CHANNEL_STATUS_UPDATED
            - DELIVERY_REQUEST_SENT
            - DELIVERY_REFUND_REQUESTED
          type: string
          description: Type of event to subscribe to.
          example: 'NULL'
        callbackUrl:
          maxLength: 256
          minLength: 0
          type: string
          description: Callback URL that will receive the event notifications.
          format: uri
        auth:
          $ref: '#/components/schemas/EventSubscribeAuth'
      additionalProperties: false
    BaseResponse:
      type: object
      properties:
        error:
          $ref: '#/components/schemas/Error'
        data:
          nullable: true
        status:
          type: string
          nullable: true
      additionalProperties: false
    EventSubscribeAuth:
      required:
        - type
      type: object
      properties:
        type:
          maxLength: 16
          minLength: 0
          type: string
          description: >-
            Type of authentication to use. Options: 'hmac' (secret key),
            'header' (API key), 'basic' (username/password), or null if no
            authentication is required.
        headerName:
          maxLength: 64
          minLength: 0
          type: string
          description: Name of the API key header. Required if type is 'header'.
          nullable: true
        headerValue:
          maxLength: 512
          minLength: 0
          type: string
          description: Value of the API key. Required if type is 'header'.
          nullable: true
        username:
          maxLength: 128
          minLength: 0
          type: string
          description: Username for basic authentication. Required if type is 'basic'.
          nullable: true
        password:
          maxLength: 512
          minLength: 0
          type: string
          description: Password for basic authentication. Required if type is 'basic'.
          nullable: true
        secret:
          maxLength: 512
          minLength: 0
          type: string
          description: Secret key for HMAC authentication. Required if type is 'hmac'.
          nullable: true
      additionalProperties: false
    Error:
      type: object
      properties:
        guid:
          type: string
          nullable: true
        code:
          type: integer
          format: int32
        type:
          type: string
          nullable: true
        message:
          type: string
          nullable: true
        title:
          type: string
          nullable: true
      additionalProperties: false
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: API Key required in `x-api-key` header

````