# Create an Application

## App Types

* **Private**\
  Available to you and your sub accounts (if Agency tariff), moderation-free
* **Public**\
  Available to all users of the platform after moderation

To integrate with the Marketplace, you need to implement a separate application service that communicates with both the POS system and the Marketplace.

This service must expose several endpoints that the Marketplace will interact with.

## **App Endpoints**

## Check Credentials

> This method is used to verify the user credentials specified when installing the application.

```json
{"openapi":"3.0.0","info":{"title":"Marketplace API","version":"1.0.0"},"servers":[{"url":"https://app-domain.example"}],"security":[],"paths":{"/check-credentials":{"post":{"summary":"Check Credentials","description":"This method is used to verify the user credentials specified when installing the application.","operationId":"post_app_api_v2_marketplace_stabdoc_checkcredentials","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckCredentialsRequest"}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckCredentialsResponse"}}}}}}}},"components":{"schemas":{"CheckCredentialsRequest":{"properties":{"credentials":{"description":"Merchant credentials.","type":"array","items":{"properties":{"name":{"type":"string"},"value":{"type":"string"}},"type":"object"}}},"type":"object"},"CheckCredentialsResponse":{"properties":{"isValid":{"type":"boolean","nullable":true}},"type":"object"}}}}
```

## Get Inventory

> This method is used to retrieve an inventory tree (for example, a restaurant menu).\
> The method is used during application installation and when inventory-based rules are triggered.

```json
{"openapi":"3.0.0","info":{"title":"Marketplace API","version":"1.0.0"},"servers":[{"url":"https://app-domain.example"}],"security":[],"paths":{"/get-inventory":{"post":{"summary":"Get Inventory","description":"This method is used to retrieve an inventory tree (for example, a restaurant menu).\nThe method is used during application installation and when inventory-based rules are triggered.","operationId":"post_app_api_v2_marketplace_stabdoc_getinventory","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetInventoryRequest"}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetInventoryResponse"}}}}}}}},"components":{"schemas":{"GetInventoryRequest":{"properties":{"credentials":{"description":"Merchant credentials.","type":"array","items":{"properties":{"name":{"type":"string"},"value":{"type":"string"}},"type":"object"}}},"type":"object"},"GetInventoryResponse":{"properties":{"inventoryItems":{"type":"array","items":{"$ref":"#/components/schemas/InventoryItem"}}},"type":"object"},"InventoryItem":{"required":["type","id","title"],"properties":{"type":{"type":"string","enum":["group","item"],"nullable":true},"id":{"type":"string","nullable":true},"title":{"type":"string","nullable":true},"items":{"type":"array","items":{"$ref":"#/components/schemas/InventoryItem"},"nullable":true}},"type":"object"}}}}
```

***

## Example app for marketplace

{% embed url="<https://github.com/BoomerangmeInc/marketplace-app-example>" %}

***

## **Marketplace API Documentation**

<https://docs.dev.boomerangme.cards/#tag/Marketplace-API>

{% openapi src="<https://api.digitalwallet.cards/api/v2/docs/json>" path="/api/v2/marketplace/resolve-credentials" method="post" %}
<https://api.digitalwallet.cards/api/v2/docs/json>
{% endopenapi %}

{% openapi src="<https://api.digitalwallet.cards/api/v2/docs/json>" path="/api/v2/marketplace/accrue" method="post" %}
<https://api.digitalwallet.cards/api/v2/docs/json>
{% endopenapi %}

{% openapi src="<https://api.digitalwallet.cards/api/v2/docs/json>" path="/api/v2/marketplace/reverse" method="post" %}
<https://api.digitalwallet.cards/api/v2/docs/json>
{% endopenapi %}

Once you have all the data, you can add your application to the Boomerang marketplace.

To do this, go to the Settings -> Apps tab and click “Create App.”

<figure><img src="https://121681468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FBfW4nnOu4AysbkbyxNug%2Fuploads%2F3XUqQ1lyHddC8HBMQ4ot%2FScreenshot%20at%20Sep%2009%2018-55-39.png?alt=media&#x26;token=8a07c068-ece1-4dab-9f0b-8fc124ed2065" alt=""><figcaption></figcaption></figure>

Enter the name and description of the application.&#x20;

Enter the URLs for checking credits (required), obtaining a list of products, and Webhook Postback after installation.

Set whether your application will be public (accessible to all users) or not (accessible only to you and your sub-accounts).

Select which accrual rules will be available in your application.

<figure><img src="https://121681468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FBfW4nnOu4AysbkbyxNug%2Fuploads%2FWYSnt55xGm2srB8S936J%2FScreenshot%20at%20Sep%2009%2018-30-46.png?alt=media&#x26;token=dc563230-caa1-42c0-97c7-561b386c811c" alt=""><figcaption></figcaption></figure>

Add the fields required to connect the application:

Field name for API - the name of the field used in the API

<figure><img src="https://121681468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FBfW4nnOu4AysbkbyxNug%2Fuploads%2FOx9Avu6niRnwH27mllAW%2FScreenshot%20at%20Sep%2009%2018-51-08.png?alt=media&#x26;token=58c611d1-3908-4331-a9a6-dcc96bd14d73" alt=""><figcaption></figcaption></figure>

Field title for UI - the name of the field that will be displayed in the interface.

Add a description that will also be reflected in the interface.

<div><figure><img src="https://121681468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FBfW4nnOu4AysbkbyxNug%2Fuploads%2FKEfda8inf5seoN7LeljX%2FScreenshot%20at%20Sep%2009%2018-30-03.png?alt=media&#x26;token=bb5df351-9b57-4510-9b02-677db8f64c40" alt=""><figcaption></figcaption></figure> <figure><img src="https://121681468-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FBfW4nnOu4AysbkbyxNug%2Fuploads%2FyiS7EQzLYVglRrf7Kt6v%2FScreenshot%20at%20Sep%2009%2018-34-12.png?alt=media&#x26;token=c7a54c12-40cd-4668-8377-0273a28b0b21" alt=""><figcaption></figcaption></figure></div>

After adding a public application, you need to submit it for moderation.<br>
