kamiPay LogokamiPay Docs

Pay

Receive notifications about outgoing Pix payments

After you broadcast a transaction with our endpoint, kamiPay will keep you updated on the progress of this payment using our webhooks so you don't need to manually check status endpoints from your backend.

Handling Webhook Responses

The payment process happens in two main steps, and you'll receive different webhook notifications for each:

1. Blockchain Transfer

The first step in the payment process is to send a transaction over the blockchain:

Mined

This status indicates the transaction is confirmed in the blockchain so bank instruction can kick in.

{
  "status": "mined",
  "transaction_hash": "0x0ce2792b5deff9440b6xxxxxxxxxxxxxxxf0c25b47739cbc3a35b16",
  "type": "pay",
  "timestamp": "2024-07-27 11:28:50.426788-03:00",
  "external_id": "aaa-11112",
  "kamipay_id": "txc_01j3t9fxqffrva9s8d1ekm4g3v"
}

Dropped, not_found or reverted

These are statuses that indicate that the operation won't continue for the broadcasted transaction and you will need to retry. Money won't be deducted from your wallet in this case.

{
  "type": "pay",
  "transaction_hash": "0x0ce2792b5deff9440b6xxxxxxxxxxxxxxxf0c25b47739cbc3a35b16",
  "status": "not_found",
  "timestamp": "2024-02-04 17:13:51.419027-03:00",
  "external_id": "aaa-11112",
  "kamipay_id": "txc_01j3t9fxqffrva9s8d1ekm4g3v"
}

2. Bank Payment Process

The second step of the payment is initiated once the transaction was confirmed and received by our bank. Our webhooks will continue to notify you through that flow:

Processing

This status indicates that the money is received and the bank initiated the payment, which may end up successfully or be rejected. If successful, the receiver's bank will see the notification only a few seconds later.

{
  "status": "processing",
  "transaction_hash": "0x0ce2792b5deff9440b6xxxxxxxxxxxxxxxf0c25b47739cbc3a35b16",
  "data": {
    "operation_id": "1722090526505",
    "address_in": "0xca4xxxxxxxxxxxxxxx1f2fc",
    "usdt_amount": "0.72626",
    "brl_amount": "4.0",
    "bank_txid": null,
    "pix_key": "nico@kamipay.io",
    "name": "Kamipay AR Servicos Digitais Ltda"
  },
  "type": "pay",
  "timestamp": "2024-07-27 11:29:11.160878-03:00",
  "external_id": "aaa-11112",
  "kamipay_id": "txc_01j3t9fxqffrva9s8d1ekm4g3v"
}

Done

If payment was successful, you will receive the bank transaction information so you can share with the receiver as proof of payment. It's important to mention that this status is when we already have all the final settlement and the sender and receiver banks have confirmed the payment. In most cases, the receiver already gets the confirmation in their machine if it's a merchant, before this status is received and when the processing status begins.

{
  "status": "done",
  "transaction_hash": "0x0ce2792b5deff9440b6xxxxxxxxxxxxxxxf0c25b47739cbc3a35b16",
  "data": {
    "operation_id": "1722090526505",
    "address_in": "0xca4xxxxxxxxxxxxxxx1f2fc",
    "usdt_amount": "0.72626",
    "brl_amount": "4.0",
    "bank_txid": "E20018183202407271428zerNpVxiayI",
    "pix_key": "nico@kamipay.io",
    "name": "Kamipay AR Servicos Digitais Ltda"
  },
  "type": "pay",
  "timestamp": "2024-07-27 11:29:11.160878-03:00",
  "external_id": "aaa-11112",
  "kamipay_id": "txc_01j3t9fxqffrva9s8d1ekm4g3v"
}

Failed

This status indicates that the payment attempt failed. This can happen for various reasons, some for instance can be that the QR code expired before you pay, or for any other technical reason.

In all cases, the money is refunded to the wallet, so you will get a deposit in your wallet with the amount of USDT paid.

{
  "status": "failed",
  "transaction_hash": "0x0fbe56145a07e5fxxxxxxxxxxxxxxxxxa4a61ee904bf5b7644",
  "data": {},
  "refund_txid": "0x2c15a5b6fcd8277e5fxxxxxxxxxxxxxxxxxa30b84c28fd79142ad39128d15bc",
  "type": "pay",
  "timestamp": "2024-03-15 10:10:47.017652-03:00",
  "external_id": "aaa-11112",
  "kamipay_id": "txc_01j3t9fxqffrva9s8d1ekm4g3v"
}

If external_id is not provided, all webhooks will come with null value for that field. We strongly recommend all users to pass an external_id to this endpoint for better tracking and monitoring.

On this page