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

# RegisterWebhook

> RegisterWebhook registers a URL to receive signed event deliveries. The URL
 must be HTTPS and publicly routable. The response carries the signing secret
 once; store it, as it is never shown again.



## OpenAPI

````yaml /api-reference/sodacards.yaml post /v1/webhooks
openapi: 3.1.0
info:
  title: SODACARDS Developer API
  description: Sell gift cards and game top-ups from your own systems.
  version: 1.0.0
servers:
  - url: https://api.sodacards.com
security:
  - ApiKeyAuth: []
tags:
  - name: PublicAPIService
    description: >-
      PublicAPIService is the public developer API a reseller calls with an API
      key.
       It is served as REST (via HTTP transcoding) so developers use GET /v1/... and
       curl, and its OpenAPI 3.1 spec is generated from this one file. Every method is
       authenticated by the API-key gateway that fronts it.
paths:
  /v1/webhooks:
    post:
      tags:
        - PublicAPIService
      summary: RegisterWebhook
      description: >-
        RegisterWebhook registers a URL to receive signed event deliveries. The
        URL
         must be HTTPS and publicly routable. The response carries the signing secret
         once; store it, as it is never shown again.
      operationId: PublicAPIService_RegisterWebhook
      requestBody:
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/sodacards.devpublic.v1.RegisterWebhookRequest
        required: true
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/sodacards.devpublic.v1.RegisterWebhookResponse
components:
  schemas:
    sodacards.devpublic.v1.RegisterWebhookRequest:
      type: object
      properties:
        url:
          type: string
          title: url
          description: url is the HTTPS endpoint to deliver events to.
        events:
          type: array
          items:
            type: string
          title: events
          description: |-
            events are the event types to subscribe to (at least one), e.g.
             "order.fulfilled", "order.failed", "order.refunded", "wallet.low_balance",
             "wallet.credited".
      title: RegisterWebhookRequest
      additionalProperties: false
    sodacards.devpublic.v1.RegisterWebhookResponse:
      type: object
      properties:
        webhook:
          $ref: '#/components/schemas/sodacards.devpublic.v1.Webhook'
          title: webhook
          description: webhook is the registered endpoint.
        secret:
          type: string
          title: secret
          description: >-
            secret is the signing secret, shown only once. Store it; verify each
            delivery
             with it. It is never returned again.
      title: RegisterWebhookResponse
      additionalProperties: false
    sodacards.devpublic.v1.Webhook:
      type: object
      properties:
        id:
          type: string
          title: id
          description: id identifies the endpoint.
        url:
          type: string
          title: url
          description: url is the HTTPS endpoint events are delivered to.
        events:
          type: array
          items:
            type: string
          title: events
          description: events are the subscribed event types.
        active:
          type: boolean
          title: active
          description: active is whether deliveries are currently sent to this endpoint.
        createdAt:
          type: string
          title: created_at
          description: created_at is when the endpoint was registered (RFC 3339).
      title: Webhook
      additionalProperties: false
      description: Webhook is a registered endpoint. It never carries the signing secret.
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      description: Your API key, prefixed sc_live_ or sc_test_.
      name: X-API-Key
      in: header

````