# QuickBuy Callback

## Overview

The body of this request contains details about the requested exchange and the captured payment once the exchange has been agreed.

## Completed fiat payment callback

The body of this request contains details about the requested exchange and the captured payment once the exchange has been agreed.

Key details:

* ﻿﻿`transactionReference` is our reference for the transaction, for use in correspondence.
* ﻿﻿`status` is currently always `SUCCESS` as this callback currently only occurs for captured payments. In future other status codes may be added.
* ﻿﻿The `requestDetails` object contains:
  * client signature and user reference used to initiate the widget,
  * user selected asset, currency, and payment amount,
  * the estimate displayed to the user of the amount of crypto asset to purchase, and
  * ﻿﻿other details about the widget instantiation like the timestamp and IP address.
* ﻿﻿The `transactionDetails` object contains:
  * ﻿﻿payment card details;
  * ﻿﻿payment capture date;
  * confirmation of the amount charged to the user's card;
  * confirmation of the fee charged - the amount used to buy the crypto will be the charged amount less this fee;
  * the amount of the crypto asset to be purchased (note that there are several transactions to make before this reaches the nominated external wallet, and some fees may be incurred);
  * an estimated value in the selected fiat currency of this crypto amount; and
  * other details such as the card payment processor.
* The content type of the body is `application/json`.

### Callback Example

<pre class="language-json"><code class="lang-json">{
  "TransactionReference": "QBWE1001",
  "Status": "SUCCESS",
  "RequestDetails": {
    "UserReference": "TestWidgetUser1",
    "ClientSignature": "lafsao7y4v5q847yrjerocq32yroaerq398", 
    "CryptoAssetCode": "USDC",
    "FiatCurrencyCode": "USD",
<strong>    "FiatCurrencyAmount": 50,
</strong>    "CryptoAssetAmount": 49.95,
    "RequestDate": "2022-02-18T14:30:59.52",
    "RequestIp": "51.141.9.231"
  },
  "TransactionDetails": {
    "StatementDescriptor": null,
<strong>    "PaymentProcessor": "Processor 1", 
</strong><strong>    "CryptoAssetGrossAmount": 47, 
</strong><strong>    "CryptoAssetEstimatedFiatValue": 47.5, 
</strong><strong>    "FiatCurrencyChargedAmount": 50, 
</strong><strong>    "FiatCurrencyFeeAmount": 2.5, 
</strong><strong>    "PaymentCaptureDate": "2022-02-18T14:31:59.577", 
</strong><strong>    "PaymentCardLast4Digits": "1111"
</strong>  } 
}
</code></pre>

[**We will include a signing header with this request (see below).**](#callback-signing)

***

## Completed Cryptocurrency deposit callback

The body of this request contains details about transaction which deposits the cryptocurrency into the customers wallet.

Key details:

* ﻿﻿`transactionReference` is our reference for the transaction, for use in correspondence.
* ﻿﻿`status` is currently always `SUCCESS` as this callback currently only occurs for captured payments. In future other status codes may be added.
* ﻿﻿The `requestDetails` object contains:
  * client signature and user reference used to initiate the widget,
  * user selected asset, currency, and payment amount,
  * the estimate displayed to the user of the amount of crypto asset to purchase, and
  * other details about the widget instantiation like the timestamp and IP address.
* ﻿﻿The `transactionDetails` object contains:
  * payment card details;
  * ﻿﻿payment capture date;
  * confirmation of the amount charged to the user's card;
  * confirmation of the fee charged - the amount used to buy the crypto will be the
  * charged amount less this fee;
  * the amount of the crypto asset to be purchased (note that there are several transactions to make before this reaches the nominated external wallet, and some fees may be incurred);
  * an estimated value in the selected fiat currency of this crypto amount;
  * **the transaction hash**; and
  * other details such as the card payment processor.
* ﻿﻿The content type of the body is `application/json`.

### Completed cryptocurrency deposit callback body

<pre class="language-json"><code class="lang-json">{
  "TransactionReference": "QBWE1001",
  "Status": "SUCCESS",
  "RequestDetails": {
  "UserReference": "TestWidgetUser1",
  "ClientSignature": "lafsao7y4v5q847yrjerocq32yroaerq398", 
  "CryptoAssetCode": "USDC",
  "FiatCurrencyCode": "USD",
  "FiatCurrencyAmount": 50,
  "CryptoAssetAmount": 49.95,
  "RequestDate": "2022-02-18T14:30:59.52",
  "RequestIp": "51.141.9.231"
  },
  "TransactionDetails": {
    "StatementDescriptor": null,
    "PaymentProcessor": "Processor 1",
    "CryptoAssetGrossAmount": 47,
    "CryptoAssetEstimatedFiatValue": 47.5,
    "FiatCurrencyChargedAmount": 50,
    "FiatCurrencyFeeAmount": 2.5,
<strong>    "PaymentCaptureDate": "2022-02-18T14:31:59.577",
</strong>    "PaymentCardLast4Digits": "1111",
    "TransactionHash": "0x9ec48ce0653cc7b2bcaa463a92b3191ddee5275d897854f2d210d2b298828d00"
    } 
}
</code></pre>

[**We will include a signing header with this request (see below).**](#callback-signing)

***

## Callback Signing

In order for you to authenticate a call to your payment capture webhook we will sign it using the shared secret provided to you. To generate the signing header we:

* Append the shared secret (in UTF8 encoding) to the bytes of the request body.
* Perform a SHA256 hash on the result
* Provide the hash value in the QuickBuy-Signature header for the callback (encoded as a base64 string).

Note: This only applies to the payment capture callback, we currently do not sign the initial authentication callback.

### [See the code examples for checking the callback signature.](/quickbuy/validating-the-webhook-signature.md)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://customer-api-docs.ibanera.com/quickbuy/quickbuy-callback.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
