# APIs

~~In the recent past, the API economy has grown a lot. Businesses are using different APIs to delegate the work they don’t have expertise on\[\[viii]] enabling faster, cheaper and smarter work. We create APIs to enable cryptocurrency payments for the businesses~~.

Since the overhead for developers to learn blockchain and crypto currencies is very huge at the moment and moreover businesses want their teams to focus on their product, we provide ready to use API's to business which they can use just like in the centralised banking/payment gateway solution to handle their business specific payment schemes.&#x20;

Business hit `generateSmartContract()` function with their business specific JSON data to create the smart-contract. Apart from business use cases, businesses can provide private keys who can have access to these smart-contracts and funds, replicating their hierarchy for account management.\\

The more details around APIs

## Deploy

<mark style="color:green;">`POST`</mark> `/v1/deploy/`

Deploys a Business Smart&#x20;

#### Request Body

| Name   | Type   | Description |
| ------ | ------ | ----------- |
| amount | string | Amount      |

{% tabs %}
{% tab title="200 JSON object with transaction hash, which can be used to get contract address" %}

```
{
    transaction_hash:  <string>,
    bsm_id: <string>
}
```

{% endtab %}
{% endtabs %}

| **Endpoint**                                     | **Method** | **Parameters**                                                                  | **Returns**                                                               | Actions                                                                                                                                                                             |
| ------------------------------------------------ | ---------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| /v1/deploy                                       | POST       | <p><br></p>                                                                     | <p>JSON Object:{transaction\_hash:  \<string>,bsm\_id: \<string>}<br></p> | Deploys  a Business Smart Contract based for the business based on the specifications provided in the parameters when calling this API.                                             |
| /v1/update/\<bsc\_id>                            | PUT        | <p><br></p>                                                                     | JSON Object:{transaction\_hash:  \<string>}                               | Update your Business Smart Contract with new values provided in the parameter&#x73;**.**                                                                                            |
| /v1/delete/\<bsc\_id>                            | POST       | JSON Object with fields to update.Eg.{accept\_token: OPCHOTC,token\_amount: 20} | <p>JSON Object:{transaction\_hash: \<string>}<br></p>                     | Delete your currently deployed BSC. This will make call self destruct on the contract, transferring any existing balance to your wallet address as well as returning the gas freed. |
| /v1/details/\<bsc\_id>                           | GET        | <p><br></p>                                                                     | JSON Object                                                               | Lists all current details regarding the BSC Eg. Current Balance, Deployed address, Total payments etc.These details would be polled from blockchain or from IPFS.                   |
| <p>/v1/details/\<bscid>/\<user\_address><br></p> | GET        | <p><br></p>                                                                     | JSON Object                                                               | Lists the user specific details regarding that BSC like last payment date, number of active subscriptions etc.                                                                      |
