Type Alias WebHookResponse<Payload>

WebHookResponse<Payload>: {
    error: never;
    payload: Payload;
    request_id: string;
    status: "OK";
} | {
    error: string;
    payload: Payload;
    request_id: string;
    status: "ERROR";
}

Represents the response from a WebHook request. This is a union type that varies based on the status property.

Type Parameters

  • Payload = any

    The type of the payload in the response. It defaults to any, allowing for flexibility in specifying the structure of the payload.

Type declaration

  • error: never

    Error is never present in a successful response.

  • payload: Payload

    The payload of the response, structure determined by the Payload type.

  • request_id: string

    The unique identifier for the request.

  • status: "OK"

    Indicates a successful response.

Type declaration

  • error: string

    Description of the error that occurred.

  • payload: Payload

    The payload of the response, structure determined by the Payload type.

  • request_id: string

    The unique identifier for the request.

  • status: "ERROR"

    Indicates an unsuccessful response.