ANexPay Docs
    • Introduction
    • Signature
    • API Keys
    • Get Started
    • Webhook Service
    • Enum Reference
    • Api Reference
      • Authentication
        • Get Auth Token
      • Hosted Payment Page
        • Hosted Payment Page
      • CreditCardPay
        • List Payment History
        • Get Payment Detail
        • Refund
        • List Subscriptions
        • Get Subscription Detail
        • Cancel Subscription
        • Get Subscription Bills
      • StableCoinPay
        • order
          • GetCheckoutOrderList
        • refund-order
          • CreateRefundOrder
          • CancelRefundOrder
          • GetRefundOrderInfo
          • GetRefundOrderList
        • settlement
          • CreateFiatSettlementOrder
          • CancelSettlementOrder
          • GetSettlementOrderList
        • abnormal-payment
          • GetAbnormalPaymentList
          • CreateAbnormalPaymentRefund
    • Schemas
      • Schemas
        • RefundOrderDTO
        • RefundPageReq
        • ApiPageApiPageRefundOrderDTO
        • ApiResponseApiPageRefundOrderDTO
        • CancelReq

    Webhook Service

    Overview#

    AnexPay supports callback to customer interfaces in multiple business scenarios. Customers can implement their own business logic in the callback interface.
    For webhook url configuration, please refer to API key management menu in Portal platform, and update the related API key info.
    The callback is based on the HTTP/HTTP protocol with the POST method, and all request bodies are in JSON format with all characters encoded in UTF-8.
    The callback process is considered Failed if any of the following situations occur: request failed, request timeout, or response status code other than 2XX.
    The callback is divided into Synchronous and Asynchronous types, Synchronous request must respond in a timely manner and have no try mechanism, while asynchronous requests do not need to respond in a timely manner and have a retry maechanism.
    Upon receiving the callback, kindly respond with SUCCESS; otherwise, a retry will be triggered.
    NameResponse TimeRetry countRetry Interval
    OPENAPI_WEBHOOK15s1415,15, 30, 180, 600, 1200, 1800,1800,3600,10800,10800,10800,21600,21600

    Webhook Data Example#

    {
      "eventId": "event_9853dccb85b1",
      "eventType": "credit_card.order.paid",
      "data": {
        "id": 0,
        "trxNo": "txNo_db8b4f203301"
      }
      "userId": 1
    }

    Webhook Signature#

    Webhook payload use signKey to format ANEX_PAY_SIGNATURE
    in https request header, you need to encode the payload in the same way and compare with ANEX_PAY_SIGNATURE
    String signature = Base64.getEncoder().encodeToString( Hashing.hmacSha512(signKey.getBytes()) .hashBytes(stringToSign.getBytes()) .asBytes());

    Webhook Event Type#

    Event TypeDescription
    credit_card.order.paidA card payment order has been successfully paid
    credit_card.order.failedA card payment order has failed
    credit_card.order.cancelledA card payment order has been cancelled
    credit_card.order.expiredA card payment order has expired
    credit_card.subscription.expiredA subscription has expired
    credit_card.subscription.payment.succeededA subscription billing cycle payment succeeded
    credit_card.subscription.payment.failedA subscription billing cycle payment failed
    crypto.order.paidA crypto payment order has been fully paid
    crypto.refund.completedA crypto refund has been completed
    crypto.refund.failedA crypto refund has failed
    crypto.settlement.completedA crypto settlement has been completed
    Modified at 2026-06-03 09:02:55
    Previous
    Get Started
    Next
    Enum Reference
    Built with