---
title: Setting up your integration
slug: setting-up-your-integration
docTags: 
createdAt: 2022-05-11T19:06:47.000Z
---

# Generating an API Client (Basic)



::::VerticalSplit{layout="middle"}
:::VerticalSplitItem
The simplest way to generate an API client is to use **Swagger's online editor** which can be found at [editor.swagger.io](https://editor.swagger.io).&#x20;



1. Download the Jetpay `openapi.json` file from [extapi.jetpay.baselinepayments.com/openapi.json](https://extapi.jetpay.baselinepayments.com/openapi.json),&#x20;
2. Open the swagger editor,&#x20;
3. and **import the JSON file** by clicking on **File** >**&#x20;Import File**.
:::

:::VerticalSplitItem
![](https://api.archbee.com/api/optimize/3fu3LxsSpFdL9nSHt8vg8/h79WQw4MIcjcnCzh6PNRM_image.png)
:::
::::

***

::::VerticalSplit{layout="left"}
:::VerticalSplitItem
This will result in the spec being loaded and the creation of a **YAML document** that shows the **API** as well as a **visual representation** of the docs on the right.
:::

:::VerticalSplitItem
![](https://api.archbee.com/api/optimize/22RTQMLnemxhvi7pdhX-s/-haeXgCxIznmT4L5DE2S-_s11.png)
:::
::::

***

::::VerticalSplit{layout="left"}
:::VerticalSplitItem
From here, click on **Generate Client** in the top menu and select the type of client you would like to generate from the list.&#x20;



We're going to select **javascript** for this example.
:::

:::VerticalSplitItem
![](https://api.archbee.com/api/optimize/3fu3LxsSpFdL9nSHt8vg8/d8JZu6yIRL8JAqJp7bf0l_image.png)
:::
::::

***

::::VerticalSplit{layout="left"}
:::VerticalSplitItem
This generates a **javascript** client, including **documentation** and **source code**.
:::

:::VerticalSplitItem
![](https://api.archbee.com/api/optimize/3fu3LxsSpFdL9nSHt8vg8/CINkNAld5bWW8P_cPN30m_image.png)
:::
::::

***

::::VerticalSplit{layout="left"}
:::VerticalSplitItem
Usage of the API through this client can be done according to the included docs.



Assuming that the folder where the client is located is '**jetpay**' it could be imported and used as follows:
:::

:::VerticalSplitItem
```javascript
import {Jetpay} from 'jetpay';

let apiInstance = new Jetpay.TransactionsApi();
let body = new Jetpay.DebitTransactionCreateOperation(...);

apiInstance.createDebitDebitPut(body, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});
```
:::
::::



# The Next Step

:::hint{type="info"}
See the sections in [Using the API](docId\:WPK0w4zXqewDTjCj5VHi5)  for examples of how to use the API.
:::

