Loading...
NAV Navbar
Shell HTTP JavaScript Node.JS Python Ruby Java

AppMarket API Reference

Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.

The AppMarket API Reference lists various APIs that you can use to manage and interact with your marketplace.

Use the following URL format to send API calls:

https://{marketplaceURL}/api/{endpoint}

For example:

https://myMarketplace.com/api/marketplace/v1/bundles

Generated on Thu Oct 17 2019 08:55:37 GMT-0400 (EDT)

Bundles

Retrieve a bundle status

This call returns the current state of the bundle.

Example request

curl -X GET https://{marketplaceURL}/api/marketplace/v1/bundles/{bundleId}/status \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \

GET https://{marketplaceURL}/api/marketplace/v1/bundles/{bundleId}/status HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json

var headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
$.ajax({
  url: 'https://{marketplaceURL}/api/marketplace/v1/bundles/{bundleId}/status',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const request = require('node-fetch');

const headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
fetch('https://{marketplaceURL}/api/marketplace/v1/bundles/{bundleId}/status',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

r = requests.get('https://{marketplaceURL}/api/marketplace/v1/bundles/{bundleId}/status', params={

}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json'
}

result = RestClient.get 'https://{marketplaceURL}/api/marketplace/v1/bundles/{bundleId}/status',
  params: {
  }, headers: headers

p JSON.parse(result)

URL obj = new URL("https://{marketplaceURL}/api/marketplace/v1/bundles/{bundleId}/status");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

Example response

[
  {
    "assigned": false,
    "companyEntitlementId": null,
    "companyEntitlementPending": false,
    "companyWide": false,
    "editionId": null,
    "editionPricingId": null,
    "freeTrialAllowed": true,
    "freeTrialDaysLeft": 0,
    "ownerAdmin": false,
    "ownerFullName": null,
    "ownerId": null,
    "ownerUuid": null,
    "partOfExistingBundle": false,
    "pending": false,
    "pendingAppType": "REQUESTED",
    "requested": false
  }
]

GET/marketplace/v1/bundles/{bundleId}/status

Retrieve a bundle status This call returns the current state of the bundle.

Parameters

Parameter Type Data Type Default Description
*bundleId path number Bundle product id

Responses

Status Meaning Description Definition
200 OK Bundle application status read. array of UserAppInfo
404 Not Found Bundle application not found.

Retrieve a bundle

This call returns all details about a specific bundle.

Example request

curl -X GET https://{marketplaceURL}/api/marketplace/v1/bundles/{bundleId} \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \

GET https://{marketplaceURL}/api/marketplace/v1/bundles/{bundleId} HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json

var headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
$.ajax({
  url: 'https://{marketplaceURL}/api/marketplace/v1/bundles/{bundleId}',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const request = require('node-fetch');

const headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
fetch('https://{marketplaceURL}/api/marketplace/v1/bundles/{bundleId}',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

r = requests.get('https://{marketplaceURL}/api/marketplace/v1/bundles/{bundleId}', params={

}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json'
}

result = RestClient.get 'https://{marketplaceURL}/api/marketplace/v1/bundles/{bundleId}',
  params: {
  }, headers: headers

p JSON.parse(result)

URL obj = new URL("https://{marketplaceURL}/api/marketplace/v1/bundles/{bundleId}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

Example response

{
  "billingFrequency": null,
  "blurb": "Bundle Blurb",
  "bundledProducts": [],
  "buyable": false,
  "changeSubscriptionAllowed": true,
  "collectLeads": false,
  "collectLeadsWithPurchaseEnabled": false,
  "description": "Bundle Description",
  "discountDetails": null,
  "downloadFileSize": null,
  "featured": false,
  "featuredSliderPosition": null,
  "free": false,
  "freeTrialOrEditionPresent": false,
  "href": "http://localhost/api/marketplace/v1/bundles/245",
  "iconUrl": null,
  "id": 245,
  "lastModified": 1461792750786,
  "name": "MockApp-4393604041692298141",
  "newSubscriptionEnabled": true,
  "numRatings": null,
  "overview": null,
  "overviewImageUrl": null,
  "popular": false,
  "popularity": null,
  "productType": "BUNDLE",
  "profileLogoUrl": null,
  "provider": {
    "name": "Appdirect",
    "url": "appdirect.com",
    "uuid": "b863d403-f8a7-4d38-9f89-c5fa021c2b7e"
  },
  "publishedOn": 1461792750665,
  "rating": null,
  "referable": false,
  "staffPick": false,
  "staffPickSliderPosition": null,
  "startingPrice": null,
  "supportedLanguages": [
    "en"
  ],
  "tags": [],
  "url": "http://localhost/apps/245"
}

GET/marketplace/v1/bundles/{bundleId}

Retrieve a bundle This call returns all details about a specific bundle.

Parameters

Parameter Type Data Type Default Description
*bundleId path number Bundle product id

Responses

Status Meaning Description Definition
200 OK Bundle application read. Bundle
404 Not Found Bundle application not found.

List all bundles

This call lists all bundles on the marketplace.

Example request

curl -X GET https://{marketplaceURL}/api/marketplace/v1/bundles \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \

GET https://{marketplaceURL}/api/marketplace/v1/bundles HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json

var headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
$.ajax({
  url: 'https://{marketplaceURL}/api/marketplace/v1/bundles',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const request = require('node-fetch');

const headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
fetch('https://{marketplaceURL}/api/marketplace/v1/bundles',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

r = requests.get('https://{marketplaceURL}/api/marketplace/v1/bundles', params={

}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json'
}

result = RestClient.get 'https://{marketplaceURL}/api/marketplace/v1/bundles',
  params: {
  }, headers: headers

p JSON.parse(result)

URL obj = new URL("https://{marketplaceURL}/api/marketplace/v1/bundles");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

Example response

[
  {
    "addon": false,
    "billingFrequency": "MONTHLY",
    "blurb": "Bundle Blurb",
    "bundleUrls": [],
    "bundledProducts": [],
    "buyable": false,
    "collectLeads": false,
    "description": "Bundle Description",
    "developerName": "Appdirect",
    "discountDetails": null,
    "downloadFileSize": null,
    "featured": false,
    "featuredSliderPosition": null,
    "free": false,
    "freeTrialOrEditionPresent": true,
    "hasLyncToPhone": false,
    "hidePricings": false,
    "href": "http://localhost/api/marketplace/v1/bundles/257",
    "iconUrl": null,
    "id": 257,
    "lastModified": 1461792752644,
    "name": "MockApp3891706169852983393",
    "numRatings": null,
    "overview": null,
    "overviewImageUrl": null,
    "popular": false,
    "popularity": null,
    "productType": "BUNDLE",
    "profileLogoUrl": null,
    "publishedOn": 1461792752534,
    "rating": null,
    "referable": false,
    "sortRank": 5,
    "staffPick": false,
    "staffPickSliderPosition": null,
    "startingPrice": "$0.00/User/Mo",
    "supportedLanguages": [
      "en"
    ],
    "tags": [],
    "url": "http://localhost/apps/257",
    "uuid": "df44129f-3c03-40eb-a112-b04e455b8c3f",
    "vendorName": "Appdirect"
  }
]

GET/marketplace/v1/bundles

List all bundles This call lists all bundles on the marketplace.

Responses

Status Meaning Description Definition
200 OK List of product bundle. array of BundleListing

Checkout Items

Get item details

Example request

curl -X POST https://{marketplaceURL}/api/v3/checkout/items \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \

POST https://{marketplaceURL}/api/v3/checkout/items HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json

var headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
$.ajax({
  url: 'https://{marketplaceURL}/api/v3/checkout/items',
  method: 'post',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const request = require('node-fetch');
const inputBody = '{
  "bundleIds": [
    "300",
    "400"
  ],
  "buyerCompanyId": "6e5a0af2-e6be-4a86-a1b0-ffabcc2c6324",
  "buyerUserId": "55144410-a14a-43a1-9e0a-062c6cf31770",
  "currency": "USD",
  "ownerCompanyId": "b0410709-8333-43e2-84d6-3228f6b9998b",
  "ownerUserId": "19d7343b-b8ab-464a-a893-8b107d77137d",
  "pricingPlanIds": [
    "a12bcf2e-d27e-4808-aae0-6099cc828664",
    "3e0a22d3-dafb-4b3d-a487-7f4e7a94b32a"
  ],
  "productIds": [
    "100",
    "200"
  ],
  "subscriptionIds": [
    "915a6558-5a1b-446a-8ec6-334cc60e3d37",
    "8569269e-4c7f-4238-807c-513c718be135"
  ]
}';
const headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
fetch('https://{marketplaceURL}/api/v3/checkout/items',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

r = requests.post('https://{marketplaceURL}/api/v3/checkout/items', params={

}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json'
}

result = RestClient.post 'https://{marketplaceURL}/api/v3/checkout/items',
  params: {
  }, headers: headers

p JSON.parse(result)

URL obj = new URL("https://{marketplaceURL}/api/v3/checkout/items");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

Request body

{
  "bundleIds": [
    "300",
    "400"
  ],
  "buyerCompanyId": "6e5a0af2-e6be-4a86-a1b0-ffabcc2c6324",
  "buyerUserId": "55144410-a14a-43a1-9e0a-062c6cf31770",
  "currency": "USD",
  "ownerCompanyId": "b0410709-8333-43e2-84d6-3228f6b9998b",
  "ownerUserId": "19d7343b-b8ab-464a-a893-8b107d77137d",
  "pricingPlanIds": [
    "a12bcf2e-d27e-4808-aae0-6099cc828664",
    "3e0a22d3-dafb-4b3d-a487-7f4e7a94b32a"
  ],
  "productIds": [
    "100",
    "200"
  ],
  "subscriptionIds": [
    "915a6558-5a1b-446a-8ec6-334cc60e3d37",
    "8569269e-4c7f-4238-807c-513c718be135"
  ]
}

Example response

{
  "branding": {
    "desc": "Sample Application description",
    "href": "https://marketplace.appdirect.com/api/marketplace/v1/products/1111",
    "iconUrl": "https://appdirect.cloudfront.net/app_resources/1111/thumbs_64/img1111.png",
    "name": "Sample Application",
    "storefrontUrl": "https://marketplace.appdirect.com/apps/1111",
    "vendor": "AppDirect"
  },
  "editions": [
    {
      "freeTrialTerms": {
        "freeTrialDuration": 1,
        "freeTrialDurationPeriod": "MONTH",
        "freeTrialGracePeriod": 10
      },
      "id": "45b79e06-1ac6-11e5-90d8-ca7e16f380a7",
      "name": "Sample Edition",
      "pricingPlans": [
        {
          "currency": "USD",
          "id": "b794c2a1-69a7-40bc-9bf7-75a2f945a5fc",
          "pricingPeriod": "MONTHLY",
          "pricingSources": [
            {
              "pricingDefinitions": [
                {
                  "allowsMeteredUsage": true,
                  "costType": "RECURRING_PER_UNIT",
                  "costTypeCategory": "RECURRING",
                  "displaysPricePerIncrement": true,
                  "increment": 5,
                  "priceRanges": [
                    {
                      "max": 5,
                      "min": 0,
                      "salePrice": "4.0000000000",
                      "wholeSalePrice": null
                    }
                  ],
                  "pricingStrategy": "UNIT",
                  "unit": "USER",
                  "unitAllowsDecimals": false
                }
              ],
              "source": "BASE_CATALOG"
            },
            {
              "pricingDefinitions": [
                {
                  "costType": "ONE_TIME_FLAT",
                  "costTypeCategory": "ONE_TIME",
                  "pricingStrategy": "FLAT",
                  "salePrice": "3.0000000000",
                  "wholeSalePrice": null
                }
              ],
              "source": "CHANNEL_CATALOG"
            }
          ]
        }
      ],
      "revenueModel": "RECURRING"
    }
  ],
  "id": "098357e5-7a88-45fe-82d3-843bfd6bcbd1",
  "stacked": false,
  "type": "PRODUCT"
}

POST/v3/checkout/items

Retrieves product details such as branding, pricing, and so on.

Body Parameters

CICheckoutItemsDetailsRequest object:

Property Type Description
bundleIds array of string

List of bundle IDs to retrieve details for. (Currently not supported)

buyerCompanyId string

The buyer's company's ID. In assisted sales or reseller scenarios, the buyer's company can be different than the owner's company.

buyerUserId string

The buyer user ID. The buyer is the person who is making the purchase. In assisted sales or reseller scenarios, the buyer can be different than the owner.

currency string

Three-letter code, such as USD, that determines the currency in which to display item pricing details.

ownerCompanyId string

The owner's company's ID.

ownerUserId string

The owner user ID. The owner owns the product after the purchase is complete.

pricingPlanIds array of string

List of pricing plan IDs to retrieve details for.

productIds array of string

List of product IDs to retrieve details for.

subscriptionIds array of string

List of subscription IDs to retrieve details for. (Currently not supported)

Responses

Status Meaning Description Definition
200 OK Item details retrieved successfully CICheckoutItemDetails

Companies

Create new company

Example request

curl -X POST https://{marketplaceURL}/api/account/v2/companies \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \

POST https://{marketplaceURL}/api/account/v2/companies HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json

var headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
$.ajax({
  url: 'https://{marketplaceURL}/api/account/v2/companies',
  method: 'post',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const request = require('node-fetch');
const inputBody = '{
  "allOf": [
    {
      "description": "Resource links",
      "title": "ResourceSupport",
      "properties": {
        "links": {
          "description": "Resource links",
          "type": "array",
          "items": {
            "title": "Link",
            "properties": {
              "href": {
                "type": "string"
              },
              "rel": {
                "type": "string"
              }
            },
            "example": {
              "href": "...",
              "rel": "..."
            },
            "nullable": true,
            "type": "object"
          }
        }
      },
      "example": {
        "links": [
          {
            "href": "...",
            "rel": "..."
          },
          {
            "href": "...",
            "rel": "..."
          }
        ]
      },
      "nullable": true,
      "type": "object"
    },
    {
      "description": "Payload for \"create company\" requests",
      "type": "object",
      "title": "CreateCompanyV2Request",
      "properties": {
        "address": {
          "allOf": [
            {
              "type": "object",
              "title": "CompanyAddress",
              "required": [
                "country",
                "city",
                "zip",
                "street1"
              ],
              "properties": {
                "city": {
                  "type": "string",
                  "maxLength": 255,
                  "minLength": 0
                },
                "country": {
                  "type": "string",
                  "maxLength": 255,
                  "minLength": 0
                },
                "state": {
                  "type": "string",
                  "maxLength": 255,
                  "minLength": 0
                },
                "street1": {
                  "type": "string",
                  "maxLength": 255,
                  "minLength": 0
                },
                "street2": {
                  "type": "string",
                  "maxLength": 255,
                  "minLength": 0
                },
                "zip": {
                  "type": "string",
                  "maxLength": 255,
                  "minLength": 0
                }
              },
              "example": {
                "city": "...",
                "country": "...",
                "state": "...",
                "street1": "...",
                "street2": "...",
                "zip": "..."
              }
            },
            {
              "description": "Company address"
            }
          ]
        },
        "channelAdmin": {
          "description": "Indicates whether the company has Channel Admin access",
          "type": "boolean"
        },
        "companySize": {
          "allOf": [
            {
              "description": "Company size types",
              "type": "string",
              "title": "CompanySizeType",
              "enum": [
                "SMALL",
                "MEDIUM",
                "ENTERPRISE"
              ]
            },
            {
              "description": "Company size"
            }
          ]
        },
        "countryCode": {
          "description": "Company country code defined by ISO ALPHA-2 standard",
          "type": "string"
        },
        "customAttributes": {
          "description": "Custom attributes",
          "type": "array",
          "items": {
            "description": "Custom attributes",
            "type": "object",
            "title": "CustomAttributeAccountV2",
            "properties": {
              "attributeType": {
                "allOf": [
                  {
                    "type": "string",
                    "title": "AttributeType",
                    "enum": []
                  },
                  {
                    "description": "Attribute type"
                  }
                ]
              },
              "hint": {
                "description": "Localized hint",
                "type": "string"
              },
              "label": {
                "description": "Localized label",
                "type": "string"
              },
              "name": {
                "description": "Name",
                "type": "string"
              },
              "value": {
                "description": "Value",
                "type": "string"
              },
              "valueKeys": {
                "description": "Value keys",
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            },
            "example": {
              "attributeType": "MULTISELECT",
              "hint": "",
              "label": "Label Names",
              "name": "Company Details",
              "valueKeys": [
                "great option"
              ]
            }
          }
        },
        "defaultRole": {
          "description": "The default role newly created users receive",
          "type": "string"
        },
        "emailAddress": {
          "description": "Company email address",
          "type": "string"
        },
        "externalId": {
          "description": "Company external ID",
          "type": "string"
        },
        "firstUser": {
          "allOf": [
            {
              "allOf": [
                {
                  "description": "Resource links",
                  "title": "ResourceSupport",
                  "properties": {
                    "links": {
                      "description": "Resource links",
                      "type": "array",
                      "items": {
                        "title": "Link",
                        "properties": {
                          "href": {
                            "type": "string"
                          },
                          "rel": {
                            "type": "string"
                          }
                        },
                        "example": {
                          "href": "...",
                          "rel": "..."
                        },
                        "nullable": true,
                        "type": "object"
                      }
                    }
                  },
                  "example": {
                    "links": [
                      {
                        "href": "...",
                        "rel": "..."
                      },
                      {
                        "href": "...",
                        "rel": "..."
                      }
                    ]
                  },
                  "nullable": true,
                  "type": "object"
                },
                {
                  "description": "Represents a user membership to a company since a user can be a member of multiple companies",
                  "type": "object",
                  "title": "UserCompanyMembershipAccountV2",
                  "properties": {
                    "company": {},
                    "enabled": {},
                    "lastUsed": {},
                    "metadata": {},
                    "mosiUser": {},
                    "position": {},
                    "roles": {},
                    "user": {}
                  },
                  "example": {
                    "content": [],
                    "links": []
                  }
                }
              ]
            },
            {
              "description": "First user of the newly created company"
            }
          ]
        },
        "industry": {
          "description": "Company industry sector",
          "type": "string"
        },
        "name": {
          "description": "Company name",
          "nullable": true,
          "type": "string"
        },
        "phoneNumber": {
          "description": "Company phone number",
          "nullable": true,
          "type": "string"
        },
        "picture": {
          "description": "Company profile picture URL",
          "nullable": true,
          "type": "string"
        },
        "reseller": {
          "description": "Indicates whether the company has Reseller access",
          "type": "boolean"
        },
        "salesAgent": {
          "allOf": [
            {
              "title": "Link",
              "properties": {
                "href": {
                  "type": "string"
                },
                "rel": {
                  "type": "string"
                }
              },
              "example": {
                "href": "...",
                "rel": "..."
              },
              "nullable": true,
              "type": "object"
            },
            {
              "description": "Sales agent link"
            }
          ]
        },
        "vendor": {
          "description": "Indicates whether the company has Vendor access",
          "type": "boolean"
        },
        "website": {
          "description": "Company website URL",
          "type": "string"
        }
      },
      "example": {
        "customAttributes": [
          {
            "attributeType": "TEXT",
            "hint": "US West, US Central, or US East",
            "label": "Geographic Region",
            "name": "Geographic Region",
            "value": "US"
          },
          {
            "attributeType": "MULTISELECT",
            "hint": "",
            "label": "Label Names",
            "name": "Company Details",
            "valueKeys": [
              "great option"
            ]
          }
        ],
        "defaultRole": "USER",
        "firstUser": {
          "activated": false,
          "currency": null,
          "email": "john.simpson@company5833088198.com",
          "firstName": "John",
          "lastName": "Simpson",
          "ldapId": "1",
          "links": [
            {
              "href": "http://appdirect/api/account/v2/users/d6e7c0d2-e86a-4ea2-a6c9-c1bbeb2410f0",
              "rel": "self"
            },
            {
              "href": "http://appdirect/api/account/v2/users/d6e7c0d2-e86a-4ea2-a6c9-c1bbeb2410f0/memberships",
              "rel": "memberships"
            }
          ],
          "picture": "http://appdirect/profilePics/img2147417701652580695.png?184b58e358f087154d94329f9000b28a",
          "roles": [
            "ROLE_USER"
          ],
          "userName": "john.simpson",
          "uuid": "d6e7c0d2-e86a-4ea2-a6c9-c1bbeb2410f0"
        },
        "links": [
          {
            "href": "http://appdirect/api/account/v2/companies/d689b970-f3f9-42a6-a974-90e2bdadf860",
            "rel": "self"
          },
          {
            "href": "http://appdirect/api/account/v2/companies/d689b970-f3f9-42a6-a974-90e2bdadf860/memberships",
            "rel": "memberships"
          }
        ],
        "name": "Company 7078259907",
        "phoneNumber": "9259221234",
        "picture": "http://localhost:8080/profilePics/http://cdn/company.png",
        "reseller": false,
        "vendor": false
      }
    }
  ]
}';
const headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
fetch('https://{marketplaceURL}/api/account/v2/companies',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

r = requests.post('https://{marketplaceURL}/api/account/v2/companies', params={

}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json'
}

result = RestClient.post 'https://{marketplaceURL}/api/account/v2/companies',
  params: {
  }, headers: headers

p JSON.parse(result)

URL obj = new URL("https://{marketplaceURL}/api/account/v2/companies");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

Request body

{
  "customAttributes": [
    {
      "attributeType": "TEXT",
      "hint": "US West, US Central, or US East",
      "label": "Geographic Region",
      "name": "Geographic Region",
      "value": "US"
    },
    {
      "attributeType": "MULTISELECT",
      "hint": "",
      "label": "Label Names",
      "name": "Company Details",
      "valueKeys": [
        "great option"
      ]
    }
  ],
  "defaultRole": "USER",
  "firstUser": {
    "activated": false,
    "currency": null,
    "email": "john.simpson@company5833088198.com",
    "firstName": "John",
    "lastName": "Simpson",
    "ldapId": "1",
    "links": [
      {
        "href": "http://appdirect/api/account/v2/users/d6e7c0d2-e86a-4ea2-a6c9-c1bbeb2410f0",
        "rel": "self"
      },
      {
        "href": "http://appdirect/api/account/v2/users/d6e7c0d2-e86a-4ea2-a6c9-c1bbeb2410f0/memberships",
        "rel": "memberships"
      }
    ],
    "picture": "http://appdirect/profilePics/img2147417701652580695.png?184b58e358f087154d94329f9000b28a",
    "roles": [
      "ROLE_USER"
    ],
    "userName": "john.simpson",
    "uuid": "d6e7c0d2-e86a-4ea2-a6c9-c1bbeb2410f0"
  },
  "links": [
    {
      "href": "http://appdirect/api/account/v2/companies/d689b970-f3f9-42a6-a974-90e2bdadf860",
      "rel": "self"
    },
    {
      "href": "http://appdirect/api/account/v2/companies/d689b970-f3f9-42a6-a974-90e2bdadf860/memberships",
      "rel": "memberships"
    }
  ],
  "name": "Company 7078259907",
  "phoneNumber": "9259221234",
  "picture": "http://localhost:8080/profilePics/http://cdn/company.png",
  "reseller": false,
  "vendor": false
}

Example response

{
  "customAttributes": [
    {
      "attributeType": "TEXT",
      "hint": "US West, US Central, or US East",
      "label": "Geographic Region",
      "name": "Geographic Region",
      "value": "US"
    },
    {
      "attributeType": "MULTISELECT",
      "hint": "",
      "label": "Label Names",
      "name": "Company Details",
      "valueKeys": [
        "great option"
      ]
    }
  ],
  "defaultRole": "USER",
  "enabled": true,
  "firstUser": {
    "email": "john.simpson@company5833088198.com",
    "firstName": "John",
    "lastName": "Simpson",
    "roles": [
      "ROLE_USER"
    ]
  },
  "links": [
    {
      "href": "http://appdirect/api/account/v2/companies/d689b970-f3f9-42a6-a974-90e2bdadf860",
      "rel": "self"
    },
    {
      "href": "http://appdirect/api/account/v2/companies/d689b970-f3f9-42a6-a974-90e2bdadf860/memberships",
      "rel": "memberships"
    }
  ],
  "name": "Company 7078259907",
  "phoneNumber": "9259221234",
  "picture": "http://localhost:8080/profilePics/http://cdn/company.png",
  "reseller": false,
  "uuid": "d689b970-f3f9-42a6-a974-90e2bdadf860",
  "vendor": false
}

POST/account/v2/companies

Create a new marketplace company

Required Scope and Authorization Rules

Scope Rule
ROLE_CHANNEL_ADMIN Allows access as a Marketplace Manager for the marketplace.
ROLE_CHANNEL_SUPPORT Allows access as a Customer Support agent for the marketplace.
ROLE_CORPORATE_ADMIN Allows access as a Network Manager for the marketplace.
ROLE_PARTNER Allows access to read and write all marketplace data.
ROLE_SALES_SUPPORT Allows access as a Sales Support agent for the marketplace.

Body Parameters

New marketplace company

CreateCompanyV2Request object:

Property Type Description
address CompanyAddress

Company address

channelAdmin boolean

Indicates whether the company has Channel Admin access

companySize CompanySizeType

Company size

countryCode string

Company country code defined by ISO ALPHA-2 standard

customAttributes array of CustomAttributeAccountV2

Custom attributes

defaultRole string

The default role newly created users receive

emailAddress string

Company email address

externalId string

Company external ID

firstUser UserCompanyMembershipAccountV2

First user of the newly created company

industry string

Company industry sector

links array of Link

Resource links

name string

Company name

phoneNumber string

Company phone number

picture string

Company profile picture URL

reseller boolean

Indicates whether the company has Reseller access

salesAgent Link

Sales agent link

vendor boolean

Indicates whether the company has Vendor access

website string

Company website URL

Responses

Status Meaning Description Definition
201 Created Created CreateCompanyV2Response
401 Unauthorized Unauthorized

List all companies

Example request

curl -X GET https://{marketplaceURL}/api/account/v2/companies \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \

GET https://{marketplaceURL}/api/account/v2/companies HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json

var headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
$.ajax({
  url: 'https://{marketplaceURL}/api/account/v2/companies',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const request = require('node-fetch');

const headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
fetch('https://{marketplaceURL}/api/account/v2/companies',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

r = requests.get('https://{marketplaceURL}/api/account/v2/companies', params={

}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json'
}

result = RestClient.get 'https://{marketplaceURL}/api/account/v2/companies',
  params: {
  }, headers: headers

p JSON.parse(result)

URL obj = new URL("https://{marketplaceURL}/api/account/v2/companies");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

Example response

{
  "content": [
    {
      "address": {
        "city": "Calgary",
        "country": "Canada",
        "state": "AB",
        "street1": "Harris Place NW",
        "street2": "907",
        "zip": "T3B2V4"
      },
      "channelAdmin": true,
      "companySize": "SMALL",
      "countryCode": "US",
      "creationDate": 1457416568000,
      "customAttributes": [],
      "defaultRole": "USER",
      "emailAddress": "john.smith@example.com",
      "enabled": true,
      "externalId": "37ac4899-0847-41ac-8e6b-adfde0363b37",
      "industry": "Finance",
      "links": [
        {
          "href": "http://marketplace.local:8080/api/account/v2/companies/a3f385be-e10b-444e-99d1-95cd7d4c1f5a",
          "rel": "self"
        },
        {
          "href": "http://marketplace.local:8080/api/account/v2/companies/a3f385be-e10b-444e-99d1-95cd7d4c1f5a/memberships",
          "rel": "memberships"
        }
      ],
      "name": "John & Co",
      "phoneNumber": "888-888-8888",
      "picture": null,
      "reseller": false,
      "salesAgent": {
        "href": "http://marketplace.local:8080/api/account/v2/users/a3f385be-e10b-444e-99d1-95cd7d4c1f5a",
        "rel": "salesRepLink"
      },
      "salesSupport": false,
      "uuid": "a3f385be-e10b-444e-99d1-95cd7d4c1f5a",
      "vendor": true,
      "website": "example.com"
    },
    {
      "address": {
        "city": "Calgary",
        "country": "Canada",
        "state": "AB",
        "street1": "Harris Place NW",
        "street2": "907",
        "zip": "T3B2V4"
      },
      "channelAdmin": true,
      "companySize": "SMALL",
      "countryCode": "US",
      "creationDate": 1521573411000,
      "customAttributes": [
        {
          "attributeType": "TEXT",
          "hint": "",
          "label": "C1593404",
          "name": "C1593404",
          "value": "t1"
        }
      ],
      "defaultRole": "USER",
      "emailAddress": "john.smith@example.com",
      "enabled": false,
      "externalId": "b34974b2-f5d6-4326-9859-5247dc42ee60",
      "industry": "Finance",
      "links": [
        {
          "href": "http://marketplace.local:8080/api/account/v2/companies/42f4e0cd-0614-4695-87ba-fcaee49fb995",
          "rel": "self"
        },
        {
          "href": "http://marketplace.local:8080/api/account/v2/companies/42f4e0cd-0614-4695-87ba-fcaee49fb995/memberships",
          "rel": "memberships"
        }
      ],
      "name": "John & Co",
      "phoneNumber": "888-888-8888",
      "picture": null,
      "reseller": false,
      "salesAgent": {
        "href": "http://marketplace.local:8080/api/account/v2/users/a3f385be-e10b-444e-99d1-95cd7d4c1f5a",
        "rel": "salesRepLink"
      },
      "salesSupport": false,
      "uuid": "42f4e0cd-0614-4695-87ba-fcaee49fb995",
      "vendor": true,
      "website": "example.com"
    }
  ],
  "links": [],
  "page": {
    "number": 0,
    "size": 50,
    "totalElements": 2,
    "totalPages": 1
  }
}

GET/account/v2/companies

Retrieve all marketplace companies.

Required Scope and Authorization Rules

Scope Rule
ROLE_CHANNEL_ADMIN Allows access as a Marketplace Manager for the marketplace.
ROLE_CHANNEL_SUPPORT Allows access as a Customer Support agent for the marketplace.
ROLE_CORPORATE_ADMIN Allows access as a Network Manager for the marketplace.
ROLE_PARTNER_READ Allows access to read all marketplace data.
ROLE_SALES_SUPPORT Allows access as a Sales Support agent for the marketplace.

Parameters

Parameter Type Data Type Default Description
name query string Company name
page query integer 0 Zero-based page index
size query integer 50 The number of search results to return per page
sortField query string of enum:
NAME
NAME The property to sort by
sortOrder query string of enum:
ASC
DESC
DESC Ordering type

Responses

Status Meaning Description Definition
200 OK Success PagedCompanyAccountV2
401 Unauthorized Unauthorized

Read activities

Example request

curl -X GET https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/activities \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \

GET https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/activities HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json

var headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
$.ajax({
  url: 'https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/activities',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const request = require('node-fetch');

const headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
fetch('https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/activities',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

r = requests.get('https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/activities', params={

}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json'
}

result = RestClient.get 'https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/activities',
  params: {
  }, headers: headers

p JSON.parse(result)

URL obj = new URL("https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/activities");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

Example response

{
  "content": [
    {
      "actor": {
        "activated": false,
        "deleted": false,
        "email": "c2801919@appdirect.com",
        "externalId": null,
        "id": 1344,
        "name": "C2801919_first last",
        "personalInfoMasked": false,
        "profileLinkMasked": false,
        "roleChanges": null,
        "type": "USER",
        "userRemovedFromCompanyObject": false,
        "userRemovedFromCompanyTarget": false,
        "uuid": "966216bb-bb4e-4766-8849-fd72eead20ce"
      },
      "context": {
        "description": "Documentation Center 283",
        "header": "Documentation Center 283",
        "imageUrl": "https://d33na3ni6eqf5j.cloudfront.net/importable_app_resources/81858cea-627f-45ee-8906-67d5a23dd3bf/list.png?b5960593b97c0fdd95bc9b81c08e70bb"
      },
      "links": [],
      "object": {
        "companyLinkMasked": false,
        "externalId": null,
        "id": 26,
        "name": "Company 6032459369",
        "type": "COMPANY",
        "uuid": "222cf5ff-7795-4ece-b612-83ef6b72bb30"
      },
      "origin": "MARKETPLACE",
      "subject": {
        "activated": true,
        "deleted": false,
        "email": "susan.doe@company5087848592.com",
        "externalId": null,
        "id": 30,
        "name": "Susan Doe",
        "personalInfoMasked": false,
        "profileLinkMasked": false,
        "type": "USER",
        "userRemovedFromCompanyObject": false,
        "userRemovedFromCompanyTarget": false,
        "uuid": "8487f55b-05be-4c0e-97d8-021e5ca4008b"
      },
      "target": {
        "companyLinkMasked": false,
        "externalId": null,
        "id": 194379,
        "name": "Matts Company",
        "type": "COMPANY",
        "uuid": "a0504b87-f21f-40fe-9de1-e8479776a26f"
      },
      "timestamp": [
        2016,
        12,
        2,
        17,
        25,
        56,
        414
      ],
      "verb": "COMPANY_ACTIVATED"
    },
    {
      "actor": {
        "activated": false,
        "deleted": false,
        "email": "c3945627346@appdirect.com",
        "externalId": null,
        "id": 1434,
        "name": "Adam Smith",
        "personalInfoMasked": false,
        "profileLinkMasked": false,
        "roleChanges": null,
        "type": "USER",
        "userRemovedFromCompanyObject": false,
        "userRemovedFromCompanyTarget": false,
        "uuid": "ac6216bb-bb4e-4766-8849-fd72eead20ce"
      },
      "context": {
        "description": "Documentation Center 283",
        "header": "Documentation Center 283",
        "imageUrl": "https://d33na3ni6eqf5j.cloudfront.net/importable_app_resources/81858cea-627f-45ee-8906-67d5a23dd3bf/list.png?b5960593b97c0fdd95bc9b81c08e70bb"
      },
      "links": [],
      "object": {
        "companyLinkMasked": false,
        "externalId": null,
        "id": 26,
        "name": "Company 6032459369",
        "type": "COMPANY",
        "uuid": "222cf5ff-7795-4ece-b612-83ef6b72bb30"
      },
      "origin": null,
      "subject": {
        "activated": true,
        "deleted": false,
        "email": "susan.doe@company5087848592.com",
        "externalId": null,
        "id": 30,
        "name": "Susan Doe",
        "personalInfoMasked": false,
        "profileLinkMasked": false,
        "type": "USER",
        "userRemovedFromCompanyObject": false,
        "userRemovedFromCompanyTarget": false,
        "uuid": "8487f55b-05be-4c0e-97d8-021e5ca4008b"
      },
      "target": {
        "companyLinkMasked": false,
        "externalId": null,
        "id": 149379,
        "name": "Global Company",
        "type": "COMPANY",
        "uuid": "70904b87-a2bf-40fe-9de1-e8479776a26f"
      },
      "timestamp": [
        2016,
        12,
        2,
        17,
        25,
        56,
        401
      ],
      "verb": "USER_JOINED"
    }
  ],
  "links": [],
  "page": {
    "number": 0,
    "size": 2,
    "totalElements": 2,
    "totalPages": 1
  }
}

GET/account/v2/companies/{companyUuid}/activities

Retrieve company or user activities.

The displayType parameter dictates whether activities for the given user or activities for the whole company are returned.

Required Scope and Authorization Rules

Scope Rule
ROLE_CHANNEL_ADMIN Allows access as a Marketplace Manager for the marketplace.
ROLE_CHANNEL_SUPPORT Allows access as a Customer Support agent for the marketplace.
ROLE_CORPORATE_ADMIN Allows access as a Network Manager for the marketplace.
ROLE_PARTNER_READ Allows access to read all marketplace data.
ROLE_RESELLER Allows access as a Reseller for the company.
ROLE_SALES_SUPPORT Allows access as a Sales Support agent for the marketplace.
ROLE_USER Allows access as an end user in the company.

Parameters

Parameter Type Data Type Default Description
*companyUuid path string Unique identifier of company in the API request
displayType query string of enum:
EVERYONE
ONLY_ME
ONLY_ME Scope
page query integer 0 Zero-based page index
size query integer 12 The size of the page to be returned

Responses

Status Meaning Description Definition
200 OK Success PagedActivityAccountV2
401 Unauthorized Unauthorized
404 Not Found Company not found

Read a company

Example request

curl -X GET https://{marketplaceURL}/api/account/v2/companies/{companyUuid} \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \

GET https://{marketplaceURL}/api/account/v2/companies/{companyUuid} HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json

var headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
$.ajax({
  url: 'https://{marketplaceURL}/api/account/v2/companies/{companyUuid}',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const request = require('node-fetch');

const headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
fetch('https://{marketplaceURL}/api/account/v2/companies/{companyUuid}',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

r = requests.get('https://{marketplaceURL}/api/account/v2/companies/{companyUuid}', params={

}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json'
}

result = RestClient.get 'https://{marketplaceURL}/api/account/v2/companies/{companyUuid}',
  params: {
  }, headers: headers

p JSON.parse(result)

URL obj = new URL("https://{marketplaceURL}/api/account/v2/companies/{companyUuid}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

Example response

{
  "address": {
    "city": "Calgary",
    "country": "Canada",
    "state": "AB",
    "street1": "Stephen Ave",
    "street2": "12",
    "zip": "T22V34"
  },
  "channelAdmin": true,
  "companySize": "SMALL",
  "countryCode": "US",
  "creationDate": 1457416568000,
  "customAttributes": [
    {
      "attributeType": "TEXT",
      "hint": "US West, US Central, or US East",
      "label": "Geographic Region",
      "name": "Geographic Region",
      "value": "US"
    },
    {
      "attributeType": "MULTISELECT",
      "hint": "",
      "label": "Label Names",
      "name": "Company Details",
      "valueKeys": [
        "great option"
      ]
    }
  ],
  "defaultRole": "USER",
  "emailAddress": "john.smith@example.com",
  "enabled": true,
  "externalId": "37ac4899-0847-41ac-8e6b-adfde0363b37",
  "industry": "Finance",
  "links": [
    {
      "href": "http://appdirect/api/account/v2/companies/d689b970-f3f9-42a6-a974-90e2bdadf860",
      "rel": "self"
    },
    {
      "href": "http://appdirect/api/account/v2/companies/d689b970-f3f9-42a6-a974-90e2bdadf860/memberships",
      "rel": "memberships"
    }
  ],
  "name": "Company 7078259907",
  "phoneNumber": "888-888-8888",
  "picture": "http://localhost:8080/profilePics/http://cdn/company.png",
  "reseller": false,
  "salesAgent": {
    "href": "http://marketplace.local:8080/api/account/v2/users/a3f385be-e10b-444e-99d1-95cd7d4c1f5a",
    "rel": "salesRepLink"
  },
  "salesSupport": false,
  "uuid": "d689b970-f3f9-42a6-a974-90e2bdadf860",
  "vendor": true,
  "website": "example.com"
}

GET/account/v2/companies/{companyUuid}

Retrieve a marketplace company by ID or external ID. If you use the ID, you can omit a prefix or use 'id:' as the prefix. If you use the external ID, you must always specify the 'externalId:' prefix.

Required Scope and Authorization Rules

Scope Rule
ROLE_CHANNEL_ADMIN Allows access as a Marketplace Manager for the marketplace.
ROLE_CHANNEL_SUPPORT Allows access as a Customer Support agent for the marketplace.
ROLE_CORPORATE_ADMIN Allows access as a Network Manager for the marketplace.
ROLE_PARTNER_READ Allows access to read all marketplace data.
ROLE_RESELLER Allows access as a Reseller for the company.
ROLE_SALES_SUPPORT Allows access as a Sales Support agent for the marketplace.
ROLE_USER Allows access as an end user in the company.

Parameters

Parameter Type Data Type Default Description
*companyUuid path string Unique identifier (ID or external ID) of the company in the API request

Responses

Status Meaning Description Definition
200 OK Success CompanyAccountV2
401 Unauthorized Unauthorized
404 Not Found Company not found

Update company

Example request

curl -X PUT https://{marketplaceURL}/api/account/v2/companies/{companyUuid} \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \

PUT https://{marketplaceURL}/api/account/v2/companies/{companyUuid} HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json

var headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
$.ajax({
  url: 'https://{marketplaceURL}/api/account/v2/companies/{companyUuid}',
  method: 'put',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const request = require('node-fetch');
const inputBody = '{
  "allOf": [
    {
      "description": "Resource links",
      "title": "ResourceSupport",
      "properties": {
        "links": {
          "description": "Resource links",
          "type": "array",
          "items": {
            "title": "Link",
            "properties": {
              "href": {
                "type": "string"
              },
              "rel": {
                "type": "string"
              }
            },
            "example": {
              "href": "...",
              "rel": "..."
            },
            "nullable": true,
            "type": "object"
          }
        }
      },
      "example": {
        "links": [
          {
            "href": "...",
            "rel": "..."
          },
          {
            "href": "...",
            "rel": "..."
          }
        ]
      },
      "nullable": true,
      "type": "object"
    },
    {
      "description": "Payload for \"update company\" request",
      "type": "object",
      "title": "CompanyAccountV2Request",
      "properties": {
        "address": {
          "allOf": [
            {
              "type": "object",
              "title": "CompanyAddress",
              "required": [
                "country",
                "city",
                "zip",
                "street1"
              ],
              "properties": {
                "city": {
                  "type": "string",
                  "maxLength": 255,
                  "minLength": 0
                },
                "country": {
                  "type": "string",
                  "maxLength": 255,
                  "minLength": 0
                },
                "state": {
                  "type": "string",
                  "maxLength": 255,
                  "minLength": 0
                },
                "street1": {
                  "type": "string",
                  "maxLength": 255,
                  "minLength": 0
                },
                "street2": {
                  "type": "string",
                  "maxLength": 255,
                  "minLength": 0
                },
                "zip": {
                  "type": "string",
                  "maxLength": 255,
                  "minLength": 0
                }
              },
              "example": {
                "city": "...",
                "country": "...",
                "state": "...",
                "street1": "...",
                "street2": "...",
                "zip": "..."
              }
            },
            {
              "description": "Company address"
            }
          ]
        },
        "channelAdmin": {
          "description": "Indicates whether the company has Channel Admin access",
          "type": "boolean"
        },
        "companySize": {
          "allOf": [
            {
              "description": "Company size types",
              "type": "string",
              "title": "CompanySizeType",
              "enum": [
                "SMALL",
                "MEDIUM",
                "ENTERPRISE"
              ]
            },
            {
              "description": "Company size"
            }
          ]
        },
        "countryCode": {
          "description": "Company country code defined by ISO ALPHA-2 standard",
          "type": "string"
        },
        "customAttributes": {
          "description": "Custom attributes",
          "type": "array",
          "items": {
            "description": "Custom attributes",
            "type": "object",
            "title": "CustomAttributeAccountV2",
            "properties": {
              "attributeType": {
                "allOf": [
                  {
                    "type": "string",
                    "title": "AttributeType",
                    "enum": []
                  },
                  {
                    "description": "Attribute type"
                  }
                ]
              },
              "hint": {
                "description": "Localized hint",
                "type": "string"
              },
              "label": {
                "description": "Localized label",
                "type": "string"
              },
              "name": {
                "description": "Name",
                "type": "string"
              },
              "value": {
                "description": "Value",
                "type": "string"
              },
              "valueKeys": {
                "description": "Value keys",
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            },
            "example": {
              "attributeType": "MULTISELECT",
              "hint": "",
              "label": "Label Names",
              "name": "Company Details",
              "valueKeys": [
                "great option"
              ]
            }
          }
        },
        "defaultRole": {
          "description": "The default role newly created users receive",
          "type": "string"
        },
        "emailAddress": {
          "description": "Company email address",
          "type": "string"
        },
        "enabled": {
          "description": "Indicates whether company is enabled",
          "type": "boolean"
        },
        "externalId": {
          "description": "Company external ID",
          "type": "string"
        },
        "industry": {
          "description": "Company industry sector",
          "type": "string"
        },
        "name": {
          "description": "Company name",
          "nullable": true,
          "type": "string"
        },
        "phoneNumber": {
          "description": "Company phone number",
          "nullable": true,
          "type": "string"
        },
        "picture": {
          "description": "Company profile picture URL",
          "nullable": true,
          "type": "string"
        },
        "reseller": {
          "description": "Indicates whether the company has Reseller access",
          "type": "boolean"
        },
        "salesAgent": {
          "allOf": [
            {
              "title": "Link",
              "properties": {
                "href": {
                  "type": "string"
                },
                "rel": {
                  "type": "string"
                }
              },
              "example": {
                "href": "...",
                "rel": "..."
              },
              "nullable": true,
              "type": "object"
            },
            {
              "description": "Sales agent link"
            }
          ]
        },
        "vendor": {
          "description": "Indicates whether the company has Vendor access",
          "type": "boolean"
        },
        "website": {
          "description": "Company website URL",
          "type": "string"
        }
      },
      "example": {
        "address": {
          "city": "San Francisco",
          "country": "United Stated of America",
          "state": "California",
          "street1": "5th Ave",
          "street2": "#400",
          "zip": "32455"
        },
        "channelAdmin": false,
        "companySize": "SMALL",
        "countryCode": "US",
        "customAttributes": [
          {
            "attributeType": "TEXT",
            "hint": "US West, US Central, or US East",
            "label": "Geographic Region",
            "name": "Geographic Region",
            "value": "US"
          },
          {
            "attributeType": "MULTISELECT",
            "hint": "",
            "label": "Label Names",
            "name": "Company Details",
            "valueKeys": [
              "great option"
            ]
          }
        ],
        "defaultRole": "USER",
        "emailAddress": "info@company.com",
        "enabled": true,
        "externalId": "d689b970-f3f9-42a6-a974-90e2bdadf860",
        "industry": "IT",
        "links": [
          {
            "href": "http://appdirect/api/account/v2/companies/d689b970-f3f9-42a6-a974-90e2bdadf860",
            "rel": "self"
          },
          {
            "href": "http://appdirect/api/account/v2/companies/d689b970-f3f9-42a6-a974-90e2bdadf860/memberships",
            "rel": "memberships"
          }
        ],
        "name": "Company 7078259907",
        "phoneNumber": "9259221234",
        "picture": "http://localhost:8080/profilePics/http://cdn/company.png",
        "reseller": false,
        "salesAgent": {
          "href": "http://appdirect/api/account/v2/users/d689b970-f3f9-42a6-a974-90e2bdadf860",
          "rel": "sales"
        },
        "vendor": false,
        "website": "http://www.company.com"
      }
    }
  ]
}';
const headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
fetch('https://{marketplaceURL}/api/account/v2/companies/{companyUuid}',
{
  method: 'PUT',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

r = requests.put('https://{marketplaceURL}/api/account/v2/companies/{companyUuid}', params={

}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json'
}

result = RestClient.put 'https://{marketplaceURL}/api/account/v2/companies/{companyUuid}',
  params: {
  }, headers: headers

p JSON.parse(result)

URL obj = new URL("https://{marketplaceURL}/api/account/v2/companies/{companyUuid}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("PUT");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

Request body

{
  "address": {
    "city": "San Francisco",
    "country": "United Stated of America",
    "state": "California",
    "street1": "5th Ave",
    "street2": "#400",
    "zip": "32455"
  },
  "channelAdmin": false,
  "companySize": "SMALL",
  "countryCode": "US",
  "customAttributes": [
    {
      "attributeType": "TEXT",
      "hint": "US West, US Central, or US East",
      "label": "Geographic Region",
      "name": "Geographic Region",
      "value": "US"
    },
    {
      "attributeType": "MULTISELECT",
      "hint": "",
      "label": "Label Names",
      "name": "Company Details",
      "valueKeys": [
        "great option"
      ]
    }
  ],
  "defaultRole": "USER",
  "emailAddress": "info@company.com",
  "enabled": true,
  "externalId": "d689b970-f3f9-42a6-a974-90e2bdadf860",
  "industry": "IT",
  "links": [
    {
      "href": "http://appdirect/api/account/v2/companies/d689b970-f3f9-42a6-a974-90e2bdadf860",
      "rel": "self"
    },
    {
      "href": "http://appdirect/api/account/v2/companies/d689b970-f3f9-42a6-a974-90e2bdadf860/memberships",
      "rel": "memberships"
    }
  ],
  "name": "Company 7078259907",
  "phoneNumber": "9259221234",
  "picture": "http://localhost:8080/profilePics/http://cdn/company.png",
  "reseller": false,
  "salesAgent": {
    "href": "http://appdirect/api/account/v2/users/d689b970-f3f9-42a6-a974-90e2bdadf860",
    "rel": "sales"
  },
  "vendor": false,
  "website": "http://www.company.com"
}

Example response

{
  "address": {
    "city": "Calgary",
    "country": "Canada",
    "state": "AB",
    "street1": "Stephen Ave",
    "street2": "12",
    "zip": "T22V34"
  },
  "channelAdmin": true,
  "companySize": "SMALL",
  "countryCode": "US",
  "creationDate": 1457416568000,
  "customAttributes": [
    {
      "attributeType": "TEXT",
      "hint": "US West, US Central, or US East",
      "label": "Geographic Region",
      "name": "Geographic Region",
      "value": "US"
    },
    {
      "attributeType": "MULTISELECT",
      "hint": "",
      "label": "Label Names",
      "name": "Company Details",
      "valueKeys": [
        "great option"
      ]
    }
  ],
  "defaultRole": "USER",
  "emailAddress": "john.smith@example.com",
  "enabled": true,
  "externalId": "37ac4899-0847-41ac-8e6b-adfde0363b37",
  "industry": "Finance",
  "links": [
    {
      "href": "http://appdirect/api/account/v2/companies/d689b970-f3f9-42a6-a974-90e2bdadf860",
      "rel": "self"
    },
    {
      "href": "http://appdirect/api/account/v2/companies/d689b970-f3f9-42a6-a974-90e2bdadf860/memberships",
      "rel": "memberships"
    }
  ],
  "name": "Company 7078259907",
  "phoneNumber": "888-888-8888",
  "picture": "http://localhost:8080/profilePics/http://cdn/company.png",
  "reseller": false,
  "salesAgent": {
    "href": "http://marketplace.local:8080/api/account/v2/users/a3f385be-e10b-444e-99d1-95cd7d4c1f5a",
    "rel": "salesRepLink"
  },
  "salesSupport": false,
  "uuid": "d689b970-f3f9-42a6-a974-90e2bdadf860",
  "vendor": true,
  "website": "example.com"
}

PUT/account/v2/companies/{companyUuid}

Update a marketplace company.

Required Scope and Authorization Rules

Scope Rule
ROLE_CHANNEL_ADMIN Allows access as a Marketplace Manager for the marketplace.
ROLE_CHANNEL_SUPPORT Allows access as a Customer Support agent for the marketplace.
ROLE_CORPORATE_ADMIN Allows access as a Network Manager for the marketplace.
ROLE_PARTNER Allows access to read and write all marketplace data.
ROLE_SALES_SUPPORT Allows access as a Sales Support agent for the marketplace.

Parameters

Parameter Type Data Type Default Description
*companyUuid path string Company ID

Body Parameters

Updated marketplace company

CompanyAccountV2Request object:

Property Type Description
address CompanyAddress

Company address

channelAdmin boolean

Indicates whether the company has Channel Admin access

companySize CompanySizeType

Company size

countryCode string

Company country code defined by ISO ALPHA-2 standard

customAttributes array of CustomAttributeAccountV2

Custom attributes

defaultRole string

The default role newly created users receive

emailAddress string

Company email address

enabled boolean

Indicates whether company is enabled

externalId string

Company external ID

industry string

Company industry sector

links array of Link

Resource links

name string

Company name

phoneNumber string

Company phone number

picture string

Company profile picture URL

reseller boolean

Indicates whether the company has Reseller access

salesAgent Link

Sales agent link

vendor boolean

Indicates whether the company has Vendor access

website string

Company website URL

Responses

Status Meaning Description Definition
200 OK Success CompanyAccountV2
401 Unauthorized Unauthorized
404 Not Found Company not found

Create a payment instrument

Example request

curl -X POST https://{marketplaceURL}/api/billing/v1/companies/{companyId}/users/{userId}/paymentInstruments \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \

POST https://{marketplaceURL}/api/billing/v1/companies/{companyId}/users/{userId}/paymentInstruments HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json

var headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
$.ajax({
  url: 'https://{marketplaceURL}/api/billing/v1/companies/{companyId}/users/{userId}/paymentInstruments',
  method: 'post',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const request = require('node-fetch');
const inputBody = '{
  "allOf": [
    {
      "type": "object",
      "title": "PaymentInstrument",
      "properties": {
        "accountDisplay": {
          "description": "Account display text.",
          "type": "string",
          "maxLength": 255,
          "minLength": 0
        },
        "billingAddress": {
          "allOf": [
            {
              "allOf": [
                {
                  "type": "object",
                  "title": "Address",
                  "required": [
                    "country",
                    "city",
                    "zip",
                    "firstName",
                    "phone",
                    "lastName",
                    "street1"
                  ],
                  "properties": {
                    "city": {},
                    "country": {},
                    "firstName": {},
                    "lastName": {},
                    "phone": {},
                    "state": {},
                    "street1": {},
                    "street2": {},
                    "zip": {}
                  },
                  "example": {
                    "city": "...",
                    "country": "...",
                    "state": "...",
                    "street1": "...",
                    "street2": "...",
                    "zip": "..."
                  }
                },
                {
                  "type": "object",
                  "title": "BillingAddress",
                  "properties": {
                    "companyName": {},
                    "fax": {},
                    "faxExtension": {},
                    "phoneExtension": {},
                    "poBox": {},
                    "salutation": {}
                  },
                  "example": {
                    "city": "...",
                    "companyName": "...",
                    "country": "...",
                    "fax": "...",
                    "faxExtension": "...",
                    "firstName": "...",
                    "lastName": "...",
                    "phone": "...",
                    "phoneExtension": "...",
                    "poBox": "...",
                    "salutation": "...",
                    "state": "...",
                    "street1": "...",
                    "street2": "...",
                    "zip": "..."
                  }
                }
              ]
            },
            {
              "description": "Billing address."
            }
          ]
        },
        "company": {
          "allOf": [
            {
              "title": "LinkWS",
              "properties": {
                "href": {
                  "type": "string"
                },
                "id": {
                  "type": "string"
                }
              },
              "example": {
                "href": "...",
                "id": "..."
              },
              "nullable": true,
              "type": "object"
            },
            {
              "description": "Link to company information."
            }
          ]
        },
        "createdOn": {
          "description": "Payment instrument creation date.",
          "type": "number"
        },
        "creditCard": {
          "allOf": [
            {
              "type": "object",
              "title": "CreditCard",
              "required": [
                "name",
                "number",
                "securityCode",
                "expirationMonth",
                "expirationYear"
              ],
              "properties": {
                "expirationMonth": {
                  "description": "Expiration month. Required field.",
                  "type": "number",
                  "maxLength": 12,
                  "minLength": 1
                },
                "expirationYear": {
                  "description": "Expiration year. Required field.",
                  "type": "number"
                },
                "name": {
                  "description": "Name as it appears on credit card. Required field.",
                  "type": "string",
                  "maxLength": 255,
                  "minLength": 0
                },
                "number": {
                  "description": "Credit card number. Required field.",
                  "maxLength": 19,
                  "minLength": 0,
                  "nullable": true,
                  "type": "string"
                },
                "securityCode": {
                  "description": "Credit card security code. Required field.",
                  "maxLength": 4,
                  "minLength": 3,
                  "nullable": true,
                  "type": "string"
                },
                "type": {
                  "allOf": [
                    {},
                    {}
                  ]
                }
              },
              "example": {
                "expirationMonth": 12345,
                "expirationYear": 12345,
                "name": "...",
                "number": "...",
                "securityCode": "...",
                "type": "JCB"
              }
            },
            {
              "description": "Credit card information."
            }
          ]
        },
        "id": {
          "description": "ID",
          "type": "string"
        },
        "isDefault": {
          "description": "True if this payment instrument is the default.",
          "type": "boolean"
        },
        "paymentMethod": {
          "allOf": [
            {
              "description": "The supported payment methods",
              "type": "string",
              "title": "PaymentMethod",
              "enum": [
                "CREDIT_CARD",
                "PAYPAL",
                "MANUAL",
                "EXTERNAL_INVOICE",
                "MARKETPLACE_CREDITS"
              ]
            },
            {
              "description": "Payment method. Most often CREDIT_CARD, PAYPAL, or MANUAL. Other options are supported."
            }
          ]
        },
        "user": {
          "allOf": [
            {
              "title": "LinkWS",
              "properties": {
                "href": {
                  "type": "string"
                },
                "id": {
                  "type": "string"
                }
              },
              "example": {
                "href": "...",
                "id": "..."
              },
              "nullable": true,
              "type": "object"
            },
            {
              "description": "Link to user information."
            }
          ]
        },
        "vatId": {
          "description": "VAT ID.",
          "type": "string"
        }
      },
      "example": {
        "accountDisplay": "...",
        "billingAddress": {
          "city": "...",
          "companyName": "...",
          "country": "...",
          "fax": "...",
          "faxExtension": "...",
          "firstName": "...",
          "lastName": "...",
          "phone": "...",
          "phoneExtension": "...",
          "poBox": "...",
          "salutation": "...",
          "state": "...",
          "street1": "...",
          "street2": "...",
          "zip": "..."
        },
        "company": {
          "href": "...",
          "id": "..."
        },
        "createdOn": 12345,
        "creditCard": {
          "expirationMonth": 12345,
          "expirationYear": 12345,
          "name": "...",
          "number": "...",
          "securityCode": "...",
          "type": "AMEX"
        },
        "id": "...",
        "isDefault": true,
        "paymentMethod": "MANO_TEO_BILL",
        "user": {
          "href": "...",
          "id": "..."
        },
        "vatId": "..."
      }
    },
    {
      "description": "Payment instrument data object"
    }
  ]
}';
const headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
fetch('https://{marketplaceURL}/api/billing/v1/companies/{companyId}/users/{userId}/paymentInstruments',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

r = requests.post('https://{marketplaceURL}/api/billing/v1/companies/{companyId}/users/{userId}/paymentInstruments', params={

}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json'
}

result = RestClient.post 'https://{marketplaceURL}/api/billing/v1/companies/{companyId}/users/{userId}/paymentInstruments',
  params: {
  }, headers: headers

p JSON.parse(result)

URL obj = new URL("https://{marketplaceURL}/api/billing/v1/companies/{companyId}/users/{userId}/paymentInstruments");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

Request body

{
  "accountDisplay": "...",
  "billingAddress": {
    "city": "...",
    "companyName": "...",
    "country": "...",
    "fax": "...",
    "faxExtension": "...",
    "firstName": "...",
    "lastName": "...",
    "phone": "...",
    "phoneExtension": "...",
    "poBox": "...",
    "salutation": "...",
    "state": "...",
    "street1": "...",
    "street2": "...",
    "zip": "..."
  },
  "company": {
    "href": "...",
    "id": "..."
  },
  "createdOn": 12345,
  "creditCard": {
    "expirationMonth": 12345,
    "expirationYear": 12345,
    "name": "...",
    "number": "...",
    "securityCode": "...",
    "type": "AMEX"
  },
  "id": "...",
  "isDefault": true,
  "paymentMethod": "MANO_TEO_BILL",
  "user": {
    "href": "...",
    "id": "..."
  },
  "vatId": "..."
}

Example response

{
  "accountDisplay": "1111",
  "billingAddress": {
    "city": "Somerville",
    "companyName": "AppDirect",
    "country": "US",
    "firstName": "John",
    "lastName": "Doe",
    "phone": "9999999999",
    "state": "Massachusetts",
    "street1": "50 Grove St.",
    "street2": "500 Grove St.",
    "zip": "02114"
  },
  "company": {
    "href": "http://appdirect/api/account/v1/companies/7ee20d50-8147-482e-839c-775c02e73c45",
    "id": "7ee20d50-8147-482e-839c-775c02e73c45"
  },
  "createdOn": 1481002402567,
  "creditCard": {
    "expirationMonth": 12,
    "expirationYear": 2016,
    "name": "John Doe",
    "number": "12655615611",
    "securityCode": "111",
    "type": "VISA"
  },
  "default": false,
  "id": "e3f7f37b-1e0b-4f05-a8b2-aae74e2f5f2d",
  "paymentMethod": "CREDIT_CARD",
  "user": {
    "href": "http://appdirect/api/account/v1/users/952105f7-ad15-4fa3-bdbf-f25736a0dc48",
    "id": "952105f7-ad15-4fa3-bdbf-f25736a0dc48"
  }
}

POST/billing/v1/companies/{companyId}/users/{userId}/paymentInstruments

Create a payment instrument for the given user and company using the provided data

Parameters

Parameter Type Data Type Default Description
*companyId path string User's company UUID
*userId path string User UUID

Body Parameters

Payment instrument data object

PaymentInstrument object:

Property Type Description
accountDisplay string

Account display text.

billingAddress BillingAddress

Billing address.

company LinkWS

Link to company information.

createdOn number

Payment instrument creation date.

creditCard CreditCard

Credit card information.

id string

ID

isDefault boolean

True if this payment instrument is the default.

paymentMethod PaymentMethod

Payment method. Most often CREDIT_CARD, PAYPAL, or MANUAL. Other options are supported.

user LinkWS

Link to user information.

vatId string

VAT ID.

Responses

Status Meaning Description Definition
201 Created Created PaymentInstrument
400 Bad Request Bad Request
404 Not Found Not Found
409 Conflict Conflict

List all invoices for a company

Example request

curl -X GET https://{marketplaceURL}/api/billing/v1/companies/{companyId}/invoices \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \

GET https://{marketplaceURL}/api/billing/v1/companies/{companyId}/invoices HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json

var headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
$.ajax({
  url: 'https://{marketplaceURL}/api/billing/v1/companies/{companyId}/invoices',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const request = require('node-fetch');

const headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
fetch('https://{marketplaceURL}/api/billing/v1/companies/{companyId}/invoices',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

r = requests.get('https://{marketplaceURL}/api/billing/v1/companies/{companyId}/invoices', params={

}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json'
}

result = RestClient.get 'https://{marketplaceURL}/api/billing/v1/companies/{companyId}/invoices',
  params: {
  }, headers: headers

p JSON.parse(result)

URL obj = new URL("https://{marketplaceURL}/api/billing/v1/companies/{companyId}/invoices");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

Example response

[
  {
    "company": {
      "href": "http://appdirect/api/account/v1/companies/644eb32e-4afa-4699-9dae-5d3394320968",
      "id": "644eb32e-4afa-4699-9dae-5d3394320968"
    },
    "creationDate": 1481002410613,
    "currency": "USD",
    "dueDate": 1481353200000,
    "invoiceId": 20,
    "links": [
      {
        "href": "http://appdirect/api/account/v2/users/a18c91e8-d5d5-4fb8-915c-726535a0bc8a",
        "rel": "user"
      },
      {
        "href": "http://appdirect/api/account/v2/companies/644eb32e-4afa-4699-9dae-5d3394320968",
        "rel": "company"
      },
      {
        "href": "http://appdirect/api/billing/v1/invoices/20",
        "rel": "self"
      }
    ],
    "orderIds": [
      "2030"
    ],
    "referenceNumber": null,
    "status": "PAID",
    "total": 10,
    "user": {
      "href": "http://appdirect/api/account/v1/users/a18c91e8-d5d5-4fb8-915c-726535a0bc8a",
      "id": "a18c91e8-d5d5-4fb8-915c-726535a0bc8a"
    }
  }
]

GET/billing/v1/companies/{companyId}/invoices

List all of the invoices for the given company

Parameters

Parameter Type Data Type Default Description
*companyId path string Company UUID
count query integer 250 Number of results to fetch. Used for paging.
excludeFree query boolean Exclude invoices with no charges (free)
fromDate query number From date
sortField query string of enum:
DATE
INVOICE_ID
TOTAL
INVOICE_ID Sort field
sortOrder query string of enum:
ASC
DESC
DESC Sort order
start query integer 0 First result index. Used for paging.
status query string of enum:
CARRIED
PAID
UNPAID
VOIDED
Invoice status
toDate query number To date

Responses

Status Meaning Description Definition
200 OK OK array of InvoiceListing
404 Not Found Not Found

List all payments for a company

Example request

curl -X GET https://{marketplaceURL}/api/billing/v1/companies/{companyId}/payments \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \

GET https://{marketplaceURL}/api/billing/v1/companies/{companyId}/payments HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json

var headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
$.ajax({
  url: 'https://{marketplaceURL}/api/billing/v1/companies/{companyId}/payments',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const request = require('node-fetch');

const headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
fetch('https://{marketplaceURL}/api/billing/v1/companies/{companyId}/payments',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

r = requests.get('https://{marketplaceURL}/api/billing/v1/companies/{companyId}/payments', params={

}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json'
}

result = RestClient.get 'https://{marketplaceURL}/api/billing/v1/companies/{companyId}/payments',
  params: {
  }, headers: headers

p JSON.parse(result)

URL obj = new URL("https://{marketplaceURL}/api/billing/v1/companies/{companyId}/payments");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

Example response

[
  {
    "amount": 10,
    "company": {
      "href": "http://appdirect/api/account/v1/companies/644eb32e-4afa-4699-9dae-5d3394320968",
      "id": "644eb32e-4afa-4699-9dae-5d3394320968"
    },
    "currency": "USD",
    "date": 1481002410613,
    "gatewayResponse": {
      "avs": true,
      "code": null,
      "cvv": true,
      "message": null
    },
    "links": [
      {
        "href": "http://appdirect/api/billing/v1/payments/21",
        "rel": "self"
      }
    ],
    "method": "CREDIT_CARD",
    "paymentNumber": 21,
    "result": "SUCCESSFUL",
    "transactionId": "123456abcdef",
    "user": {
      "href": "http://appdirect/api/account/v1/users/a18c91e8-d5d5-4fb8-915c-726535a0bc8a",
      "id": "a18c91e8-d5d5-4fb8-915c-726535a0bc8a"
    }
  }
]

GET/billing/v1/companies/{companyId}/payments

List all of the payments for the given company

Parameters

Parameter Type Data Type Default Description
*companyId path string Company UUID
count query integer 250 Number of results to fetch. Used for paging.
fromDate query number From date
method query string of enum:
ADP_INVOICE
ARIBAPAY
BT_BILL
CLICKANDBUY
CLOUDFOUNDRY
CREDIT_CARD
CUMULA_BILL
DTAG
EXTERNAL_INVOICE
KREDITKARTE
LASTSCHRIFT_MRNEXNET
MANO_TEO_BILL
MANUAL
MARKETPLACE_CREDITS
NETS_ARVATO_INVOICE
NEXTEL
PAYPAL
ROGERS_CC_DTMF
ROGERS_CC_POS
SNAP
TBILL
THISTLE
TOICLEARING
Payment method
result query string of enum:
FAILED
GATEWAY_NOT_AVAILABLE
MANUAL
SUCCESSFUL
Payment result
sortField query string of enum:
AMOUNT
DATE
PAYMENT_ID
PAYMENT_ID Sort field
sortOrder query string of enum:
ASC
DESC
DESC Sort order
start query integer 0 First result index. Used for paging.
toDate query number To date

Responses

Status Meaning Description Definition
200 OK OK array of Payment
404 Not Found Not Found

List all purchase orders for a company

Example request

curl -X GET https://{marketplaceURL}/api/billing/v1/companies/{companyId}/orders \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \

GET https://{marketplaceURL}/api/billing/v1/companies/{companyId}/orders HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json

var headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
$.ajax({
  url: 'https://{marketplaceURL}/api/billing/v1/companies/{companyId}/orders',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const request = require('node-fetch');

const headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
fetch('https://{marketplaceURL}/api/billing/v1/companies/{companyId}/orders',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

r = requests.get('https://{marketplaceURL}/api/billing/v1/companies/{companyId}/orders', params={

}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json'
}

result = RestClient.get 'https://{marketplaceURL}/api/billing/v1/companies/{companyId}/orders',
  params: {
  }, headers: headers

p JSON.parse(result)

URL obj = new URL("https://{marketplaceURL}/api/billing/v1/companies/{companyId}/orders");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

Example response

{
  "orders": [
    {
      "activated": false,
      "company": {
        "href": "http://appdirect/api/account/v1/companies/e83cd3d6-7865-4fc2-9d7c-603ad17dd639",
        "id": "e83cd3d6-7865-4fc2-9d7c-603ad17dd639"
      },
      "contract": null,
      "currency": "USD",
      "discount": null,
      "discountId": null,
      "endDate": null,
      "endOfDiscountDate": null,
      "frequency": "MONTHLY",
      "id": 1,
      "links": [
        {
          "href": "http://appdirect/api/billing/v1/subscriptions/1b577640-9b77-47bc-beb8-ed59accb4836",
          "rel": "subscription"
        }
      ],
      "nextBillingDate": 1483599600000,
      "nextOrder": null,
      "oneTimeOrders": [],
      "orderLines": [
        {
          "description": "Test App 1 - null - Per User Fee",
          "id": 1,
          "listingPrice": 10,
          "price": 10,
          "quantity": 1,
          "totalPrice": 10,
          "type": "ITEM",
          "unit": "USER"
        }
      ],
      "parameters": [],
      "paymentPlan": {
        "allowCustomUsage": false,
        "contract": {
          "alignWithParentCycleStartDate": false,
          "autoExtensionPricingId": null,
          "blockContractDowngrades": false,
          "blockContractUpgrades": false,
          "blockSwitchToShorterContract": false,
          "cancellationPeriodLimit": null,
          "endOfContractGracePeriod": null,
          "gracePeriod": null,
          "minimumServiceLength": null,
          "terminationFee": null
        },
        "costs": [
          {
            "amount": {
              "USD": 10
            },
            "blockContractDecrease": false,
            "blockContractIncrease": false,
            "blockOriginalContractDecrease": false,
            "id": 2,
            "increment": 1,
            "maxUnits": null,
            "meteredUsage": false,
            "minUnits": 0,
            "pricePerIncrement": false,
            "pricingStrategy": "UNIT",
            "unit": "USER",
            "unitDependency": null
          }
        ],
        "discount": null,
        "frequency": "MONTHLY",
        "href": "http://appdirect/api/marketplace/v1/products/2/editions/2/paymentPlans/2",
        "id": 2,
        "isPrimaryPrice": false,
        "keepBillDateOnUsageChange": false,
        "primaryPrice": false,
        "separatePrepaid": false,
        "uuid": "eaca1aa5-4c4f-44cb-8cf4-eb0aa9267273"
      },
      "paymentPlanId": 2,
      "previousOrder": null,
      "referenceCode": null,
      "salesSupportUser": null,
      "startDate": 1480921200000,
      "status": "ACTIVE",
      "totalPrice": 10,
      "type": "NEW",
      "user": {
        "href": "http://appdirect/api/account/v1/users/c47d0fd7-b67a-4e07-84f8-f93dfafbeecc",
        "id": "c47d0fd7-b67a-4e07-84f8-f93dfafbeecc"
      }
    }
  ],
  "total": 1
}

GET/billing/v1/companies/{companyId}/orders

List all of the purchase orders for the given company

Parameters

Parameter Type Data Type Default Description
applicationIds query number Filters subscriptions by internal application ID
*companyId path string Company ID
count query integer 250 Number of results to fetch. Used for paging.
currency query string of enum:
USD
CAD
EUR
JPY
GBP
KRW
CHF
SEK
SGD
MYR
AUD
MXN
INR
BRL
DKK
NZD
NOK
ZAR
PHP
CNY
SAR
GTQ
IDR
ARS
COP
PEN
Filters subscriptions by currency
frequency query string of enum:
ONE_TIME
MONTHLY
QUARTERLY
SIX_MONTHS
YEARLY
TWO_YEARS
THREE_YEARS
DAILY
Filters subscriptions by pricing frequency
fromCreationDate query number Filters results to only include subscriptions that were created on or after the specified date
orderReferenceCode query string Filters subscriptions by order reference code
sortField query string of enum:
DATE
ORDER_ID
TOTAL
DATE Sort field.
sortOrder query string of enum:
ASC
DESC
ASC Sort order.
start query integer 0 First result index. Used for paging.
startDateFrom query number Filters results to only include subscriptions that were started on or after the specified date
startDateTo query number Filters results to only include subscriptions that were started on or before the specified date
status query string of enum:
INITIALIZED
PENDING_USER_APPROVAL
PENDING_REMOTE_CREATION
PENDING_MANUAL_RECOVERY
PENDING_ASYNCHRONOUS_CREATION
FREE_TRIAL
ACTIVE
FINISHED
ONE_TIME
CANCELLED
SUSPENDED
FREE_TRIAL_EXPIRED
FREE_TRIAL_CANCELLED
DELETED
FAILED
UPCOMING
PENDING_MIGRATION_ACTIVATION
PENDING_DELAYED_PROVISIONING
Filters subscriptions by order status
toCreationDate query number Filters results to only include subscriptions that were created on or before the specified date
type query string of enum:
NEW
MIGRATION
ADOPTION
FREE_TRIAL_ACTIVATION
TERMINATION_FEE
END_OF_CONTRACT_MIGRATION
REFUND
CREDIT
ONE_TIME_FEE
ADDITIONAL_FEE
END_OF_DISCOUNT_MIGRATION
METERED_USAGE
BUNDLED
Filters subscriptions by subscription type

Responses

Status Meaning Description Definition
200 OK OK OrderDetailedListing
404 Not Found Not Found

List all subscriptions for a company

Example request

curl -X GET https://{marketplaceURL}/api/billing/v1/companies/{companyId}/subscriptions \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \

GET https://{marketplaceURL}/api/billing/v1/companies/{companyId}/subscriptions HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json

var headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
$.ajax({
  url: 'https://{marketplaceURL}/api/billing/v1/companies/{companyId}/subscriptions',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const request = require('node-fetch');

const headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
fetch('https://{marketplaceURL}/api/billing/v1/companies/{companyId}/subscriptions',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

r = requests.get('https://{marketplaceURL}/api/billing/v1/companies/{companyId}/subscriptions', params={

}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json'
}

result = RestClient.get 'https://{marketplaceURL}/api/billing/v1/companies/{companyId}/subscriptions',
  params: {
  }, headers: headers

p JSON.parse(result)

URL obj = new URL("https://{marketplaceURL}/api/billing/v1/companies/{companyId}/subscriptions");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

Example response

[
  {
    "assignmentCount": 1,
    "company": {
      "href": "http://appdirect/api/account/v1/companies/e83cd3d6-7865-4fc2-9d7c-603ad17dd639",
      "id": "e83cd3d6-7865-4fc2-9d7c-603ad17dd639"
    },
    "creationDate": 1481002406580,
    "edition": {
      "href": "http://appdirect/api/marketplace/v1/products/2/editions/2",
      "id": "2"
    },
    "endDate": null,
    "externalAccountId": "d2f4acf1-fb5a-4c4a-921f-75c4b6bfff08",
    "id": "1b577640-9b77-47bc-beb8-ed59accb4836",
    "links": [],
    "maxUsers": 1,
    "order": {
      "href": "http://appdirect/api/billing/v1/orders/1",
      "id": "1"
    },
    "parentSubscriptionId": null,
    "product": {
      "href": "http://appdirect/api/marketplace/v1/products/2",
      "id": "2"
    },
    "status": "ACTIVE",
    "suspensionReason": "API",
    "user": {
      "href": "http://appdirect/api/account/v1/users/c47d0fd7-b67a-4e07-84f8-f93dfafbeecc",
      "id": "c47d0fd7-b67a-4e07-84f8-f93dfafbeecc"
    }
  }
]

GET/billing/v1/companies/{companyId}/subscriptions

List all of the subscriptions for the given company

Parameters

Parameter Type Data Type Default Description
applicationIds query number Filters subscriptions by internal application ID
bundleApplicationId query number Filters subscriptions by internal bundle ID
*companyId path string Company ID
count query integer 250 Number of results to fetch. Used for paging.
discountId query number Filters subscriptions by internal discount ID
editionId query number Filters subscriptions by internal edition ID
expand query string Expands filtered subscription results to include details about the specified query parameters, one or more of "order", "product", or "edition".
fromDate query number Filters results to only include subscriptions that were created on or after the specified date
lastModified query number Filters subscriptions by last modified date
orderReferenceCode query string Filters subscriptions by order reference code
paymentPlanId query number Filters subscriptions by internal payment plan ID
sortField query string of enum:
APPLICATION
COMPANY
DATE
OWNER
STATUS
SUBSCRIPTION_ID
DATE Sort field
sortOrder query string of enum:
ASC
DESC
ASC Sort order
start query integer 0 First result index. Used for paging.
status query string Filters subscriptions by status
toDate query number Filters results to only include subscriptions that were created on or before the specified date

Responses

Status Meaning Description Definition
200 OK OK array of SubscriptionListing
404 Not Found Not Found

List all invoices for a user

Example request

curl -X GET https://{marketplaceURL}/api/billing/v1/companies/{companyId}/users/{userId}/invoices \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \

GET https://{marketplaceURL}/api/billing/v1/companies/{companyId}/users/{userId}/invoices HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json

var headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
$.ajax({
  url: 'https://{marketplaceURL}/api/billing/v1/companies/{companyId}/users/{userId}/invoices',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const request = require('node-fetch');

const headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
fetch('https://{marketplaceURL}/api/billing/v1/companies/{companyId}/users/{userId}/invoices',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

r = requests.get('https://{marketplaceURL}/api/billing/v1/companies/{companyId}/users/{userId}/invoices', params={

}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json'
}

result = RestClient.get 'https://{marketplaceURL}/api/billing/v1/companies/{companyId}/users/{userId}/invoices',
  params: {
  }, headers: headers

p JSON.parse(result)

URL obj = new URL("https://{marketplaceURL}/api/billing/v1/companies/{companyId}/users/{userId}/invoices");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

Example response

[
  {
    "company": {
      "href": "http://appdirect/api/account/v1/companies/644eb32e-4afa-4699-9dae-5d3394320968",
      "id": "644eb32e-4afa-4699-9dae-5d3394320968"
    },
    "creationDate": 1481002410613,
    "currency": "USD",
    "dueDate": 1481353200000,
    "invoiceId": 20,
    "links": [
      {
        "href": "http://appdirect/api/account/v2/users/a18c91e8-d5d5-4fb8-915c-726535a0bc8a",
        "rel": "user"
      },
      {
        "href": "http://appdirect/api/account/v2/companies/644eb32e-4afa-4699-9dae-5d3394320968",
        "rel": "company"
      },
      {
        "href": "http://appdirect/api/billing/v1/invoices/20",
        "rel": "self"
      }
    ],
    "orderIds": [
      "2030"
    ],
    "referenceNumber": null,
    "status": "PAID",
    "total": 10,
    "user": {
      "href": "http://appdirect/api/account/v1/users/a18c91e8-d5d5-4fb8-915c-726535a0bc8a",
      "id": "a18c91e8-d5d5-4fb8-915c-726535a0bc8a"
    }
  }
]

GET/billing/v1/companies/{companyId}/users/{userId}/invoices

List all of the invoices for the given user

Parameters

Parameter Type Data Type Default Description
*companyId path string User's company UUID
count query integer 250 Number of results to fetch. Used for paging.
excludeFree query boolean Exclude invoices with no charges (free)
fromDate query number From date
sortField query string of enum:
DATE
INVOICE_ID
TOTAL
INVOICE_ID Sort field
sortOrder query string of enum:
ASC
DESC
ASC Sort order
start query integer 0 First result index. Used for paging.
status query string of enum:
CARRIED
PAID
UNPAID
VOIDED
Invoice status
toDate query number To date
*userId path string User UUID

Responses

Status Meaning Description Definition
200 OK OK array of InvoiceListing
404 Not Found Not Found

List all payment instruments for a user

Example request

curl -X GET https://{marketplaceURL}/api/billing/v1/companies/{companyId}/users/{userId}/paymentInstruments \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \

GET https://{marketplaceURL}/api/billing/v1/companies/{companyId}/users/{userId}/paymentInstruments HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json

var headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
$.ajax({
  url: 'https://{marketplaceURL}/api/billing/v1/companies/{companyId}/users/{userId}/paymentInstruments',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const request = require('node-fetch');

const headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
fetch('https://{marketplaceURL}/api/billing/v1/companies/{companyId}/users/{userId}/paymentInstruments',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

r = requests.get('https://{marketplaceURL}/api/billing/v1/companies/{companyId}/users/{userId}/paymentInstruments', params={

}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json'
}

result = RestClient.get 'https://{marketplaceURL}/api/billing/v1/companies/{companyId}/users/{userId}/paymentInstruments',
  params: {
  }, headers: headers

p JSON.parse(result)

URL obj = new URL("https://{marketplaceURL}/api/billing/v1/companies/{companyId}/users/{userId}/paymentInstruments");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

Example response

[
  {
    "accountDisplay": "1111",
    "billingAddress": {
      "city": "Somerville",
      "companyName": "AppDirect",
      "country": "US",
      "firstName": "John",
      "lastName": "Doe",
      "phone": "9999999999",
      "state": "Massachusetts",
      "street1": "50 Grove St.",
      "street2": "500 Grove St.",
      "zip": "02114"
    },
    "company": {
      "href": "http://appdirect/api/account/v1/companies/7ee20d50-8147-482e-839c-775c02e73c45",
      "id": "7ee20d50-8147-482e-839c-775c02e73c45"
    },
    "createdOn": 1481002402567,
    "creditCard": {
      "expirationMonth": 12,
      "expirationYear": 2016,
      "name": "John Doe",
      "number": "12655615611",
      "securityCode": "111",
      "type": "VISA"
    },
    "default": false,
    "id": "e3f7f37b-1e0b-4f05-a8b2-aae74e2f5f2d",
    "paymentMethod": "CREDIT_CARD",
    "user": {
      "href": "http://appdirect/api/account/v1/users/952105f7-ad15-4fa3-bdbf-f25736a0dc48",
      "id": "952105f7-ad15-4fa3-bdbf-f25736a0dc48"
    }
  }
]

GET/billing/v1/companies/{companyId}/users/{userId}/paymentInstruments

List all of the payment instruments for the given user

Parameters

Parameter Type Data Type Default Description
*companyId path string User's company UUID
*userId path string User UUID

Responses

Status Meaning Description Definition
200 OK OK array of PaymentInstrument
404 Not Found Not Found

List all payments for a user

Example request

curl -X GET https://{marketplaceURL}/api/billing/v1/companies/{companyId}/users/{userId}/payments \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \

GET https://{marketplaceURL}/api/billing/v1/companies/{companyId}/users/{userId}/payments HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json

var headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
$.ajax({
  url: 'https://{marketplaceURL}/api/billing/v1/companies/{companyId}/users/{userId}/payments',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const request = require('node-fetch');

const headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
fetch('https://{marketplaceURL}/api/billing/v1/companies/{companyId}/users/{userId}/payments',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

r = requests.get('https://{marketplaceURL}/api/billing/v1/companies/{companyId}/users/{userId}/payments', params={

}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json'
}

result = RestClient.get 'https://{marketplaceURL}/api/billing/v1/companies/{companyId}/users/{userId}/payments',
  params: {
  }, headers: headers

p JSON.parse(result)

URL obj = new URL("https://{marketplaceURL}/api/billing/v1/companies/{companyId}/users/{userId}/payments");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

Example response

[
  {
    "amount": 10,
    "company": {
      "href": "http://appdirect/api/account/v1/companies/644eb32e-4afa-4699-9dae-5d3394320968",
      "id": "644eb32e-4afa-4699-9dae-5d3394320968"
    },
    "currency": "USD",
    "date": 1481002410613,
    "gatewayResponse": {
      "avs": true,
      "code": null,
      "cvv": true,
      "message": null
    },
    "links": [
      {
        "href": "http://appdirect/api/billing/v1/payments/21",
        "rel": "self"
      }
    ],
    "method": "CREDIT_CARD",
    "paymentNumber": 21,
    "result": "SUCCESSFUL",
    "transactionId": "123456abcdef",
    "user": {
      "href": "http://appdirect/api/account/v1/users/a18c91e8-d5d5-4fb8-915c-726535a0bc8a",
      "id": "a18c91e8-d5d5-4fb8-915c-726535a0bc8a"
    }
  }
]

GET/billing/v1/companies/{companyId}/users/{userId}/payments

List all of the payments for the given user

Parameters

Parameter Type Data Type Default Description
*companyId path string Company UUID
count query integer 250 Number of results to fetch. Used for paging.
fromDate query number From date
method query string of enum:
ADP_INVOICE
ARIBAPAY
BT_BILL
CLICKANDBUY
CLOUDFOUNDRY
CREDIT_CARD
CUMULA_BILL
DTAG
EXTERNAL_INVOICE
KREDITKARTE
LASTSCHRIFT_MRNEXNET
MANO_TEO_BILL
MANUAL
MARKETPLACE_CREDITS
NETS_ARVATO_INVOICE
NEXTEL
PAYPAL
ROGERS_CC_DTMF
ROGERS_CC_POS
SNAP
TBILL
THISTLE
TOICLEARING
Payment method
result query string of enum:
FAILED
GATEWAY_NOT_AVAILABLE
MANUAL
SUCCESSFUL
Payment result
sortField query string of enum:
AMOUNT
DATE
PAYMENT_ID
PAYMENT_ID Sort field
sortOrder query string of enum:
ASC
DESC
ASC Sort order
start query integer 0 First result index. Used for paging.
toDate query number To date
*userId path string User UUID

Responses

Status Meaning Description Definition
200 OK OK array of Payment
404 Not Found Not Found

List all purchase orders for a user

Example request

curl -X GET https://{marketplaceURL}/api/billing/v1/companies/{companyId}/users/{userId}/orders \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \

GET https://{marketplaceURL}/api/billing/v1/companies/{companyId}/users/{userId}/orders HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json

var headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
$.ajax({
  url: 'https://{marketplaceURL}/api/billing/v1/companies/{companyId}/users/{userId}/orders',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const request = require('node-fetch');

const headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
fetch('https://{marketplaceURL}/api/billing/v1/companies/{companyId}/users/{userId}/orders',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

r = requests.get('https://{marketplaceURL}/api/billing/v1/companies/{companyId}/users/{userId}/orders', params={

}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json'
}

result = RestClient.get 'https://{marketplaceURL}/api/billing/v1/companies/{companyId}/users/{userId}/orders',
  params: {
  }, headers: headers

p JSON.parse(result)

URL obj = new URL("https://{marketplaceURL}/api/billing/v1/companies/{companyId}/users/{userId}/orders");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

Example response

{
  "orders": [
    {
      "activated": false,
      "company": {
        "href": "http://appdirect/api/account/v1/companies/e83cd3d6-7865-4fc2-9d7c-603ad17dd639",
        "id": "e83cd3d6-7865-4fc2-9d7c-603ad17dd639"
      },
      "contract": null,
      "currency": "USD",
      "discount": null,
      "discountId": null,
      "endDate": null,
      "endOfDiscountDate": null,
      "frequency": "MONTHLY",
      "id": 1,
      "links": [
        {
          "href": "http://appdirect/api/billing/v1/subscriptions/1b577640-9b77-47bc-beb8-ed59accb4836",
          "rel": "subscription"
        }
      ],
      "nextBillingDate": 1483599600000,
      "nextOrder": null,
      "oneTimeOrders": [],
      "orderLines": [
        {
          "description": "Test App 1 - null - Per User Fee",
          "id": 1,
          "listingPrice": 10,
          "price": 10,
          "quantity": 1,
          "totalPrice": 10,
          "type": "ITEM",
          "unit": "USER"
        }
      ],
      "parameters": [],
      "paymentPlan": {
        "allowCustomUsage": false,
        "contract": {
          "alignWithParentCycleStartDate": false,
          "autoExtensionPricingId": null,
          "blockContractDowngrades": false,
          "blockContractUpgrades": false,
          "blockSwitchToShorterContract": false,
          "cancellationPeriodLimit": null,
          "endOfContractGracePeriod": null,
          "gracePeriod": null,
          "minimumServiceLength": null,
          "terminationFee": null
        },
        "costs": [
          {
            "amount": {
              "USD": 10
            },
            "blockContractDecrease": false,
            "blockContractIncrease": false,
            "blockOriginalContractDecrease": false,
            "id": 2,
            "increment": 1,
            "maxUnits": null,
            "meteredUsage": false,
            "minUnits": 0,
            "pricePerIncrement": false,
            "pricingStrategy": "UNIT",
            "unit": "USER",
            "unitDependency": null
          }
        ],
        "discount": null,
        "frequency": "MONTHLY",
        "href": "http://appdirect/api/marketplace/v1/products/2/editions/2/paymentPlans/2",
        "id": 2,
        "isPrimaryPrice": false,
        "keepBillDateOnUsageChange": false,
        "primaryPrice": false,
        "separatePrepaid": false,
        "uuid": "eaca1aa5-4c4f-44cb-8cf4-eb0aa9267273"
      },
      "paymentPlanId": 2,
      "previousOrder": null,
      "referenceCode": null,
      "salesSupportUser": null,
      "startDate": 1480921200000,
      "status": "ACTIVE",
      "totalPrice": 0,
      "type": "NEW",
      "user": {
        "href": "http://appdirect/api/account/v1/users/c47d0fd7-b67a-4e07-84f8-f93dfafbeecc",
        "id": "c47d0fd7-b67a-4e07-84f8-f93dfafbeecc"
      }
    }
  ],
  "total": 1
}

GET/billing/v1/companies/{companyId}/users/{userId}/orders

List all of the purchase orders for the given user

Parameters

Parameter Type Data Type Default Description
applicationIds query number Filters subscriptions by internal application ID
*companyId path string User's company ID
count query integer 250 Number of results to fetch. Used for paging.
currency query string of enum:
USD
CAD
EUR
JPY
GBP
KRW
CHF
SEK
SGD
MYR
AUD
MXN
INR
BRL
DKK
NZD
NOK
ZAR
PHP
CNY
SAR
GTQ
IDR
ARS
COP
PEN
Filters subscriptions by currency
frequency query string of enum:
ONE_TIME
MONTHLY
QUARTERLY
SIX_MONTHS
YEARLY
TWO_YEARS
THREE_YEARS
DAILY
Filters subscriptions by pricing frequency
fromCreationDate query number Filters results to only include subscriptions that were created on or after the specified date
orderReferenceCode query string Filters subscriptions by order reference code
sortField query string of enum:
DATE
ORDER_ID
TOTAL
DATE Sort field.
sortOrder query string of enum:
ASC
DESC
ASC Sort order.
start query integer 0 First result index. Used for paging.
startDateFrom query number Filters results to only include subscriptions that were started on or after the specified date
startDateTo query number Filters results to only include subscriptions that were started on or before the specified date
status query string of enum:
INITIALIZED
PENDING_USER_APPROVAL
PENDING_REMOTE_CREATION
PENDING_MANUAL_RECOVERY
PENDING_ASYNCHRONOUS_CREATION
FREE_TRIAL
ACTIVE
FINISHED
ONE_TIME
CANCELLED
SUSPENDED
FREE_TRIAL_EXPIRED
FREE_TRIAL_CANCELLED
DELETED
FAILED
UPCOMING
PENDING_MIGRATION_ACTIVATION
PENDING_DELAYED_PROVISIONING
Filters subscriptions by order status
toCreationDate query number Filters results to only include subscriptions that were created on or before the specified date
type query string of enum:
NEW
MIGRATION
ADOPTION
FREE_TRIAL_ACTIVATION
TERMINATION_FEE
END_OF_CONTRACT_MIGRATION
REFUND
CREDIT
ONE_TIME_FEE
ADDITIONAL_FEE
END_OF_DISCOUNT_MIGRATION
METERED_USAGE
BUNDLED
Filters subscriptions by subscription type
*userId path string User ID

Responses

Status Meaning Description Definition
200 OK Response.

Update a payment instrument

Example request

curl -X PUT https://{marketplaceURL}/api/billing/v1/companies/{companyId}/users/{userId}/paymentInstruments/{paymentInstrumentId} \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \

PUT https://{marketplaceURL}/api/billing/v1/companies/{companyId}/users/{userId}/paymentInstruments/{paymentInstrumentId} HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json

var headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
$.ajax({
  url: 'https://{marketplaceURL}/api/billing/v1/companies/{companyId}/users/{userId}/paymentInstruments/{paymentInstrumentId}',
  method: 'put',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const request = require('node-fetch');
const inputBody = '{
  "allOf": [
    {
      "type": "object",
      "title": "PaymentInstrument",
      "properties": {
        "accountDisplay": {
          "description": "Account display text.",
          "type": "string",
          "maxLength": 255,
          "minLength": 0
        },
        "billingAddress": {
          "allOf": [
            {
              "type": "object",
              "title": "BillingAddress",
              "required": [
                "country",
                "city",
                "zip",
                "firstName",
                "phone",
                "lastName",
                "street1"
              ],
              "properties": {
                "city": {
                  "description": "The name of the city or town",
                  "type": "string",
                  "maxLength": 255,
                  "minLength": 0
                },
                "companyName": {
                  "description": "The name of the company",
                  "type": "string"
                },
                "country": {
                  "description": "The country code, in ISO-3166 format",
                  "type": "string",
                  "maxLength": 2,
                  "minLength": 0
                },
                "fax": {
                  "description": "The fax number",
                  "type": "string"
                },
                "faxExtension": {
                  "description": "The fax extension number",
                  "type": "string"
                },
                "firstName": {
                  "description": "The first name",
                  "type": "string",
                  "maxLength": 255,
                  "minLength": 0
                },
                "lastName": {
                  "description": "The last name",
                  "type": "string",
                  "maxLength": 255,
                  "minLength": 0
                },
                "phone": {
                  "description": "The phone number",
                  "type": "string",
                  "maxLength": 255,
                  "minLength": 0
                },
                "phoneExtension": {
                  "description": "The phone extension number",
                  "type": "string"
                },
                "poBox": {
                  "description": "The post office box number",
                  "type": "string"
                },
                "salutation": {
                  "description": "The title in a person's name, for example, Mr or Ms",
                  "type": "string"
                },
                "state": {
                  "description": "The state, province, or region",
                  "type": "string",
                  "maxLength": 255,
                  "minLength": 0
                },
                "street1": {
                  "description": "The first line of a street address",
                  "type": "string",
                  "maxLength": 255,
                  "minLength": 0
                },
                "street2": {
                  "description": "The second line of a street address, for example, an apartment or office number",
                  "type": "string",
                  "maxLength": 255,
                  "minLength": 0
                },
                "zip": {
                  "description": "The ZIP or postal code of the address",
                  "type": "string",
                  "maxLength": 255,
                  "minLength": 0
                }
              },
              "example": {
                "city": "...",
                "companyName": "...",
                "country": "...",
                "fax": "...",
                "faxExtension": "...",
                "firstName": "...",
                "lastName": "...",
                "phone": "...",
                "phoneExtension": "...",
                "poBox": "...",
                "salutation": "...",
                "state": "...",
                "street1": "...",
                "street2": "...",
                "zip": "..."
              }
            },
            {
              "description": "Billing address."
            }
          ]
        },
        "company": {
          "allOf": [
            {
              "title": "LinkWS",
              "properties": {
                "href": {
                  "type": "string"
                },
                "id": {
                  "type": "string"
                }
              },
              "example": {
                "href": "...",
                "id": "..."
              },
              "nullable": true,
              "type": "object"
            },
            {
              "description": "Link to company information."
            }
          ]
        },
        "createdOn": {
          "description": "Payment instrument creation date.",
          "type": "number"
        },
        "creditCard": {
          "allOf": [
            {
              "type": "object",
              "title": "CreditCard",
              "required": [
                "name",
                "number",
                "securityCode",
                "expirationMonth",
                "expirationYear"
              ],
              "properties": {
                "expirationMonth": {
                  "description": "Expiration month. Required field.",
                  "type": "number",
                  "maxLength": 12,
                  "minLength": 1
                },
                "expirationYear": {
                  "description": "Expiration year. Required field.",
                  "type": "number"
                },
                "name": {
                  "description": "Name as it appears on credit card. Required field.",
                  "type": "string",
                  "maxLength": 255,
                  "minLength": 0
                },
                "number": {
                  "description": "Credit card number. Required field.",
                  "maxLength": 19,
                  "minLength": 0,
                  "nullable": true,
                  "type": "string"
                },
                "securityCode": {
                  "description": "Credit card security code. Required field.",
                  "maxLength": 4,
                  "minLength": 3,
                  "nullable": true,
                  "type": "string"
                },
                "type": {
                  "allOf": [
                    {},
                    {}
                  ]
                }
              },
              "example": {
                "expirationMonth": 12345,
                "expirationYear": 12345,
                "name": "...",
                "number": "...",
                "securityCode": "...",
                "type": "JCB"
              }
            },
            {
              "description": "Credit card information."
            }
          ]
        },
        "id": {
          "description": "ID",
          "type": "string"
        },
        "isDefault": {
          "description": "True if this payment instrument is the default.",
          "type": "boolean"
        },
        "paymentMethod": {
          "allOf": [
            {
              "description": "The supported payment methods",
              "type": "string",
              "title": "PaymentMethod",
              "enum": [
                "CREDIT_CARD",
                "PAYPAL",
                "MANUAL",
                "EXTERNAL_INVOICE",
                "MARKETPLACE_CREDITS"
              ]
            },
            {
              "description": "Payment method. Most often CREDIT_CARD, PAYPAL, or MANUAL. Other options are supported."
            }
          ]
        },
        "user": {
          "allOf": [
            {
              "title": "LinkWS",
              "properties": {
                "href": {
                  "type": "string"
                },
                "id": {
                  "type": "string"
                }
              },
              "example": {
                "href": "...",
                "id": "..."
              },
              "nullable": true,
              "type": "object"
            },
            {
              "description": "Link to user information."
            }
          ]
        },
        "vatId": {
          "description": "VAT ID.",
          "type": "string"
        }
      },
      "example": {
        "accountDisplay": "...",
        "billingAddress": {
          "city": "...",
          "companyName": "...",
          "country": "...",
          "fax": "...",
          "faxExtension": "...",
          "firstName": "...",
          "lastName": "...",
          "phone": "...",
          "phoneExtension": "...",
          "poBox": "...",
          "salutation": "...",
          "state": "...",
          "street1": "...",
          "street2": "...",
          "zip": "..."
        },
        "company": {
          "href": "...",
          "id": "..."
        },
        "createdOn": 12345,
        "creditCard": {
          "expirationMonth": 12345,
          "expirationYear": 12345,
          "name": "...",
          "number": "...",
          "securityCode": "...",
          "type": "AMEX"
        },
        "id": "...",
        "isDefault": true,
        "paymentMethod": "MANO_TEO_BILL",
        "user": {
          "href": "...",
          "id": "..."
        },
        "vatId": "..."
      }
    },
    {
      "description": "Payment instrument data object"
    }
  ]
}';
const headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
fetch('https://{marketplaceURL}/api/billing/v1/companies/{companyId}/users/{userId}/paymentInstruments/{paymentInstrumentId}',
{
  method: 'PUT',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

r = requests.put('https://{marketplaceURL}/api/billing/v1/companies/{companyId}/users/{userId}/paymentInstruments/{paymentInstrumentId}', params={

}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json'
}

result = RestClient.put 'https://{marketplaceURL}/api/billing/v1/companies/{companyId}/users/{userId}/paymentInstruments/{paymentInstrumentId}',
  params: {
  }, headers: headers

p JSON.parse(result)

URL obj = new URL("https://{marketplaceURL}/api/billing/v1/companies/{companyId}/users/{userId}/paymentInstruments/{paymentInstrumentId}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("PUT");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

Request body

{
  "accountDisplay": "...",
  "billingAddress": {
    "city": "...",
    "companyName": "...",
    "country": "...",
    "fax": "...",
    "faxExtension": "...",
    "firstName": "...",
    "lastName": "...",
    "phone": "...",
    "phoneExtension": "...",
    "poBox": "...",
    "salutation": "...",
    "state": "...",
    "street1": "...",
    "street2": "...",
    "zip": "..."
  },
  "company": {
    "href": "...",
    "id": "..."
  },
  "createdOn": 12345,
  "creditCard": {
    "expirationMonth": 12345,
    "expirationYear": 12345,
    "name": "...",
    "number": "...",
    "securityCode": "...",
    "type": "AMEX"
  },
  "id": "...",
  "isDefault": true,
  "paymentMethod": "MANO_TEO_BILL",
  "user": {
    "href": "...",
    "id": "..."
  },
  "vatId": "..."
}

Example response

{
  "accountDisplay": "1111",
  "billingAddress": {
    "city": "Somerville",
    "companyName": "AppDirect",
    "country": "US",
    "firstName": "John",
    "lastName": "Doe",
    "phone": "9999999999",
    "state": "Massachusetts",
    "street1": "50 Grove St.",
    "street2": "500 Grove St.",
    "zip": "02114"
  },
  "company": {
    "href": "http://appdirect/api/account/v1/companies/7ee20d50-8147-482e-839c-775c02e73c45",
    "id": "7ee20d50-8147-482e-839c-775c02e73c45"
  },
  "creditCard": {
    "expirationMonth": 12,
    "expirationYear": 2016,
    "name": "Updated Credit Card name",
    "number": "13688112366",
    "securityCode": "111",
    "type": "VISA"
  },
  "default": false,
  "id": "e3f7f37b-1e0b-4f05-a8b2-aae74e2f5f2d",
  "paymentMethod": "CREDIT_CARD",
  "user": {
    "href": "http://appdirect/api/account/v1/users/952105f7-ad15-4fa3-bdbf-f25736a0dc48",
    "id": "952105f7-ad15-4fa3-bdbf-f25736a0dc48"
  }
}

PUT/billing/v1/companies/{companyId}/users/{userId}/paymentInstruments/{paymentInstrumentId}

Update the payment instrument for the given user and company using the provided data

Parameters

Parameter Type Data Type Default Description
*companyId path string User's company UUID
*paymentInstrumentId path string Existing payment instrument UUID
*userId path string User UUID

Body Parameters

Payment instrument data object

PaymentInstrument object:

Property Type Description
accountDisplay string

Account display text.

billingAddress BillingAddress

Billing address.

company LinkWS

Link to company information.

createdOn number

Payment instrument creation date.

creditCard CreditCard

Credit card information.

id string

ID

isDefault boolean

True if this payment instrument is the default.

paymentMethod PaymentMethod

Payment method. Most often CREDIT_CARD, PAYPAL, or MANUAL. Other options are supported.

user LinkWS

Link to user information.

vatId string

VAT ID.

Responses

Status Meaning Description Definition
200 OK OK PaymentInstrument
400 Bad Request Bad Request
404 Not Found Not Found
409 Conflict Conflict

Company Memberships

Create company membership (Add User)

Example request

curl -X POST https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/active \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \

POST https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/active HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json

var headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
$.ajax({
  url: 'https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/active',
  method: 'post',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const request = require('node-fetch');
const inputBody = '{
  "allOf": [
    {
      "description": "Minimal data required to create a active user membership",
      "type": "object",
      "title": "ActiveUserCreationAccountV2",
      "properties": {
        "recipientEmails": {
          "description": "List of emails where the user invitation is sent",
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "temporaryPassword": {
          "description": "Temporary password",
          "type": "string"
        },
        "user": {
          "allOf": [
            {
              "description": "User information (company)",
              "type": "object",
              "title": "ActiveUserAccountV2",
              "properties": {
                "email": {
                  "description": "Email address",
                  "type": "string"
                },
                "firstName": {
                  "description": "First name",
                  "type": "string"
                },
                "lastName": {
                  "description": "Last name",
                  "type": "string"
                },
                "roles": {
                  "description": "Roles for this membership. One or more of the following: ROLE_CHANNEL_ADMIN (Marketplace Manager), ROLE_CHANNEL_PRODUCT_SUPPORT (Product Support), ROLE_SALES_SUPPORT (Sales Support), ROLE_RESELLER_MANAGER (Reseller Manager), ROLE_RESELLER (Reseller), ROLE_CHANNEL_SUPPORT (Customer Support), ROLE_SYS_ADMIN (Company Admin), ROLE_BILLING_ADMIN (Billing Admin), ROLE_DEVELOPER (Developer). For user roles (not associated with membership), see [UserAccountV2](#useraccountv2).",
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              },
              "example": {
                "email": "jude.doe@company8578572384.com",
                "firstName": "Jude",
                "lastName": "Doe",
                "roles": [
                  "ROLE_USER"
                ]
              }
            },
            {
              "description": "User data"
            }
          ]
        }
      },
      "example": {
        "recipientEmails": [
          "guy.smith@company9411805586.com"
        ],
        "temporaryPassword": "Temporary Password",
        "user": {
          "email": "guy.smith@company9411805586.com",
          "firstName": "Guy",
          "lastName": "Smith",
          "roles": [
            "ROLE_DEVELOPER"
          ]
        }
      }
    },
    {
      "example": {
        "recipientEmails": [
          "guy.smith@company9411805586.com"
        ],
        "temporaryPassword": "Temporary Password",
        "user": {
          "email": "guy.smith@company9411805586.com",
          "firstName": "Guy",
          "lastName": "Smith",
          "roles": [
            "ROLE_DEVELOPER"
          ]
        }
      }
    }
  ]
}';
const headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
fetch('https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/active',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

r = requests.post('https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/active', params={

}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json'
}

result = RestClient.post 'https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/active',
  params: {
  }, headers: headers

p JSON.parse(result)

URL obj = new URL("https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/active");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

Request body

{
  "recipientEmails": [
    "guy.smith@company9411805586.com"
  ],
  "temporaryPassword": "Temporary Password",
  "user": {
    "email": "guy.smith@company9411805586.com",
    "firstName": "Guy",
    "lastName": "Smith",
    "roles": [
      "ROLE_DEVELOPER"
    ]
  }
}

Example response

{
  "company": {
    "customAttributes": [
      {
        "attributeType": "TEXT",
        "hint": "US West, US Central, or US East",
        "label": "Geographic Region",
        "name": "Geographic Region",
        "value": "US"
      },
      {
        "attributeType": "MULTISELECT",
        "hint": "",
        "label": "Label Names",
        "name": "Company Details",
        "valueKeys": [
          "great option"
        ]
      }
    ],
    "defaultRole": "USER",
    "enabled": true,
    "links": [
      {
        "href": "http://appdirect/api/account/v2/companies/ece062bd-0c74-4d44-996c-743c3e71f8e1",
        "rel": "self"
      },
      {
        "href": "http://appdirect/api/account/v2/companies/ece062bd-0c74-4d44-996c-743c3e71f8e1/memberships",
        "rel": "memberships"
      }
    ],
    "name": "Company 4492834930",
    "phoneNumber": "9259221234",
    "picture": "http://localhost:8080/profilePics/http://cdn/company.png",
    "reseller": true,
    "uuid": "ece062bd-0c74-4d44-996c-743c3e71f8e1",
    "vendor": false
  },
  "enabled": true,
  "lastUsed": false,
  "links": [
    {
      "href": "http://appdirect/api/account/v2/companies/ece062bd-0c74-4d44-996c-743c3e71f8e1/memberships/e16171eb-d89c-4842-9550-2f9cf3ef4cee",
      "rel": "self"
    },
    {
      "href": "http://appdirect/api/account/v2/users/e16171eb-d89c-4842-9550-2f9cf3ef4cee",
      "rel": "user"
    },
    {
      "href": "http://appdirect/api/account/v2/companies/ece062bd-0c74-4d44-996c-743c3e71f8e1",
      "rel": "company"
    }
  ],
  "metadata": {
    "mosi_username": null
  },
  "mosiUser": null,
  "position": null,
  "roles": [
    "ROLE_USER"
  ],
  "user": {
    "activated": true,
    "allowLogin": true,
    "boostUser": null,
    "currency": null,
    "customAttributes": [],
    "email": "guy.smith@company9411805586.com",
    "firstName": "Guy",
    "lastName": "Smith",
    "ldapId": null,
    "links": [
      {
        "href": "http://appdirect/api/account/v2/users/e16171eb-d89c-4842-9550-2f9cf3ef4cee",
        "rel": "self"
      },
      {
        "href": "http://appdirect/api/account/v2/users/e16171eb-d89c-4842-9550-2f9cf3ef4cee/memberships",
        "rel": "memberships"
      }
    ],
    "metadata": {
      "apsUid": null
    },
    "picture": null,
    "roles": [
      "ROLE_USER"
    ],
    "userName": "guy.smith@company9411805586.com",
    "uuid": "e16171eb-d89c-4842-9550-2f9cf3ef4cee"
  }
}

POST/account/v2/companies/{companyUuid}/memberships/active

Create a marketplace user with membership in the given company.

The created user is active, and is associated with the specified company (membership). User is set with a temporary password; the password is emailed to the recipients specified in the request body.

The domain part of the user's email address must match one of the verified domains associated with the company the user will be created in.

Note: You cannot set the Marketplace Manager role through the API.

Required Scope and Authorization Rules

Scope Rule
ROLE_CHANNEL_ADMIN Allows access as a Marketplace Manager for the marketplace.
ROLE_CORPORATE_ADMIN Allows access as a Network Manager for the marketplace.
ROLE_PARTNER Allows access to read and write all marketplace data.
ROLE_SYS_ADMIN Allows access as a Company Admin for the company.

Parameters

Parameter Type Data Type Default Description
*companyUuid path string Unique identifier of company in the API request

Body Parameters

User creation data

ActiveUserCreationAccountV2 object:

Property Type Description
recipientEmails array of string

List of emails where the user invitation is sent

temporaryPassword string

Temporary password

user ActiveUserAccountV2

User data

Responses

Status Meaning Description Definition
200 OK Success UserCompanyMembershipAccountV2
401 Unauthorized Unauthorized
404 Not Found Company not found

Update company membership roles (bulk)

Example request

curl -X PATCH https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/roles \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \

PATCH https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/roles HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json

var headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
$.ajax({
  url: 'https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/roles',
  method: 'patch',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const request = require('node-fetch');
const inputBody = '[
  {
    "rolesToAdd": [
      "ROLE_DEVELOPER",
      "ROLE_RESELLER"
    ],
    "rolesToRemove": [
      "ROLE_CHANNEL_SUPPORT"
    ],
    "userUuid": "92a8d9f6-223d-11e8-a232-d879d2b204fc"
  },
  {
    "rolesToAdd": [
      "ROLE_SYS_ADMIN"
    ],
    "userUuid": "673d2cda-2d1a-11e8-a232-d879d2b204fc"
  }
]';
const headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
fetch('https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/roles',
{
  method: 'PATCH',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

r = requests.patch('https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/roles', params={

}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json'
}

result = RestClient.patch 'https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/roles',
  params: {
  }, headers: headers

p JSON.parse(result)

URL obj = new URL("https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/roles");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("PATCH");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

Request body

[
  {
    "rolesToAdd": [
      "ROLE_DEVELOPER",
      "ROLE_RESELLER"
    ],
    "rolesToRemove": [
      "ROLE_CHANNEL_SUPPORT"
    ],
    "userUuid": "92a8d9f6-223d-11e8-a232-d879d2b204fc"
  },
  {
    "rolesToAdd": [
      "ROLE_SYS_ADMIN"
    ],
    "userUuid": "673d2cda-2d1a-11e8-a232-d879d2b204fc"
  }
]

PATCH/account/v2/companies/{companyUuid}/memberships/roles

Update role assignments for one or more company memberships (users).

API clients acting on behalf of an end user must first call Read assignable roles for company membership to retrieve the list of roles they are allowed to update.

Note: You cannot set the Marketplace Manager role through the API.

Required Scope and Authorization Rules

Scope Rule
ROLE_CHANNEL_ADMIN Allows access as a Marketplace Manager for the marketplace.
ROLE_CHANNEL_SUPPORT Allows access as a Customer Support agent for the marketplace.
ROLE_CORPORATE_ADMIN Allows access as a Network Manager for the marketplace.
ROLE_PARTNER Allows access to read and write all marketplace data.
ROLE_RESELLER Allows access as a Reseller for the company.
ROLE_SALES_SUPPORT Allows access as a Sales Support agent for the marketplace.
ROLE_SYS_ADMIN Allows access as a Company Admin for the company.

Parameters

Parameter Type Data Type Default Description
*companyUuid path string Unique identifier of company in the API request

Body Parameters

User company membership role data

Array of PatchUserCompanyMembershipsAccountV2

Property Type Description
rolesToAdd array of string

Roles to add to this membership. One or more of the following: ROLE_CHANNEL_PRODUCT_SUPPORT (Product Support), ROLE_SALES_SUPPORT (Sales Support), ROLE_RESELLER_MANAGER (Reseller Manager), ROLE_RESELLER (Reseller), ROLE_CHANNEL_SUPPORT (Customer Support), ROLE_SYS_ADMIN (Company Admin), ROLE_BILLING_ADMIN (Billing Admin), ROLE_DEVELOPER (Developer).

rolesToRemove array of string

Roles to remove from this membership. One or more of the following: ROLE_CHANNEL_ADMIN (Marketplace Manager), ROLE_CHANNEL_PRODUCT_SUPPORT (Product Support), ROLE_SALES_SUPPORT (Sales Support), ROLE_RESELLER_MANAGER (Reseller Manager), ROLE_RESELLER (Reseller), ROLE_CHANNEL_SUPPORT (Customer Support), ROLE_SYS_ADMIN (Company Admin), ROLE_BILLING_ADMIN (Billing Admin), ROLE_DEVELOPER (Developer).

userUuid string

UUID of the user whose membership roles need to be modified

Responses

Status Meaning Description Definition
200 OK Success
400 Bad Request Bad request
401 Unauthorized Unauthorized
404 Not Found Company not found

Create company membership

Example request

curl -X POST https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \

POST https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json

var headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
$.ajax({
  url: 'https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships',
  method: 'post',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const request = require('node-fetch');
const inputBody = '{
  "allOf": [
    {
      "description": "Represents a user membership to a company since a user can be a member of multiple companies ([Companies](#companies))",
      "type": "object",
      "title": "CreateUserCompanyMembershipAccountV2",
      "properties": {
        "roles": {
          "description": "Optional.  When not included the company default role will be used.\n\nRoles for this membership. One or more of the following: ROLE_USER (User), ROLE_CHANNEL_PRODUCT_SUPPORT (Product Support), ROLE_SALES_SUPPORT (Sales Support), ROLE_RESELLER_MANAGER (Reseller Manager), ROLE_RESELLER (Reseller), ROLE_CHANNEL_SUPPORT (Customer Support), ROLE_SYS_ADMIN (Company Admin), ROLE_BILLING_ADMIN (Billing Admin), ROLE_DEVELOPER (Developer). For user roles (not associated with membership), see [UserAccountV2](#useraccountv2).",
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "user": {
          "allOf": [
            {
              "description": "User information data",
              "type": "object",
              "title": "CreateUserAccountV2",
              "properties": {
                "allowLogin": {
                  "description": "Optional. Default is \"true\".\n\nWhen set to \"true\", the user is invited to this marketplace company with login access. The user can purchase and assign products within the company. Products can also be purchased on their behalf, and assigned to them.\n\nWhen set to \"false\", the user is added to this marketplace company without login access. Products are purchased and assigned on their behalf, and they access those products directly through the product interface.\n\nNote: If a user already exists in the marketplace and is being added to an additional company, they must be added with the same login access as their other companies.  For example, if a user is currently a member of company A with login access then it's not allowed to add them to company B without login access.",
                  "type": "boolean"
                },
                "email": {
                  "description": "Email address of the user being added to this company.  Used to determine if user already exists in the marketplace and invite the user to the company when allowLogin=true.",
                  "type": "string"
                },
                "firstName": {
                  "description": "First name of the user being added to this company.",
                  "type": "string"
                },
                "lastName": {
                  "description": "Last name of the user being added to this company.",
                  "nullable": true,
                  "type": "string"
                }
              },
              "example": {
                "allowLogin": true,
                "email": "jude.doe@company8578572384.com",
                "firstName": "Jude",
                "lastName": "Doe"
              }
            },
            {
              "description": "User data"
            }
          ]
        }
      },
      "example": {
        "roles": [
          "ROLE_USER"
        ],
        "user": {
          "allowLogin": true,
          "email": "jane.lee@company1151609035.com",
          "firstName": "Jane",
          "lastName": "Lee"
        }
      }
    },
    {
      "example": {
        "roles": [
          "ROLE_USER"
        ],
        "user": {
          "allowLogin": true,
          "email": "mary.gonsalez@company3157614232.com",
          "firstName": "Mary",
          "lastName": "Gonsalez"
        }
      }
    }
  ]
}';
const headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
fetch('https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

r = requests.post('https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships', params={

}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json'
}

result = RestClient.post 'https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships',
  params: {
  }, headers: headers

p JSON.parse(result)

URL obj = new URL("https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

Request body

{
  "roles": [
    "ROLE_USER"
  ],
  "user": {
    "allowLogin": true,
    "email": "mary.gonsalez@company3157614232.com",
    "firstName": "Mary",
    "lastName": "Gonsalez"
  }
}

Example response

{
  "company": {
    "customAttributes": [
      {
        "attributeType": "TEXT",
        "hint": "US West, US Central, or US East",
        "label": "email",
        "name": "Geographic Region",
        "value": "US"
      }
    ],
    "defaultRole": "DEVELOPER",
    "enabled": true,
    "links": [
      {
        "href": "http://localhost:8080/api/account/v2/companies/6b4bd452-895d-4098-aa56-e6046b238e0f",
        "rel": "self"
      },
      {
        "href": "http://localhost:8080/api/account/v2/companies/6b4bd452-895d-4098-aa56-e6046b238e0f/memberships",
        "rel": "memberships"
      }
    ],
    "name": "Appdirect",
    "phoneNumber": "9259221234",
    "picture": null,
    "reseller": true,
    "uuid": "6b4bd452-895d-4098-aa56-e6046b238e0f",
    "vendor": true
  },
  "enabled": true,
  "lastUsed": false,
  "links": [
    {
      "href": "http://localhost:8080/api/account/v2/companies/6b4bd452-895d-4098-aa56-e6046b238e0f/memberships/29c370c8-960a-43a0-8dc5-c09aadbaa101",
      "rel": "self"
    },
    {
      "href": "http://localhost:8080/api/account/v2/users/29c370c8-960a-43a0-8dc5-c09aadbaa101",
      "rel": "user"
    },
    {
      "href": "http://localhost:8080/api/account/v2/companies/6b4bd452-895d-4098-aa56-e6046b238e0f",
      "rel": "company"
    }
  ],
  "metadata": {
    "mosi_username": null
  },
  "mosiUser": null,
  "position": null,
  "roles": [
    "ROLE_DEVELOPER"
  ],
  "user": {
    "activated": false,
    "allowLogin": true,
    "boostUser": null,
    "currency": null,
    "customAttributes": [],
    "email": "mary.gonsalez@company3157614232.com",
    "firstName": "Mary",
    "lastName": "Gonsalez",
    "ldapId": null,
    "links": [
      {
        "href": "http://localhost:8080/api/account/v2/users/29c370c8-960a-43a0-8dc5-c09aadbaa101",
        "rel": "self"
      },
      {
        "href": "http://localhost:8080/api/account/v2/users/29c370c8-960a-43a0-8dc5-c09aadbaa101/memberships",
        "rel": "memberships"
      }
    ],
    "metadata": {
      "apsUid": null
    },
    "picture": null,
    "roles": [
      "ROLE_USER"
    ],
    "userName": "mary.gonsalez@company3157614232.com",
    "uuid": "29c370c8-960a-43a0-8dc5-c09aadbaa101"
  }
}

POST/account/v2/companies/{companyUuid}/memberships

Add a new or existing user as a member of a marketplace company.

If no user exists with the given email address a new user account (Users) will be created. Use the allowLogin body parameter to control if a new user account should be invited to the marketplace with login access or created as a managed user without login access. See CreateUserAccountV2 for more information on the allowLogin parameter.

Depending on channel configuration, an invited membership is either created immediately, or when the invited user accepts the invitation.

Note: You cannot set the Marketplace Manager role through the API.

Required Scope and Authorization Rules

Scope Rule
ROLE_CHANNEL_ADMIN Allows access as a Marketplace Manager for the marketplace.
ROLE_CHANNEL_SUPPORT Allows access as a Customer Support agent for the marketplace.
ROLE_CORPORATE_ADMIN Allows access as a Network Manager for the marketplace.
ROLE_PARTNER Allows access to read and write all marketplace data.
ROLE_RESELLER Allows access as a Reseller for the company.
ROLE_SALES_SUPPORT Allows access as a Sales Support agent for the marketplace.
ROLE_SYS_ADMIN Allows access as a Company Admin for the company.

Parameters

Parameter Type Data Type Default Description
*companyUuid path string Unique identifier of company in the API request
inviterUuid query string Unique identifier of the inviter in the API request. Required only when ROLE_PARTNER authority/scope is used to make the API request.

Body Parameters

User company membership data

CreateUserCompanyMembershipAccountV2 object:

Property Type Description
roles array of string

Optional. When not included the company default role will be used.

Roles for this membership. One or more of the following: ROLE_USER (User), ROLE_CHANNEL_PRODUCT_SUPPORT (Product Support), ROLE_SALES_SUPPORT (Sales Support), ROLE_RESELLER_MANAGER (Reseller Manager), ROLE_RESELLER (Reseller), ROLE_CHANNEL_SUPPORT (Customer Support), ROLE_SYS_ADMIN (Company Admin), ROLE_BILLING_ADMIN (Billing Admin), ROLE_DEVELOPER (Developer). For user roles (not associated with membership), see UserAccountV2.

user CreateUserAccountV2

User data

Responses

Status Meaning Description Definition
201 Created Success UserCompanyMembershipAccountV2
401 Unauthorized Unauthorized
404 Not Found Company/Inviter not found

Delete company membership

Example request

curl -X DELETE https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid} \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \

DELETE https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid} HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json

var headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
$.ajax({
  url: 'https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}',
  method: 'delete',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const request = require('node-fetch');

const headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
fetch('https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}',
{
  method: 'DELETE'

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

r = requests.delete('https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}', params={

}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json'
}

result = RestClient.delete 'https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}',
  params: {
  }, headers: headers

p JSON.parse(result)

URL obj = new URL("https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("DELETE");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

DELETE/account/v2/companies/{companyUuid}/memberships/{userUuid}

Delete a marketplace user's company membership.

If this is the only company the user was member of, user is marked as deleted. A user that has active entitlements, owns products or is externally managed can't be deleted.

Required Scope and Authorization Rules

Scope Rule
ROLE_CHANNEL_ADMIN Allows access as a Marketplace Manager for the marketplace.
ROLE_CHANNEL_SUPPORT Allows access as a Customer Support agent for the marketplace.
ROLE_CORPORATE_ADMIN Allows access as a Network Manager for the marketplace.
ROLE_PARTNER Allows access to read and write all marketplace data.
ROLE_RESELLER Allows access as a Reseller for the company.
ROLE_SALES_SUPPORT Allows access as a Sales Support agent for the marketplace.
ROLE_SYS_ADMIN Allows access as a Company Admin for the company.

Parameters

Parameter Type Data Type Default Description
*companyUuid path string Unique identifier of company in the API request
*userUuid path string Unique identifier of user in the API request

Responses

Status Meaning Description Definition
204 No Content Success
401 Unauthorized Unauthorized
404 Not Found Company/User/Membership not found

Invite a managed user

Example request

curl -X POST https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}/invite \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \

POST https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}/invite HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json

var headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
$.ajax({
  url: 'https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}/invite',
  method: 'post',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const request = require('node-fetch');

const headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
fetch('https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}/invite',
{
  method: 'POST'

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

r = requests.post('https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}/invite', params={

}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json'
}

result = RestClient.post 'https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}/invite',
  params: {
  }, headers: headers

p JSON.parse(result)

URL obj = new URL("https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}/invite");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

POST/account/v2/companies/{companyUuid}/memberships/{userUuid}/invite

Invite a managed user as a member of a marketplace company.

Required Scope and Authorization Rules

Scope Rule
ROLE_CHANNEL_ADMIN Allows access as a Marketplace Manager for the marketplace.
ROLE_CHANNEL_SUPPORT Allows access as a Customer Support agent for the marketplace.
ROLE_CORPORATE_ADMIN Allows access as a Network Manager for the marketplace.
ROLE_PARTNER Allows access to read and write all marketplace data.
ROLE_RESELLER Allows access as a Reseller for the company.
ROLE_SALES_SUPPORT Allows access as a Sales Support agent for the marketplace.
ROLE_SYS_ADMIN Allows access as a Company Admin for the company.

Parameters

Parameter Type Data Type Default Description
*companyUuid path string Unique identifier of company in the API request
inviterUuid query string Unique identifier of the inviter in the API request. Required only when ROLE_PARTNER authority/scope is used to make the API request.
*userUuid path string Unique identifier of user in the API request

Responses

Status Meaning Description Definition
204 No Content Success
401 Unauthorized Unauthorized
404 Not Found Company/ManagedUser/Inviter not found

Enable/Disable company membership

Example request

curl -X PATCH https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid} \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \

PATCH https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid} HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json

var headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
$.ajax({
  url: 'https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}',
  method: 'patch',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const request = require('node-fetch');
const inputBody = '{
  "allOf": [
    {
      "description": "Represents partially updating a user membership to company",
      "type": "object",
      "title": "PatchUserCompanyMembershipAccountV2",
      "properties": {
        "enabled": {
          "description": "Indicates whether membership is enabled",
          "type": "boolean"
        }
      },
      "example": {
        "enabled": true
      }
    },
    {
      "example": {
        "enabled": true
      }
    }
  ]
}';
const headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
fetch('https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}',
{
  method: 'PATCH',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

r = requests.patch('https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}', params={

}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json'
}

result = RestClient.patch 'https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}',
  params: {
  }, headers: headers

p JSON.parse(result)

URL obj = new URL("https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("PATCH");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

Request body

{
  "enabled": true
}

Example response

{
  "company": {
    "defaultRole": "USER",
    "enabled": true,
    "links": [
      {
        "href": "http://appdirect/api/account/v2/companies/88542fbc-f801-4588-9525-e615146889f7",
        "rel": "self"
      },
      {
        "href": "http://appdirect/api/account/v2/companies/88542fbc-f801-4588-9525-e615146889f7/memberships",
        "rel": "memberships"
      }
    ],
    "name": "Company 1079194187",
    "phoneNumber": "9259221234",
    "picture": "http://localhost:8080/profilePics/http://cdn/company.png",
    "uuid": "88542fbc-f801-4588-9525-e615146889f7",
    "vendor": false
  },
  "enabled": true,
  "lastUsed": false,
  "links": [
    {
      "href": "http://appdirect/api/account/v2/companies/88542fbc-f801-4588-9525-e615146889f7/memberships/9cc60e5e-5a46-4efb-9d53-afc6ee0586cd",
      "rel": "self"
    },
    {
      "href": "http://appdirect/api/account/v2/users/9cc60e5e-5a46-4efb-9d53-afc6ee0586cd",
      "rel": "user"
    },
    {
      "href": "http://appdirect/api/account/v2/companies/88542fbc-f801-4588-9525-e615146889f7",
      "rel": "company"
    }
  ],
  "metadata": {
    "mosi_username": null
  },
  "mosiUser": null,
  "position": null,
  "roles": [
    "ROLE_BILLING_ADMIN",
    "ROLE_SYS_ADMIN"
  ],
  "user": {
    "activated": true,
    "allowLogin": true,
    "boostUser": null,
    "email": "susan.gonsalez@company4486527851.com",
    "firstName": "Susan",
    "lastName": "Gonsalez",
    "ldapId": null,
    "links": [
      {
        "href": "http://appdirect/api/account/v2/users/9cc60e5e-5a46-4efb-9d53-afc6ee0586cd",
        "rel": "self"
      },
      {
        "href": "http://appdirect/api/account/v2/users/9cc60e5e-5a46-4efb-9d53-afc6ee0586cd/memberships",
        "rel": "memberships"
      }
    ],
    "metadata": {
      "apsUid": null
    },
    "picture": null,
    "roles": [
      "ROLE_USER"
    ],
    "userName": "susan.gonsalez",
    "uuid": "9cc60e5e-5a46-4efb-9d53-afc6ee0586cd"
  }
}

PATCH/account/v2/companies/{companyUuid}/memberships/{userUuid}

Enable or disable marketplace user's company membership.

This only changes the user company membership's enabled status; all other attributes are ignored.

Required Scope and Authorization Rules

Scope Rule
ROLE_CHANNEL_ADMIN Allows access as a Marketplace Manager for the marketplace.
ROLE_CHANNEL_SUPPORT Allows access as a Customer Support agent for the marketplace.
ROLE_CORPORATE_ADMIN Allows access as a Network Manager for the marketplace.
ROLE_PARTNER Allows access to read and write all marketplace data.
ROLE_RESELLER Allows access as a Reseller for the company.
ROLE_SALES_SUPPORT Allows access as a Sales Support agent for the marketplace.
ROLE_SYS_ADMIN Allows access as a Company Admin for the company.

Parameters

Parameter Type Data Type Default Description
*companyUuid path string Unique identifier of company in the API request
*userUuid path string Unique identifier of user in the API request

Body Parameters

User company membership data

PatchUserCompanyMembershipAccountV2 object:

Property Type Description
enabled boolean

Indicates whether membership is enabled

Responses

Status Meaning Description Definition
200 OK Success UserCompanyMembershipAccountV2
401 Unauthorized Unauthorized
404 Not Found Company/User/Membership not found

Read assignable roles for company membership

Example request

curl -X GET https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}/assignableRoles \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \

GET https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}/assignableRoles HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json

var headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
$.ajax({
  url: 'https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}/assignableRoles',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const request = require('node-fetch');

const headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
fetch('https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}/assignableRoles',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

r = requests.get('https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}/assignableRoles', params={

}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json'
}

result = RestClient.get 'https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}/assignableRoles',
  params: {
  }, headers: headers

p JSON.parse(result)

URL obj = new URL("https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}/assignableRoles");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

Example response

[
  {
    "name": "USER"
  },
  {
    "name": "CHANNEL_PRODUCT_SUPPORT"
  },
  {
    "name": "SALES_SUPPORT"
  },
  {
    "name": "CHANNEL_SUPPORT"
  }
]

GET/account/v2/companies/{companyUuid}/memberships/{userUuid}/assignableRoles

Retrieve marketplace roles that can be assigned by this company membership.

Required Scope and Authorization Rules

Scope Rule
ROLE_CHANNEL_ADMIN Allows access as a Marketplace Manager for the marketplace.
ROLE_CHANNEL_SUPPORT Allows access as a Customer Support agent for the marketplace.
ROLE_CORPORATE_ADMIN Allows access as a Network Manager for the marketplace.
ROLE_PARTNER_READ Allows access to read all marketplace data.
ROLE_RESELLER Allows access as a Reseller for the company.
ROLE_SALES_SUPPORT Allows access as a Sales Support agent for the marketplace.
ROLE_SYS_ADMIN Allows access as a Company Admin for the company.
ROLE_USER Allows access as current user matches the user in path.

Parameters

Parameter Type Data Type Default Description
*companyUuid path string Unique identifier of company in the API request
*userUuid path string Unique identifier of user in the API request

Responses

Status Meaning Description Definition
200 OK Success array of UserRoleAccountV2
401 Unauthorized Unauthorized
404 Not Found Company/User/Membership not found

Read company membership

Example request

curl -X GET https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid} \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \

GET https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid} HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json

var headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
$.ajax({
  url: 'https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const request = require('node-fetch');

const headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
fetch('https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

r = requests.get('https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}', params={

}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json'
}

result = RestClient.get 'https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}',
  params: {
  }, headers: headers

p JSON.parse(result)

URL obj = new URL("https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

Example response

{
  "company": {
    "customAttributes": [
      {
        "attributeType": "TEXT",
        "hint": "US West, US Central, or US East",
        "label": "Geographic Region",
        "name": "Geographic Region",
        "value": "US"
      },
      {
        "attributeType": "MULTISELECT",
        "hint": "",
        "label": "Label Names",
        "name": "Company Details",
        "valueKeys": [
          "great option"
        ]
      }
    ],
    "defaultRole": "DEVELOPER",
    "enabled": true,
    "links": [
      {
        "href": "http://appdirect/api/account/v2/companies/4be3ce24-a702-46b9-a789-f15ce822a9ef",
        "rel": "self"
      },
      {
        "href": "http://appdirect/api/account/v2/companies/4be3ce24-a702-46b9-a789-f15ce822a9ef/memberships",
        "rel": "memberships"
      }
    ],
    "name": "Company 5261852235",
    "phoneNumber": "9259221234",
    "picture": "http://localhost:8080/profilePics/http://cdn/company.png",
    "reseller": true,
    "uuid": "4be3ce24-a702-46b9-a789-f15ce822a9ef",
    "vendor": true
  },
  "enabled": true,
  "lastUsed": false,
  "links": [
    {
      "href": "http://appdirect/api/account/v2/companies/4be3ce24-a702-46b9-a789-f15ce822a9ef/memberships/6de203c1-a583-455a-ba95-3797edc262d0",
      "rel": "self"
    },
    {
      "href": "http://appdirect/api/account/v2/users/6de203c1-a583-455a-ba95-3797edc262d0",
      "rel": "user"
    },
    {
      "href": "http://appdirect/api/account/v2/companies/4be3ce24-a702-46b9-a789-f15ce822a9ef",
      "rel": "company"
    }
  ],
  "metadata": {
    "mosi_username": "adazuretest@sdasd21321.onmicrosoft.com"
  },
  "mosiUser": {
    "username": "adazuretest@sdasd21321.onmicrosoft.com"
  },
  "position": "Business Analyst",
  "roles": [
    "ROLE_BILLING_ADMIN",
    "ROLE_SYS_ADMIN"
  ],
  "user": {
    "activated": true,
    "allowLogin": true,
    "boostUser": {
      "apsUid": "murnu8w"
    },
    "currency": null,
    "customAttributes": [
      {
        "attributeType": "TEXT",
        "hint": "commission_hint",
        "label": "Commission_Payout_ID",
        "name": "C5125859",
        "value": "value"
      }
    ],
    "email": "jude.simpson@company5833088198.com",
    "firstName": "Jude",
    "lastName": "Simpson",
    "ldapId": "1",
    "links": [
      {
        "href": "http://appdirect/api/account/v2/users/6de203c1-a583-455a-ba95-3797edc262d0",
        "rel": "self"
      },
      {
        "href": "http://appdirect/api/account/v2/users/6de203c1-a583-455a-ba95-3797edc262d0/memberships",
        "rel": "memberships"
      }
    ],
    "metadata": {
      "apsUid": "murnu8w"
    },
    "picture": "http://appdirect/profilePics/img2147417701652580695.png?184b58e358f087154d94329f9000b28a",
    "roles": [
      "ROLE_USER"
    ],
    "userName": "jude.simpson",
    "uuid": "6de203c1-a583-455a-ba95-3797edc262d0"
  }
}

GET/account/v2/companies/{companyUuid}/memberships/{userUuid}

Retrieve a marketplace user's company membership information.

Required Scope and Authorization Rules

Scope Rule
ROLE_CHANNEL_ADMIN Allows access as a Marketplace Manager for the marketplace.
ROLE_CHANNEL_SUPPORT Allows access as a Customer Support agent for the marketplace.
ROLE_CORPORATE_ADMIN Allows access as a Network Manager for the marketplace.
ROLE_PARTNER_READ Allows access to read all marketplace data.
ROLE_RESELLER Allows access as a Reseller for the company.
ROLE_RESELLER_MANAGER Allows access as a Reseller Manager for the marketplace. Only memberships with the Reseller role or that are linked to Reseller companies can be retrieved.
ROLE_SALES_SUPPORT Allows access as a Sales Support agent for the marketplace.
ROLE_USER Allows access as an end user in the company

Parameters

Parameter Type Data Type Default Description
*companyUuid path string Unique identifier of company in the API request
*userUuid path string Unique identifier of user in the API request

Responses

Status Meaning Description Definition
200 OK Success UserCompanyMembershipAccountV2
401 Unauthorized Unauthorized
404 Not Found Company/User/Membership not found

List company memberships

Example request

curl -X GET https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \

GET https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json

var headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
$.ajax({
  url: 'https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const request = require('node-fetch');

const headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
fetch('https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

r = requests.get('https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships', params={

}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json'
}

result = RestClient.get 'https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships',
  params: {
  }, headers: headers

p JSON.parse(result)

URL obj = new URL("https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

Example response

{
  "content": [
    {
      "company": {
        "customAttributes": [
          {
            "attributeType": "TEXT",
            "hint": "US West, US Central, or US East",
            "label": "Geographic Region",
            "name": "Geographic Region",
            "value": "US"
          },
          {
            "attributeType": "MULTISELECT",
            "hint": "",
            "label": "Label Names",
            "name": "Company Details",
            "valueKeys": [
              "great option"
            ]
          }
        ],
        "defaultRole": "DEVELOPER",
        "enabled": true,
        "links": [
          {
            "href": "http://appdirect/api/account/v2/companies/4be3ce24-a702-46b9-a789-f15ce822a9ef",
            "rel": "self"
          },
          {
            "href": "http://appdirect/api/account/v2/companies/4be3ce24-a702-46b9-a789-f15ce822a9ef/memberships",
            "rel": "memberships"
          }
        ],
        "name": "Company 5261852235",
        "phoneNumber": "9259221234",
        "picture": "http://localhost:8080/profilePics/http://cdn/company.png",
        "reseller": true,
        "uuid": "4be3ce24-a702-46b9-a789-f15ce822a9ef",
        "vendor": true
      },
      "enabled": true,
      "lastUsed": false,
      "links": [
        {
          "href": "http://appdirect/api/account/v2/companies/4be3ce24-a702-46b9-a789-f15ce822a9ef/memberships/d6e7c0d2-e86a-4ea2-a6c9-c1bbeb2410f0",
          "rel": "self"
        },
        {
          "href": "http://appdirect/api/account/v2/users/d6e7c0d2-e86a-4ea2-a6c9-c1bbeb2410f0",
          "rel": "user"
        },
        {
          "href": "http://appdirect/api/account/v2/companies/4be3ce24-a702-46b9-a789-f15ce822a9ef",
          "rel": "company"
        }
      ],
      "metadata": {
        "mosi_username": "agcompanybill1@testl3816.onmicrosoft.com"
      },
      "mosiUser": {
        "username": "agcompanybill1@testl3816.onmicrosoft.com"
      },
      "position": "Project Team Lead",
      "roles": [
        "ROLE_BILLING_ADMIN",
        "ROLE_SYS_ADMIN"
      ],
      "user": {
        "activated": true,
        "allowLogin": true,
        "boostUser": {
          "apsUid": "murnu8w"
        },
        "currency": null,
        "customAttributes": [
          {
            "attributeType": "TEXT",
            "hint": "commission_hint",
            "label": "Commission_Payout_ID",
            "name": "C5125859",
            "value": "value"
          }
        ],
        "email": "john.simpson@company5833088198.com",
        "firstName": "John",
        "lastName": "Simpson",
        "ldapId": "1",
        "links": [
          {
            "href": "http://appdirect/api/account/v2/users/d6e7c0d2-e86a-4ea2-a6c9-c1bbeb2410f0",
            "rel": "self"
          },
          {
            "href": "http://appdirect/api/account/v2/users/d6e7c0d2-e86a-4ea2-a6c9-c1bbeb2410f0/memberships",
            "rel": "memberships"
          }
        ],
        "metadata": {
          "apsUid": "murnu8w"
        },
        "picture": "http://appdirect/profilePics/img2147417701652580695.png?184b58e358f087154d94329f9000b28a",
        "roles": [
          "ROLE_USER"
        ],
        "userName": "john.simpson",
        "uuid": "d6e7c0d2-e86a-4ea2-a6c9-c1bbeb2410f0"
      }
    },
    {
      "company": {
        "customAttributes": [
          {
            "attributeType": "TEXT",
            "hint": "US West, US Central, or US East",
            "label": "Geographic Region",
            "name": "Geographic Region",
            "value": "US"
          },
          {
            "attributeType": "MULTISELECT",
            "hint": "",
            "label": "Label Names",
            "name": "Company Details",
            "valueKeys": [
              "great option"
            ]
          }
        ],
        "defaultRole": "DEVELOPER",
        "enabled": true,
        "links": [
          {
            "href": "http://appdirect/api/account/v2/companies/4be3ce24-a702-46b9-a789-f15ce822a9ef",
            "rel": "self"
          },
          {
            "href": "http://appdirect/api/account/v2/companies/4be3ce24-a702-46b9-a789-f15ce822a9ef/memberships",
            "rel": "memberships"
          }
        ],
        "name": "Company 5261852235",
        "phoneNumber": "9259221234",
        "picture": "http://localhost:8080/profilePics/http://cdn/company.png",
        "reseller": true,
        "uuid": "4be3ce24-a702-46b9-a789-f15ce822a9ef",
        "vendor": true
      },
      "enabled": true,
      "lastUsed": false,
      "links": [
        {
          "href": "http://appdirect/api/account/v2/companies/4be3ce24-a702-46b9-a789-f15ce822a9ef/memberships/6de203c1-a583-455a-ba95-3797edc262d0",
          "rel": "self"
        },
        {
          "href": "http://appdirect/api/account/v2/users/6de203c1-a583-455a-ba95-3797edc262d0",
          "rel": "user"
        },
        {
          "href": "http://appdirect/api/account/v2/companies/4be3ce24-a702-46b9-a789-f15ce822a9ef",
          "rel": "company"
        }
      ],
      "metadata": {
        "mosi_username": "adazuretest@sdasd21321.onmicrosoft.com"
      },
      "mosiUser": {
        "username": "adazuretest@sdasd21321.onmicrosoft.com"
      },
      "position": "Business Analyst",
      "roles": [
        "ROLE_BILLING_ADMIN",
        "ROLE_SYS_ADMIN"
      ],
      "user": {
        "activated": true,
        "allowLogin": true,
        "boostUser": null,
        "currency": null,
        "customAttributes": [],
        "email": "jude.simpson@company5833088198.com",
        "firstName": "Jude",
        "lastName": "Simpson",
        "ldapId": null,
        "links": [
          {
            "href": "http://appdirect/api/account/v2/users/6de203c1-a583-455a-ba95-3797edc262d0",
            "rel": "self"
          },
          {
            "href": "http://appdirect/api/account/v2/users/6de203c1-a583-455a-ba95-3797edc262d0/memberships",
            "rel": "memberships"
          }
        ],
        "metadata": {
          "apsUid": null
        },
        "picture": null,
        "roles": [
          "ROLE_USER"
        ],
        "userName": "jude.simpson",
        "uuid": "6de203c1-a583-455a-ba95-3797edc262d0"
      }
    }
  ],
  "links": [],
  "page": {
    "number": 0,
    "size": 50,
    "totalElements": 2,
    "totalPages": 1
  }
}

GET/account/v2/companies/{companyUuid}/memberships

List a marketplace company's user memberships.

Required Scope and Authorization Rules

Scope Rule
ROLE_CHANNEL_ADMIN Allows access as a Marketplace Manager for the marketplace.
ROLE_CHANNEL_SUPPORT Allows access as a Customer Support agent for the marketplace.
ROLE_CORPORATE_ADMIN Allows access as a Network Manager for the marketplace.
ROLE_PARTNER_READ Allows access to read all marketplace data.
ROLE_RESELLER Allows access as a Reseller for the company.
ROLE_SALES_SUPPORT Allows access as a Sales Support agent for the marketplace.
ROLE_USER Allows access as an end user in the company.

Parameters

Parameter Type Data Type Default Description
active query boolean If specified, returns only memberships associated with users having the specified active status
*companyUuid path string Unique identifier of company in the API request
enabled query boolean If specified, returns only memberships with the specified enabled status
groupUuid query string If specified, returns only memberships that are a part of the specified group
page query integer 0 Zero-based page index
roleName query string If specified, returns only memberships with the specified role enabled
searchText query string Search term used to search on different fields of a membership
size query integer 50 The size of the page to be returned
sortField query string of enum:
DATE
FIRST_NAME
LAST_NAME
DATE The property to sort by
sortOrder query string of enum:
ASC
DESC
ASC Ordering type

Responses

Status Meaning Description Definition
200 OK Success PagedUserCompanyMembershipAccountV2
401 Unauthorized Unauthorized
404 Not Found Company not found

List application assignments for company membership

Example request

curl -X GET https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}/assignments \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \

GET https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}/assignments HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json

var headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
$.ajax({
  url: 'https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}/assignments',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const request = require('node-fetch');

const headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
fetch('https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}/assignments',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

r = requests.get('https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}/assignments', params={

}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json'
}

result = RestClient.get 'https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}/assignments',
  params: {
  }, headers: headers

p JSON.parse(result)

URL obj = new URL("https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}/assignments");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

Example response

{
  "content": [
    {
      "assignmentCount": 1,
      "companyEntitlementId": 23,
      "companyEntitlementStatus": "ACTIVE",
      "createdOn": 1480699562586,
      "gridImageUrl": "http://appdirect/app_resources/9/myAppIcon/img1445094381431796823.png?466c707fefd0aba59d170d532e013f3d",
      "links": [
        {
          "href": "http://appdirect/api/marketplace/v1/products/47",
          "rel": "application"
        }
      ],
      "listImageUrl": "http://appdirect/app_resources/9/thumbs_64/img1445094381431796823.png?466c707fefd0aba59d170d532e013f3d",
      "ownerFirstName": "Susan",
      "ownerId": 40,
      "ownerLastName": "Simpson",
      "ownerUuid": "4aad1f87-a653-4031-9b64-de42c7c5fa3f",
      "productName": "MockApp208301774438095187",
      "status": "ACTIVE",
      "uuid": "4d8ab391-33b9-472f-abce-6a6bd5e4c39b"
    },
    {
      "assignmentCount": 2,
      "companyEntitlementId": 1323,
      "companyEntitlementStatus": "ACTIVE",
      "createdOn": 1481650330000,
      "gridImageUrl": "http://appdirect/app_resources/2723/myAppIcon/img4627488903781521711.png?0e3706dc6af5012131ca53ed107d0675",
      "links": [
        {
          "href": "http://appdirect/api/marketplace/v1/products/2723?country=&currency=",
          "rel": "application"
        }
      ],
      "listImageUrl": "http://appdirect/app_resources/2723/thumbs_64/img4627488903781521711.png?5eee537065a26ca7f488610144784c88\n",
      "ownerFirstName": "super",
      "ownerId": 1,
      "ownerLastName": "user",
      "ownerUuid": "2f93cb24-f7b9-433f-875e-bb0dd9b0f1c1",
      "productName": "Sample Application2",
      "status": "ACTIVE",
      "uuid": "88ab5014-56fa-4e4e-9090-8ac6e4e2d189"
    }
  ],
  "links": []
}

GET/account/v2/companies/{companyUuid}/memberships/{userUuid}/assignments

Retrieve a marketplace user's application assignments.

Returns assignments that are not FAILED or CANCELLED.

Required Scope and Authorization Rules

Scope Rule
ROLE_CHANNEL_ADMIN Allows access as a Marketplace Manager for the marketplace.
ROLE_CHANNEL_SUPPORT Allows access as a Customer Support agent for the marketplace.
ROLE_CORPORATE_ADMIN Allows access as a Network Manager for the marketplace.
ROLE_PARTNER_READ Allows access to read all marketplace data.
ROLE_RESELLER Allows access as a Reseller for the company.
ROLE_SALES_SUPPORT Allows access as a Sales Support agent for the marketplace.
ROLE_SYS_ADMIN Allows access as a Company Admin for the company.

Parameters

Parameter Type Data Type Default Description
*companyUuid path string Unique identifier of company in the API request
*userUuid path string Unique identifier of user in the API request

Responses

Status Meaning Description Definition
200 OK Success ResourcesUserAssignmentAccountV2
401 Unauthorized Unauthorized
404 Not Found Company/User not found

Read user checklist

Example request

curl -X GET https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}/checklist \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \

GET https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}/checklist HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json

var headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
$.ajax({
  url: 'https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}/checklist',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const request = require('node-fetch');

const headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
fetch('https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}/checklist',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

r = requests.get('https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}/checklist', params={

}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json'
}

result = RestClient.get 'https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}/checklist',
  params: {
  }, headers: headers

p JSON.parse(result)

URL obj = new URL("https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}/checklist");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

Example response

{
  "haveAssignedUsers": false,
  "haveCompletedCompanyProfile": false,
  "haveCompletedProfile": false,
  "haveInvitedUsers": false,
  "havePurchasedProduct": false,
  "links": []
}

GET/account/v2/companies/{companyUuid}/memberships/{userUuid}/checklist

Retrieve a marketplace user's checklist.

Required Scope and Authorization Rules

Scope Rule
ROLE_CHANNEL_ADMIN Allows access as a Marketplace Manager for the marketplace.
ROLE_CORPORATE_ADMIN Allows access as a Network Manager for the marketplace.
ROLE_PARTNER_READ Allows access to read all marketplace data.
ROLE_RESELLER Allows access as a Reseller for the company.
ROLE_SYS_ADMIN Allows access as a Company Admin for the company.
ROLE_USER Allows access as current user matches the user in path.

Parameters

Parameter Type Data Type Default Description
*companyUuid path string Unique identifier of company in the API request
*userUuid path string Unique identifier of user in the API request

Responses

Status Meaning Description Definition
200 OK Success UserChecklistAccountV2
401 Unauthorized Unauthorized
404 Not Found Company/User not found

Request to purchase an application

Example request

curl -X POST https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}/applications/{applicationId}/purchaseRequests \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \

POST https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}/applications/{applicationId}/purchaseRequests HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json

var headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
$.ajax({
  url: 'https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}/applications/{applicationId}/purchaseRequests',
  method: 'post',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const request = require('node-fetch');

const headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
fetch('https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}/applications/{applicationId}/purchaseRequests',
{
  method: 'POST'

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

r = requests.post('https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}/applications/{applicationId}/purchaseRequests', params={

}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json'
}

result = RestClient.post 'https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}/applications/{applicationId}/purchaseRequests',
  params: {
  }, headers: headers

p JSON.parse(result)

URL obj = new URL("https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}/applications/{applicationId}/purchaseRequests");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

POST/account/v2/companies/{companyUuid}/memberships/{userUuid}/applications/{applicationId}/purchaseRequests

Request to purchase an application for the given marketplace company and user.

This causes an email notification to be sent to company administrators (system and billing admins).

Required Scope and Authorization Rules

Scope Rule
ROLE_CHANNEL_ADMIN Allows access as a Marketplace Manager for the marketplace.
ROLE_CORPORATE_ADMIN Allows access as a Network Manager for the marketplace.
ROLE_PARTNER Allows access to read and write all marketplace data.
ROLE_USER Allows access as current user matches the user in path.

Parameters

Parameter Type Data Type Default Description
*applicationId path integer Unique identifier of application to purchase
*companyUuid path string Unique identifier of company in the API request
*userUuid path string User Unique identifier of user in the API request

Responses

Status Meaning Description Definition
204 No Content Success
401 Unauthorized Unauthorized
404 Not Found Company/User/Membership/Application not found
409 Conflict Application already purchased

Update company membership

Example request

curl -X PUT https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid} \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \

PUT https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid} HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json

var headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
$.ajax({
  url: 'https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}',
  method: 'put',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const request = require('node-fetch');
const inputBody = '{
  "allOf": [
    {
      "description": "Represents updating a user membership to company",
      "type": "object",
      "title": "UpdateUserCompanyMembershipAccountV2",
      "properties": {
        "enabled": {
          "description": "Indicates whether membership is enabled",
          "type": "boolean"
        },
        "roles": {
          "description": "Roles for this membership. One or more of the following: ROLE_CHANNEL_ADMIN (Marketplace Manager), ROLE_CHANNEL_PRODUCT_SUPPORT (Product Support), ROLE_SALES_SUPPORT (Sales Support), ROLE_RESELLER_MANAGER (Reseller Manager), ROLE_RESELLER (Reseller), ROLE_CHANNEL_SUPPORT (Customer Support), ROLE_SYS_ADMIN (Company Admin), ROLE_BILLING_ADMIN (Billing Admin), ROLE_DEVELOPER (Developer).",
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "example": {
        "enabled": true,
        "roles": [
          "ROLE_BILLING_ADMIN",
          "ROLE_DEVELOPER",
          "ROLE_SYS_ADMIN"
        ]
      }
    },
    {
      "example": {
        "enabled": true,
        "roles": [
          "ROLE_BILLING_ADMIN",
          "ROLE_DEVELOPER",
          "ROLE_SYS_ADMIN"
        ]
      }
    }
  ]
}';
const headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
fetch('https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}',
{
  method: 'PUT',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

r = requests.put('https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}', params={

}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json'
}

result = RestClient.put 'https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}',
  params: {
  }, headers: headers

p JSON.parse(result)

URL obj = new URL("https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("PUT");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

Request body

{
  "enabled": true,
  "roles": [
    "ROLE_BILLING_ADMIN",
    "ROLE_DEVELOPER",
    "ROLE_SYS_ADMIN"
  ]
}

Example response

{
  "company": {
    "customAttributes": [
      {
        "attributeType": "TEXT",
        "hint": "US West, US Central, or US East",
        "label": "email",
        "name": "Geographic Region",
        "value": "US1"
      }
    ],
    "defaultRole": "DEVELOPER",
    "enabled": true,
    "links": [
      {
        "href": "http://localhost:8080/api/account/v2/companies/6b4bd452-895d-4098-aa56-e6046b238e0f",
        "rel": "self"
      },
      {
        "href": "http://localhost:8080/api/account/v2/companies/6b4bd452-895d-4098-aa56-e6046b238e0f/memberships",
        "rel": "memberships"
      }
    ],
    "name": "Appdirect",
    "phoneNumber": "9259221234",
    "picture": null,
    "reseller": true,
    "uuid": "6b4bd452-895d-4098-aa56-e6046b238e0f",
    "vendor": true
  },
  "enabled": true,
  "lastUsed": false,
  "links": [
    {
      "href": "http://localhost:8080/api/account/v2/companies/6b4bd452-895d-4098-aa56-e6046b238e0f/memberships/a38ef2d2-cdad-483c-ba86-fa6186d12263",
      "rel": "self"
    },
    {
      "href": "http://localhost:8080/api/account/v2/users/a38ef2d2-cdad-483c-ba86-fa6186d12263",
      "rel": "user"
    },
    {
      "href": "http://localhost:8080/api/account/v2/companies/6b4bd452-895d-4098-aa56-e6046b238e0f",
      "rel": "company"
    }
  ],
  "metadata": {
    "mosi_username": null
  },
  "mosiUser": null,
  "position": null,
  "roles": [
    "ROLE_BILLING_ADMIN",
    "ROLE_DEVELOPER",
    "ROLE_SYS_ADMIN",
    "ROLE_CHANNEL_ADMIN",
    "ROLE_CHANNEL_PRODUCT_SUPPORT",
    "ROLE_CHANNEL_SUPPORT",
    "ROLE_SALES_SUPPORT",
    "ROLE_RESELLER",
    "ROLE_RESELLER_MANAGER"
  ],
  "user": {
    "activated": true,
    "allowLogin": true,
    "boostUser": {
      "apsUid": "murnu8w"
    },
    "currency": null,
    "customAttributes": [],
    "email": "guy.smith24@yopmail.com",
    "firstName": "Guy",
    "lastName": "Smith",
    "ldapId": null,
    "links": [
      {
        "href": "http://localhost:8080/api/account/v2/users/a38ef2d2-cdad-483c-ba86-fa6186d12263",
        "rel": "self"
      },
      {
        "href": "http://localhost:8080/api/account/v2/users/a38ef2d2-cdad-483c-ba86-fa6186d12263/memberships",
        "rel": "memberships"
      }
    ],
    "metadata": {
      "apsUid": "murnu8w"
    },
    "picture": null,
    "roles": [
      "ROLE_USER"
    ],
    "userName": "guy.smith24@yopmail.com",
    "uuid": "a38ef2d2-cdad-483c-ba86-fa6186d12263"
  }
}

PUT/account/v2/companies/{companyUuid}/memberships/{userUuid}

Update a marketplace user's company membership.

Updates the following roles based on the provided user company membership data: Product Support, Sales Support, Reseller Manager, Customer Support, Reseller, Billing Admin, Company Admin, Developer. This also enables/disables the membership based on provided user company membership data.

Note: You cannot set the Marketplace Manager role through the API.

Required Scope and Authorization Rules

Scope Rule
ROLE_CHANNEL_ADMIN Allows access as a Marketplace Manager for the marketplace.
ROLE_CHANNEL_SUPPORT Allows access as a Customer Support agent for the marketplace.
ROLE_CORPORATE_ADMIN Allows access as a Network Manager for the marketplace.
ROLE_PARTNER Allows access to read and write all marketplace data.
ROLE_RESELLER Allows access as a Reseller for the company.
ROLE_SALES_SUPPORT Allows access as a Sales Support agent for the marketplace.
ROLE_SYS_ADMIN Allows access as a Company Admin for the company.

Parameters

Parameter Type Data Type Default Description
*companyUuid path string Unique identifier of company in the API request
*userUuid path string Unique identifier of user in the API request

Body Parameters

Update User company membership data

UpdateUserCompanyMembershipAccountV2 object:

Property Type Description
enabled boolean

Indicates whether membership is enabled

roles array of string

Roles for this membership. One or more of the following: ROLE_CHANNEL_ADMIN (Marketplace Manager), ROLE_CHANNEL_PRODUCT_SUPPORT (Product Support), ROLE_SALES_SUPPORT (Sales Support), ROLE_RESELLER_MANAGER (Reseller Manager), ROLE_RESELLER (Reseller), ROLE_CHANNEL_SUPPORT (Customer Support), ROLE_SYS_ADMIN (Company Admin), ROLE_BILLING_ADMIN (Billing Admin), ROLE_DEVELOPER (Developer).

Responses

Status Meaning Description Definition
200 OK Success UserCompanyMembershipAccountV2
401 Unauthorized Unauthorized
404 Not Found Company/User/Membership not found

List groups for company membership

Example request

curl -X GET https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}/groups \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \

GET https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}/groups HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json

var headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
$.ajax({
  url: 'https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}/groups',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const request = require('node-fetch');

const headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
fetch('https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}/groups',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

r = requests.get('https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}/groups', params={

}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json'
}

result = RestClient.get 'https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}/groups',
  params: {
  }, headers: headers

p JSON.parse(result)

URL obj = new URL("https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}/groups");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

Example response

{
  "content": [
    {
      "companyDefault": false,
      "companyUuid": "6b4bd452-895d-4098-aa56-e6046b238e0f",
      "description": "superuser group",
      "externallyManaged": false,
      "links": [
        {
          "href": "http://appdirect/api/account/v2/companies/6b4bd452-895d-4098-aa56-e6046b238e0f/groups/56ac8abc-2b63-4b66-a648-dde419aa6c4a",
          "rel": "self"
        },
        {
          "href": "http://appdirect/api/account/v2/companies/6b4bd452-895d-4098-aa56-e6046b238e0f",
          "rel": "company"
        },
        {
          "href": "http://appdirect/api/account/v2/companies/6b4bd452-895d-4098-aa56-e6046b238e0f/groups/56ac8abc-2b63-4b66-a648-dde419aa6c4a/memberships?member=true&page=0&size=50",
          "rel": "memberships"
        }
      ],
      "memberCount": 2,
      "name": "superuser-group",
      "systemManaged": false,
      "uuid": "56ac8abc-2b63-4b66-a648-dde419aa6c4a"
    },
    {
      "companyDefault": true,
      "companyUuid": "6b4bd452-895d-4098-aa56-e6046b238e0f",
      "description": "All company users",
      "externallyManaged": false,
      "links": [
        {
          "href": "http://appdirect/api/account/v2/companies/6b4bd452-895d-4098-aa56-e6046b238e0f/groups/5acdd82e-5cb7-4a23-b842-38d514aafcdf",
          "rel": "self"
        },
        {
          "href": "http://appdirect/api/account/v2/companies/6b4bd452-895d-4098-aa56-e6046b238e0f",
          "rel": "company"
        },
        {
          "href": "http://appdirect/api/account/v2/companies/6b4bd452-895d-4098-aa56-e6046b238e0f/groups/5acdd82e-5cb7-4a23-b842-38d514aafcdf/memberships?member=true&page=0&size=50",
          "rel": "memberships"
        }
      ],
      "memberCount": 88,
      "name": "Everyone",
      "systemManaged": true,
      "uuid": "5acdd82e-5cb7-4a23-b842-38d514aafcdf"
    },
    {
      "companyDefault": false,
      "companyUuid": "6b4bd452-895d-4098-aa56-e6046b238e0f",
      "description": "All Company Admin users",
      "externallyManaged": false,
      "links": [
        {
          "href": "http://appdirect/api/account/v2/companies/6b4bd452-895d-4098-aa56-e6046b238e0f/groups/74f7132f-8dd9-4b3a-8014-5aac81dc2c05",
          "rel": "self"
        },
        {
          "href": "http://appdirect/api/account/v2/companies/6b4bd452-895d-4098-aa56-e6046b238e0f",
          "rel": "company"
        },
        {
          "href": "http://appdirect/api/account/v2/companies/6b4bd452-895d-4098-aa56-e6046b238e0f/groups/74f7132f-8dd9-4b3a-8014-5aac81dc2c05/memberships?member=true&page=0&size=50",
          "rel": "memberships"
        }
      ],
      "memberCount": 14,
      "name": "Company Admins",
      "systemManaged": true,
      "uuid": "74f7132f-8dd9-4b3a-8014-5aac81dc2c05"
    },
    {
      "companyDefault": false,
      "companyUuid": "6b4bd452-895d-4098-aa56-e6046b238e0f",
      "description": "All Marketplace Managers",
      "externallyManaged": false,
      "links": [
        {
          "href": "http://appdirect/api/account/v2/companies/6b4bd452-895d-4098-aa56-e6046b238e0f/groups/9a79c98d-8e36-49ed-837c-cc9473dee851",
          "rel": "self"
        },
        {
          "href": "http://appdirect/api/account/v2/companies/6b4bd452-895d-4098-aa56-e6046b238e0f",
          "rel": "company"
        },
        {
          "href": "http://appdirect/api/account/v2/companies/6b4bd452-895d-4098-aa56-e6046b238e0f/groups/9a79c98d-8e36-49ed-837c-cc9473dee851/memberships?member=true&page=0&size=50",
          "rel": "memberships"
        }
      ],
      "memberCount": 9,
      "name": "Marketplace Managers",
      "systemManaged": true,
      "uuid": "9a79c98d-8e36-49ed-837c-cc9473dee851"
    },
    {
      "companyDefault": false,
      "companyUuid": "6b4bd452-895d-4098-aa56-e6046b238e0f",
      "description": "All Reseller Manager users",
      "externallyManaged": false,
      "links": [
        {
          "href": "http://appdirect/api/account/v2/companies/6b4bd452-895d-4098-aa56-e6046b238e0f/groups/6d970a9e-a702-406f-808b-9483163efdd1",
          "rel": "self"
        },
        {
          "href": "http://appdirect/api/account/v2/companies/6b4bd452-895d-4098-aa56-e6046b238e0f",
          "rel": "company"
        },
        {
          "href": "http://appdirect/api/account/v2/companies/6b4bd452-895d-4098-aa56-e6046b238e0f/groups/6d970a9e-a702-406f-808b-9483163efdd1/memberships?member=true&page=0&size=50",
          "rel": "memberships"
        }
      ],
      "memberCount": 2,
      "name": "Reseller Managers",
      "systemManaged": true,
      "uuid": "6d970a9e-a702-406f-808b-9483163efdd1"
    },
    {
      "companyDefault": false,
      "companyUuid": "6b4bd452-895d-4098-aa56-e6046b238e0f",
      "description": "All Customer Support users",
      "externallyManaged": false,
      "links": [
        {
          "href": "http://appdirect/api/account/v2/companies/6b4bd452-895d-4098-aa56-e6046b238e0f/groups/70c65cb0-cbe5-447c-bdce-1d00e4d08f84",
          "rel": "self"
        },
        {
          "href": "http://appdirect/api/account/v2/companies/6b4bd452-895d-4098-aa56-e6046b238e0f",
          "rel": "company"
        },
        {
          "href": "http://appdirect/api/account/v2/companies/6b4bd452-895d-4098-aa56-e6046b238e0f/groups/70c65cb0-cbe5-447c-bdce-1d00e4d08f84/memberships?member=true&page=0&size=50",
          "rel": "memberships"
        }
      ],
      "memberCount": 12,
      "name": "Customer Support",
      "systemManaged": true,
      "uuid": "70c65cb0-cbe5-447c-bdce-1d00e4d08f84"
    },
    {
      "companyDefault": false,
      "companyUuid": "6b4bd452-895d-4098-aa56-e6046b238e0f",
      "description": "All Sales Support users",
      "externallyManaged": false,
      "links": [
        {
          "href": "http://appdirect/api/account/v2/companies/6b4bd452-895d-4098-aa56-e6046b238e0f/groups/73f252d5-0dbe-4414-8384-edb7544b83b6",
          "rel": "self"
        },
        {
          "href": "http://appdirect/api/account/v2/companies/6b4bd452-895d-4098-aa56-e6046b238e0f",
          "rel": "company"
        },
        {
          "href": "http://appdirect/api/account/v2/companies/6b4bd452-895d-4098-aa56-e6046b238e0f/groups/73f252d5-0dbe-4414-8384-edb7544b83b6/memberships?member=true&page=0&size=50",
          "rel": "memberships"
        }
      ],
      "memberCount": 13,
      "name": "Sales Support",
      "systemManaged": true,
      "uuid": "73f252d5-0dbe-4414-8384-edb7544b83b6"
    },
    {
      "companyDefault": false,
      "companyUuid": "6b4bd452-895d-4098-aa56-e6046b238e0f",
      "description": "All Product Support users",
      "externallyManaged": false,
      "links": [
        {
          "href": "http://appdirect/api/account/v2/companies/6b4bd452-895d-4098-aa56-e6046b238e0f/groups/b0cf07b9-9953-406f-ba64-b4ca239f30bf",
          "rel": "self"
        },
        {
          "href": "http://appdirect/api/account/v2/companies/6b4bd452-895d-4098-aa56-e6046b238e0f",
          "rel": "company"
        },
        {
          "href": "http://appdirect/api/account/v2/companies/6b4bd452-895d-4098-aa56-e6046b238e0f/groups/b0cf07b9-9953-406f-ba64-b4ca239f30bf/memberships?member=true&page=0&size=50",
          "rel": "memberships"
        }
      ],
      "memberCount": 12,
      "name": "Product Support",
      "systemManaged": true,
      "uuid": "b0cf07b9-9953-406f-ba64-b4ca239f30bf"
    },
    {
      "companyDefault": false,
      "companyUuid": "6b4bd452-895d-4098-aa56-e6046b238e0f",
      "description": "All Developer users",
      "externallyManaged": false,
      "links": [
        {
          "href": "http://appdirect/api/account/v2/companies/6b4bd452-895d-4098-aa56-e6046b238e0f/groups/a7d34c49-a376-433b-af53-f51be1cf2038",
          "rel": "self"
        },
        {
          "href": "http://appdirect/api/account/v2/companies/6b4bd452-895d-4098-aa56-e6046b238e0f",
          "rel": "company"
        },
        {
          "href": "http://appdirect/api/account/v2/companies/6b4bd452-895d-4098-aa56-e6046b238e0f/groups/a7d34c49-a376-433b-af53-f51be1cf2038/memberships?member=true&page=0&size=50",
          "rel": "memberships"
        }
      ],
      "memberCount": 78,
      "name": "Developers",
      "systemManaged": true,
      "uuid": "a7d34c49-a376-433b-af53-f51be1cf2038"
    },
    {
      "companyDefault": false,
      "companyUuid": "6b4bd452-895d-4098-aa56-e6046b238e0f",
      "description": "All Billing Admin users",
      "externallyManaged": false,
      "links": [
        {
          "href": "http://appdirect/api/account/v2/companies/6b4bd452-895d-4098-aa56-e6046b238e0f/groups/84d6c781-9290-461c-a18f-010791cb87ca",
          "rel": "self"
        },
        {
          "href": "http://appdirect/api/account/v2/companies/6b4bd452-895d-4098-aa56-e6046b238e0f",
          "rel": "company"
        },
        {
          "href": "http://appdirect/api/account/v2/companies/6b4bd452-895d-4098-aa56-e6046b238e0f/groups/84d6c781-9290-461c-a18f-010791cb87ca/memberships?member=true&page=0&size=50",
          "rel": "memberships"
        }
      ],
      "memberCount": 20,
      "name": "Billing Admins",
      "systemManaged": true,
      "uuid": "84d6c781-9290-461c-a18f-010791cb87ca"
    }
  ],
  "links": [
    {
      "href": "http://appdirect/api/account/v2/companies/6b4bd452-895d-4098-aa56-e6046b238e0f/memberships/2f93cb24-f7b9-433f-875e-bb0dd9b0f1c1/groups?page=0&size=50&sortField=createdOn&sortOrder=DESC",
      "rel": "self"
    }
  ],
  "page": {
    "number": 0,
    "size": 50,
    "totalElements": 10,
    "totalPages": 1
  }
}

GET/account/v2/companies/{companyUuid}/memberships/{userUuid}/groups

Retrieve the list of groups the company membership is in.

Required Scope and Authorization Rules

Scope Rule
ROLE_CHANNEL_ADMIN Allows access as a Marketplace Manager for the marketplace.
ROLE_CHANNEL_SUPPORT Allows access as a Customer Support agent for the marketplace.
ROLE_CORPORATE_ADMIN Allows access as a Network Manager for the marketplace.
ROLE_PARTNER_READ Allows access to read all marketplace data.
ROLE_RESELLER Allows access as a Reseller for the company.
ROLE_SALES_SUPPORT Allows access as a Sales Support agent for the marketplace.
ROLE_USER Allows access as an end user in the company

Parameters

Parameter Type Data Type Default Description
*companyUuid path string Unique identifier of company in the API request
ldap query boolean Set to true when company is externally managed
page query integer 0 Zero-based page index
searchText query string Search term used to search on group name and description
size query integer 50 The size of the page to be returned
sortField query string createdOn
sortOrder query string of enum:
ASC
DESC
DESC
*userUuid path string Unique identifier of user in the API request

Responses

Status Meaning Description Definition
200 OK Success PagedCompanyGroupAccountV2
401 Unauthorized Unauthorized
404 Not Found Company/User not found

Currency Exchange Rate

Deactivate a Currency Exchange Rate

Example request

curl -X PATCH https://{marketplaceURL}/api/channel/v1/exchangeRates/{currencyExchangeRateUuid} \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \

PATCH https://{marketplaceURL}/api/channel/v1/exchangeRates/{currencyExchangeRateUuid} HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json

var headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
$.ajax({
  url: 'https://{marketplaceURL}/api/channel/v1/exchangeRates/{currencyExchangeRateUuid}',
  method: 'patch',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const request = require('node-fetch');
const inputBody = '{
  "allOf": [
    {
      "properties": {
        "active": {
          "description": "Currency Exchange Rates can be only deactivated. Allowed value: false.",
          "type": "boolean"
        }
      },
      "example": {
        "active": true
      }
    },
    {
      "description": "Currency Exchange Rate active object",
      "example": {
        "active": false
      }
    }
  ]
}';
const headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
fetch('https://{marketplaceURL}/api/channel/v1/exchangeRates/{currencyExchangeRateUuid}',
{
  method: 'PATCH',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

r = requests.patch('https://{marketplaceURL}/api/channel/v1/exchangeRates/{currencyExchangeRateUuid}', params={

}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json'
}

result = RestClient.patch 'https://{marketplaceURL}/api/channel/v1/exchangeRates/{currencyExchangeRateUuid}',
  params: {
  }, headers: headers

p JSON.parse(result)

URL obj = new URL("https://{marketplaceURL}/api/channel/v1/exchangeRates/{currencyExchangeRateUuid}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("PATCH");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

Request body

{
  "active": false
}

Example response

{
  "active": true,
  "authenticationType": "USER_LOGIN",
  "baseCurrency": "GTQ",
  "counterCurrency": "INR",
  "currencyExchangeRateUuid": "76b11329-e3a5-4944-93b0-0411c9f63369",
  "oauthKey": "",
  "rate": 0.3,
  "userId": 3434556,
  "validFrom": 1507077229000
}

PATCH/channel/v1/exchangeRates/{currencyExchangeRateUuid}

Deactivate a Currency Exchange Rate. To stop supporting currency exchange on your marketplace, deactivate a rate. This will prevent the exchange rate from being used to convert usage.

Parameters

Parameter Type Data Type Default Description
*currencyExchangeRateUuid path string The unique identifier of the currency exchange rate.

Body Parameters

Currency Exchange Rate active

Responses

Status Meaning Description Definition
200 OK OK CurrencyExchangeRate
404 Not Found Not Found

Read all Currency Exchange Rates

Example request

curl -X GET https://{marketplaceURL}/api/channel/v1/exchangeRates \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \

GET https://{marketplaceURL}/api/channel/v1/exchangeRates HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json

var headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
$.ajax({
  url: 'https://{marketplaceURL}/api/channel/v1/exchangeRates',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const request = require('node-fetch');

const headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
fetch('https://{marketplaceURL}/api/channel/v1/exchangeRates',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

r = requests.get('https://{marketplaceURL}/api/channel/v1/exchangeRates', params={

}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json'
}

result = RestClient.get 'https://{marketplaceURL}/api/channel/v1/exchangeRates',
  params: {
  }, headers: headers

p JSON.parse(result)

URL obj = new URL("https://{marketplaceURL}/api/channel/v1/exchangeRates");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

Example response

{
  "content": [
    {
      "active": true,
      "authenticationType": "CHANNEL_CONSUMER_LOGIN",
      "baseCurrency": "USD",
      "counterCurrency": "CAD",
      "currencyExchangeRateUuid": "9ec1a010-2814-42c9-a9e0-44ed1f5895f0",
      "oauthKey": "dNcCBthw82",
      "rate": 1.25,
      "userId": 1111,
      "validFrom": 1507077229000
    }
  ],
  "links": [
    {
      "href": "http://appdirect/api/channel/v1/exchangeRates?page=1",
      "rel": "next"
    }
  ],
  "page": {
    "number": 0,
    "size": 20,
    "totalElements": 50,
    "totalPages": 3
  }
}

GET/channel/v1/exchangeRates

Retrieve all of the current and historical exchange rates set on the marketplace.

Parameters

Parameter Type Data Type Default Description
baseCurrency query string of enum:
USD
CAD
EUR
JPY
GBP
KRW
CHF
SEK
SGD
MYR
AUD
MXN
INR
BRL
DKK
NZD
NOK
ZAR
PHP
CNY
SAR
GTQ
Supported currencies for the system
counterCurrency query string of enum:
USD
CAD
EUR
JPY
GBP
KRW
CHF
SEK
SGD
MYR
AUD
MXN
INR
BRL
DKK
NZD
NOK
ZAR
PHP
CNY
SAR
GTQ
Supported currencies for the system
page query integer 0 The page number. Optional.
size query integer 20 The number of application returned by page. Optional.
sortField query string of enum:
BASE_CURRENCY
COUNTER_CURRENCY
VALID_FROM
VALID_FROM The order field. Optional.
sortOrder query string of enum:
ASC
DESC
DESC The sort direction. Optional.

Responses

Status Meaning Description Definition
200 OK OK CurrencyExchangeRateList
404 Not Found Not Found

Create new Currency Exchange Rate

Example request

curl -X POST https://{marketplaceURL}/api/channel/v1/exchangeRates \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \

POST https://{marketplaceURL}/api/channel/v1/exchangeRates HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json

var headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
$.ajax({
  url: 'https://{marketplaceURL}/api/channel/v1/exchangeRates',
  method: 'post',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const request = require('node-fetch');
const inputBody = '{
  "allOf": [
    {
      "type": "object",
      "title": "CurrencyExchangeRateRequest",
      "required": [
        "baseCurrency",
        "counterCurrency",
        "rate"
      ],
      "properties": {
        "baseCurrency": {
          "allOf": [
            {
              "description": "Supported currencies for the system",
              "type": "string",
              "title": "Currency",
              "enum": [
                "USD",
                "CAD",
                "EUR",
                "JPY",
                "GBP",
                "KRW",
                "CHF",
                "SEK",
                "SGD",
                "MYR",
                "AUD",
                "MXN",
                "INR",
                "BRL",
                "DKK",
                "NZD",
                "NOK",
                "ZAR",
                "PHP",
                "CNY",
                "SAR",
                "GTQ"
              ]
            },
            {
              "description": "A supported External Currency"
            }
          ]
        },
        "counterCurrency": {
          "allOf": [
            {
              "description": "Supported currencies for the system",
              "type": "string",
              "title": "Currency",
              "enum": [
                "USD",
                "CAD",
                "EUR",
                "JPY",
                "GBP",
                "KRW",
                "CHF",
                "SEK",
                "SGD",
                "MYR",
                "AUD",
                "MXN",
                "INR",
                "BRL",
                "DKK",
                "NZD",
                "NOK",
                "ZAR",
                "PHP",
                "CNY",
                "SAR",
                "GTQ"
              ]
            },
            {
              "description": "A supported Marketplace Currency"
            }
          ]
        },
        "rate": {
          "description": "A currency pair is the quotation and pricing structure of the currencies traded in a forex market. A Currency Pair is represented as XXX/YYY where XXX is the Base currency and YYY is the Counter currency.\n\nIn AppDirect the Base currency is an external currency and the Counter currency is a supported currency in your marketplace.\n\nWhen an exchange rate is provided with a Currency Pair, it represents how much of the Counter currency is required to purchase 1 unit of the Base currency.\nEUR/USD=1.18; EUR is the Base currency and USD is the counter currency.\n1 EUR is equal to 1.18 USD.\nIn order to buy 1 EUR, the buyer must pay 1.18 USD.",
          "type": "number"
        }
      },
      "example": {
        "baseCurrency": "USD",
        "counterCurrency": "CAD",
        "rate": 0.5
      }
    },
    {
      "description": "Currency Exchange Rate object",
      "example": {
        "baseCurrency": "USD",
        "counterCurrency": "CAD",
        "rate": 0.2
      }
    }
  ]
}';
const headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
fetch('https://{marketplaceURL}/api/channel/v1/exchangeRates',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

r = requests.post('https://{marketplaceURL}/api/channel/v1/exchangeRates', params={

}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json'
}

result = RestClient.post 'https://{marketplaceURL}/api/channel/v1/exchangeRates',
  params: {
  }, headers: headers

p JSON.parse(result)

URL obj = new URL("https://{marketplaceURL}/api/channel/v1/exchangeRates");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

Request body

{
  "baseCurrency": "USD",
  "counterCurrency": "CAD",
  "rate": 0.2
}

Example response

{
  "active": true,
  "authenticationType": "USER_LOGIN",
  "baseCurrency": "GTQ",
  "counterCurrency": "INR",
  "currencyExchangeRateUuid": "76b11329-e3a5-4944-93b0-0411c9f63369",
  "oauthKey": "",
  "rate": 0.3,
  "userId": 3434556,
  "validFrom": 1507077229000
}

POST/channel/v1/exchangeRates

Define a new exchange rate to be used when custom metered usage is reported to your marketplace by a Developer in a currency that isn't supported by your marketplace. This enables you to invoice your customers in your marketplace currency, even though a Developer's external price list for metered usage charges (like Amazon Web Services) might be in a different currency.

Body Parameters

The new Currency Exchange Rate

CurrencyExchangeRateRequest object:

Property Type Description
baseCurrency Currency

A supported External Currency

counterCurrency Currency

A supported Marketplace Currency

rate number

A currency pair is the quotation and pricing structure of the currencies traded in a forex market. A Currency Pair is represented as XXX/YYY where XXX is the Base currency and YYY is the Counter currency.

In AppDirect the Base currency is an external currency and the Counter currency is a supported currency in your marketplace.

When an exchange rate is provided with a Currency Pair, it represents how much of the Counter currency is required to purchase 1 unit of the Base currency.

EUR/USD=1.18; EUR is the Base currency and USD is the counter currency.

1 EUR is equal to 1.18 USD.

In order to buy 1 EUR, the buyer must pay 1.18 USD.

Responses

Status Meaning Description Definition
200 OK OK CurrencyExchangeRate
404 Not Found Not Found

Read a Currency Exchange Rate

Example request

curl -X GET https://{marketplaceURL}/api/channel/v1/exchangeRates/{currencyExchangeRateUuid} \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \

GET https://{marketplaceURL}/api/channel/v1/exchangeRates/{currencyExchangeRateUuid} HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json

var headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
$.ajax({
  url: 'https://{marketplaceURL}/api/channel/v1/exchangeRates/{currencyExchangeRateUuid}',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const request = require('node-fetch');

const headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
fetch('https://{marketplaceURL}/api/channel/v1/exchangeRates/{currencyExchangeRateUuid}',
{
  method: 'GET',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

r = requests.get('https://{marketplaceURL}/api/channel/v1/exchangeRates/{currencyExchangeRateUuid}', params={

}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json'
}

result = RestClient.get 'https://{marketplaceURL}/api/channel/v1/exchangeRates/{currencyExchangeRateUuid}',
  params: {
  }, headers: headers

p JSON.parse(result)

URL obj = new URL("https://{marketplaceURL}/api/channel/v1/exchangeRates/{currencyExchangeRateUuid}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

Example response

{
  "active": true,
  "authenticationType": "USER_LOGIN",
  "baseCurrency": "GTQ",
  "counterCurrency": "INR",
  "currencyExchangeRateUuid": "76b11329-e3a5-4944-93b0-0411c9f63369",
  "oauthKey": "",
  "rate": 0.3,
  "userId": 3434556,
  "validFrom": 1507077229000
}

GET/channel/v1/exchangeRates/{currencyExchangeRateUuid}

Retrieve the details of a specific Currency Exchange Rate.

Parameters

Parameter Type Data Type Default Description
*currencyExchangeRateUuid path string The unique identifier of the currency exchange rate.

Responses

Status Meaning Description Definition
200 OK OK CurrencyExchangeRate
404 Not Found Not Found

Customer Notifications

Create or update a common email template element

This call allows you to create a new template element (for example, a variable) or update an existing one.

Example request

curl -X POST https://{marketplaceURL}/api/notification/v1/templates/common/email \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \

POST https://{marketplaceURL}/api/notification/v1/templates/common/email HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json

var headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
$.ajax({
  url: 'https://{marketplaceURL}/api/notification/v1/templates/common/email',
  method: 'post',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const request = require('node-fetch');
const inputBody = '{
  "allOf": [
    {
      "type": "object",
      "title": "NotificationCommonEmailElementWS",
      "required": [
        "type",
        "content",
        "locale"
      ],
      "properties": {
        "content": {
          "description": "Email notification content",
          "type": "string"
        },
        "defaultCommonElement": {
          "description": "If the elements are default common elements",
          "type": "boolean"
        },
        "enabled": {
          "description": "If the email template is enabled",
          "type": "boolean"
        },
        "id": {
          "description": "Email notification template ID",
          "type": "number"
        },
        "locale": {
          "description": "Email notification locale to determine the language",
          "type": "string"
        },
        "partner": {
          "description": "Partner being used to render the email",
          "type": "string"
        },
        "type": {
          "allOf": [
            {
              "type": "string",
              "title": "NotificationCommonElementType",
              "enum": [
                "UNSUBSCRIBE"
              ]
            },
            {
              "description": "Email notification common element type"
            }
          ]
        }
      }
    },
    {
      "example": {
        "content": "This is a test.",
        "enabled": true,
        "locale": "en_US",
        "partner": "APPDIRECT",
        "type": "UNSUBSCRIBE"
      }
    }
  ]
}';
const headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
fetch('https://{marketplaceURL}/api/notification/v1/templates/common/email',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

r = requests.post('https://{marketplaceURL}/api/notification/v1/templates/common/email', params={

}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json'
}

result = RestClient.post 'https://{marketplaceURL}/api/notification/v1/templates/common/email',
  params: {
  }, headers: headers

p JSON.parse(result)

URL obj = new URL("https://{marketplaceURL}/api/notification/v1/templates/common/email");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

Request body

{
  "content": "This is a test.",
  "enabled": true,
  "locale": "en_US",
  "partner": "APPDIRECT",
  "type": "UNSUBSCRIBE"
}

Example response

{
  "content": "This is a test.",
  "defaultCommonElement": false,
  "enabled": true,
  "id": 3,
  "locale": "en_US",
  "partner": "APPDIRECT",
  "type": "UNSUBSCRIBE"
}

POST/notification/v1/templates/common/email

Create or update a common email template element This call allows you to create a new template element (for example, a variable) or update an existing one.

Body Parameters

Common element definition

NotificationCommonEmailElementWS object:

Property Type Description
content string

Email notification content

defaultCommonElement boolean

If the elements are default common elements

enabled boolean

If the email template is enabled

id number

Email notification template ID

locale string

Email notification locale to determine the language

partner string

Partner being used to render the email

type NotificationCommonElementType

Email notification common element type

Responses

Status Meaning Description Definition
200 OK Read notification common elements successfully.

Create or update an email template

This call creates a new email template or updates an existing template.

Example request

curl -X POST https://{marketplaceURL}/api/notification/v1/templates/email \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \

POST https://{marketplaceURL}/api/notification/v1/templates/email HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json

var headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
$.ajax({
  url: 'https://{marketplaceURL}/api/notification/v1/templates/email',
  method: 'post',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const request = require('node-fetch');
const inputBody = '{
  "allOf": [
    {
      "type": "object",
      "title": "NotificationEmailTemplateWS",
      "required": [
        "type",
        "locale",
        "subject",
        "content"
      ],
      "properties": {
        "content": {
          "description": "Email notification content",
          "type": "string"
        },
        "defaultTemplate": {
          "description": "If the template is a default template of it's kind",
          "type": "boolean"
        },
        "directSales": {
          "description": "If the template is used for a direct sale product",
          "type": "boolean"
        },
        "enabled": {
          "description": "If the email template is enabled",
          "type": "boolean"
        },
        "fallbackEmailTemplateId": {
          "description": "The ID of the template to fallback to if current one is disabled or not existing",
          "type": "number"
        },
        "id": {
          "description": "Email notification template ID",
          "type": "number"
        },
        "locale": {
          "description": "Email notification locale to determine the language",
          "type": "string"
        },
        "partner": {
          "description": "Partner being used to render the email",
          "type": "string"
        },
        "reminderPattern": {
          "description": "Notification reminder pattern",
          "type": "string"
        },
        "subject": {
          "description": "Email notification subject",
          "type": "string"
        },
        "type": {
          "allOf": [
            {
              "type": "string",
              "title": "NotificationTemplateType",
              "enum": [
                "ACCOUNT_ACTIVATION",
                "ACCOUNT_ACTIVATION_AFTER_MIGRATION",
                "BRANDED_ACCOUNT_ACTIVATION",
                "ACCOUNT_ACTIVATION_CREATED_BY_ASSISTED_SALES",
                "ACTIVE_USER_TEMP_PASSWORD",
                "NEW_USER",
                "INVITE_USER",
                "BAAS_MARKETPLACE_SIGN_UP_REQUEST",
                "LISTING_MARKETPLACE_SIGN_UP_REQUEST",
                "STORE_MARKETPLACE_SIGN_UP_REQUEST",
                "LISTING_MARKETPLACE_SIGN_UP_REMINDER",
                "STORE_MARKETPLACE_SIGN_UP_REMINDER",
                "PASSWORD_RESET",
                "PASSWORD_CHANGED_NOTICE",
                "PRIMARY_EMAIL_CHANGED_NOTICE",
                "EMAIL_VERIFICATION",
                "IMPERSONATE_REQUEST",
                "PASSWORD_REMINDER",
                "REGISTRATION_REMINDER",
                "FIRST_TIME_LOGIN",
                "INACTIVE_USER_LOGIN_REMINDER",
                "INACTIVE_USER_PURCHASE_REMINDER",
                "ACCOUNT_ACTIVATION_FOR_EMAIL_CHANGE",
                "TWO_FACTOR_AUTHENTICATION_EMAIL",
                "ASSIGNMENT_NOTICE",
                "UNASSIGNMENT_NOTICE",
                "ASSIGNED_USERS_LIMIT",
                "ADOPTION_NOTICE",
                "SUBSCRIPTION_ADOPTION",
                "APPLICATION_ACCESS_REQUEST_NOTICE",
                "APPLICATION_PURCHASE_REQUEST_NOTICE",
                "EXPIRED_APPLICATION_REQUEST",
                "SUSPENDED_APPLICATION_REQUEST",
                "UPDATED_DOWNLOAD",
                "REVIEW_PURCHASE_REMINDER",
                "DENY_REVIEW",
                "DISCOUNT_DEACTIVATED",
                "CHANGE_OWNERSHIP",
                "REACTIVATE_DOMAIN",
                "SUBSCRIPTION_ORDER",
                "SUBSCRIPTION_ORDER_SINGLE_USER",
                "SUBSCRIPTION_ORDER_FREE_TRIAL",
                "PERSONAL_SUBSCRIPTION_NOTICE",
                "SUBSCRIPTION_ORDER_DOCUMENT",
                "SUBSCRIPTION_ORDER_MODULE",
                "FAILED_ORDER",
                "SUBSCRIPTION_UPGRADE",
                "FREE_TRIAL_OVER",
                "FREE_TRIAL_AUTO_UPGRADE_TO_PAID",
                "EXPIRED_TRIAL_UPGRADE_REMINDER",
                "INVOICE",
                "PAYMENT_SUCCESSFUL",
                "PAYMENT_FAILED",
                "REFUND",
                "EXPIRED_CREDIT_CARD",
                "SUBSCRIPTION_SUSPENDED_OVERDUE_INVOICE",
                "SUBSCRIPTION_SUSPENDED",
                "SUBSCRIPTION_CANCEL",
                "SUBSCRIPTION_CANCEL_SCHEDULED",
                "SCHEDULED_CANCELLATION_REMINDER",
                "TICKET_SUPPORT_SUBSCRIPTION_CANCEL",
                "FAILED_TO_REMOVE_USER",
                "FAILED_TO_REMOVE_USER_HAS_ACTIVE_OR_PENDING_APPS",
                "FAILED_TO_REMOVE_USER_OWNS_APPS",
                "FAILED_TO_REMOVE_USER_SOLE_SYSADMIN",
                "END_OF_CONTRACT",
                "OFF_PURCHASE_ORDER",
                "ORDER_APPROVAL_REQUEST",
                "SUBSCRIPTION_ORDER_RESELLER",
                "SUBSCRIPTION_CHANGE_RESELLER",
                "PUBLISH_REQUEST_PENDING_APPROVAL",
                "APPLICATION_PUBLISHED",
                "PUBLISH_DENIED",
                "VENDOR_NOTIFICATION",
                "VENDOR_REVIEW",
                "QUESTION_ASKED",
                "VENDOR_PUBLISH_REQUEST",
                "NETWORK_APPLICATION_REPUBLISHED",
                "MANUAL_EVENT_RESOLUTION",
                "NEW_REPORT_AVAILABLE",
                "REPORT_GENERATED",
                "REPORT_SUMMARY",
                "NEW_REPORT_SPECIFIC_NOTIFICATION",
                "OFFLINE_ORDER",
                "OFFLINE_ASSIGNMENT",
                "PRODUCT_CREDENTIALS",
                "MOSI_BOOST_FAILURE",
                "CREST_NEW_ADMIN",
                "MOSI_NEW_ADMIN",
                "MOSI_NEW_USER",
                "MOSI_UPDATE_USERNAME",
                "MOSI_ORDER_PLACED",
                "GOOGLE_NEW_ADMIN_USER",
                "GOOGLE_NEW_USER",
                "SENDGRID_PURCHASE",
                "MCAFEE_PURCHASE",
                "SCALEXTREME_ACCOUNT",
                "SYMANTEC_CLOUD_NEW_ACCOUNT",
                "SYMANTEC_CLOUD_OLD_ACCOUNT",
                "SYMANTEC_EV_CLOUD_NOTIFICATION",
                "MOZY_NEW_USER",
                "NORTON_NEW_USER_PC",
                "WEBEX_NEW_USER",
                "ASYNCHRONOUS_PRODUCT_PURCHASE_NOTIFICATION",
                "MARKETPLACE_REQUEST_TO_ADD_PRODUCT",
                "VENDOR_ADD_REQUEST",
                "PRODUCT_ADDED",
                "VENDOR_APPROVED",
                "AZURE_SYNC_INVITE_NEW_USER",
                "AZURE_SYNC_INVITE_USER",
                "DOCUSIGN_PURCHASE",
                "DOCUSIGN_ASSIGN",
                "RESELLER_LINKED",
                "RESELLER_UNLINKED",
                "RESELLER_SIGNUP_REQUESTED",
                "RESELLER_SIGNUP_APPROVED",
                "RESELLER_SIGNUP_DENIED",
                "TBILL_VALIDATION",
                "TBILL_APPROVED_USER_NOTIFICATION",
                "TBILL_REJECTED_USER_NOTIFICATION",
                "TBILL_APPROVED_CHANNEL_NOTIFICATION",
                "TBILL_REJECTED_CHANNEL_NOTIFICATION",
                "TBILL_INVALID_NOTIFICATION",
                "LEFTRONIC_ACCOUNT_ACTIVATION",
                "DOMAIN_REGISTRATION_DOMAIN_PURCHASED_NEW",
                "DOMAIN_REGISTRATION_DOMAIN_PURCHASED_TRANSFER",
                "DOMAIN_REGISTRATION_DOMAIN_TRANSFER_COMPLETE",
                "DOMAIN_REGISTRATION_END_OF_CONTRACT",
                "DOMAIN_REGISTRATION_END_OF_CONTRACT_MANUAL_RENEWAL",
                "DOMAIN_REGISTRATION_DOMAIN_SUSPENDED",
                "DOMAIN_REGISTRATION_DOMAIN_CANCELED",
                "O365_RESET_DOMAIN_USER_PASSWORDS",
                "SALES_LEAD_CREATED",
                "SALES_LEAD_ACCEPTED",
                "SALES_LEAD_DENIED",
                "SALES_LEAD_ASSIGNED",
                "SALES_LEAD_WON",
                "SALES_LEAD_LOST",
                "LEAD_PRODUCT_CREATED_ADMIN",
                "LEAD_MANUAL_CREATED_RESELLER",
                "LEAD_MANUAL_CREATED_DEVELOPER",
                "LEAD_PRODUCT_CREATED_SSR",
                "LEAD_REFERRED_COMPANY_SSR",
                "LEAD_REFERRED_COMPANY_RESELLER",
                "LEAD_CONVERTED_ADMIN",
                "LEAD_CONVERTED_SSR",
                "PRODUCT_PROFILE_LEAD_CREATED",
                "CUSTOM_AD_HOC",
                "SALES_OPPORTUNITY_CREATED",
                "SALES_OPPORTUNITY_APPROVED",
                "SALES_OPPORTUNITY_DENIED",
                "RESELLER_PROFILE_PUBLICATION_REQUESTED",
                "RESELLER_PROFILE_PUBLICATION_REQUEST_CANCELLED",
                "RESELLER_PROFILE_UNPUBLISHED",
                "RESELLER_PROFILE_PUBLICATION_APPROVED",
                "RESELLER_PROFILE_PUBLICATION_DENIED",
                "MICROSOFT_CREDENTIALS_SENT",
                "FAILED_CONTRACT",
                "WHOLESALES_PRICE_END_USER_ACTION_PENDING_PRICE_GRANTED",
                "WHOLESALE_PRICE_END_USER_ACTION_PENDING_PRICE_GRANTED_BY_SALES_SUPPORT",
                "WHOLESALE_PRICE_END_USER_ACTION_PENDING_REJECTED",
                "WHOLESALE_PRICE_END_USER_ACTION_PENDING_REJECTED_BY_CHANNEL",
                "WHOLESALES_PRICE_RESELLER_ACTION_PENDING_PRICE_REQUESTED",
                "WHOLESALE_PRICE_SALES_SUPPORT_ACTION_PENDING_PRICE_REQUESTED",
                "WHOLESALES_PRICE_RESELLER_ACTION_PENDING_PRICE_REQUESTED_FOR_COMPANY_ADMIN",
                "WHOLESALE_PRICE_RESELLER_ACTION_PENDING_REJECTED_BY_RESELLER_MANAGER",
                "WHOLESALE_PRICE_SALES_SUPPORT_ACTION_PENDING_REJECTED_BY_CHANNEL_ADMIN",
                "WHOLESALE_PRICE_RESELLER_ACTION_PENDING_REJECTED_BY_END_USER",
                "WHOLESALE_PRICE_SALES_SUPPORT_ACTION_PENDING_REJECTED_BY_END_USER",
                "WHOLESALES_PRICE_RESELLER_ACTION_PENDING_MANAGER_APPROVED",
                "WHOLESALES_PRICE_RESELLER_MANAGER_ACTION_PENDING_PRICE_REQUESTED",
                "WHOLESALES_PRICE_RESELLER_MANAGER_ACTION_PENDING_PRICE_REQUESTED_FOR_CHANNEL_ADMIN",
                "API_ALERT",
                "WELCOME_USER",
                "CREDIT_CARD_REQUIRED"
              ]
            },
            {
              "description": "Email notification template type"
            }
          ]
        }
      }
    },
    {
      "example": {
        "content": "This is a test.",
        "directSales": false,
        "enabled": true,
        "fallbackEmailTemplateId": 1,
        "locale": "en_US",
        "partner": "APPDIRECT",
        "subject": "Test email",
        "type": "ACCOUNT_ACTIVATION"
      }
    }
  ]
}';
const headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
fetch('https://{marketplaceURL}/api/notification/v1/templates/email',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

r = requests.post('https://{marketplaceURL}/api/notification/v1/templates/email', params={

}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json'
}

result = RestClient.post 'https://{marketplaceURL}/api/notification/v1/templates/email',
  params: {
  }, headers: headers

p JSON.parse(result)

URL obj = new URL("https://{marketplaceURL}/api/notification/v1/templates/email");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

Request body

{
  "content": "This is a test.",
  "directSales": false,
  "enabled": true,
  "fallbackEmailTemplateId": 1,
  "locale": "en_US",
  "partner": "APPDIRECT",
  "subject": "Test email",
  "type": "ACCOUNT_ACTIVATION"
}

Example response

{
  "content": "This is a test.",
  "defaultTemplate": false,
  "directSales": false,
  "enabled": true,
  "fallbackEmailTemplateId": 1,
  "id": 573,
  "locale": "en_US",
  "partner": "APPDIRECT",
  "reminderPattern": "pattern...",
  "subject": "Test email",
  "type": "ACCOUNT_ACTIVATION"
}

POST/notification/v1/templates/email

Create or update an email template This call creates a new email template or updates an existing template.

Body Parameters

Template definition

NotificationEmailTemplateWS object:

Property Type Description
content string

Email notification content

defaultTemplate boolean

If the template is a default template of it's kind

directSales boolean

If the template is used for a direct sale product

enabled boolean

If the email template is enabled

fallbackEmailTemplateId number

The ID of the template to fallback to if current one is disabled or not existing

id number

Email notification template ID

locale string

Email notification locale to determine the language

partner string

Partner being used to render the email

reminderPattern string

Notification reminder pattern

subject string

Email notification subject

type NotificationTemplateType

Email notification template type

Responses

Status Meaning Description Definition
200 OK Read notification common elements successfully.

Create or update an sms template

This call create a new element or updates an existing SMS template.

Example request

curl -X POST https://{marketplaceURL}/api/notification/v1/templates/sms \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \

POST https://{marketplaceURL}/api/notification/v1/templates/sms HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json

var headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
$.ajax({
  url: 'https://{marketplaceURL}/api/notification/v1/templates/sms',
  method: 'post',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const request = require('node-fetch');
const inputBody = '{
  "allOf": [
    {
      "type": "object",
      "title": "NotificationSmsTemplateWS",
      "required": [
        "type",
        "locale",
        "content"
      ],
      "properties": {
        "content": {
          "description": "SMS notification content",
          "type": "string"
        },
        "directSales": {
          "description": "If the template is used for a direct sale product",
          "type": "boolean"
        },
        "enabled": {
          "description": "If the SMS template is enabled",
          "type": "boolean"
        },
        "id": {
          "description": "SMS notification template ID",
          "type": "number"
        },
        "locale": {
          "description": "SMS notification locale to determine the language",
          "type": "string"
        },
        "type": {
          "allOf": [
            {
              "type": "string",
              "title": "NotificationTemplateType",
              "enum": [
                "ACCOUNT_ACTIVATION",
                "ACCOUNT_ACTIVATION_AFTER_MIGRATION",
                "BRANDED_ACCOUNT_ACTIVATION",
                "ACCOUNT_ACTIVATION_CREATED_BY_ASSISTED_SALES",
                "ACTIVE_USER_TEMP_PASSWORD",
                "NEW_USER",
                "INVITE_USER",
                "BAAS_MARKETPLACE_SIGN_UP_REQUEST",
                "LISTING_MARKETPLACE_SIGN_UP_REQUEST",
                "STORE_MARKETPLACE_SIGN_UP_REQUEST",
                "LISTING_MARKETPLACE_SIGN_UP_REMINDER",
                "STORE_MARKETPLACE_SIGN_UP_REMINDER",
                "PASSWORD_RESET",
                "PASSWORD_CHANGED_NOTICE",
                "PRIMARY_EMAIL_CHANGED_NOTICE",
                "EMAIL_VERIFICATION",
                "IMPERSONATE_REQUEST",
                "PASSWORD_REMINDER",
                "REGISTRATION_REMINDER",
                "FIRST_TIME_LOGIN",
                "INACTIVE_USER_LOGIN_REMINDER",
                "INACTIVE_USER_PURCHASE_REMINDER",
                "ACCOUNT_ACTIVATION_FOR_EMAIL_CHANGE",
                "TWO_FACTOR_AUTHENTICATION_EMAIL",
                "ASSIGNMENT_NOTICE",
                "UNASSIGNMENT_NOTICE",
                "ASSIGNED_USERS_LIMIT",
                "ADOPTION_NOTICE",
                "SUBSCRIPTION_ADOPTION",
                "APPLICATION_ACCESS_REQUEST_NOTICE",
                "APPLICATION_PURCHASE_REQUEST_NOTICE",
                "EXPIRED_APPLICATION_REQUEST",
                "SUSPENDED_APPLICATION_REQUEST",
                "UPDATED_DOWNLOAD",
                "REVIEW_PURCHASE_REMINDER",
                "DENY_REVIEW",
                "DISCOUNT_DEACTIVATED",
                "CHANGE_OWNERSHIP",
                "REACTIVATE_DOMAIN",
                "SUBSCRIPTION_ORDER",
                "SUBSCRIPTION_ORDER_SINGLE_USER",
                "SUBSCRIPTION_ORDER_FREE_TRIAL",
                "PERSONAL_SUBSCRIPTION_NOTICE",
                "SUBSCRIPTION_ORDER_DOCUMENT",
                "SUBSCRIPTION_ORDER_MODULE",
                "FAILED_ORDER",
                "SUBSCRIPTION_UPGRADE",
                "FREE_TRIAL_OVER",
                "FREE_TRIAL_AUTO_UPGRADE_TO_PAID",
                "EXPIRED_TRIAL_UPGRADE_REMINDER",
                "INVOICE",
                "PAYMENT_SUCCESSFUL",
                "PAYMENT_FAILED",
                "REFUND",
                "EXPIRED_CREDIT_CARD",
                "SUBSCRIPTION_SUSPENDED_OVERDUE_INVOICE",
                "SUBSCRIPTION_SUSPENDED",
                "SUBSCRIPTION_CANCEL",
                "SUBSCRIPTION_CANCEL_SCHEDULED",
                "SCHEDULED_CANCELLATION_REMINDER",
                "TICKET_SUPPORT_SUBSCRIPTION_CANCEL",
                "FAILED_TO_REMOVE_USER",
                "FAILED_TO_REMOVE_USER_HAS_ACTIVE_OR_PENDING_APPS",
                "FAILED_TO_REMOVE_USER_OWNS_APPS",
                "FAILED_TO_REMOVE_USER_SOLE_SYSADMIN",
                "END_OF_CONTRACT",
                "OFF_PURCHASE_ORDER",
                "ORDER_APPROVAL_REQUEST",
                "SUBSCRIPTION_ORDER_RESELLER",
                "SUBSCRIPTION_CHANGE_RESELLER",
                "PUBLISH_REQUEST_PENDING_APPROVAL",
                "APPLICATION_PUBLISHED",
                "PUBLISH_DENIED",
                "VENDOR_NOTIFICATION",
                "VENDOR_REVIEW",
                "QUESTION_ASKED",
                "VENDOR_PUBLISH_REQUEST",
                "NETWORK_APPLICATION_REPUBLISHED",
                "MANUAL_EVENT_RESOLUTION",
                "NEW_REPORT_AVAILABLE",
                "REPORT_GENERATED",
                "REPORT_SUMMARY",
                "NEW_REPORT_SPECIFIC_NOTIFICATION",
                "OFFLINE_ORDER",
                "OFFLINE_ASSIGNMENT",
                "PRODUCT_CREDENTIALS",
                "MOSI_BOOST_FAILURE",
                "CREST_NEW_ADMIN",
                "MOSI_NEW_ADMIN",
                "MOSI_NEW_USER",
                "MOSI_UPDATE_USERNAME",
                "MOSI_ORDER_PLACED",
                "GOOGLE_NEW_ADMIN_USER",
                "GOOGLE_NEW_USER",
                "SENDGRID_PURCHASE",
                "MCAFEE_PURCHASE",
                "SCALEXTREME_ACCOUNT",
                "SYMANTEC_CLOUD_NEW_ACCOUNT",
                "SYMANTEC_CLOUD_OLD_ACCOUNT",
                "SYMANTEC_EV_CLOUD_NOTIFICATION",
                "MOZY_NEW_USER",
                "NORTON_NEW_USER_PC",
                "WEBEX_NEW_USER",
                "ASYNCHRONOUS_PRODUCT_PURCHASE_NOTIFICATION",
                "MARKETPLACE_REQUEST_TO_ADD_PRODUCT",
                "VENDOR_ADD_REQUEST",
                "PRODUCT_ADDED",
                "VENDOR_APPROVED",
                "AZURE_SYNC_INVITE_NEW_USER",
                "AZURE_SYNC_INVITE_USER",
                "DOCUSIGN_PURCHASE",
                "DOCUSIGN_ASSIGN",
                "RESELLER_LINKED",
                "RESELLER_UNLINKED",
                "RESELLER_SIGNUP_REQUESTED",
                "RESELLER_SIGNUP_APPROVED",
                "RESELLER_SIGNUP_DENIED",
                "TBILL_VALIDATION",
                "TBILL_APPROVED_USER_NOTIFICATION",
                "TBILL_REJECTED_USER_NOTIFICATION",
                "TBILL_APPROVED_CHANNEL_NOTIFICATION",
                "TBILL_REJECTED_CHANNEL_NOTIFICATION",
                "TBILL_INVALID_NOTIFICATION",
                "LEFTRONIC_ACCOUNT_ACTIVATION",
                "DOMAIN_REGISTRATION_DOMAIN_PURCHASED_NEW",
                "DOMAIN_REGISTRATION_DOMAIN_PURCHASED_TRANSFER",
                "DOMAIN_REGISTRATION_DOMAIN_TRANSFER_COMPLETE",
                "DOMAIN_REGISTRATION_END_OF_CONTRACT",
                "DOMAIN_REGISTRATION_END_OF_CONTRACT_MANUAL_RENEWAL",
                "DOMAIN_REGISTRATION_DOMAIN_SUSPENDED",
                "DOMAIN_REGISTRATION_DOMAIN_CANCELED",
                "O365_RESET_DOMAIN_USER_PASSWORDS",
                "SALES_LEAD_CREATED",
                "SALES_LEAD_ACCEPTED",
                "SALES_LEAD_DENIED",
                "SALES_LEAD_ASSIGNED",
                "SALES_LEAD_WON",
                "SALES_LEAD_LOST",
                "LEAD_PRODUCT_CREATED_ADMIN",
                "LEAD_MANUAL_CREATED_RESELLER",
                "LEAD_MANUAL_CREATED_DEVELOPER",
                "LEAD_PRODUCT_CREATED_SSR",
                "LEAD_REFERRED_COMPANY_SSR",
                "LEAD_REFERRED_COMPANY_RESELLER",
                "LEAD_CONVERTED_ADMIN",
                "LEAD_CONVERTED_SSR",
                "PRODUCT_PROFILE_LEAD_CREATED",
                "CUSTOM_AD_HOC",
                "SALES_OPPORTUNITY_CREATED",
                "SALES_OPPORTUNITY_APPROVED",
                "SALES_OPPORTUNITY_DENIED",
                "RESELLER_PROFILE_PUBLICATION_REQUESTED",
                "RESELLER_PROFILE_PUBLICATION_REQUEST_CANCELLED",
                "RESELLER_PROFILE_UNPUBLISHED",
                "RESELLER_PROFILE_PUBLICATION_APPROVED",
                "RESELLER_PROFILE_PUBLICATION_DENIED",
                "MICROSOFT_CREDENTIALS_SENT",
                "FAILED_CONTRACT",
                "WHOLESALES_PRICE_END_USER_ACTION_PENDING_PRICE_GRANTED",
                "WHOLESALE_PRICE_END_USER_ACTION_PENDING_PRICE_GRANTED_BY_SALES_SUPPORT",
                "WHOLESALE_PRICE_END_USER_ACTION_PENDING_REJECTED",
                "WHOLESALE_PRICE_END_USER_ACTION_PENDING_REJECTED_BY_CHANNEL",
                "WHOLESALES_PRICE_RESELLER_ACTION_PENDING_PRICE_REQUESTED",
                "WHOLESALE_PRICE_SALES_SUPPORT_ACTION_PENDING_PRICE_REQUESTED",
                "WHOLESALES_PRICE_RESELLER_ACTION_PENDING_PRICE_REQUESTED_FOR_COMPANY_ADMIN",
                "WHOLESALE_PRICE_RESELLER_ACTION_PENDING_REJECTED_BY_RESELLER_MANAGER",
                "WHOLESALE_PRICE_SALES_SUPPORT_ACTION_PENDING_REJECTED_BY_CHANNEL_ADMIN",
                "WHOLESALE_PRICE_RESELLER_ACTION_PENDING_REJECTED_BY_END_USER",
                "WHOLESALE_PRICE_SALES_SUPPORT_ACTION_PENDING_REJECTED_BY_END_USER",
                "WHOLESALES_PRICE_RESELLER_ACTION_PENDING_MANAGER_APPROVED",
                "WHOLESALES_PRICE_RESELLER_MANAGER_ACTION_PENDING_PRICE_REQUESTED",
                "WHOLESALES_PRICE_RESELLER_MANAGER_ACTION_PENDING_PRICE_REQUESTED_FOR_CHANNEL_ADMIN",
                "API_ALERT",
                "WELCOME_USER",
                "CREDIT_CARD_REQUIRED"
              ]
            },
            {
              "description": "SMS notification template type"
            }
          ]
        }
      }
    },
    {
      "example": {
        "content": "This is a test.",
        "directSales": false,
        "enabled": true,
        "locale": "en_US",
        "type": "ACCOUNT_ACTIVATION"
      }
    }
  ]
}';
const headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
fetch('https://{marketplaceURL}/api/notification/v1/templates/sms',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

r = requests.post('https://{marketplaceURL}/api/notification/v1/templates/sms', params={

}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json'
}

result = RestClient.post 'https://{marketplaceURL}/api/notification/v1/templates/sms',
  params: {
  }, headers: headers

p JSON.parse(result)

URL obj = new URL("https://{marketplaceURL}/api/notification/v1/templates/sms");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

Request body

{
  "content": "This is a test.",
  "directSales": false,
  "enabled": true,
  "locale": "en_US",
  "type": "ACCOUNT_ACTIVATION"
}

Example response

{
  "content": "This is a test.",
  "directSales": false,
  "enabled": true,
  "id": 1,
  "locale": "en_US",
  "type": "ACCOUNT_ACTIVATION"
}

POST/notification/v1/templates/sms

Create or update an sms template This call create a new element or updates an existing SMS template.

Body Parameters

Sms Template definition

NotificationSmsTemplateWS object:

Property Type Description
content string

SMS notification content

directSales boolean

If the template is used for a direct sale product

enabled boolean

If the SMS template is enabled

id number

SMS notification template ID

locale string

SMS notification locale to determine the language

type NotificationTemplateType

SMS notification template type

Responses

Status Meaning Description Definition
200 OK Read notification common elements successfully.

Retrieve common email element by type

Retrieve common email element by type for the current channel.

Example request

curl -X GET https://{marketplaceURL}/api/notification/v1/templates/common/email/{type} \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \

GET https://{marketplaceURL}/api/notification/v1/templates/common/email/{type} HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json

var headers = {
    'Content-Type':'application/json