# Quick Buy

The Quick Buy module provides infrastructure to perform buy exchanges on behalf of customers, using a customer's external payment card. This module includes a series of endpoints tailored to the needs of users looking to perform and monitor quick buy exchanges for their customers, as well as manage their saved cards.

Offering functions from quoting to execution, along with detailed tracking mechanisms, the Quick Buy module endpoints include:

**Onboarding**:

* [**Create QuickBuy Customer**](#create-quickbuy-customer) - Onboard a new customer account for using QuickBuy.
* [**Upload Documents (For QuickBuy Customer Onboarding)**](#upload-documents-for-quickbuy-customer-onboarding) - Upload Documents for a newly onboarded QuickBuy Customer, if using external KYC.

**Card Management**:

* [**List Cards**](#list-cards) - Retrieve a list of payment cards associated with a customer.
* [**Get Card by ID**](#get-card-by-id) - Enables a user to retrieve information about a payment card by submitting the ID of the payment card.
* [**Delete Card**](#delete-card) - Allows a user to delete a payment card, removing it from being an option for further exchanges.

**Exchanges**:

* [**Get Available Asset Pairs**](#get-available-asset-pairs): Provides a list of asset pairs enabled for the API user and available for quick buy. The response will also include information on limits and minimums associated with each asset pair for exchanges.
* [**Get Quote**](#get-quote)**:** Provides an estimate for a quick buy exchange, detailing the price and amount before the actual exchange is executed, ensuring that the customer is informed about the potential transaction.
* [**Submit Exchange**](#submit-exchange)**:** This endpoint will allow a customer to initiate a quick buy exchange. The customer can either use a saved payment card or enter details of a payment card. The user has the option of saving the payment card for use in further exchanges.
* [**List Exchanges**](#list-exchanges): Provides a generated list of quick buy exchanges, with the ability to filter by customer, order type, and more.
* [**Get Order by ID**](#list-exchanges): Provides a details of a quick buy order buy submitting the ID of the exchange.

***

## Create QuickBuy Customer

This endpoint facilitates the onboarding of a QuickBuy-only customer with minimal required information. It is intended for widget-based applications and other simplified onboarding interfaces strictly for the QuickBuy product, providing a leaner alternative to the full managee onboarding process.

* **Endpoint**: `/api/v1/customer/quick-buy/onboard`
* **Method**: POST

Important to Note

* Customers created via this endpoint cannot access Ibanera banking services.
* For real-time status update, use the Customer Detail API /api/v1/customer/details.
* If the response contains `jumioLink`, the customer must complete that verification step before eligible to submit exchanges.

### KYC Collection

Ibanera collects KYC for QuickBuy/Portl customers. This endpoint offers the flexibility of either using Ibanera's ID Verification provider, Jumio, or using your own IDv solution. The below section outlines each approach can be executed.

### Using Ibanera's ID Verification

**`bUseJumio`** = true (Jumio Verification Required)

#### Request Body Parameters

```json
{
  "bUseJumio": true,
  "customerReference": "your-customer-reference-1234",
  "email": "user.email@ibanera.com",
  "firstName":"John",
  "lastName": "Doe",
  "dob": "1995-01-15",
  "phone": "+18001234567",
  "address": {
    "line1": "123 Main St",
    "line2": "Unit 1a",
    "city": "City",
    "state": "TX",
    "postcode": "12345",
    "countryISO": "US"
  },
  "nationalityISO": "US",
  "bAcceptTermsAndConditions": true,
  "bAcceptPrivacyPolicy": true
}
```

Upon successful creation, the API will return a Jumio verification link that the user must follow to complete KYC. This verification link is accessible in the **`jumioLink`** field.

**Response Body Parameters:**

* `id` (Integer): A placeholder ID not actively used in the response.
* `details` (Object):
  * `customersId`(bigint): Newly Created Customer ID
  * `jumioLink`(Array of Objects): Newly created customer will require to validate email from portl link (e.g. [https://portl-uat.ibanera.com](https://portl-uat.ibanera.com/)) before further identity verification on this jumio link.

**Response Body Example**

```json
{
    "id": 0,
    "details": {
        "customersId": 12345,
        "jumioLink": "https://customer-uat.ibanera.com/manageesidverification?token=IXMFastM8ZcQSt...."
    },
    "status": "1",
    "errors": []
}
```

### Using External IDv Provider

When using an external IDv provider, there are two steps to the onboarding process. The first step is to submit the customer details as defined below. Once the customer is created, you must then [use an additional API endpoint to Upload Documents](https://github.com/gradam26/Phoenix-Documentation/blob/main/customer-api/api-endpoints/quick-buy-1.md#upload-documents-for-quickbuy-customer-onboarding), which would be the externally collected ID verification documents.

`bUseJumio` = false (IDv Collected Externally)

#### Enumeration Values

**DocumentType**

<table><thead><tr><th width="286.5859375">Name</th><th>Description</th></tr></thead><tbody><tr><td>PASSPORT</td><td>Customer Passport, clearly displaying key identification details page</td></tr><tr><td>DRIVING_LICENSE</td><td>Drivers License documentation</td></tr><tr><td>ID_CARD</td><td>Identification Card document</td></tr><tr><td>VISA</td><td>Customer Visa document</td></tr></tbody></table>

**Document Sub Type**

<table><thead><tr><th width="286.5859375">Name</th><th>Description</th></tr></thead><tbody><tr><td>NOTIONAL_ID</td><td>Customer Passport, clearly displaying key identification details page</td></tr><tr><td>CONSULAR_ID</td><td>Drivers License documentation</td></tr><tr><td>ELECTORAL_ID</td><td>Identification Card document</td></tr><tr><td>RESIDENT_PERMIT_ID</td><td>Customer Visa document</td></tr><tr><td>TAX_ID</td><td>Customer selfie photo, must be clear</td></tr><tr><td>STUDENT_ID</td><td>Customer Proof of Address, must be within 90 days to be accepted</td></tr><tr><td>PASSPORT_CARD_ID</td><td>Passport Identification Card</td></tr><tr><td>MILITARY_ID</td><td>Military Identification Card</td></tr><tr><td>PUBLIC_SAFETY_ID</td><td>Public Safety Identification Card</td></tr><tr><td>HEALTH_ID</td><td>Health Identification Card</td></tr><tr><td>OTHER_ID</td><td>Other Identification Card</td></tr><tr><td>VISA</td><td>Visa Identification Card</td></tr><tr><td>REGULAR_DRIVING_LICENSE</td><td>Use when DocumentType is DRIVING_LICENSE, for regular drivers license</td></tr><tr><td>LEARNING_DRIVING_LICENSE</td><td>Use when DocumentType is DRIVING_LICENSE, for learners drivers license or permit</td></tr><tr><td>E_PASSPORT</td><td>Use when DocumentType is PASSPORT</td></tr></tbody></table>

#### Decision Results

| Name          | Description                                  |
| ------------- | -------------------------------------------- |
| NOT\_EXECUTED | ID Verification Workflow not executed        |
| PASSED        | ID Verification Workflow Passed Successfully |
| REJECTED      | ID Verification was Rejected                 |
| WARNING       | ID Verification completed with warning       |

### Request Payload Example

```json
{
    "bUseJumio": false,
    "customerReference": "your-customer-reference-1234",
    "email": "user.email@ibanera.com",
    "firstName":"John",
    "lastName": "Doe",
    "dob": "1995-01-15",
    "phone": "+18001234567",
    "address": {
        "line1": "123 Main St",
        "line2": "Unit 1A",
        "city": "City",
        "state": "TX",
        "postcode": "12345",
        "countryISO": "US"
    },
    "nationalityISO": "US",
    "bAcceptTermsAndConditions": true,
    "bAcceptPrivacyPolicy": true,
    "kycVerificationDetails": {
        "documentType": "ID_CARD",
        "subType": "NATIONAL_ID",
        "issuingCountry": "USA",
        "firstName": "JOHN",
        "lastName": "DOE",
        "dateOfBirth": "1995-01-15",
        "expiryDate": "2028-01-15",
        "documentNumber": "1234567890",
        "gender": "M",
        "workFlowDecisionResult": "PASSED", // "PASSED" means that the IDv solution confirmed the identity
        "capabilities": {
            "liveLinessDecisionResult": "PASSED", // "PASSED" means liveliness was checked and passed
            "similarityDecisionResult": "PASSED" // "PASSED" means similarity checks between selfie and ID document was checked and passed
        }
    }
}
```

Once submitted successfully, the API will respond with the `kycDocumentsRequired` to complete the onboarding. These documents can be submitted via the Upload Document endpoint below.

#### Response Payload (Success Example)

```json
{
    "id": 3044,
    "details": {
        "customersId": 15070,
        "kycDocumentsRequired": [
            {
                "type": "ID_CARD",
                "supportingDocumentTypes": null,
                "sidesRequired": [
                    "Front",
                    "Back"
                ]
            },
            {
                "type": "SELFIE",
                "supportingDocumentTypes": null,
                "sidesRequired": [
                    "Face"
                ]
            }
        ]
    },
    "status": "1",
    "errors": []
}
```

#### Response Payload (Failure Example)

```json
{
    "id": 0,
    "details": null,
    "status": "0",
    "errors": [
        {
            "fieldName": "ErrorLabel",
            "messageCode": "User already exists"
        }
    ]
}
```

***

## Upload Documents (For QuickBuy Customer Onboarding)

Upload individual KYC documents (e.g., ID Front, ID Back, Face Photo) associated with the Customer Id received from Step 1.

***

* **Endpoint**: POST `/api/v1/customer/quick-buy/uploaddocument`
* **Request Format**: `multipart/form-data`

***

Validation:

* **Max allowed file size**: 10 MB
* **Only image/PDF formats allowed.**

***

📄 **Request Payload**

| **Parameter**    | **Type** | **Description**                                                           |
| ---------------- | -------- | ------------------------------------------------------------------------- |
| **CustomerId**   | int      | Unique identifier of the customer, obtained from onboard endpoint         |
| **Type**         | enum     | Type of document being uploaded, obtained from result of onboard endpoint |
| **DocumentSide** | enum     | Side of the document (e.g., Front, Back, Face)                            |
| **File**         | file     | The document file to be uploaded                                          |

#### <kbd>Type</kbd> Enumeration Values

<table><thead><tr><th width="154.8125">Name</th><th>Description</th></tr></thead><tbody><tr><td>Front</td><td>Front side of Identification Document</td></tr><tr><td>Back</td><td>Back side of Identification Document</td></tr><tr><td>Face</td><td>Selfie of customer</td></tr></tbody></table>

#### Response Payload (Success Example)

```json
{
    "id": 0,
    "details": {
        "bSuccess": true,
        "documentID": "912afb60-fe22-4634-9428-54d5e5ebf3e1"
    },
    "status": "1",
    "errors": []
}
```

***

**Response Payload (Failure Example)**

```json
{
    "id": 0,
    "status": "0",
    "errors": [
        {
            "fieldName": "CustomerId",
            "messageCode": "CustomerId is required"
        }
    ]
}
```

***

## List Cards

Retrieve a list of payment cards associated with a customer

* **Endpoint:** `/api/v1/customer/quick-buy/cards/list`
* **Method:** `GET`

{% openapi src="/files/h5NAeoFyfsXzFQlbLTLb" path="/api/v1/customer/quick-buy/cards/list" method="get" %}
[public-api-customer-role (2).json](https://1042261367-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxYGT6bxbvntyOdsHjmeN%2Fuploads%2Fgit-blob-45eb0e19300a8551d834f5aa05923e6506ffd44e%2Fpublic-api-customer-role%20\(2\).json?alt=media)
{% endopenapi %}

#### Request Query Example

```url
{{endpoint}}/api/v1/customer/quick-buy/cards/list?customersId=14349
```

#### Response Body Example

```json
{
    "id": 0,
    "details": [
        {
            "id": 1227,
            "cardholderName": "John Doe",
            "cardDescription": "ECMC...0004",
            "cardType": "ECMC_CREDIT",
            "cardLast4Digits": "0004",
            "expiryDate": null
        }
    ],
    "status": "1",
    "errors": []
}
```

***

## Get Card by ID

Enables a user to retrieve information about a payment card by submitting the ID of the payment card.

* **Endpoint:** `/api/v1/customer/quick-buy/cards/getbyid`
* **Method:** `GET`

{% openapi src="/files/h5NAeoFyfsXzFQlbLTLb" path="/api/v1/customer/quick-buy/cards/getbyid" method="get" %}
[public-api-customer-role (2).json](https://1042261367-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxYGT6bxbvntyOdsHjmeN%2Fuploads%2Fgit-blob-45eb0e19300a8551d834f5aa05923e6506ffd44e%2Fpublic-api-customer-role%20\(2\).json?alt=media)
{% endopenapi %}

Request Query Example

```url
{{endpoint}}/api/v1/customer/quick-buy/cards/getbyid?customersId=14349&paymentCardsId=1229
```

#### Response Body Example

```json
{
    "id": 0,
    "details": {
        "id": 1229,
        "cardholderName": "John Doe",
        "cardDescription": "VISA...1111",
        "cardType": "VISA_CREDIT",
        "cardLast4Digits": "1111",
        "expiryDate": "2025-12-31T00:00:00"
    },
    "status": "1",
    "errors": []
}
```

***

## Delete Card

Allows a user to delete a payment card, removing it from being an option for further exchanges.

* **Endpoint:** `/api/v1/customer/quick-buy/cards/delete`
* **Method:** `POST`

{% openapi src="/files/h5NAeoFyfsXzFQlbLTLb" path="/api/v1/customer/quick-buy/cards/delete" method="post" %}
[public-api-customer-role (2).json](https://1042261367-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxYGT6bxbvntyOdsHjmeN%2Fuploads%2Fgit-blob-45eb0e19300a8551d834f5aa05923e6506ffd44e%2Fpublic-api-customer-role%20\(2\).json?alt=media)
{% endopenapi %}

#### Request Query Example

```url
{{endpoint}}/api/v1/customer/quick-buy/cards/delete?customersId=14349&paymentCardsId=1226
```

#### Response Body Example

```json
{
    "id": 1226,
    "status": "1",
    "errors": []
}
```

***

## Get Available Asset Pairs

Provides a list of asset pairs enabled for the API user and available for quick buy. The response will also include information on limits and minimums associated with each asset pair for exchanges.

* **Endpoint:** `/api/v1/customer/quick-buy/orders/assets`
* **Method:** `GE`

{% openapi src="/files/h5NAeoFyfsXzFQlbLTLb" path="/api/v1/customer/quick-buy/orders/assets" method="get" %}
[public-api-customer-role (2).json](https://1042261367-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxYGT6bxbvntyOdsHjmeN%2Fuploads%2Fgit-blob-45eb0e19300a8551d834f5aa05923e6506ffd44e%2Fpublic-api-customer-role%20\(2\).json?alt=media)
{% endopenapi %}

#### Request Query Example

```url
{{endpoint}}/api/v1/customer/quick-buy/orders/assets
```

#### Response Body Example

```json
{
    "id": 0,
    "details": [
        {
            "assetCode": "BTC",
            "assetSymbol": "₿",
            "assetName": "Bitcoin",
            "buyPrice": 67466.800000000000000000,
            "minAmount": 0.000100000000000000,
            "maxAmount": 10.000000000000000000,
            "minPrice": 15.000000000000000000,
            "maxPrice": 200000.000000000000000000,
            "maxDecimalPrecision": 0
        }
    ],
    "status": "1",
    "errors": []
}
```

***

## Get Quote

This endpoint provides a quoted market price for a proposed asset exchange for a particular customer, detailing the amount and price for an exchange. By specifying details of the desired trade, a customer can see the cost or proceeds they might expect from completing a transaction, including any applicable fees. This helps customers decide whether to proceed with an exchange based on real-time financial data. For quick buy exchanges, all exchanges will refer to the specified crypto currency being bought in exchange for fiat currency.

* **Endpoint:** `/api/v2/customer/quick-buy/orders/quote`
* **Method:** GET

**Query Parameters:**

* `customersId` (Integer): ID of the customer making the exchange—required.
* `assetCode` (String): The crypto currency to be bought, such as "BTC"—required.
* `assetAmount` (Decimal, Nullable): Desired amount of crypto currency to be bought. Must be null if currencyAmount is specified.
* `currenyAmount` (Decimal, Nullable): Desired amount of currency to be exchanged. Must be null if assetAmount is specified.
* `currencyCode` (String): The fiat currency to acquire a payment in. (USD or EUR)

**Response Body Parameters:**

* `id` (Integer): Not used.
* `details` (Object): Contains the quote details.
  * `customersId` (Integer): ID of the customer.
  * `assetCode` (String): Crypto currency asset to be bought in the exchange.
  * `currenyCode` (String): Fiat currency asset involved in the exchange.
  * `assetAmount` (Decimal): Amount of crypto currency asset to be bought.
  * `currencyAmount` (Decimal): Amount of fiat currency required for exchange.

#### Request Query Example

```url
{{endpoint}}/api/v2/customer/quick-buy/orders/quote?customersId=14349&AssetCode=BTC&CurrencyCode=USD&CurrencyAmount=100
```

#### Response Body Example

```json
{
    "id": 14349,
    "details": {
        "customersId": 14349,
        "assetCode": "BTC",
        "currencyCode": "USD",
        "assetAmount": 0.00705853,
        "currencyAmount": 500.0
    },
    "status": "1",
    "errors": []
}
```

#### Possible Error Codes

| Error Message Code         | Description                                                       |
| -------------------------- | ----------------------------------------------------------------- |
| Required                   | Named field missing or zero                                       |
| Invalid                    | Value given for named field is invalid                            |
| Documents\_Not\_Verified   | Cannot perform this action for this customer due to the KYC state |
| Amount\_Must\_Be\_Positive | Invalid or missing amount                                         |

***

## Submit Exchange

This endpoint is intended for initiating a quick buy exchange, enabling a customer to purchase an asset at a specified price.

**This API endpoint will capture payment details and return a `VerificationURL` (3D Secure). The order will only be processed once the `VerificationURL` is accessed on the client's device.**

* **Endpoint:** `/api/v2/customer/quick-buy/orders/submit`
* **Method:** `POST`

**Request Body Parameters:**

* `customersId` (Integer): ID of the customer making the exchange—required.
* `currencyCode` (String): The fiat currency to be spent. ("USD" or "EUR")
* `assetCode` (String): The crypto currency to be bought, such as "BTC"—required.
* `assetAmount` (Decimal, Required): Desired amount of crypto currency to be bought.
* `currenyAmount` (Decimal, Required): Desired amount of currency to be exchanged.
* `paymentRedirectUrl` (String, Required): URL of the website that the user will be redirected to once they access the verification URL.
* `paymentCardsId` (Integer, Nullable): Id of saved payment card. Must be null if CardDetails is not null.
* `cardDetails` (JSON Object): Details of payment card. Must be null if paymentCardsId is not null.
  * `cardNumber` (String, Required): Card number.
  * `cvv` (String, Required): Card CVV
  * `cardHolderName` (String, Required): Cardholder name.
  * `addressLine1` (String, Required): Cardholder address line 1.
  * `addressLine2` (String): Cardholder address line 2.
  * `townCity` (String, Required): Cardholder town or city.
  * `countryISO2` (String, Required): Cardholder country of address.
  * `stateProvince` (String, Required): Cardholder state or province.
  * `postCode` (String, Required): Cardholder ZIP/Postal Code.
  * `expMonth` (Integer, Required): Card expiration month.
  * `expYear` (Integer, Required): Card expiration year.
  * `bSaveCard` (Boolean, Required): Indicates whether the payment card should be saved.
  * `EmailAddress` (String, Required): The email address associated with the card holder.
  * `PhoneNumber` (String, Required): The phone number associated with the card holder. Must include the numeric country code (Example: +1 for USA).

**Request Example:**

```json
{
    "customersId": 14349,
    "assetCode": "BTC",
    "currencyCode": "USD",
    "assetAmount": 0.00718246,
    "currencyAmount": 500,
    "paymentRedirectUrl": "https://ibanera.com", // URL where the user will be redirected after verification
    "paymentCardsId": null,
    "cardDetails": {
        "cardNumber": "4111111111111111",
        "cvv": "123",
        "cardholderName": "John Doe",
        "addressLine1": "123 Main St",
        "addressLine2": "Apt 4B",
        "townCity": "Springfield",
        "countryISO2": "US",
        "stateProvince": "IL",
        "postCode": "62704",
        "expMonth": 12,
        "expYear": 2025,
        "bSaveCard": true,
        "EmailAddress": "your-email@ibanera.com",
        "PhoneNumber": "+18001234567"
    }
}
```

**Response Body Parameters:**

* `id` (Integer): Not used.
* `details` (Object):
  * `status` (String): The status of the transaction, such as "Pending".
    * Possible values: `Pending`, `Failed`, `Approved`, `ActionRequired`.
  * `exchangesId`(Integer): The ID of the associated asset exchange.

**Success Response Example:**

Note that an order is only processed once the `verificationURL` is accessed from the client device!

```json
{
    "id": 0,
    "details": {
        "status": "ActionRequired",
        "exchangesId": 14483,
        "verificationURL": "https://ggapi.ibanera.com/secure/start?hash=4dg..."
    },
    "status": "1",
    "errors": []
}
```

#### Getting Order Status

Upon accessing the `verificationURL` from the client device, the order will be processed. The `verificationURL` will then redirect to the `paymentRedirectUrl` provided in your request body.

When the system redirects the user to the provided `paymentRedirectUrl`, the URL will also include a URL parameter to indicate the status of the order.

{% code title="Redirect URL example, with sample status" %}

```url
https://ibanera.com/?status=AUTHORISED
```

{% endcode %}

#### Order Statuses

<table><thead><tr><th width="191.015625">Status</th><th>Description</th></tr></thead><tbody><tr><td>AUTHORISED</td><td>Card was successfully authorized, order will complete once captured (within minutes)</td></tr><tr><td>REFUSED</td><td>Card was refused / declined by card issuer</td></tr><tr><td>FAILED</td><td>Failed attempt, please try again or contact us</td></tr><tr><td>CAPTURED</td><td>Card was successfully captured, order will proceed</td></tr><tr><td>CANCELLED</td><td>Payment was cancelled. Order will reverse.</td></tr><tr><td>REFUNDED</td><td>Payment was refunded</td></tr></tbody></table>

#### Card Decline Response Example:

```json
{
    "id": 0,
    "details": {
        "status": "Failed",
        "message": "Decline reason would be here..."
    },
    "status": "1",
    "errors": []
}
```

#### Possible Error Codes

| Error Message Code       | Description                                                       |
| ------------------------ | ----------------------------------------------------------------- |
| Required                 | Named field missing or zero                                       |
| Invalid                  | Value given for named field is invalid                            |
| Documents\_Not\_Verified | Cannot perform this action for this customer due to the KYC state |

***

## List Exchanges

Provides a system generated list of quick buy exchanges, with ability to filter by the the customersID or asset pair.

* **Endpoint:** `/api/v1/customer/quick-buy/orders/list`
* **Method:** `GET`

#### Request Query

**Optional Request Query Parameters:**

* `customersId` (Integer): The ID of the customer initiating the purchase.
* `assetPair` (String): The asset pair to be filtered, such as "BTC/USDC".
* `PageNumber` (Integer): List page number (default = 1)
* `PageSize` (Integer): List page size (default = 10)

#### Request Query Example

```url
{{endpoint}}/api/v1/customer/quick-buy/orders/list?customersId=14349
```

#### Response Body Example

<pre class="language-json"><code class="lang-json">
{
    "id": 1777,
    "details": [
        {
            "id": 14487,
            "exchangeType": "Buy",
            "status": "Completed", // Indicates the status of the order
            "paymentStatus": "CAPTURED", // Indicates the status of the card payment
            "creditTransactionsId": 79311,
            "customersId": 14349,
            "assetPair": "BTC/USD",
            "requestAmount": 0.007113640000000000,
            "requestPrice": 500.000000000000000000,
            "executedAmount": 0.007144470000000000,
            "executedPrice": 500.000000000000000000,
            "commissionFee": 21.530000000000000000,
            "transferType": null,
            "bHasOpenRfi": false,
            "paymentCardsId": 1229,
            "cardDescription": "VISA...1111"
        },
        {
            "id": 14484,
            "exchangeType": "Buy",
            "status": "Pending",
            "paymentStatus": "AUTHORISED",
            "creditTransactionsId": 78928,
            "customersId": 14349,
            "assetPair": "BTC/USD",
            "requestAmount": 0.007080710000000000,
            "requestPrice": 500.000000000000000000,
            "executedAmount": null,
            "executedPrice": null,
            "commissionFee": 21.530000000000000000,
            "transferType": null,
            "bHasOpenRfi": false,
            "paymentCardsId": 1229,
            "cardDescription": "VISA...1111"
<strong>        }
</strong>    ],
    "pageSize": 10,
    "pageNumber": 1,
    "numberOfPages": 2,
    "status": "1",
    "errors": []
}
</code></pre>

***

## Get Order by Id

Provides a system generated list of quick buy exchanges, with ability to filter by the the customersID or asset pair.

* **Endpoint:** `/api/v1/customer/quick-buy/orders/getbyid`
* **Method:** `GET`

#### Request Query

**Optional Request Query Parameters:**

* `customersId` (Integer): The ID of the customer initiating the purchase.
* `assetPair` (String): The asset pair to be filtered, such as "BTC/USDC".
* `PageNumber` (Integer): List page number (default = 1)
* `PageSize` (Integer): List page size (default = 10)

#### Request Query Example

```url
{{endpoint}}/api/v1/customer/quick-buy/orders/getbyid?exchangesId=14468
```

#### Response Body Example

```json
{
    "id": 1777,
    "details": {
        "id": 14468,
        "exchangeType": "Buy",
        "status": "Completed", // Indicates the status of the order
        "paymentStatus": "CAPTURED", // Indicates the status of the card payment
        "creditTransactionsId": 76573,
        "customersId": 14349,
        "assetPair": "BTC/USD",
        "requestAmount": 0.007186150000000000,
        "requestPrice": 500.000000000000000000,
        "executedAmount": 0.007211890000000000,
        "executedPrice": 500.000000000000000000,
        "commissionFee": 21.530000000000000000,
        "transferType": null,
        "bHasOpenRfi": false,
        "paymentCardsId": 1226,
        "cardDescription": "VISA...1111"
    },
    "status": "1",
    "errors": []
}
```

#### Payment Status Definitions

<table><thead><tr><th width="191.015625">Status</th><th>Description</th></tr></thead><tbody><tr><td>AUTHORISED</td><td>Card was successfully authorized, order will complete once captured (within minutes)</td></tr><tr><td>REFUSED</td><td>Card was refused / declined by card issuer</td></tr><tr><td>FAILED</td><td>Failed attempt, please try again or contact us</td></tr><tr><td>CAPTURED</td><td>Card was successfully captured, order will proceed</td></tr><tr><td>CANCELLED</td><td>Payment was cancelled. Order will reverse.</td></tr><tr><td>REFUNDED</td><td>Payment was refunded</td></tr></tbody></table>


---

# 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/api-endpoints/quick-buy.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.
