Cregis Developer Docs
WEBHOOK

Order Webhook

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

Cregis sends an HTTP POST application/json notification to the callback_url configured when creating the order whenever its status changes.

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.

Fields by status

All scenarios include common order fields; the following details depend on the scenario.

event_typeScenarioDetail fields
additional_payment_requiredPartial payment; top-up requiredpayment_detail with additional-payment fields
paidFully paidpayment_detail without additional-payment fields
transferredBulk transfer to merchant wallet completedbulk_transfer
cancelledFull refundrefund_data
cancelledAML exceptionpayment_exception_data with an array of records
expiredExpired without full paymentCommon order fields only

Six complete callback examples are provided 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_order"

    Callback event name.

  • event_typestring
    enum: "additional_payment_required", "paid", "transferred", "cancelled", "expired"

    Order event type.

    • additional_payment_requiredPartial payment received; top-up needed.
    • paidFully paid.
    • transferredBulk-transferred to the merchant wallet.
    • cancelledCancelled (full refund or AML).
    • expiredTimed out without full payment.
  • data
    • cregis_idinteger<int64>

      Cregis order number.

    • merchant_order_idstring

      Merchant order number submitted by the merchant.

    • order_amountstring

      Order amount submitted by the merchant.

    • order_currencystring

      Order currency submitted by the merchant.

    • created_timeinteger<int64>

      Order creation time (13-digit Unix timestamp).

    • expire_timeinteger<int64>

      Order expiry time (13-digit Unix timestamp).

    • statusstring
      enum: "additional_payment_required", "paid", "transferred", "cancelled", "expired"

      Current order status.

      • additional_payment_requiredPartial payment received; top-up needed.
      • paidFully paid.
      • transferredBulk-transferred to the merchant wallet.
      • cancelledCancelled (full refund or AML).
      • expiredTimed out without full payment.
    • valid_timeinteger

      Order validity in minutes.

    • remarkstring

      Order remark.

    • payerobject | null

      Echo of the submitted payer object; returns null if not submitted.

      Match one event payload shape

      Option 1 · object
      • payer_idstring | null

        Payer's unique identifier. Returns null if not submitted.

        Match one event payload shape

        Option 1 · string
        string
        Option 2 · null
        null
      • payer_namestring | null

        Payer's name. Returns null if not submitted.

        Match one event payload shape

        Option 1 · string
        string
        Option 2 · null
        null
      • payer_emailstring | null

        Payer's email address. Returns null if not submitted.

        Match one event payload shape

        Option 1 · string
        string
        Option 2 · null
        null
      Option 2 · null
      null
    • payment_detailobject

      Included for additional_payment_required or paid. Paid does not include the additional-payment amount, deadline, or address.

      • actual_received_amountstring

        Actual received amount: total payment amount minus the refund amount.

      • payment_statusstring
        enum: "equal_to_order_amount", "more_than_order_amount", "less_than_order_amount", "additional_payment_required", "refund"

        Payment status.

        • equal_to_order_amountThe actual received amount equals the order amount in the payment currency, and the order status is paid or transferred.
        • more_than_order_amountThe actual received amount is greater than the order amount in the payment currency, and the order status is paid or transferred.
        • less_than_order_amountThe actual received amount is less than the order amount in the payment currency, and the order status is paid or transferred.
        • additional_payment_requiredThe order status is additional_payment_required; an additional payment is required.
        • refundThe order requires a full refund.
      • token_symbolstring

        Token symbol.

      • blockchainstring

        Blockchain name.

      • token_namestring

        Full token name including chain.

      • order_amount_in_payment_currencystring

        Order amount in payment currency.

      • payment_currencystring

        Payment currency symbol.

      • exchange_ratestring

        Exchange rate used.

      • payment_historyarray<object>

        Payment records sorted by block_time in ascending order.

        Array items · object

        • idinteger<int64>

          Payment record ID.

        • block_timeinteger<int64>

          Block timestamp (13-digit Unix timestamp).

        • from_addressstring

          Sender address.

        • to_addressstring

          Recipient address.

        • amountstring

          Payment amount.

        • tx_idstring

          On-chain transaction ID.

      • additional_amount_requiredstring

        Amount still required for a partial payment. Absent from paid callbacks.

      • additional_payment_expire_timeinteger<int64>

        Deadline for additional payment, as a 13-digit Unix timestamp in milliseconds. Present for partial payment; absent from paid callbacks.

      • additional_payment_addressstring

        Additional-payment address, the same as the first payment address. Present for partial payment; absent from paid callbacks.

    • bulk_transferobject

      Bulk transfer information, included for transferred callbacks.

      • statusstring
        enum: "transferring", "transferred", "transfer_partial_failed"

        transferring: not all transfers have succeeded and none have failed; transferred: all transfers succeeded; transfer_partial_failed: one or more transfers failed.

      • idinteger<int64>

        Bulk transfer ID.

      • created_timeinteger<int64>

        Transfer creation time (13-digit Unix timestamp).

      • token_symbolstring

        Token symbol.

      • to_addressstring

        Destination address in the merchant wallet.

      • transfer_amount_for_this_orderstring

        Amount transferred for this order; for non-stablecoins, deduct the order service fee from the actual received amount.

    • refund_dataobject

      Included for the full-refund cancelled scenario.

      • 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.

    • payment_exception_dataobject

      Included for AML-cancelled orders; payment_history is an array.

      • token_symbolstring

        Token symbol.

      • blockchainstring

        Blockchain name.

      • token_namestring

        Full token name including chain.

      • typestring
        enum: "aml", "other"

        aml: AML reason, linked to an order; other: other reasons, with no linked order.

      • payment_historyarray<object>

        Array of payment-exception records sorted by block_time ascending, used by Query Order and AML-cancelled order callbacks.

        Array items · object

        • idinteger<int64>

          Exception payment record ID.

        • block_timeinteger<int64>

          On-chain receive time (UTC), as a 13-digit Unix timestamp in milliseconds.

        • from_addressstring

          Sender address.

        • to_addressstring

          Recipient address.

        • initial_amountstring

          Initial payment amount.

        • tx_idstring

          On-chain transaction ID.

        • created_timeinteger<int64>

          Record creation time (13-digit Unix timestamp).

        • transfer_feestring

          Payment-exception transfer fee; absent from the initiated example.

        • statusstring
          enum: "initiated", "transferring", "transfer_successful", "transfer_failed"

          Payment exception record status.

          • initiatedPayment exception received, not transferred yet.
          • transferringTransfer in progress.
          • transfer_successfulTransfer completed.
          • transfer_failedTransfer failed.
        • transfer_history
          • block_timeinteger<int64>

            On-chain transfer time (UTC), as a 13-digit Unix timestamp in milliseconds.

          • from_addressstring

            Transfer sender address.

          • to_addressstring

            Transfer recipient address.

          • amountstring

            Transfer amount.

          • tx_idstring

            On-chain transfer transaction ID.

Responses

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