PHPackages                             banxa/php-sdk - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. banxa/php-sdk

ActiveLibrary

banxa/php-sdk
=============

Banxa Official PHP API SDK for partners

v1.0.4(2y ago)36.0k↑225%3[1 PRs](https://github.com/BanxaOfficial/php-sdk/pulls)MITPHPPHP ^8.0

Since Aug 22Pushed 2y ago1 watchersCompare

[ Source](https://github.com/BanxaOfficial/php-sdk)[ Packagist](https://packagist.org/packages/banxa/php-sdk)[ Docs](https://banxa.com)[ RSS](/packages/banxa-php-sdk/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (5)Dependencies (3)Versions (11)Used By (0)

[![Banxa](https://camo.githubusercontent.com/89f6822c0a5c0bbfc64696bf3d74fa575d6d443fdb46627bc0d921d520656f1d/68747470733a2f2f62616e78612e636f6d2f77702d636f6e74656e742f75706c6f6164732f323032322f30322f696d6167652d31362e706e67)](https://camo.githubusercontent.com/89f6822c0a5c0bbfc64696bf3d74fa575d6d443fdb46627bc0d921d520656f1d/68747470733a2f2f62616e78612e636f6d2f77702d636f6e74656e742f75706c6f6164732f323032322f30322f696d6167652d31362e706e67)

Banxa official PHP SDK
----------------------

[](#banxa-official-php-sdk)

[![GitHub Workflow Status](https://camo.githubusercontent.com/e16ead3db84f3ad53ce2ce574340746b42c073767ce9485cc1a3bfea8f93593c/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f62616e78612d676c6f62616c2f7068702d73646b2f6d61696e2e796d6c3f6c6162656c3d7465737473)](https://camo.githubusercontent.com/e16ead3db84f3ad53ce2ce574340746b42c073767ce9485cc1a3bfea8f93593c/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f62616e78612d676c6f62616c2f7068702d73646b2f6d61696e2e796d6c3f6c6162656c3d7465737473)[![Latest Version on Packagist](https://camo.githubusercontent.com/07a5daefbcdb78f3ff6a804475e566cb2bdb986df35008a0f651f5d5e99c33a1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f62616e78612f7068702d73646b2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/banxa/php-sdk)

Table of Contents
-----------------

[](#table-of-contents)

- [General info](#general-info)
    - [Installation](#installation)
    - [Authentication](#authentication)
        - [Domain, ApiKey and ApiSecret](#apikey-and-apisecret)
    - [Dependencies](#dependencies)
    - [Usage](#usage)
        - [Sandbox](#sandbox)
        - [Production](#production)
- [Localisation](#localisation)
    - [Countries](#countries)
    - [US States](#us-states)
- [Currencies](#currencies)
    - [Fiat](#fiat)
    - [Crypto](#crypto)
- [Payment Methods](#payment-methods)
    - [Buy &amp; Sell order type](#buy--sell-order-type-payment-methods)
    - [Buy order type](#buy-order-type-payment-methods)
    - [Sell order type](#sell-order-type-payment-methods)
- [Prices](#prices)
    - [Buy order types](#buy-order-types-pricing)
    - [Buy order type](#buy-order-type-pricing)
    - [Sell order types](#sell-order-types-pricing)
    - [Sell order type](#sell-order-type-pricing)
- [Orders](#orders)
    - [Retrieving Order(s)](#retrieving-orders)
        - [Fetch orders](#fetch-orders)
        - [Fetch order](#fetch-order)
    - [Order creation](#creating-orders)
        - [Creating a buy order](#creating-a-buy-order)
        - [Creating a NFT buy order](#creating-a-nft-buy-order)
        - [Creating a sell order](#creating-a-sell-order)
    - [Confirm sell order](#confirm-sell-order)
- [Identity](#identity)
    - [Create Identity](#create-identity)

General info
============

[](#general-info)

The Banxa SDK is a plug and play ready to go implementation to access our services.
It allows for a simple and fast integration.

Installation
============

[](#installation)

Install the package via [composer](https://getcomposer.org/)

```
composer require banxa/php-sdk
```

Authentication
==============

[](#authentication)

ApiKey and ApiSecret
--------------------

[](#apikey-and-apisecret)

While on-boarding with banxa, you will be provided with API keys and a subdomain (\[partnername\].banxa.com),
initially these will be for the sandbox environment. Once you are done testing the implementation, you will receive the credentials to use the production environment.

Dependencies
============

[](#dependencies)

PHPGuzzle^8.0^7.0Usage
=====

[](#usage)

```
Banxa::create($subdomain, $apiKey, $apiSecret, $testMode)
```

Propertytyperequireddescription`$subdomain``string``true`The subdomain provided by banxa. (\[partnername\].banxa.com)`$apiKey``string``true`Given API key`$apiSecret``string``true`Given API Secret`$testMode``bool``false`Enable if testing, and provide sandbox api key and secret to method###### Sandbox

[](#sandbox)

```
$subdomain = 'partner';
$sandboxApiKey = 'xxx-xxx-xxx-xxx-xxx';
$sandboxApiSecret = 'xxxx-xxxx-xxxx-xxxx';
$testMode = true;
Banxa::create($subdomain, $sandboxApiKey, $sandboxApiSecret, $testMode)
```

###### Production

[](#production)

```
$subdomain = 'partner';
$apiKey = 'xxx-xxx-xxx-xxx-xxx';
$apiSecret = 'xxxx-xxxx-xxxx-xxxx';
Banxa::create($subdomain, $apiKey, $apiSecret)
```

---

Localisation
============

[](#localisation)

Countries
---------

[](#countries)

> ### Global
>
> [](#global)
>
> **Fetch all available countries**
>
> ```
> $banxa->getCountries()
> ```

**Result Example**

```
[
   [
       "country_code" => "AD",
       "country_name" => "Andora"
   ],
   [
       "country_code" => "AE",
       "country_name" => "United Arab Emirates"
   ],
]
```

### US States

[](#us-states)

> **Fetch all available US States**
>
> ```
> $banxa->getUsStates()
> ```

**Result Example**

```
[
   [
       "state_code" => "AL",
       "state_name" => "Alabama"
   ],
   [
       "state_code" => "AK",
       "state_name" => "Alaska"
   ],
]
```

---

Currencies
==========

[](#currencies)

Fiat
----

[](#fiat)

> ### Buy order type
>
> [](#buy-order-type)
>
> **Fetch all available fiat currencies for buy order type.**
>
> ```
> $banxa->getBuyFiatCurrencies()
> ```
>
>
>
> ### Sell order type
>
> [](#sell-order-type)
>
> **Fetch all available fiat currencies for sell order type.**
>
> ```
> $banxa->getSellFiatCurrencies()
> ```

**Result Example**

```
[
  [
      "fiat_code"   => "EUR",
      "fiat_name"   => "Euro",
      "fiat_symbol" => "€",
  ],
  [
      "fiat_code"   => "GBP",
      "fiat_name"   => "British Pound Sterling",
      "fiat_symbol" => "£",
  ],
]

```

---

Crypto
------

[](#crypto)

> ### Buy order type
>
> [](#buy-order-type-1)
>
> **Fetch all cryptocurrencies for buy order type.**
>
> ```
> $banxa->getBuyCryptoCurrencies()
> ```
>
>
>
> ### Sell order type
>
> [](#sell-order-type-1)
>
> **Fetch all cryptocurrencies for sell-order type.**
>
> ```
> $banxa->getSellCryptoCurrencies()
> ```

**Result Example**

```
[
   [
       "coin_code"=> "BTC",
       "coin_name"=> "Bitcoin",
       "blockchains"=> [
           [
               "code"=> "BTC",
               "description"=> "Bitcoin",
               "is_default"=> true
           ]
       ]
   ],
   [
       "coin_code"=> "ETH",
       "coin_name"=> "Ethereum",
       "blockchains"=> [
           [
               "code"=> "ETH",
               "description"=> "Ethereum (ERC-20)",
               "is_default"=> true
           ],
           [
               "code"=> "MATIC",
               "description"=> "Polygon",
               "is_default"=> false
           ]
       ]
   ]
]
```

---

Payment Methods
===============

[](#payment-methods)

### Buy &amp; Sell order type payment methods

[](#buy--sell-order-type-payment-methods)

> **Fetch all available payment providers for buy and sell order type**
>
> ```
> $banxa->getAllPaymentMethods()
> ```

**Result Example**

```
[
  [
       "id"               => 6036,
       "paymentType"      => "WORLDPAYCREDIT",
       "name"             => "Visa/Mastercard",
       "description"      => "Conveniently buy digital currency using your personal VISA or MasterCard.",
       "logo_url"         => "https://partner.banxa.com/images/payment-providers/worlpaycredit.png",
       "status"           => "ACTIVE",
       "supported_agents" => [
           [
               "os"      => "ios",
               "browser" => "safari"
           ],
           [
               "os"      => "macos",
               "browser" => "safari"
           ],
           [
               "os"      => "ipados",
               "browser" => "safari"
           ]
       ],
       "type"             => "FIAT_TO_CRYPTO",
       "supported_fiat"   => [
           "AED",
       ],
       "transaction_fees" => [
           [
               "fiat_code" => "AED",
               "coin_code" => "BTC",
               "fees"      => [
                   [
                       "name"   => "surcharge",
                       "amount" => 3,
                       "type"   => "fixed"
                   ]
               ]
           ],
       ]
   ],
   [
       "id"               => 6036,
       "paymentType"      => "WORLDPAYAPPLE",
       "name"             => "Apple Pay",
       "description"      => "Conveniently buy digital currency using your Apple Pay wallet.",
       "logo_url"         => "https://partner.banxa.com/images/payment-providers/apple-pay.png",
       "status"           => "ACTIVE",
       "supported_agents" => [
           [
               "os"      => "ios",
               "browser" => "safari"
           ],
           [
               "os"      => "macos",
               "browser" => "safari"
           ],
           [
               "os"      => "ipados",
               "browser" => "safari"
           ]
       ],
       "type"             => "CRYPTO_TO_FIAT",
       "supported_fiat"   => [
           "AED",
       ],
       "transaction_fees" => [
           [
               "fiat_code" => "AED",
               "coin_code" => "BTC",
               "fees"      => [
                   [
                       "name"   => "surcharge",
                       "amount" => 3,
                       "type"   => "fixed"
                   ]
               ]
           ],
       ]
   ]
];
```

### Buy order type payment methods

[](#buy-order-type-payment-methods)

> **Fetch all available payment providers for buy order type**
>
> ```
> $banxa->getBuyPaymentMethods($fiatCode, $coinCode)
> ```

Propertytyperequireddescription`$fiatCode``string``true`Fiat code e.g. 'USD' or 'EUR' see [Fiat](#fiat) to get a list all available fiats`$coinCode``string``true`Coin code e.g. 'BTC' or 'ETH' see [Crypto](#crypto) to get a list all available crypto**Result Example**

```
[
   "id"               => 6036,
   "paymentType"      => "WORLDPAYAPPLE",
   "name"             => "Apple Pay",
   "description"      => "Conveniently buy digital currency using your Apple Pay wallet.",
   "logo_url"         => "https://partner.banxa.com/images/payment-providers/apple-pay.png",
   "status"           => "ACTIVE",
   "supported_agents" => [
       [
           "os"      => "ios",
           "browser" => "safari"
       ],
       [
           "os"      => "macos",
           "browser" => "safari"
       ],
       [
           "os"      => "ipados",
           "browser" => "safari"
       ]
   ],
   "type"             => "FIAT_TO_CRYPTO",
   "supported_fiat"   => [
       "AED",
   ],
   "transaction_fees" => [
       [
           "fiat_code" => "AED",
           "coin_code" => "BTC",
           "fees"      => [
               [
                   "name"   => "surcharge",
                   "amount" => 3,
                   "type"   => "fixed"
               ]
           ]
       ],
   ]
]
```

### Sell order type payment methods

[](#sell-order-type-payment-methods)

> **Fetch all available payment methods for sell order type**
>
> ```
> $banxa->getSellPaymentMethods($coinCode, $fiatCode)
> ```

Propertytyperequireddescription`$coinCode``string``true`Coin code e.g. 'BTC' or 'ETH' see [Crypto](#crypto) to get a list all available crypto`$fiatCode``string``true`Fiat code e.g. 'USD' or 'EUR' see [Fiat](#fiat) to get a list all available fiats**Result Example**

```
[
   "id"               => 6036,
   "paymentType"      => "DIRECTCREDIT",
   "name"             => "Bank Transfer",
   "description"      => "Sell digital currency to us and have the value directly credited to your bank account",
   "logo_url"         => "https://partner.banxa.com/images/payment-providers/directcredit.png",
   "status"           => "ACTIVE",
   "supported_agents" => [
       [
           "os"      => "ios",
           "browser" => "safari"
       ],
       [
           "os"      => "macos",
           "browser" => "safari"
       ],
       [
           "os"      => "ipados",
           "browser" => "safari"
       ]
   ],
   "type"             => "CRYPTO_TO_FIAT",
   "supported_fiat"   => [
       "AED",
   ],
   "transaction_fees" => [
       [
           "fiat_code" => "AED",
           "coin_code" => "BTC",
           "fees"      => [
               [
                   "name"   => "surcharge",
                   "amount" => 3,
                   "type"   => "fixed"
               ]
           ]
       ],
   ]
]
```

---

Prices
======

[](#prices)

Get prices for [Payment Methods](#payment-methods) to obtain a payment method id for each specific fiat.

### Buy order types pricing

[](#buy-order-types-pricing)

> **Fetch all available prices for buy order type**
>
> ```
> $banxa->getAllBuyPrices(
>     $fiatCode,
>     $coinCode,
>     $fiatAmount,
>     $blockchain
> )
> ```

Propertydescriptionrequireddescription`$fiatCode``string``true`Fiat code e.g. 'USD' or 'EUR' see [Fiat](#fiat) to get a list all available fiats`$coinCode``string``true`Coin code e.g. 'BTC' or 'ETH' see [Crypto](#crypto) to get a list all available crypto`$fiatAmount``string/int/float``true`Fiat amount`$blockchain``string``false`Blockchain code e.g. 'ETH' or 'TRON' see [Crypto](#crypto) to get a list all available blockchains per coin.**Result Example**

```
[
    "spot_price" => "1.07",
    "prices" => [
        [
            "payment_method_id" => 6047,
            "type" => "FIAT_TO_CRYPTO",
            "spot_price_fee" => "0.00",
            "spot_price_including_fee" => "1.07",
            "coin_amount" => "93.84000000",
            "coin_code" => "USDT",
            "fiat_amount" => "100.00",
            "fiat_code" => "USD",
            "fee_amount" => "0.00",
            "network_fee" => "2.37"
        ],
        [
            "payment_method_id" => 6058,
            "type" => "FIAT_TO_CRYPTO",
            "spot_price_fee" => "0.00",
            "spot_price_including_fee" => "1.09",
            "coin_amount" => "93.84000000",
            "coin_code" => "USDT",
            "fiat_amount" => "100.00",
            "fiat_code" => "USD",
            "fee_amount" => "0.00",
            "network_fee" => "2.37"
        ]
    ]
]
```

---

### Buy order type pricing

[](#buy-order-type-pricing)

> **Fetch single price for buy order type for a specific payment method**
>
> ```
> $banxa->getBuyPrice(
>     $fiatCode,
>     $coinCode,
>     $fiatAmount,
>     $paymentMethodId,
>     $blockchain
> )
> ```

Propertytyperequiredrequired`$fiatCode``string``true`Fiat code e.g. 'USD' or 'EUR' see [Fiat](#fiat) to get a list all available fiats`$coinCode``string``true`Coin code e.g. 'BTC' or 'ETH' see [Crypto](#crypto) to get a list all available crypto`$fiatAmount``string/int/float``true`Fiat amount`$paymentMethodId``string/int``true`Unique ID for the payment method that you want to get prices for. see [Payment Methods](#payment-methods) to get a list of payment providers.`$blockchain``string``false`Blockchain code e.g. 'ETH' or 'TRON' see [Crypto](#crypto) to get a list all available blockchains per coin.**Result Example**

```
[
    "payment_method_id" => 6058,
    "type" => "FIAT_TO_CRYPTO",
    "spot_price_fee" => "0.00",
    "spot_price_including_fee" => "1.09",
    "coin_amount" => "93.84000000",
    "coin_code" => "USDT",
    "fiat_amount" => "100.00",
    "fiat_code" => "USD",
    "fee_amount" => "0.00",
    "network_fee" => "2.37"
]
```

Sell order types pricing
------------------------

[](#sell-order-types-pricing)

> **Fetch all available prices for sell order type**
>
> ```
> $banxa->getAllSellPrices(
>   $coinCode,
>   $fiatCode,
>   $coinAmount
> )
> ```

Propertytyperequireddescription`$coinCode``string``true`Coin code e.g. 'BTC' or 'ETH' see [Crypto](#crypto) to get a list all available crypto`$fiatCode``string``true`Fiat code e.g. 'USD' or 'EUR' see [Fiat](#fiat) to get a list all available fiats`$coinAmount``string/int/float``true`Crypto amount that will be used to calculate the fiat amount**Result Example**

```
[
    "spot_price" => "1.07",
    "prices" => [
        [
            "payment_method_id" => 6045,
            "type" => "CRYPTO_TO_FIAT",
            "spot_price_fee" => "0.00",
            "spot_price_including_fee" => "32500.00",
            "coin_amount" => "0.02000000",
            "coin_code" => "BTC",
            "fiat_amount" => "100.00",
            "fiat_code" => "AUD",
            "fee_amount" => "0.00",
            "network_fee" => "0.00"
        ],
        [
            "payment_method_id" => 6046,
            "type" => "CRYPTO_TO_FIAT",
            "spot_price_fee" => "0.00",
            "spot_price_including_fee" => "32500.00",
            "coin_amount" => "0.04000000",
            "coin_code" => "BTC",
            "fiat_amount" => "650.00",
            "fiat_code" => "AUD",
            "fee_amount" => "0.00",
            "network_fee" => "0.00"
        ],
    ]
]
```

### Sell order type pricing

[](#sell-order-type-pricing)

> **Fetch single price for buy order type for a specific payment method**
>
> ```
> $banxa->getSellPrice(
>   $coinCode,
>   $fiatCode,
>   $coinAmount,
>   $paymentMethodId
> )
> ```

Propertytyperequireddescription`$coinCode``string``true`Coin code e.g. 'BTC' or 'ETH' see [Crypto](#crypto) to get a list all available crypto`$fiatCode``string``true`Fiat code e.g. 'USD' or 'EUR' see [Fiat](#fiat) to get a list all available fiats`$coinAmount``string/int/float``true`Crypto amount that will be used to calculate`$paymentMethodId``string/int``true`Unique ID for the payment method that you want to get prices for. see [Payment Methods](#payment-methods) to get a list of payment providers.**Result Example**

```
[
    "payment_method_id" => 6033,
    "type" => "CRYPTO_TO_FIAT",
    "spot_price_fee" => "0.00",
    "spot_price_including_fee" => "1.09",
    "coin_amount" => "93.84000000",
    "coin_code" => "USDT",
    "fiat_amount" => "100.00",
    "fiat_code" => "USD",
    "fee_amount" => "0.00",
    "network_fee" => "2.37"
]
```

---

Orders
======

[](#orders)

Retrieving orders
-----------------

[](#retrieving-orders)

### Fetch orders

[](#fetch-orders)

> **Fetch all orders within a specific time range. (paginated)**
>
> ```
> $banxa->getOrders(
>   $startDate,
>   $endDate,
>   $statuses,
>   $perPage,
>   $page,
>   $accountReference
> )
> ```

Propertytyperequireddescription`$startDate``string``true`Start date used for filtering orders. Must be a date in the format YYYY-MM-DD.`$endDate``string``true`End date used for filtering orders. Must be a date in the format YYYY-MM-DD.`$statuses``array``false`One or many order statuses (see 'Available Statuses')`$perPage``string/int``false`Page size.`$page``string/int``false`Page to retrieve.`$accountReference``string``false`Customer reference that was passed as a parameter when creating an order. Used to retrieve all orders for a customer.Available Statuses`OrderStatus::PENDING_PAYMENT``OrderStatus::WAITING_PAYMENT``OrderStatus::PAYMENT_RECEIVED``OrderStatus::IN_PROGRESS``OrderStatus::COIN_TRANSFERRED``OrderStatus::CANCELLED``OrderStatus::DECLINED``OrderStatus::EXPIRED``OrderStatus::COMPLETE``OrderStatus::REFUNDED`**Result Example**

```
[
    [
        "id"                  => "e7f3d4e436c8925af84a391f317aaa6e",
        "account_id"          => "ebfef819583ff4573e6db307abd9c126",
        "account_reference"   => "banxa-account",
        "order_type"          => "CRYPTO-BUY",
        "ref"                 => 501903,
        "country"             => "AU",
        "fiat_code"           => "AUD",
        "fiat_amount"         => 100,
        "coin_code"           => "BTC",
        "coin_amount"         => 0.00704583,
        "wallet_address"      => "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
        "wallet_address_tag"  => null,
        "fee"                 => 0,
        "fee_tax"             => 0,
        "payment_fee"         => 2.14,
        "payment_fee_tax"     => 0.19,
        "commission"          => 0,
        "tx_hash"             => "sync-tx:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
        "tx_confirms"         => 10,
        "created_date"        => "01-Jul-2022",
        "created_at"          => "01-Jul-2022 07:51:18",
        "payment_type"        => "WorldPay Credit Card",
        "status"              => "complete",
        "completed_at"        => "01-Jul-2022 07:55:19",
        "merchant_fee"        => 0,
        "merchant_commission" => 0,
        "meta_data"           => null,
        "blockchain"          => [
        "code"        => "BTC",
        "description" => "Bitcoin"
        ]
   ],
   [
        "id"                  => "b719377e3541921297ebef33016fb068",
        "account_id"          => "ebfef819583ff4573e6db307abd9c126",
        "account_reference"   => "banxa-account",
        "order_type"          => "CRYPTO-BUY",
        "ref"                 => 501902,
        "country"             => "AU",
        "fiat_code"           => "AUD",
        "fiat_amount"         => 320,
        "coin_code"           => "BTC",
        "coin_amount"         => 0.02255405,
        "wallet_address"      => "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
        "wallet_address_tag"  => null,
        "fee"                 => 0,
        "fee_tax"             => 0,
        "payment_fee"         => 6.83,
        "payment_fee_tax"     => 0.62,
        "commission"          => 0,
        "tx_hash"             => "sync-tx:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
        "tx_confirms"         => 10,
        "created_date"        => "01-Jul-2022",
        "created_at"          => "01-Jul-2022 07:51:18",
        "payment_type"        => "WorldPay Credit Card",
        "status"              => "complete",
        "completed_at"        => "01-Jul-2022 07:55:19",
        "merchant_fee"        => 0,
        "merchant_commission" => 0,
        "meta_data"           => null,
        "blockchain"          => [
            "code"        => "BTC",
            "description" => "Bitcoin"
        ]
   ]
]
```

---

### Fetch order

[](#fetch-order)

> **Fetch single order**
>
> ```
> $banxa->getOrder($orderId);
> ```

Propertydescriptionrequireddescription`$orderId``string``true`Unique ID of the order to retrieve**Result Example**

```
[
    "id"                  => "b719377e3541921297ebef33016fb068",
    "account_id"          => "ebfef819583ff4573e6db307abd9c126",
    "account_reference"   => "banxa-account",
    "order_type"          => "CRYPTO-BUY",
    "ref"                 => 501902,
    "country"             => "AU",
    "fiat_code"           => "AUD",
    "fiat_amount"         => 320,
    "coin_code"           => "BTC",
    "coin_amount"         => 0.02255405,
    "wallet_address"      => "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
    "wallet_address_tag"  => null,
    "fee"                 => 0,
    "fee_tax"             => 0,
    "payment_fee"         => 6.83,
    "payment_fee_tax"     => 0.62,
    "commission"          => 0,
    "tx_hash"             => "sync-tx:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
    "tx_confirms"         => 10,
    "created_date"        => "01-Jul-2022",
    "created_at"          => "01-Jul-2022 07:51:18",
    "payment_type"        => "WorldPay Credit Card",
    "status"              => "complete",
    "completed_at"        => "01-Jul-2022 07:55:19",
    "merchant_fee"        => 0,
    "merchant_commission" => 0,
    "meta_data"           => null,
    "blockchain"          => [
        "code"        => "BTC",
        "description" => "Bitcoin"
    ]
]
```

---

Creating orders
---------------

[](#creating-orders)

Allows your customer to create a buy or sell crypto order with Banxa. Upon success, the response will contain a checkout URL which will be unique for the order. The customer will be redirected to this URL to complete the checkout process, which will expire after 1 minute if a redirect does not occur.

When creating an order you will be required to create a BuyOrderTransaction/SellOrderTransaction/NftBuyOrderTransaction object. This object will allow you to create a transaction using a fiat amount, coin amount, or if you require both, you can specify your own amount using the createDynamic method, this will depend on your business use case.

### Creating a buy order

[](#creating-a-buy-order)

> ```
> $banxa->createBuyOrder(
>   $buyOrderTransaction,
>   $returnUrlOnSuccess,
>   $returnUrlOnFailure,
>   $returnUrlOnCancelled,
>   $metadata,
>   $readOnlyAmounts,
>   $iframeRefererDomain,
>   $optionalOrderParameters
> );
> ```

Propertytyperequireddescription`$buyOrderTransaction``Object``true``BuyOrderTransaction` object`$returnUrlOnSuccess``string``true`The return url on success`$returnUrlOnFailure``string``false`The return url on failure`$returnUrlOnCancelled``string``false`The return url on cancelled`$metadata``string``false`Free form string that you can use to send us any information that will be returned in the Get Orders endpoint`$readOnlyAmounts``boolean``false`Will cause the cryptocurrency and fiat amounts on the Banxa screens to be read-only and un-editable.`$iframeRefererDomain``string``false`Used if you are embedding an iFrame. This must be the exact domain where the iFrame will be hosted. e.g. \[yourCompany\].com. Do not include https:// in front of the domain.`$optionalOrderParameters``Object``false``optionalOrderParameters` object---

> **BuyOrderTransaction using Fiat as base amount**
>
> ```
> $buyOrderTransaction = BuyOrderTransaction::createFromFiatAmount(
>       $accountReference,
>       $fiatCode,
>       $coinCode,
>       $fiatAmount,
>       $walletAddress,
>       $paymentMethodId
>   );
> ```

Propertytyperequireddescription`$accountReference``string``true`The customer's unique ID`$fiatCode``string``true`Fiat code e.g. 'USD' or 'EUR' see [Fiat](#fiat) to get a list all available fiats`$coinCode``string``true`Coin code e.g. 'BTC' or 'ETH' see [Crypto](#crypto) to get a list all available crypto`$fiatAmount``string/float``true`Fiat amount`$walletAddress``string``true`The target wallet address to transfer the coin to`$paymentMethodId``int/string``false`Unique ID for the payment method that you want to get prices for. see [Payment Methods](#payment-methods) to get a list of payment providers.`$blockchain``string``false`Blockchain code, the list of available blockchains per coin see [Crypto](#crypto) for all available blockchains per coin`$walletAddressTag``string``false`Wallet tag or memo associated with the wallet address. Should be sent for buy cryptocurrency orders only for BNB (Memo) or XRP (Tag).---

> **BuyOrderTransaction using Coin as base amount**
>
> ```
>  $buyOrderTransaction = BuyOrderTransaction::createFromCoinAmount(
>       $accountReference,
>       $fiatCode,
>       $coinCode,
>       $coinAmount,
>       $walletAddress,
>       $paymentMethodId
>  );
> ```

Propertytyperequireddescription`$accountReference``string``true`The customer's unique ID`$fiatCode``string``true`Fiat code e.g. 'USD' or 'EUR' see [Fiat](#fiat) to get a list all available fiats`$coinCode``string``true`Coin code e.g. 'BTC' or 'ETH' see [Crypto](#crypto) to get a list all available crypto`$coinAmount``string/float``true`The coin amount`$walletAddress``string``true`The target wallet address to transfer the coin to`$paymentMethodId``int/string``false`Unique ID for the payment method that you want to get prices for. see [Payment Methods](#payment-methods) to get a list of payment providers.`$blockchain``string``false`Blockchain code, the list of available blockchains per coin see [Crypto](#crypto) for all available blockchains per coin`$walletAddressTag``string``false`Wallet tag or memo associated with the wallet address. Should be sent for buy cryptocurrency orders only for BNB (Memo) or XRP (Tag).---

> **BuyOrderTransaction using dynamic sourceAmount or targetAmount**
>
> When using BuyOrderTransaction::createDynamic you will need to specify `$source`(Fiat), `$target`(Coin), and either `$sourceAmount` or `$targetAmount`
>
> ```
>   $buyOrderTransaction = BuyOrderTransaction::createDynamic(
>       $accountReference,
>       $source,
>       $target,
>       $sourceAmount,
>       $targetAmount,
>       $walletAddress,
>       $refundAddress,
>       $paymentMethodId,
>       $blockchain,
>       $walletAddressTag
>   );
> ```

Propertytyperequireddescription`$accountReference``string``true`The customer's unique ID`$source``string``true`Fiat code e.g. 'USD' or 'EUR' see [Fiat](#fiat) to get a list all available fiats`$target``string``true`Coin code e.g. 'BTC' or 'ETH' see [Crypto](#crypto) to get a list all available crypto`$sourceAmount``string/float/null``true`Source amount - null if targetAmount is set`$targetAmount``string/float/null``true`Target amount - null if sourceAmount is set`$walletAddress``string/null``true`The target wallet address to transfer the coin to - For Buy orders only`$refundAddress``string/null``true`The refund wallet address - For sell orders only`$paymentMethodId``int/string``false`Unique ID for the payment method that you want to get prices for. see [Payment Methods](#payment-methods) to get a list of payment providers.`$blockchain``string``false`Blockchain code, the list of available blockchains per coin see [Crypto](#crypto) for all available blockchains per coin`$walletAddressTag``string``false`Wallet tag or memo associated with the wallet address. Should be sent for buy cryptocurrency orders only for BNB (Memo) or XRP (Tag).---

> **optionalOrderParameters**
>
> ```
>   $optionalOrderParameters = optionalOrderParameters::create(
>       $sourceAddress,
>       $sourceAddressTag,
>       $email,
>       $mobile,
>   );
> ```

Propertytyperequireddescription`$sourceAddress``string/null``false`Source wallet address. Should be sent for sell cryptocurrency orders only.`$sourceAddressTag``string/null``false`Source wallet address tag or memo. Should be sent for sell cryptocurrency orders only. Required when source wallet address for BNB (Memo) or XRP (Tag).`$email``string/null``false`Customer's email address. This will pre-populate the customers' email address field when they are redirected to Banxa checkout`$mobile``string/null``false`Customer's mobile number. This will pre-populate the customers' mobile number field when they are redirected to Banxa checkout---

> **Buy order full example**
>
> ```
> $buyOrderTransaction = BuyOrderTransaction::createFromFiatAmount($accountReference, $fiatCode, $coinCode, $fiatAmount, $walletAddress, $paymentMethodId, $blockchain, $walletAddressTag);// From Fiat Amount
> ```
>
>
>
> ```
> $buyOrderTransaction = BuyOrderTransaction::createFromCoinAmount($accountReference, $fiatCode, $coinCode, $coinAmount, $walletAddress, $paymentMethodId, $blockchain, $walletAddressTag);// From Coin Amount
> ```
>
>
>
> ```
> $buyOrderTransaction = BuyOrderTransaction::createDynamic($accountReference, $source, $target, $sourceAmount, null, $walletAddress, null, $paymentMethodId, $blockchain, $walletAddressTag); // Dynamic
> ```
>
>
>
> ```
> $buyOrderTransaction = BuyOrderTransaction::createDynamic($accountReference, $source, $target, null, $targetAmount, $walletAddress, null, $paymentMethodId, $blockchain, $walletAddressTag); // Dynamic
> ```
>
>
>
> ```
> $optionalOrderParameters = OptionalOrderParameters::create($sourceAddress, $sourceAddressTag, $email, $mobile);
> ```
>
>
>
> ```
> $banxa->createBuyOrder(
>     $buyOrderTransaction,
>     $returnUrlOnSuccess,
>     $returnUrlOnFailure,
>     $returnUrlOnCancelled,
>     $metadata,
>     $readOnlyAmounts,
>     $iframeRefererDomain,
>     $optionalOrderParameters
> );
> ```
>
>
>
> **Result Example**
>
> ```
> [
>    "id"                => "b890df4aee4583a25ca8da17eb863c81",
>    "account_id"        => "3ec8d3c67617af11d84a18931c4e369d",
>    "account_reference" => "banxa-test-01",
>    "order_type"        => "CRYPTO-BUY",
>    "fiat_code"         => "AUD",
>    "fiat_amount"       => 1,
>    "coin_code"         => "BTC",
>    "wallet_address"    => "1LbQ1WNTsm1Nzj1hbh3WDCbEim1oUg5rfi",
>    "blockchain"        => [
>        "id"          => 1,
>        "code"        => "BTC",
>        "description" => "Bitcoin"
>    ],
>    "created_at"        => "17-Aug-2022 00:09:03",
>    "checkout_url"      => "https://your-return-url"
> ]
> ```

---

### Creating a NFT buy order

[](#creating-a-nft-buy-order)

> ```
> $banxa->createNftBuyOrder(
>     $nftBuyOrderTransaction,
>     $nftData,
>     $returnUrlOnSuccess,
>     $returnUrlOnFailure,
>     $returnUrlOnCancelled,
>     $iframeRefererDomain
> );
> ```

Propertytyperequireddescription`$nftBuyOrderTransaction``Object``true``NftBuyOrderTransaction` object`$nftData``Object``true``NftData` object`$returnUrlOnSuccess``string``true`The return url on success`$returnUrlOnFailure``string``false`The return url on failure`$returnUrlOnCancelled``string``false`The return url on cancelled`$iframeRefererDomain``string``false`Used if you are embedding an iFrame. This must be the exact domain where the iFrame will be hosted. e.g. \[yourCompany\].com. Do not include https:// in front of the domain.---

> **NftBuyOrderTransaction**
>
> ```
> $nftBuyOrderTransaction = NftBuyOrderTransaction::create(
>     $accountReference,
>     $fiatCode,
>     $coinCode,
>     $fiatAmount,
>     $walletAddress,
>     $paymentMethodId = null,
>     $blockchain = null,
>     $walletAddressTag = null
> );
> ```

Propertytyperequireddescription`$accountReference``string``true`The customer's unique ID`$fiatCode``string``true`Fiat code e.g. 'USD' or 'EUR' see [Fiat](#fiat) to get a list all available fiats`$coinCode``string``true`Coin code e.g. 'BTC' or 'ETH' see [Crypto](#crypto) to get a list all available crypto`$fiatAmount``string/float``true`Fiat amount`$walletAddress``string``true`The target wallet address to transfer the coin to`$paymentMethodId``int/string``false`Unique ID for the payment method that you want to get prices for. see [Payment Methods](#payment-methods) to get a list of payment providers.`$blockchain``string``false`Blockchain code, the list of available blockchains per coin see [Crypto](#crypto) for all available blockchains per coin`$blockchain``string``false`Blockchain code, the list of available blockchains per coin see [Crypto](#crypto) for all available blockchains per coin`$walletAddressTag``string``false`Wallet tag or memo associated with the wallet address. Should be sent for buy cryptocurrency orders only for BNB (Memo) or XRP (Tag).---

> **NftData**
>
> ```
> $nftData = NftData::create(
>     $purchaseReference,
>     $nft,
>     $metaData
> );
> ```

Propertytyperequireddescription`$purchaseReference``string``true`A reference of the purchase`$nft``Object``true``Nft` object`$metaData``array``false`Array of metaData---

> **Nft**
>
> ```
> $nft = Nft::create(
>     $name,
>     $collection,
>     $nftMedia,
> );
> ```

Propertytyperequireddescription`$name``string``true`The name of the NFT`$collection``string``true`The Collection the NFT`$nftMedia``object``true``NftMedia` object---

> **Create VideoNftMedia**
>
> ```
>   $nftMedia = VideoNftMedia::create($link);
> ```
>
>
>
> **Create ImageNftMedia**
>
> ```
>   $nftMedia = ImageNftMedia::create($link);
> ```

Propertytyperequireddescription`link``string``true`A link to the Nft video---

> **Nft buy order full example**
>
> ```
> $nftBuyOrderTransaction = NftBuyOrderTransaction::create(
>      $accountReference,
>      $fiatCode,
>      $coinCode,
>      $fiatAmount,
>      $walletAddress,
>      $paymentMethodId,
>      $blockchain,
>      $walletAddressTag
> );
>
>
> $nftMedia = ImageNftMedia::create($link); // OR $nftMedia = VideoNftMedia::create($link)
>
>
> $nft = Nft::create(
>     $name,
>     $collection,
>     $nftMedia,
> );
>
> $nftData = NftData::create(
>     $purchaseReference,
>     $nft,
>     $metaData
> );
>
> $banxa->createNftBuyOrder(
>     $nftBuyOrderTransaction,
>     $nftData,
>     $returnUrlOnSuccess,
>     $returnUrlOnFailure,
>     $returnUrlOnCancelled,
>     $iframeRefererDomain,
> );
> ```
>
>
>
> **Result Example**
>
> ```
> [
>    "id"                => "b890df4aee4583a25ca8da17eb863c81",
>    "account_id"        => "3ec8d3c67617af11d84a18931c4e369d",
>    "account_reference" => "Banxa-Testing-01",
>    "order_type"        => "NFT-BUY",
>    "blockchain"        => [
>        "id"          => 1,
>        "code"        => "ETH",
>        "description" => "Ethereum (ERC-20)"
>    ],
>    "created_at"        => "17-Aug-2022 00:09:03",
>    "checkout_url"      => "https://your-return-url"
> ]
> ```

---

### Creating a Sell order

[](#creating-a-sell-order)

> ```
> $banxa->createSellOrder(
>    $sellOrderTransaction,
>    $returnUrlOnSuccess,
>    $returnUrlOnFailure,
>    $returnUrlOnCancelled,
>    $metadata,
>    $readOnlyAmounts,
>    $iframeRefererDomain,
>    $optionalOrderParameters,
> )
> ```

Propertytyperequireddescription`$sellOrderTransaction``Object``true``SellOrdertransaction` object`$returnUrlOnSuccess``string``true`The return url on success`$returnUrlOnFailure``string``false`The return url on failure`$returnUrlOnCancelled``string``false`The return url on cancelled`$metadata``string``false`Free form string that you can use to send us any information that will be returned in the Get Orders endpoint`$readOnlyAmounts``boolean``false`Will cause the cryptocurrency and fiat amounts on the Banxa screens to be read-only and un-editable.`$iframeRefererDomain``string``false`Used if you are embedding an iFrame. This must be the exact domain where the iFrame will be hosted. e.g. \[yourCompany\].com. Do not include https:// in front of the domain.`$optionalOrderParameters``Object``false``optionalOrderParameters` object---

> **SellOrderTransaction using Fiat as base amount**
>
> ```
> $sellOrderTransaction = SellOrderTransaction::createFromFiatAmount(
>       $accountReference,
>       $fiatCode,
>       $coinCode,
>       $fiatAmount,
>       $refundAddress,
>       $paymentMethodId,
>       $blockchain,
>       $walletAddressTag,
> );
> ```

Propertytyperequireddescription`$accountReference``string``true`The customer's unique ID`$fiatCode``string``true`Fiat code e.g. 'USD' or 'EUR' see [Fiat](#fiat) to get a list all available fiats`$coinCode``string``true`Coin code e.g. 'BTC' or 'ETH' see [Crypto](#crypto) to get a list all available crypto`$fiatAmount``string/float``true`Fiat amount`$refundAddress``string``true`The refund wallet address if the order gets rejected`$paymentMethodId``int/string``false`Unique ID for the payment method that you want to get prices for. see [Payment Methods](#payment-methods) to get a list of payment providers.`$blockchain``string``false`Blockchain code, the list of available blockchains per coin see [Crypto](#crypto) for all available blockchains per coin`$walletAddressTag``string``false`Wallet tag or memo associated with the wallet address. Should be sent for buy cryptocurrency orders only for BNB (Memo) or XRP (Tag).---

> **sellOrderTransaction using Coin as base amount**
>
> ```
> $sellOrderTransaction = SellOrderTransaction::createFromCoinAmount(
>       $accountReference,
>       $fiatCode,
>       $coinCode,
>       $coinAmount,
>       $refundAddress,
>       $paymentMethodId,
>       $blockchain,
>       $walletAddressTag,
>  );
> ```

Propertytyperequireddescription`$accountReference``string``true`The customer's unique ID`$fiatCode``string``true`Fiat code e.g. 'USD' or 'EUR' see [Fiat](#fiat) to get a list all available fiats`$coinCode``string``true`Coin code e.g. 'BTC' or 'ETH' see [Crypto](#crypto) to get a list all available crypto`$coinAmount``string/float``true`The coin amount`$refundAddress``string``true`The refund wallet address if the order gets rejected`$paymentMethodId``int/string``false`Unique ID for the payment method that you want to get prices for. see [Payment Methods](#payment-methods) to get a list of payment providers.`$blockchain``string``false`Blockchain code, the list of available blockchains per coin see [Crypto](#crypto) for all available blockchains per coin`$walletAddressTag``string``false`Wallet tag or memo associated with the wallet address. Should be sent for buy cryptocurrency orders only for BNB (Memo) or XRP (Tag).---

> **sellOrderTransaction using dynamic sourceAmount or targetAmount**
>
> When using SellOrderTransaction::createDynamic you will need to specify `$source`(Coin), `$target`(Fiat), and either `$sourceAmount` or `$targetAmount`
>
> ```
> $sellOrderTransaction = SellOrderTransaction::createDynamic(
>       $accountReference,
>       $source,
>       $target,
>       $sourceAmount,
>       $targetAmount,
>       $walletAddress,
>       $refundAddress,
>       $paymentMethodId,
>       $blockchain,
>       $walletAddressTag
>  );
> ```

Propertytyperequireddescription`$accountReference``string``true`The customer's unique ID`$source``string``true`Fiat code e.g. 'USD' or 'EUR' see [Fiat](#fiat) to get a list all available fiats`$target``string``true`Coin code e.g. 'BTC' or 'ETH' see [Crypto](#crypto) to get a list all available crypto`$sourceAmount``string/float/null``true`Source amount - null if targetAmount is set`$targetAmount``string/float/null``true`Target amount - null if sourceAmount is set`$walletAddress``string/null``true`The target wallet address to transfer the coin to - For Buy orders only`$refundAddress``string/null``true`The refund wallet address - For sell orders only`$paymentMethodId``int/string``false`Unique ID for the payment method that you want to get prices for. see [Payment Methods](#payment-methods) to get a list of payment providers.`$blockchain``string``false`Blockchain code, the list of available blockchains per coin see [Crypto](#crypto) for all available blockchains per coin`$walletAddressTag``string``false`Wallet tag or memo associated with the wallet address. Should be sent for buy cryptocurrency orders only for BNB (Memo) or XRP (Tag).---

> **optionalOrderParameters**
>
> ```
>   $optionalOrderParameters = optionalOrderParameters::create(
>       $sourceAddress,
>       $sourceAddressTag,
>       $email,
>       $mobile,
>   );
> ```

Propertytyperequireddescription`$sourceAddress``string/null``false`Source wallet address. Should be sent for sell cryptocurrency orders only.`$sourceAddressTag``string/null``false`Source wallet address tag or memo. Should be sent for sell cryptocurrency orders only. Required when source wallet address for BNB (Memo) or XRP (Tag).`$email``string/null``false`Customer's email address. This will pre-populate the customers' email address field when they are redirected to Banxa checkout`$mobile``string/null``false`Customer's mobile number. This will pre-populate the customers' mobile number field when they are redirected to Banxa checkout---

> **Sell order full example**
>
> ```
> $sellOrderTransaction = SellOrderTransaction::createFromFiatAmount($accountReference, $fiatCode, $coinCode, $fiatAmount, $refundAddress, $paymentMethodId, $blockchain, $walletAddressTag);// From Fiat Amount
> ```
>
>
>
> ```
> $sellOrderTransaction = SellOrderTransaction::createFromCoinAmount($accountReference, $fiatCode, $coinCode, $coinAmount, $refundAddress, $paymentMethodId, $blockchain, $walletAddressTag);// From Coin Amount
> ```
>
>
>
> ```
> $sellOrderTransaction = SellOrderTransaction::createDynamic($accountReference, $source, $target, $sourceAmount, null, null, $refundAddress, $paymentMethodId, $blockchain, $walletAddressTag); // Dynamic
> ```
>
>
>
> ```
> $sellOrderTransaction = SellOrderTransaction::createDynamic($accountReference, $source, $target, null, $targetAmount, null, $refundAddress, $paymentMethodId, $blockchain, $walletAddressTag); // Dynamic
> ```
>
>
>
> ```
> $optionalOrderParameters = OptionalOrderParameters::create($sourceAddress, $sourceAddressTag, $email, $mobile);
> ```
>
>
>
> ```
> $banxa->createSellOrder(
>     $sellOrderTransaction,
>     $returnUrlOnSuccess,
>     $returnUrlOnFailure,
>     $returnUrlOnCancelled,
>     $metadata,
>     $readOnlyAmounts,
>     $iframeRefererDomain,
>     $optionalOrderParameters,
> );
> ```
>
>
>
> **Result Example**
>
> ```
> [
>    "id"                => "b890df4aee4583a25ca8da17eb863c81",
>    "account_id"        => "3ec8d3c67617af11d84a18931c4e369d",
>    "account_reference" => "banxa-test-01",
>    "order_type"        => "CRYPTO-SELL",
>    "fiat_code"         => "AUD",
>    "fiat_amount"       => 1,
>    "coin_code"         => "BTC",
>    "wallet_address"    => "1LbQ1WNTsm1Nzj1hbh3WDCbEim1oUg5rfi",
>    "blockchain"        => [
>        "id"          => 1,
>        "code"        => "BTC",
>        "description" => "Bitcoin"
>    ],
>    "created_at"        => "17-Aug-2022 00:09:03",
>    "checkout_url"      => "https://your-return-url"
>
> ]
> ```

---

### Confirm sell order

[](#confirm-sell-order)

> **Once the coin amount transfer for a Sell Order has been executed,
> Banxa must be notified by sending a request to this endpoint with transaction hash, source and destination wallet address details.**
>
> ```
> $banxa->confirmSellOrder(
>       $orderId,
>       $txHash,
>       $sourceAddress,
>       $destinationAddress,
>       $sourceAddressTag,
>       $destinationAddressTag
> )
> ```

Propertytyperequireddescription`$orderId``string``true`Unique ID for the the order`$txHash``string``true`Blockchain transaction hash of the order`$sourceAddress``string``true`The provided customer's source wallet address`$destinationAddress``string``true`The wallet address provided to merchants to transact to`$sourceAddressTag``string``false`The customer's source wallet address tag if the provided source wallet address requires it`$destinationAddressTag``string``false`The wallet address tag provided to merchants if the provided destination wallet address requires it**Result Example**

```
[
    "id"                  => "ee94a43403fb608f341dd5c4c899b846",
    "account_id"          => "d6e7ab2b8f638bed61dc0ac5bec37d4d",
    "account_reference"   => "banxa-account",
    "order_type"          => "CRYPTO-SELL",
    "payment_type"        => "CLEARJCNSELLFP",
    "ref"                 => 507000,
    "fiat_code"           => "AUD",
    "fiat_amount"         => 100,
    "coin_code"           => "BTC",
    "coin_amount"         => 0.00286436,
    "wallet_address"      => null,
    "wallet_address_tag"  => null,
    "fee"                 => 9.1,
    "fee_tax"             => 0,
    "payment_fee"         => 0,
    "payment_fee_tax"     => 0,
    "commission"          => 0.1,
    "tx_hash"             => null,
    "tx_confirms"         => 0,
    "created_date"        => "01-Jul-2022",
    "created_at"          => "01-Jul-2022 07:51:18",
    "status"              => "in progress",
    "completed_at"        => null,
    "merchant_fee"        => 6.54,
    "merchant_commission" => 0.05,
    "meta_data"           => null,
    "blockchain"          => [
        "id"          => 1,
        "code"        => "BTC",
        "description" => "Bitcoin"
    ]
]
```

---

Identity
========

[](#identity)

Create Identity
---------------

[](#create-identity)

> **Allows you to share customer details with Banxa before an Order is created.
> This reduces the need for customers to re-submit personal details and upload KYC documentation during the Banxa checkout flow.
> Detailed guide on how to implement this API can be found [here](https://docs.banxa.com/docs/identities-service). You can also find Testing information [here](https://docs.banxa.com/docs/order-flow)**
>
> ```
> $banxa->createIdentity(
>    $identitySharingCollection,
>    $customerDetails,
>    $residentialAddress
>    $customerIdentity,
>    $identityDocumentCollection,
> )
> ```

Propertytyperequireddescription`$identitySharingCollection``Object``true``IdentitySharingCollection` object`$customerDetails``Object``true``CustomerDetail` object`$residentialAddress``Object``true``ResidentialAddress` object`$customerIdentity``Object``true``CustomerIdentity` object`$identityDocumentCollection``Object``false``IdentityDocumentCollection` object##### IdentitySharingCollection

[](#identitysharingcollection)

```
 IdentitySharingCollection::create($kycProviders)
```

Propertytyperequireddescription`$kycProviders``array``true`array of `IdentityProvider` objects##### IdentitySharingProvider

[](#identitysharingprovider)

```
 IdentitySharingProvider::create($provider, $token)
```

Propertytyperequireddescription`$provider``string``true`Name of the provider e.g. 'sumsub'`$token``string``true`The unique provider token##### CustomerDetail

[](#customerdetail)

```
$customerDetail = CustomerDetail::create($accountReference, $mobileNumber, $emailAddress);
```

Propertytyperequireddescription`$accountReference``string``true`Unique customer reference provided by you. This should be the same value that is passed when calling the calling the Create Order endpoint.`$mobileNumber``string``true`Mobile number of customer`$emailAddress``string``true`Email address of customer##### ResidentialAddress

[](#residentialaddress)

```
$residentialAddress = ResidentialAddress::create($country, $addressLine, $suburb, $postCode, $state);
```

Propertytyperequireddescription`$country``string``true`Customer's country of residence. Required to be formatted using ISO 3166 two-letter country code e.g. "US" or "AU".`$addressLine``string``false`Customer's Street number, street name and street type/suffix.`$suburb``string``false`Customer's Address city or suburb. E.g. "2 Abbey Road".`$postCode``string``false`Customer's Address postal / PIN / ZIP code.`$state``string``false`Customer's Address state / region.##### CustomerIdentity

[](#customeridentity)

```
 $customerIdentity = CustomerIdentity::create($givenName, $surname, $dateOfBirth);
```

Propertytyperequireddescription`$givenName``string``true`Customer's Customer's given / first name.`$surname``string``true`Customer's surname / last name.`$dateOfBirth``string``false`Customer's Customer's date of birth (e.g. "1985-01-31"). Required to format as ISO 8601 Date format : YYYY-MM-DD.##### IdentityDocumentCollection

[](#identitydocumentcollection)

Propertytypedescription`$documents``array`An Array holding `IdentityDocument` objects##### IdentityDocument

[](#identitydocument)

```
 IdentityDocument::create($documentType, $imageLinks, $documentNumber)
```

Propertytyperequireddescription`$documentType``string``true`The document type (see 'Available document types')`$imageLinks``array``true`Array of image links for the documents type`$documentNumber``string``true` **when document type is PASSPORT/IDENTIFICATION/DRIVING\_LICENSE**The document number, located on the documentAvailable document types`IdentityDocument::DOCUMENT_TYPE_DRIVING_LICENCE``IdentityDocument::DOCUMENT_TYPE_PASSPORT``IdentityDocument::DOCUMENT_TYPE_IDENTIFICATION``IdentityDocument::DOCUMENT_TYPE_SELFIE``IdentityDocument::DOCUMENT_TYPE_PROOF_OF_ADDRESS`#### Full Example

[](#full-example)

```
$kycProviders = [
    IdentitySharingProvider::create($provider, $token),
    IdentitySharingProvider::create($provider, $token),
];

$documents = [
    IdentityDocument::create($documentType, $imageLinks, $documentNumber),
    IdentityDocument::create($documentType, $imageLinks),
];

$identitySharingCollection = IdentitySharingCollection::create($kycProviders);
$customerDetail = CustomerDetail::create($accountReference, $mobileNumber, $emailAddress);
$residentialAddress = ResidentialAddress::create($country, $addressLine, $suburb, $postCode, $state);
$customerIdentity = CustomerIdentity::create($givenName, $surname, $dateOfBirth);
$identityDocumentCollection = IdentityDocumentCollection::create($documents);

$banxa->createIdentity(
    $identitySharingCollection,
    $customerDetail,
    $residentialAddress,
    $customerIdentity,
    $identityDocumentCollection
);
```

**Result Example**

```
[
    "account_id"        => "28d517af407a0566204acd75e3a8e5b7",
    "account_reference" => "test001001"
]
```

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity28

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~139 days

Total

5

Last Release

810d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/66f7ac3595f4358e087711894288e0dfecd118a192d10a7fdfe49730e0ae73d3?d=identicon)[Banxa](/maintainers/Banxa)

![](https://www.gravatar.com/avatar/773b4797ea57c7a4355611b37d554ab93c1c0317aaf08483097e18d5354e2c9e?d=identicon)[system@banxa.com](/maintainers/system@banxa.com)

---

Top Contributors

[![WesleyBanxa](https://avatars.githubusercontent.com/u/138733829?v=4)](https://github.com/WesleyBanxa "WesleyBanxa (17 commits)")[![banxa-global](https://avatars.githubusercontent.com/u/91994144?v=4)](https://github.com/banxa-global "banxa-global (13 commits)")[![AlexBanxa](https://avatars.githubusercontent.com/u/138732151?v=4)](https://github.com/AlexBanxa "AlexBanxa (6 commits)")

---

Tags

phpsdkcryptocryptocurrencycryptocurrenciesbanxafiattocryptoonrampofframp

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/banxa-php-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/banxa-php-sdk/health.svg)](https://phpackages.com/packages/banxa-php-sdk)
```

###  Alternatives

[xeroapi/xero-php-oauth2

Xero official PHP SDK for oAuth2 generated with OpenAPI spec 3

1054.3M14](/packages/xeroapi-xero-php-oauth2)[mailchimp/transactional

458.9M16](/packages/mailchimp-transactional)[kinde-oss/kinde-auth-php

Kinde PHP SDK for authentication

2369.5k3](/packages/kinde-oss-kinde-auth-php)[manamine/php-eos-rpc-sdk

PHP SDK for the EOS RPC API

187.5k](/packages/manamine-php-eos-rpc-sdk)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
