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

# VULT Webhook

> VULT cash-in webhook

<Info>
  Receive cash-in notifications from VULT processor. This webhook is called when a user deposits funds via VULT.
</Info>

## Request

<ParamField header="X-Webhook-Signature" type="string" required>
  HMAC-SHA256 signature of the request body
</ParamField>

### Body Parameters

<ParamField body="card_serial" type="string" required>
  Card serial linked to the subscriber receiving funds
</ParamField>

<ParamField body="phone_number" type="string">
  Optional phone number used to cross-check the linked subscriber
</ParamField>

<ParamField body="amount" type="integer" required>
  Amount in minor units (e.g., cents)
</ParamField>

***

## Response

<ResponseField name="success" type="boolean">
  Whether the cash-in was processed successfully
</ResponseField>

<ResponseField name="transaction_id" type="string">
  OLIVE transaction ID for the deposit
</ResponseField>

***

## Examples

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST "https://demo.api.vultlocal.com/webhooks/vult/cashin" \
    -H "Content-Type: application/json" \
    -H "X-Webhook-Signature: abc123..." \
    -d '{
      "card_serial": "CARD0001",
      "phone_number": "+23279123456",
      "amount": 50000
    }'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 Success theme={null}
  {
    "success": true,
    "transaction_id": "txn_vult_123",
    "message": "Cash-in processed successfully",
    "new_balance": 75000
  }
  ```

  ```json 400 Invalid Request theme={null}
  {
    "success": false,
    "message": "card_serial is required"
  }
  ```

  ```json 401 Invalid Signature theme={null}
  {
    "success": false,
    "message": "Invalid webhook signature"
  }
  ```
</ResponseExample>

***

## Signature Verification

<Warning>
  Always verify the `X-Webhook-Signature` header before processing:

  ```javascript theme={null}
  const crypto = require('crypto');

  function verifySignature(payload, signature, secret) {
    const expected = crypto
      .createHmac('sha256', secret)
      .update(payload)
      .digest('hex');
    return crypto.timingSafeEqual(
      Buffer.from(signature),
      Buffer.from(expected)
    );
  }
  ```
</Warning>

***

## Errors

| Status | Code              | Description                                                                  |
| ------ | ----------------- | ---------------------------------------------------------------------------- |
| 400    | Invalid request   | Missing `card_serial`, invalid amount, inactive card, or subscriber mismatch |
| 401    | Invalid signature | Webhook signature invalid                                                    |
| 500    | Internal error    | Webhook not configured or processing failed                                  |


## OpenAPI

````yaml olive-openapi.json POST /webhooks/vult/cashin
openapi: 3.0.0
info:
  description: >-
    API Gateway for OLIVE NFC Card Payment System - Comprehensive payment, card
    management, agent operations, and admin authentication. All /api/v1 routes
    require authentication using either API Key or JWT token.
  title: OLIVE NFC Card Payment API
  termsOfService: http://swagger.io/terms/
  contact:
    name: API Support
    email: support@olive.sl
  license:
    name: Apache 2.0
    url: http://www.apache.org/licenses/LICENSE-2.0.html
  version: 1.0.0
servers:
  - url: https://olive-gateway-a6ba.onrender.com/api/v1
security: []
paths:
  /webhooks/vult/cashin:
    post:
      tags:
        - Webhooks
      summary: Vult cash-in webhook
      description: HMAC-protected webhook for Vult to credit subscriber wallets
      parameters:
        - description: HMAC-SHA256 signature of request body
          name: X-Webhook-Signature
          in: header
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/handler.VultCashInWebhookRequest'
        description: Cash-in details
        required: true
      responses:
        '200':
          description: Cash-in successful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/handler.VultCashInWebhookResponse'
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
        '401':
          description: Invalid signature
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
components:
  schemas:
    handler.VultCashInWebhookRequest:
      type: object
      required:
        - amount
        - card_serial
      properties:
        amount:
          type: integer
        card_serial:
          type: string
        phone_number:
          type: string
    handler.VultCashInWebhookResponse:
      type: object
      properties:
        message:
          type: string
        new_balance:
          type: integer
        success:
          type: boolean
        transaction_id:
          type: string

````