Cregis Developer Docs
WEBHOOK

Refund Webhook

A server-initiated callback. Implement a receiving endpoint in your service.

When the refund status changes, Cregis pushes a notification to the callback_url configured when creating the order.

Verify the signature, then respond with the plain-text string success to acknowledge receipt. Other response content is treated as a failed callback. Retry failed callbacks from Cregis App > WaaS Projects > Select Project > Callback Error. See Exception Callback Handling.

Callback events

event_typeDescription
initiatedRefund created
refundingRefund in progress
refund_successfulRefund completed
refund_failedRefund failed

The initiated event omits refund_fee and refund_history; refund transaction details for other statuses are returned as processing progresses. Complete examples for all four statuses are shown below.

Request

Callback Payload

application/json
  • pidinteger<int64>

    Project ID — found under the project's settings.

  • signstring

    Digital signature — merchants MUST verify it to authenticate the callback.

  • noncestring

    6-character random string.

  • timestampinteger<int64>

    13-digit Unix timestamp (ms).

  • event_namestring
    enum: "waasom_refund"

    Callback event name.

  • event_typestring
    enum: "initiated", "refunding", "refund_successful", "refund_failed"

    Refund event type.

    • initiatedRefund created
    • refundingRefund in progress
    • refund_successfulRefund completed
    • refund_failedRefund failed
  • data
    • cregis_idinteger<int64>

      Cregis order number.

    • merchant_order_idstring

      Merchant order number submitted by the merchant.

    • refund_data
      • idinteger<int64>

        Refund ID.

      • created_timeinteger<int64>

        Refund creation time (13-digit Unix timestamp).

      • token_symbolstring

        Token symbol.

      • blockchainstring

        Blockchain name.

      • token_namestring

        Full token name including chain.

      • initial_amountstring

        Initial refund amount.

      • refund_feestring

        Refund fee; absent while refund status is initiated.

      • typestring
        enum: "partial_refund", "full_refund"

        partial_refund: refund the overpaid difference; full_refund: refund the entire paid amount.

      • statusstring
        enum: "initiated", "refunding", "refund_successful", "refund_failed"

        initiated: refund created, not yet executed; refunding: refund transfer is in progress; refund_successful: refund completed; refund_failed: refund failed.

      • reasonstring
        enum: "nonstablecoin_partial_payment", "overpayment", "additional_payment_timeout", "maximum_payments_exceeded"

        nonstablecoin_partial_payment: partial payment in a non-stablecoin; overpayment: payer overpaid; additional_payment_timeout: additional payment was not completed in time; maximum_payments_exceeded: maximum payment count reached.

      • refund_history
        • block_timeinteger<int64>

          Block timestamp (13-digit Unix timestamp).

        • from_addressstring

          Refund sender address.

        • to_addressstring

          Refund recipient address.

        • amountstring

          Actual refunded amount = refund amount minus refund fee.

        • tx_idstring

          On-chain refund transaction ID.

Responses

200Respond with plain-text success to acknowledge the callback.
text/plain
string
enum: "success"