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 2018-08-15 09:45:08 EST

Bundles

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 = {
  'Accept':'application/json',
  'Content-Type':'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 = {
  'Accept':'application/json',
  'Content-Type':'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);
});
require 'rest-client'
require 'json'

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

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

params: {
},
headers: headers

p JSON.parse(result)
import requests
headers = {
  'Accept': 'application/json',
  'Content-Type': 'application/json'
}

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

params={
},
headers = headers)

print r.json()
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. BundleListing

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 = {
  'Accept':'application/json',
  'Content-Type':'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 = {
  'Accept':'application/json',
  'Content-Type':'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);
});
require 'rest-client'
require 'json'

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

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

params: {
},
headers: headers

p JSON.parse(result)
import requests
headers = {
  'Accept': 'application/json',
  'Content-Type': 'application/json'
}

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

params={
},
headers = headers)

print r.json()
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.

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 = {
  'Accept':'application/json',
  'Content-Type':'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 = {
  'Accept':'application/json',
  'Content-Type':'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);
});
require 'rest-client'
require 'json'

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

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

params: {
},
headers: headers

p JSON.parse(result)
import requests
headers = {
  'Accept': 'application/json',
  'Content-Type': 'application/json'
}

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

params={
},
headers = headers)

print r.json()
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. UserAppInfo
404 Not Found Bundle application not found.

Companies

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 = {
  'Accept':'application/json',
  'Content-Type':'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 = {
  'Accept':'application/json',
  'Content-Type':'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);
});
require 'rest-client'
require 'json'

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

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

params: {
},
headers: headers

p JSON.parse(result)
import requests
headers = {
  'Accept': 'application/json',
  'Content-Type': 'application/json'
}

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

params={
},
headers = headers)

print r.json()
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": "jernej.klancic@sweatshop.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": "Jernej \u0026 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": "sweatshop.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": "jernej.klancic@sweatshop.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": "Jernej \u0026 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": "sweatshop.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 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 = {
  'Accept':'application/json',
  'Content-Type':'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 = {
  'Accept':'application/json',
  'Content-Type':'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);
});
require 'rest-client'
require 'json'

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

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

params: {
},
headers: headers

p JSON.parse(result)
import requests
headers = {
  'Accept': 'application/json',
  'Content-Type': 'application/json'
}

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

params={
},
headers = headers)

print r.json()
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": "jernej.klancic@sweatshop.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": "sweatshop.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

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 = {
  'Accept':'application/json',
  'Content-Type':'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 = {
  'Accept':'application/json',
  'Content-Type':'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);
});
require 'rest-client'
require 'json'

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

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

params: {
},
headers: headers

p JSON.parse(result)
import requests
headers = {
  'Accept': 'application/json',
  'Content-Type': 'application/json'
}

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

params={
},
headers = headers)

print r.json()
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

Create new company

Example request


curl -X post \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  --data-binary @- https://{marketplaceURL}/api/account/v2/companies <<EOF
{
  "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
}
EOF

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

{
  "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
}


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

};

$.ajax({
  url: 'https://{marketplaceURL}/api/account/v2/companies',
  method: 'post',
  dataType: 'json',
  data: {
  "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
},

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})
const request = require('node-fetch');
const inputBody = '{
  "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 = {
  'Accept':'application/json',
  'Content-Type':'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);
});
require 'rest-client'
require 'json'

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

result = RestClient.post 'https://{marketplaceURL}/api/account/v2/companies',
payload={
  "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
}
params: {
},
headers: headers

p JSON.parse(result)
import requests
headers = {
  'Accept': 'application/json',
  'Content-Type': 'application/json'
}

r = requests.post('https://{marketplaceURL}/api/account/v2/companies',
json={
  "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
}
params={
},
headers = headers)

print r.json()
URL obj = new URL("https://{marketplaceURL}/api/account/v2/companies");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
String inputBody = "{" +
  "\"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" +
"}";

OutputStream os = conn.getOutputStream();
os.write(inputBody.getBytes("UTF-8"));
os.close();

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

{
  "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

Update company

Example request


curl -X put \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  --data-binary @- https://{marketplaceURL}/api/account/v2/companies/{companyUuid} <<EOF
{
  "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",
  "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"
}
EOF

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

{
  "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",
  "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"
}


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

};

$.ajax({
  url: 'https://{marketplaceURL}/api/account/v2/companies/{companyUuid}',
  method: 'put',
  dataType: 'json',
  data: {
  "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",
  "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"
},

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})
const request = require('node-fetch');
const inputBody = '{
  "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",
  "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 = {
  'Accept':'application/json',
  'Content-Type':'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);
});
require 'rest-client'
require 'json'

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

result = RestClient.put 'https://{marketplaceURL}/api/account/v2/companies/{companyUuid}',
payload={
  "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",
  "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"
}
params: {
},
headers: headers

p JSON.parse(result)
import requests
headers = {
  'Accept': 'application/json',
  'Content-Type': 'application/json'
}

r = requests.put('https://{marketplaceURL}/api/account/v2/companies/{companyUuid}',
json={
  "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",
  "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"
}
params={
},
headers = headers)

print r.json()
URL obj = new URL("https://{marketplaceURL}/api/account/v2/companies/{companyUuid}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("PUT");
String inputBody = "{" +
  "\"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\"," +
  "\"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\"" +
"}";

OutputStream os = conn.getOutputStream();
os.write(inputBody.getBytes("UTF-8"));
os.close();

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": "jernej.klancic@sweatshop.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": "sweatshop.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
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

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 = {
  'Accept':'application/json',
  'Content-Type':'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 = {
  'Accept':'application/json',
  'Content-Type':'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);
});
require 'rest-client'
require 'json'

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

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

params: {
},
headers: headers

p JSON.parse(result)
import requests
headers = {
  'Accept': 'application/json',
  'Content-Type': 'application/json'
}

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

params={
},
headers = headers)

print r.json()
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"
      }
    ],
    "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 InvoiceListing
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 = {
  'Accept':'application/json',
  'Content-Type':'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 = {
  'Accept':'application/json',
  'Content-Type':'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);
});
require 'rest-client'
require 'json'

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

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

params: {
},
headers: headers

p JSON.parse(result)
import requests
headers = {
  'Accept': 'application/json',
  'Content-Type': 'application/json'
}

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

params={
},
headers = headers)

print r.json()
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
*companyId path string Company UUID.
... query string Search filter.
count query integer 250 Number of results to fetch. Used for paging.
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.

Responses

Status Meaning Description Definition
200 OK OK OrderDetailedListing
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 = {
  'Accept':'application/json',
  'Content-Type':'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 = {
  'Accept':'application/json',
  'Content-Type':'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);
});
require 'rest-client'
require 'json'

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

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

params: {
},
headers: headers

p JSON.parse(result)
import requests
headers = {
  'Accept': 'application/json',
  'Content-Type': 'application/json'
}

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

params={
},
headers = headers)

print r.json()
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 Payment
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 = {
  'Accept':'application/json',
  'Content-Type':'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 = {
  'Accept':'application/json',
  'Content-Type':'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);
});
require 'rest-client'
require 'json'

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

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

params: {
},
headers: headers

p JSON.parse(result)
import requests
headers = {
  'Accept': 'application/json',
  'Content-Type': 'application/json'
}

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

params={
},
headers = headers)

print r.json()
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
*companyId path string Company UUID
... query string Subscription filter to be applied
count query integer 250 Number of results to fetch. Used for paging.
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.

Responses

Status Meaning Description Definition
200 OK OK 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 = {
  'Accept':'application/json',
  'Content-Type':'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 = {
  'Accept':'application/json',
  'Content-Type':'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);
});
require 'rest-client'
require 'json'

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

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

params: {
},
headers: headers

p JSON.parse(result)
import requests
headers = {
  'Accept': 'application/json',
  'Content-Type': 'application/json'
}

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

params={
},
headers = headers)

print r.json()
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

Headers:
  X-Total-Count: 1
[
  {
    "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"
      }
    ],
    "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
*userId path string User 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

Responses

Status Meaning Description Definition
200 OK OK InvoiceListing
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 = {
  'Accept':'application/json',
  'Content-Type':'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 = {
  'Accept':'application/json',
  'Content-Type':'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);
});
require 'rest-client'
require 'json'

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

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

params: {
},
headers: headers

p JSON.parse(result)
import requests
headers = {
  'Accept': 'application/json',
  'Content-Type': 'application/json'
}

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

params={
},
headers = headers)

print r.json()
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
*companyId path string User's company UUID.
*userId path string User UUID.
filter query string Search filter.
count query integer 250 Number of results to fetch. Used for paging.
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.

Responses

Status Meaning Description Definition
200 OK Response.

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 = {
  'Accept':'application/json',
  'Content-Type':'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 = {
  'Accept':'application/json',
  'Content-Type':'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);
});
require 'rest-client'
require 'json'

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

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

params: {
},
headers: headers

p JSON.parse(result)
import requests
headers = {
  'Accept': 'application/json',
  'Content-Type': 'application/json'
}

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

params={
},
headers = headers)

print r.json()
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",
    "parameters": {
      "creditsAccountId": 41111111111111110,
      "externalId": "a1a5-a1da6sa2-asf6fa5-1asfs6-6a5sf16asf",
      "invoicingEmail": "invoicing@gmail.com",
      "issuer": "VISA",
      "maskedPan": "thisIsaMaskedPan",
      "paymentMethod": "CREDIT_CARD",
      "paymentToken": "28c21248-bae0-492c-ab32-8f2dda5fb87d",
      "processUrl": "http://processUrl.com"
    },
    "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 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 = {
  'Accept':'application/json',
  'Content-Type':'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 = {
  'Accept':'application/json',
  'Content-Type':'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);
});
require 'rest-client'
require 'json'

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

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

params: {
},
headers: headers

p JSON.parse(result)
import requests
headers = {
  'Accept': 'application/json',
  'Content-Type': 'application/json'
}

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

params={
},
headers = headers)

print r.json()
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
*userId path string User 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

Responses

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

Create a payment instrument

Example request


curl -X post \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  --data-binary @- https://{marketplaceURL}/api/billing/v1/companies/{companyId}/users/{userId}/paymentInstruments <<EOF
{
  "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,
  "parameters": {
    "approvedTBillInfo": {
      "company": "...",
      "createdByCompany": 12345,
      "createdByUser": 12345,
      "createdOn": 12345,
      "lastModified": 12345,
      "nnsa": "...",
      "rejected": true,
      "repFirstName": "...",
      "repLastName": "...",
      "repPONumber": "...",
      "tan": "..."
    },
    "billingId": "...",
    "creditsAccountId": 12345,
    "externalId": "...",
    "gatewayKey": "...",
    "invoicingEmail": "...",
    "issuer": "...",
    "manoTEOBillingId": "...",
    "maskedPan": "...",
    "paymentMethod": "...",
    "paymentToken": "...",
    "processUrl": "...",
    "transactionId": "...",
    "unapprovedTBillInfo": {
      "company": "...",
      "createdByCompany": 12345,
      "createdByUser": 12345,
      "createdOn": 12345,
      "lastModified": 12345,
      "nnsa": "...",
      "rejected": true,
      "repFirstName": "...",
      "repLastName": "...",
      "repPONumber": "...",
      "tan": "..."
    }
  },
  "paymentMethod": "MANO_TEO_BILL",
  "user": {
    "href": "...",
    "id": "..."
  },
  "vatId": "..."
}
EOF

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

{
  "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,
  "parameters": {
    "approvedTBillInfo": {
      "company": "...",
      "createdByCompany": 12345,
      "createdByUser": 12345,
      "createdOn": 12345,
      "lastModified": 12345,
      "nnsa": "...",
      "rejected": true,
      "repFirstName": "...",
      "repLastName": "...",
      "repPONumber": "...",
      "tan": "..."
    },
    "billingId": "...",
    "creditsAccountId": 12345,
    "externalId": "...",
    "gatewayKey": "...",
    "invoicingEmail": "...",
    "issuer": "...",
    "manoTEOBillingId": "...",
    "maskedPan": "...",
    "paymentMethod": "...",
    "paymentToken": "...",
    "processUrl": "...",
    "transactionId": "...",
    "unapprovedTBillInfo": {
      "company": "...",
      "createdByCompany": 12345,
      "createdByUser": 12345,
      "createdOn": 12345,
      "lastModified": 12345,
      "nnsa": "...",
      "rejected": true,
      "repFirstName": "...",
      "repLastName": "...",
      "repPONumber": "...",
      "tan": "..."
    }
  },
  "paymentMethod": "MANO_TEO_BILL",
  "user": {
    "href": "...",
    "id": "..."
  },
  "vatId": "..."
}


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

};

$.ajax({
  url: 'https://{marketplaceURL}/api/billing/v1/companies/{companyId}/users/{userId}/paymentInstruments',
  method: 'post',
  dataType: 'json',
  data: {
  "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,
  "parameters": {
    "approvedTBillInfo": {
      "company": "...",
      "createdByCompany": 12345,
      "createdByUser": 12345,
      "createdOn": 12345,
      "lastModified": 12345,
      "nnsa": "...",
      "rejected": true,
      "repFirstName": "...",
      "repLastName": "...",
      "repPONumber": "...",
      "tan": "..."
    },
    "billingId": "...",
    "creditsAccountId": 12345,
    "externalId": "...",
    "gatewayKey": "...",
    "invoicingEmail": "...",
    "issuer": "...",
    "manoTEOBillingId": "...",
    "maskedPan": "...",
    "paymentMethod": "...",
    "paymentToken": "...",
    "processUrl": "...",
    "transactionId": "...",
    "unapprovedTBillInfo": {
      "company": "...",
      "createdByCompany": 12345,
      "createdByUser": 12345,
      "createdOn": 12345,
      "lastModified": 12345,
      "nnsa": "...",
      "rejected": true,
      "repFirstName": "...",
      "repLastName": "...",
      "repPONumber": "...",
      "tan": "..."
    }
  },
  "paymentMethod": "MANO_TEO_BILL",
  "user": {
    "href": "...",
    "id": "..."
  },
  "vatId": "..."
},

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})
const request = require('node-fetch');
const inputBody = '{
  "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,
  "parameters": {
    "approvedTBillInfo": {
      "company": "...",
      "createdByCompany": 12345,
      "createdByUser": 12345,
      "createdOn": 12345,
      "lastModified": 12345,
      "nnsa": "...",
      "rejected": true,
      "repFirstName": "...",
      "repLastName": "...",
      "repPONumber": "...",
      "tan": "..."
    },
    "billingId": "...",
    "creditsAccountId": 12345,
    "externalId": "...",
    "gatewayKey": "...",
    "invoicingEmail": "...",
    "issuer": "...",
    "manoTEOBillingId": "...",
    "maskedPan": "...",
    "paymentMethod": "...",
    "paymentToken": "...",
    "processUrl": "...",
    "transactionId": "...",
    "unapprovedTBillInfo": {
      "company": "...",
      "createdByCompany": 12345,
      "createdByUser": 12345,
      "createdOn": 12345,
      "lastModified": 12345,
      "nnsa": "...",
      "rejected": true,
      "repFirstName": "...",
      "repLastName": "...",
      "repPONumber": "...",
      "tan": "..."
    }
  },
  "paymentMethod": "MANO_TEO_BILL",
  "user": {
    "href": "...",
    "id": "..."
  },
  "vatId": "..."
}';
const headers = {
  'Accept':'application/json',
  'Content-Type':'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);
});
require 'rest-client'
require 'json'

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

result = RestClient.post 'https://{marketplaceURL}/api/billing/v1/companies/{companyId}/users/{userId}/paymentInstruments',
payload={
  "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,
  "parameters": {
    "approvedTBillInfo": {
      "company": "...",
      "createdByCompany": 12345,
      "createdByUser": 12345,
      "createdOn": 12345,
      "lastModified": 12345,
      "nnsa": "...",
      "rejected": true,
      "repFirstName": "...",
      "repLastName": "...",
      "repPONumber": "...",
      "tan": "..."
    },
    "billingId": "...",
    "creditsAccountId": 12345,
    "externalId": "...",
    "gatewayKey": "...",
    "invoicingEmail": "...",
    "issuer": "...",
    "manoTEOBillingId": "...",
    "maskedPan": "...",
    "paymentMethod": "...",
    "paymentToken": "...",
    "processUrl": "...",
    "transactionId": "...",
    "unapprovedTBillInfo": {
      "company": "...",
      "createdByCompany": 12345,
      "createdByUser": 12345,
      "createdOn": 12345,
      "lastModified": 12345,
      "nnsa": "...",
      "rejected": true,
      "repFirstName": "...",
      "repLastName": "...",
      "repPONumber": "...",
      "tan": "..."
    }
  },
  "paymentMethod": "MANO_TEO_BILL",
  "user": {
    "href": "...",
    "id": "..."
  },
  "vatId": "..."
}
params: {
},
headers: headers

p JSON.parse(result)
import requests
headers = {
  'Accept': 'application/json',
  'Content-Type': 'application/json'
}

r = requests.post('https://{marketplaceURL}/api/billing/v1/companies/{companyId}/users/{userId}/paymentInstruments',
json={
  "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,
  "parameters": {
    "approvedTBillInfo": {
      "company": "...",
      "createdByCompany": 12345,
      "createdByUser": 12345,
      "createdOn": 12345,
      "lastModified": 12345,
      "nnsa": "...",
      "rejected": true,
      "repFirstName": "...",
      "repLastName": "...",
      "repPONumber": "...",
      "tan": "..."
    },
    "billingId": "...",
    "creditsAccountId": 12345,
    "externalId": "...",
    "gatewayKey": "...",
    "invoicingEmail": "...",
    "issuer": "...",
    "manoTEOBillingId": "...",
    "maskedPan": "...",
    "paymentMethod": "...",
    "paymentToken": "...",
    "processUrl": "...",
    "transactionId": "...",
    "unapprovedTBillInfo": {
      "company": "...",
      "createdByCompany": 12345,
      "createdByUser": 12345,
      "createdOn": 12345,
      "lastModified": 12345,
      "nnsa": "...",
      "rejected": true,
      "repFirstName": "...",
      "repLastName": "...",
      "repPONumber": "...",
      "tan": "..."
    }
  },
  "paymentMethod": "MANO_TEO_BILL",
  "user": {
    "href": "...",
    "id": "..."
  },
  "vatId": "..."
}
params={
},
headers = headers)

print r.json()
URL obj = new URL("https://{marketplaceURL}/api/billing/v1/companies/{companyId}/users/{userId}/paymentInstruments");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
String inputBody = "{" +
  "\"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," +
  "\"parameters\": {" +
    "\"approvedTBillInfo\": {" +
      "\"company\": \"...\"," +
      "\"createdByCompany\": 12345," +
      "\"createdByUser\": 12345," +
      "\"createdOn\": 12345," +
      "\"lastModified\": 12345," +
      "\"nnsa\": \"...\"," +
      "\"rejected\": true," +
      "\"repFirstName\": \"...\"," +
      "\"repLastName\": \"...\"," +
      "\"repPONumber\": \"...\"," +
      "\"tan\": \"...\"" +
    "}," +
    "\"billingId\": \"...\"," +
    "\"creditsAccountId\": 12345," +
    "\"externalId\": \"...\"," +
    "\"gatewayKey\": \"...\"," +
    "\"invoicingEmail\": \"...\"," +
    "\"issuer\": \"...\"," +
    "\"manoTEOBillingId\": \"...\"," +
    "\"maskedPan\": \"...\"," +
    "\"paymentMethod\": \"...\"," +
    "\"paymentToken\": \"...\"," +
    "\"processUrl\": \"...\"," +
    "\"transactionId\": \"...\"," +
    "\"unapprovedTBillInfo\": {" +
      "\"company\": \"...\"," +
      "\"createdByCompany\": 12345," +
      "\"createdByUser\": 12345," +
      "\"createdOn\": 12345," +
      "\"lastModified\": 12345," +
      "\"nnsa\": \"...\"," +
      "\"rejected\": true," +
      "\"repFirstName\": \"...\"," +
      "\"repLastName\": \"...\"," +
      "\"repPONumber\": \"...\"," +
      "\"tan\": \"...\"" +
    "}" +
  "}," +
  "\"paymentMethod\": \"MANO_TEO_BILL\"," +
  "\"user\": {" +
    "\"href\": \"...\"," +
    "\"id\": \"...\"" +
  "}," +
  "\"vatId\": \"...\"" +
"}";

OutputStream os = conn.getOutputStream();
os.write(inputBody.getBytes("UTF-8"));
os.close();

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",
  "parameters": {
    "creditsAccountId": 41111111111111110,
    "externalId": "a1a5-a1da6sa2-asf6fa5-1asfs6-6a5sf16asf",
    "invoicingEmail": "invoicing@gmail.com",
    "issuer": "VISA",
    "maskedPan": "thisIsaMaskedPan",
    "paymentMethod": "CREDIT_CARD",
    "paymentToken": "28c21248-bae0-492c-ab32-8f2dda5fb87d",
    "processUrl": "http://processUrl.com"
  },
  "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.
parameters CustomParameters Custom parameters for this payment instrument.
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

Update a payment instrument

Example request


curl -X put \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  --data-binary @- https://{marketplaceURL}/api/billing/v1/companies/{companyId}/users/{userId}/paymentInstruments/{paymentInstrumentId} <<EOF
{
  "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,
  "parameters": {
    "approvedTBillInfo": {
      "company": "...",
      "createdByCompany": 12345,
      "createdByUser": 12345,
      "createdOn": 12345,
      "lastModified": 12345,
      "nnsa": "...",
      "rejected": true,
      "repFirstName": "...",
      "repLastName": "...",
      "repPONumber": "...",
      "tan": "..."
    },
    "billingId": "...",
    "creditsAccountId": 12345,
    "externalId": "...",
    "gatewayKey": "...",
    "invoicingEmail": "...",
    "issuer": "...",
    "manoTEOBillingId": "...",
    "maskedPan": "...",
    "paymentMethod": "...",
    "paymentToken": "...",
    "processUrl": "...",
    "transactionId": "...",
    "unapprovedTBillInfo": {
      "company": "...",
      "createdByCompany": 12345,
      "createdByUser": 12345,
      "createdOn": 12345,
      "lastModified": 12345,
      "nnsa": "...",
      "rejected": true,
      "repFirstName": "...",
      "repLastName": "...",
      "repPONumber": "...",
      "tan": "..."
    }
  },
  "paymentMethod": "MANO_TEO_BILL",
  "user": {
    "href": "...",
    "id": "..."
  },
  "vatId": "..."
}
EOF

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

{
  "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,
  "parameters": {
    "approvedTBillInfo": {
      "company": "...",
      "createdByCompany": 12345,
      "createdByUser": 12345,
      "createdOn": 12345,
      "lastModified": 12345,
      "nnsa": "...",
      "rejected": true,
      "repFirstName": "...",
      "repLastName": "...",
      "repPONumber": "...",
      "tan": "..."
    },
    "billingId": "...",
    "creditsAccountId": 12345,
    "externalId": "...",
    "gatewayKey": "...",
    "invoicingEmail": "...",
    "issuer": "...",
    "manoTEOBillingId": "...",
    "maskedPan": "...",
    "paymentMethod": "...",
    "paymentToken": "...",
    "processUrl": "...",
    "transactionId": "...",
    "unapprovedTBillInfo": {
      "company": "...",
      "createdByCompany": 12345,
      "createdByUser": 12345,
      "createdOn": 12345,
      "lastModified": 12345,
      "nnsa": "...",
      "rejected": true,
      "repFirstName": "...",
      "repLastName": "...",
      "repPONumber": "...",
      "tan": "..."
    }
  },
  "paymentMethod": "MANO_TEO_BILL",
  "user": {
    "href": "...",
    "id": "..."
  },
  "vatId": "..."
}


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

};

$.ajax({
  url: 'https://{marketplaceURL}/api/billing/v1/companies/{companyId}/users/{userId}/paymentInstruments/{paymentInstrumentId}',
  method: 'put',
  dataType: 'json',
  data: {
  "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,
  "parameters": {
    "approvedTBillInfo": {
      "company": "...",
      "createdByCompany": 12345,
      "createdByUser": 12345,
      "createdOn": 12345,
      "lastModified": 12345,
      "nnsa": "...",
      "rejected": true,
      "repFirstName": "...",
      "repLastName": "...",
      "repPONumber": "...",
      "tan": "..."
    },
    "billingId": "...",
    "creditsAccountId": 12345,
    "externalId": "...",
    "gatewayKey": "...",
    "invoicingEmail": "...",
    "issuer": "...",
    "manoTEOBillingId": "...",
    "maskedPan": "...",
    "paymentMethod": "...",
    "paymentToken": "...",
    "processUrl": "...",
    "transactionId": "...",
    "unapprovedTBillInfo": {
      "company": "...",
      "createdByCompany": 12345,
      "createdByUser": 12345,
      "createdOn": 12345,
      "lastModified": 12345,
      "nnsa": "...",
      "rejected": true,
      "repFirstName": "...",
      "repLastName": "...",
      "repPONumber": "...",
      "tan": "..."
    }
  },
  "paymentMethod": "MANO_TEO_BILL",
  "user": {
    "href": "...",
    "id": "..."
  },
  "vatId": "..."
},

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})
const request = require('node-fetch');
const inputBody = '{
  "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,
  "parameters": {
    "approvedTBillInfo": {
      "company": "...",
      "createdByCompany": 12345,
      "createdByUser": 12345,
      "createdOn": 12345,
      "lastModified": 12345,
      "nnsa": "...",
      "rejected": true,
      "repFirstName": "...",
      "repLastName": "...",
      "repPONumber": "...",
      "tan": "..."
    },
    "billingId": "...",
    "creditsAccountId": 12345,
    "externalId": "...",
    "gatewayKey": "...",
    "invoicingEmail": "...",
    "issuer": "...",
    "manoTEOBillingId": "...",
    "maskedPan": "...",
    "paymentMethod": "...",
    "paymentToken": "...",
    "processUrl": "...",
    "transactionId": "...",
    "unapprovedTBillInfo": {
      "company": "...",
      "createdByCompany": 12345,
      "createdByUser": 12345,
      "createdOn": 12345,
      "lastModified": 12345,
      "nnsa": "...",
      "rejected": true,
      "repFirstName": "...",
      "repLastName": "...",
      "repPONumber": "...",
      "tan": "..."
    }
  },
  "paymentMethod": "MANO_TEO_BILL",
  "user": {
    "href": "...",
    "id": "..."
  },
  "vatId": "..."
}';
const headers = {
  'Accept':'application/json',
  'Content-Type':'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);
});
require 'rest-client'
require 'json'

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

result = RestClient.put 'https://{marketplaceURL}/api/billing/v1/companies/{companyId}/users/{userId}/paymentInstruments/{paymentInstrumentId}',
payload={
  "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,
  "parameters": {
    "approvedTBillInfo": {
      "company": "...",
      "createdByCompany": 12345,
      "createdByUser": 12345,
      "createdOn": 12345,
      "lastModified": 12345,
      "nnsa": "...",
      "rejected": true,
      "repFirstName": "...",
      "repLastName": "...",
      "repPONumber": "...",
      "tan": "..."
    },
    "billingId": "...",
    "creditsAccountId": 12345,
    "externalId": "...",
    "gatewayKey": "...",
    "invoicingEmail": "...",
    "issuer": "...",
    "manoTEOBillingId": "...",
    "maskedPan": "...",
    "paymentMethod": "...",
    "paymentToken": "...",
    "processUrl": "...",
    "transactionId": "...",
    "unapprovedTBillInfo": {
      "company": "...",
      "createdByCompany": 12345,
      "createdByUser": 12345,
      "createdOn": 12345,
      "lastModified": 12345,
      "nnsa": "...",
      "rejected": true,
      "repFirstName": "...",
      "repLastName": "...",
      "repPONumber": "...",
      "tan": "..."
    }
  },
  "paymentMethod": "MANO_TEO_BILL",
  "user": {
    "href": "...",
    "id": "..."
  },
  "vatId": "..."
}
params: {
},
headers: headers

p JSON.parse(result)
import requests
headers = {
  'Accept': 'application/json',
  'Content-Type': 'application/json'
}

r = requests.put('https://{marketplaceURL}/api/billing/v1/companies/{companyId}/users/{userId}/paymentInstruments/{paymentInstrumentId}',
json={
  "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,
  "parameters": {
    "approvedTBillInfo": {
      "company": "...",
      "createdByCompany": 12345,
      "createdByUser": 12345,
      "createdOn": 12345,
      "lastModified": 12345,
      "nnsa": "...",
      "rejected": true,
      "repFirstName": "...",
      "repLastName": "...",
      "repPONumber": "...",
      "tan": "..."
    },
    "billingId": "...",
    "creditsAccountId": 12345,
    "externalId": "...",
    "gatewayKey": "...",
    "invoicingEmail": "...",
    "issuer": "...",
    "manoTEOBillingId": "...",
    "maskedPan": "...",
    "paymentMethod": "...",
    "paymentToken": "...",
    "processUrl": "...",
    "transactionId": "...",
    "unapprovedTBillInfo": {
      "company": "...",
      "createdByCompany": 12345,
      "createdByUser": 12345,
      "createdOn": 12345,
      "lastModified": 12345,
      "nnsa": "...",
      "rejected": true,
      "repFirstName": "...",
      "repLastName": "...",
      "repPONumber": "...",
      "tan": "..."
    }
  },
  "paymentMethod": "MANO_TEO_BILL",
  "user": {
    "href": "...",
    "id": "..."
  },
  "vatId": "..."
}
params={
},
headers = headers)

print r.json()
URL obj = new URL("https://{marketplaceURL}/api/billing/v1/companies/{companyId}/users/{userId}/paymentInstruments/{paymentInstrumentId}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("PUT");
String inputBody = "{" +
  "\"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," +
  "\"parameters\": {" +
    "\"approvedTBillInfo\": {" +
      "\"company\": \"...\"," +
      "\"createdByCompany\": 12345," +
      "\"createdByUser\": 12345," +
      "\"createdOn\": 12345," +
      "\"lastModified\": 12345," +
      "\"nnsa\": \"...\"," +
      "\"rejected\": true," +
      "\"repFirstName\": \"...\"," +
      "\"repLastName\": \"...\"," +
      "\"repPONumber\": \"...\"," +
      "\"tan\": \"...\"" +
    "}," +
    "\"billingId\": \"...\"," +
    "\"creditsAccountId\": 12345," +
    "\"externalId\": \"...\"," +
    "\"gatewayKey\": \"...\"," +
    "\"invoicingEmail\": \"...\"," +
    "\"issuer\": \"...\"," +
    "\"manoTEOBillingId\": \"...\"," +
    "\"maskedPan\": \"...\"," +
    "\"paymentMethod\": \"...\"," +
    "\"paymentToken\": \"...\"," +
    "\"processUrl\": \"...\"," +
    "\"transactionId\": \"...\"," +
    "\"unapprovedTBillInfo\": {" +
      "\"company\": \"...\"," +
      "\"createdByCompany\": 12345," +
      "\"createdByUser\": 12345," +
      "\"createdOn\": 12345," +
      "\"lastModified\": 12345," +
      "\"nnsa\": \"...\"," +
      "\"rejected\": true," +
      "\"repFirstName\": \"...\"," +
      "\"repLastName\": \"...\"," +
      "\"repPONumber\": \"...\"," +
      "\"tan\": \"...\"" +
    "}" +
  "}," +
  "\"paymentMethod\": \"MANO_TEO_BILL\"," +
  "\"user\": {" +
    "\"href\": \"...\"," +
    "\"id\": \"...\"" +
  "}," +
  "\"vatId\": \"...\"" +
"}";

OutputStream os = conn.getOutputStream();
os.write(inputBody.getBytes("UTF-8"));
os.close();

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"
  },
  "creditCard": {
    "expirationMonth": 12,
    "expirationYear": 2016,
    "name": "Updated Credit Card name",
    "number": "13688112366",
    "securityCode": "111",
    "type": "VISA"
  },
  "default": false,
  "id": "e3f7f37b-1e0b-4f05-a8b2-aae74e2f5f2d",
  "parameters": {
    "creditsAccountId": 41111111111111110,
    "externalId": "a1a5-a1da6sa2-asf6fa5-1asfs6-6a5sf16asf",
    "invoicingEmail": "invoicing@gmail.com",
    "issuer": "VISA",
    "maskedPan": "thisIsaMaskedPan",
    "paymentMethod": "CREDIT_CARD",
    "paymentToken": "28c21248-bae0-492c-ab32-8f2dda5fb87d",
    "processUrl": "http://processUrl.com"
  },
  "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.
parameters CustomParameters Custom parameters for this payment instrument.
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

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 = {
  'Accept':'application/json',
  'Content-Type':'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 = {
  'Accept':'application/json',
  'Content-Type':'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);
});
require 'rest-client'
require 'json'

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

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

params: {
},
headers: headers

p JSON.parse(result)
import requests
headers = {
  'Accept': 'application/json',
  'Content-Type': 'application/json'
}

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

params={
},
headers = headers)

print r.json()
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,
        "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,
        "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
*companyUuid path string Unique identifier of company in the API request
active query boolean If specified, returns only memberships associated with users having the specified active status
enabled query boolean If specified, returns only memberships with the specified enabled status
roleName query string If specified, returns only memberships with the specified role enabled
groupUuid query string If specified, returns only memberships that are a part of the specified group
page query integer 0 Zero-based page index
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

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 = {
  'Accept':'application/json',
  'Content-Type':'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 = {
  'Accept':'application/json',
  'Content-Type':'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);
});
require 'rest-client'
require 'json'

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

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

params: {
},
headers: headers

p JSON.parse(result)
import requests
headers = {
  'Accept': 'application/json',
  'Content-Type': 'application/json'
}

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

params={
},
headers = headers)

print r.json()
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,
    "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_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

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 = {
  'Accept':'application/json',
  'Content-Type':'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 = {
  'Accept':'application/json',
  'Content-Type':'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);
});
require 'rest-client'
require 'json'

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

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

params: {
},
headers: headers

p JSON.parse(result)
import requests
headers = {
  'Accept': 'application/json',
  'Content-Type': 'application/json'
}

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

params={
},
headers = headers)

print r.json()
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 UserRoleAccountV2
401 Unauthorized Unauthorized
404 Not Found Company/User/Membership 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 = {
  'Accept':'application/json',
  'Content-Type':'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 = {
  'Accept':'application/json',
  'Content-Type':'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);
});
require 'rest-client'
require 'json'

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

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

params: {
},
headers: headers

p JSON.parse(result)
import requests
headers = {
  'Accept': 'application/json',
  'Content-Type': 'application/json'
}

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

params={
},
headers = headers)

print r.json()
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=\u0026currency=",
          "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 = {
  'Accept':'application/json',
  'Content-Type':'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 = {
  'Accept':'application/json',
  'Content-Type':'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);
});
require 'rest-client'
require 'json'

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

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

params: {
},
headers: headers

p JSON.parse(result)
import requests
headers = {
  'Accept': 'application/json',
  'Content-Type': 'application/json'
}

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

params={
},
headers = headers)

print r.json()
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

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 = {
  'Accept':'application/json',
  'Content-Type':'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 = {
  'Accept':'application/json',
  'Content-Type':'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);
});
require 'rest-client'
require 'json'

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

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

params: {
},
headers: headers

p JSON.parse(result)
import requests
headers = {
  'Accept': 'application/json',
  'Content-Type': 'application/json'
}

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

params={
},
headers = headers)

print r.json()
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\u0026page=0\u0026size=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\u0026page=0\u0026size=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\u0026page=0\u0026size=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\u0026page=0\u0026size=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\u0026page=0\u0026size=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\u0026page=0\u0026size=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\u0026page=0\u0026size=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\u0026page=0\u0026size=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\u0026page=0\u0026size=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\u0026page=0\u0026size=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\u0026size=50\u0026sortField=createdOn\u0026sortOrder=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
*userUuid path string Unique identifier of user 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

Responses

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

Create company membership (Invite User)

Example request


curl -X post \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  --data-binary @- https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships <<EOF
{
  "user": {
    "email": "mary.gonsalez@company3157614232.com",
    "firstName": "Mary",
    "lastName": "Gonsalez"
  }
}
EOF

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

{
  "user": {
    "email": "mary.gonsalez@company3157614232.com",
    "firstName": "Mary",
    "lastName": "Gonsalez"
  }
}


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

};

$.ajax({
  url: 'https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships',
  method: 'post',
  dataType: 'json',
  data: {
  "user": {
    "email": "mary.gonsalez@company3157614232.com",
    "firstName": "Mary",
    "lastName": "Gonsalez"
  }
},

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})
const request = require('node-fetch');
const inputBody = '{
  "user": {
    "email": "mary.gonsalez@company3157614232.com",
    "firstName": "Mary",
    "lastName": "Gonsalez"
  }
}';
const headers = {
  'Accept':'application/json',
  'Content-Type':'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);
});
require 'rest-client'
require 'json'

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

result = RestClient.post 'https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships',
payload={
  "user": {
    "email": "mary.gonsalez@company3157614232.com",
    "firstName": "Mary",
    "lastName": "Gonsalez"
  }
}
params: {
},
headers: headers

p JSON.parse(result)
import requests
headers = {
  'Accept': 'application/json',
  'Content-Type': 'application/json'
}

r = requests.post('https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships',
json={
  "user": {
    "email": "mary.gonsalez@company3157614232.com",
    "firstName": "Mary",
    "lastName": "Gonsalez"
  }
}
params={
},
headers = headers)

print r.json()
URL obj = new URL("https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
String inputBody = "{" +
  "\"user\": {" +
    "\"email\": \"mary.gonsalez@company3157614232.com\"," +
    "\"firstName\": \"Mary\"," +
    "\"lastName\": \"Gonsalez\"" +
  "}" +
"}";

OutputStream os = conn.getOutputStream();
os.write(inputBody.getBytes("UTF-8"));
os.close();

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": "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,
    "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 user as a member of a marketplace company.

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

If no user exists with the given email address (and also depending on channel configuration), a user may be created.

This causes an invitation to be sent to the user.

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
user CreateUserAccountV2 User data

Responses

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

Create company membership (Add User)

Example request


curl -X post \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  --data-binary @- https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/active <<EOF
{
  "recipientEmails": [
    "guy.smith@company9411805586.com"
  ],
  "temporaryPassword": "Temporary Password",
  "user": {
    "email": "guy.smith@company9411805586.com",
    "firstName": "Guy",
    "lastName": "Smith",
    "roles": [
      "ROLE_DEVELOPER"
    ]
  }
}
EOF

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

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


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

};

$.ajax({
  url: 'https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/active',
  method: 'post',
  dataType: 'json',
  data: {
  "recipientEmails": [
    "guy.smith@company9411805586.com"
  ],
  "temporaryPassword": "Temporary Password",
  "user": {
    "email": "guy.smith@company9411805586.com",
    "firstName": "Guy",
    "lastName": "Smith",
    "roles": [
      "ROLE_DEVELOPER"
    ]
  }
},

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})
const request = require('node-fetch');
const inputBody = '{
  "recipientEmails": [
    "guy.smith@company9411805586.com"
  ],
  "temporaryPassword": "Temporary Password",
  "user": {
    "email": "guy.smith@company9411805586.com",
    "firstName": "Guy",
    "lastName": "Smith",
    "roles": [
      "ROLE_DEVELOPER"
    ]
  }
}';
const headers = {
  'Accept':'application/json',
  'Content-Type':'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);
});
require 'rest-client'
require 'json'

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

result = RestClient.post 'https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/active',
payload={
  "recipientEmails": [
    "guy.smith@company9411805586.com"
  ],
  "temporaryPassword": "Temporary Password",
  "user": {
    "email": "guy.smith@company9411805586.com",
    "firstName": "Guy",
    "lastName": "Smith",
    "roles": [
      "ROLE_DEVELOPER"
    ]
  }
}
params: {
},
headers: headers

p JSON.parse(result)
import requests
headers = {
  'Accept': 'application/json',
  'Content-Type': 'application/json'
}

r = requests.post('https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/active',
json={
  "recipientEmails": [
    "guy.smith@company9411805586.com"
  ],
  "temporaryPassword": "Temporary Password",
  "user": {
    "email": "guy.smith@company9411805586.com",
    "firstName": "Guy",
    "lastName": "Smith",
    "roles": [
      "ROLE_DEVELOPER"
    ]
  }
}
params={
},
headers = headers)

print r.json()
URL obj = new URL("https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/active");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
String inputBody = "{" +
  "\"recipientEmails\": [" +
    "\"guy.smith@company9411805586.com\"" +
  "]," +
  "\"temporaryPassword\": \"Temporary Password\"," +
  "\"user\": {" +
    "\"email\": \"guy.smith@company9411805586.com\"," +
    "\"firstName\": \"Guy\"," +
    "\"lastName\": \"Smith\"," +
    "\"roles\": [" +
      "\"ROLE_DEVELOPER\"" +
    "]" +
  "}" +
"}";

OutputStream os = conn.getOutputStream();
os.write(inputBody.getBytes("UTF-8"));
os.close();

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": "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,
    "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.

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

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 = {
  'Accept':'application/json',
  'Content-Type':'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 = {
  'Accept':'application/json',
  'Content-Type':'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);
});
require 'rest-client'
require 'json'

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

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

params: {
},
headers: headers

p JSON.parse(result)
import requests
headers = {
  'Accept': 'application/json',
  'Content-Type': 'application/json'
}

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

params={
},
headers = headers)

print r.json()
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 \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  --data-binary @- https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid} <<EOF
{
  "enabled": true,
  "roles": [
    "ROLE_BILLING_ADMIN",
    "ROLE_DEVELOPER",
    "ROLE_SYS_ADMIN"
  ]
}
EOF

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

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


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

};

$.ajax({
  url: 'https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}',
  method: 'put',
  dataType: 'json',
  data: {
  "enabled": true,
  "roles": [
    "ROLE_BILLING_ADMIN",
    "ROLE_DEVELOPER",
    "ROLE_SYS_ADMIN"
  ]
},

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})
const request = require('node-fetch');
const inputBody = '{
  "enabled": true,
  "roles": [
    "ROLE_BILLING_ADMIN",
    "ROLE_DEVELOPER",
    "ROLE_SYS_ADMIN"
  ]
}';
const headers = {
  'Accept':'application/json',
  'Content-Type':'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);
});
require 'rest-client'
require 'json'

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

result = RestClient.put 'https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}',
payload={
  "enabled": true,
  "roles": [
    "ROLE_BILLING_ADMIN",
    "ROLE_DEVELOPER",
    "ROLE_SYS_ADMIN"
  ]
}
params: {
},
headers: headers

p JSON.parse(result)
import requests
headers = {
  'Accept': 'application/json',
  'Content-Type': 'application/json'
}

r = requests.put('https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}',
json={
  "enabled": true,
  "roles": [
    "ROLE_BILLING_ADMIN",
    "ROLE_DEVELOPER",
    "ROLE_SYS_ADMIN"
  ]
}
params={
},
headers = headers)

print r.json()
URL obj = new URL("https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("PUT");
String inputBody = "{" +
  "\"enabled\": true," +
  "\"roles\": [" +
    "\"ROLE_BILLING_ADMIN\"," +
    "\"ROLE_DEVELOPER\"," +
    "\"ROLE_SYS_ADMIN\"" +
  "]" +
"}";

OutputStream os = conn.getOutputStream();
os.write(inputBody.getBytes("UTF-8"));
os.close();

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": "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,
    "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: Marketplace Manager, 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.

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

Enable/Disable company membership

Example request


curl -X patch \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  --data-binary @- https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid} <<EOF
{
  "enabled": true
}
EOF

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

{
  "enabled": true
}


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

};

$.ajax({
  url: 'https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}',
  method: 'patch',
  dataType: 'json',
  data: {
  "enabled": true
},

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})
const request = require('node-fetch');
const inputBody = '{
  "enabled": true
}';
const headers = {
  'Accept':'application/json',
  'Content-Type':'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);
});
require 'rest-client'
require 'json'

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

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

p JSON.parse(result)
import requests
headers = {
  'Accept': 'application/json',
  'Content-Type': 'application/json'
}

r = requests.patch('https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}',
json={
  "enabled": true
}
params={
},
headers = headers)

print r.json()
URL obj = new URL("https://{marketplaceURL}/api/account/v2/companies/{companyUuid}/memberships/{userUuid}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("PATCH");
String inputBody = "{" +
  "\"enabled\": true" +
"}";

OutputStream os = conn.getOutputStream();
os.write(inputBody.getBytes("UTF-8"));
os.close();

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": {
    "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,
    "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

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 = {
  'Accept':'application/json',
  'Content-Type':'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 = {
  'Accept':'application/json',
  'Content-Type':'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);
});
require 'rest-client'
require 'json'

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

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

params: {
},
headers: headers

p JSON.parse(result)
import requests
headers = {
  'Accept': 'application/json',
  'Content-Type': 'application/json'
}

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

params={
},
headers = headers)

print r.json()
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

Currency Exchange Rate

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 = {
  'Accept':'application/json',
  'Content-Type':'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 = {
  'Accept':'application/json',
  'Content-Type':'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);
});
require 'rest-client'
require 'json'

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

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

params: {
},
headers: headers

p JSON.parse(result)
import requests
headers = {
  'Accept': 'application/json',
  'Content-Type': 'application/json'
}

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

params={
},
headers = headers)

print r.json()
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

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 = {
  'Accept':'application/json',
  'Content-Type':'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 = {
  'Accept':'application/json',
  'Content-Type':'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);
});
require 'rest-client'
require 'json'

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

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

params: {
},
headers: headers

p JSON.parse(result)
import requests
headers = {
  'Accept': 'application/json',
  'Content-Type': 'application/json'
}

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

params={
},
headers = headers)

print r.json()
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

Create new Currency Exchange Rate

Example request


curl -X post \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  --data-binary @- https://{marketplaceURL}/api/channel/v1/exchangeRates <<EOF
{
  "baseCurrency": "USD",
  "counterCurrency": "CAD",
  "rate": 0.2
}
EOF

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

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


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

};

$.ajax({
  url: 'https://{marketplaceURL}/api/channel/v1/exchangeRates',
  method: 'post',
  dataType: 'json',
  data: {
  "baseCurrency": "USD",
  "counterCurrency": "CAD",
  "rate": 0.2
},

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})
const request = require('node-fetch');
const inputBody = '{
  "baseCurrency": "USD",
  "counterCurrency": "CAD",
  "rate": 0.2
}';
const headers = {
  'Accept':'application/json',
  'Content-Type':'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);
});
require 'rest-client'
require 'json'

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

result = RestClient.post 'https://{marketplaceURL}/api/channel/v1/exchangeRates',
payload={
  "baseCurrency": "USD",
  "counterCurrency": "CAD",
  "rate": 0.2
}
params: {
},
headers: headers

p JSON.parse(result)
import requests
headers = {
  'Accept': 'application/json',
  'Content-Type': 'application/json'
}

r = requests.post('https://{marketplaceURL}/api/channel/v1/exchangeRates',
json={
  "baseCurrency": "USD",
  "counterCurrency": "CAD",
  "rate": 0.2
}
params={
},
headers = headers)

print r.json()
URL obj = new URL("https://{marketplaceURL}/api/channel/v1/exchangeRates");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
String inputBody = "{" +
  "\"baseCurrency\": \"USD\"," +
  "\"counterCurrency\": \"CAD\"," +
  "\"rate\": 0.2" +
"}";

OutputStream os = conn.getOutputStream();
os.write(inputBody.getBytes("UTF-8"));
os.close();

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
}

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

Deactivate a Currency Exchange Rate

Example request


curl -X patch \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  --data-binary @- https://{marketplaceURL}/api/channel/v1/exchangeRates/{currencyExchangeRateUuid} <<EOF
{
  "active": false
}
EOF

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

{
  "active": false
}


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

};

$.ajax({
  url: 'https://{marketplaceURL}/api/channel/v1/exchangeRates/{currencyExchangeRateUuid}',
  method: 'patch',
  dataType: 'json',
  data: {
  "active": false
},

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})
const request = require('node-fetch');
const inputBody = '{
  "active": false
}';
const headers = {
  'Accept':'application/json',
  'Content-Type':'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);
});
require 'rest-client'
require 'json'

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

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

p JSON.parse(result)
import requests
headers = {
  'Accept': 'application/json',
  'Content-Type': 'application/json'
}

r = requests.patch('https://{marketplaceURL}/api/channel/v1/exchangeRates/{currencyExchangeRateUuid}',
json={
  "active": false
}
params={
},
headers = headers)

print r.json()
URL obj = new URL("https://{marketplaceURL}/api/channel/v1/exchangeRates/{currencyExchangeRateUuid}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("PATCH");
String inputBody = "{" +
  "\"active\": false" +
"}";

OutputStream os = conn.getOutputStream();
os.write(inputBody.getBytes("UTF-8"));
os.close();

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
}

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

CurrencyExchangeRateActive object:

Property Type Description
active boolean Currency Exchange Rates can be only deactivated. Allowed value: false.

Responses

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

Customer Notifications

List notification templates

List notification templates for the current channel.

Example request


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

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



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

};

$.ajax({
  url: 'https://{marketplaceURL}/api/notification/v1/templates',
  method: 'get',
  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})
const request = require('node-fetch');
const headers = {
  'Accept':'application/json',
  'Content-Type':'application/json'

};

fetch('https://{marketplaceURL}/api/notification/v1/templates',
{
  method: 'GET',headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
require 'rest-client'
require 'json'

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

result = RestClient.get 'https://{marketplaceURL}/api/notification/v1/templates',

params: {
},
headers: headers

p JSON.parse(result)
import requests
headers = {
  'Accept': 'application/json',
  'Content-Type': 'application/json'
}

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

params={
},
headers = headers)

print r.json()
URL obj = new URL("https://{marketplaceURL}/api/notification/v1/templates");
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

[
  {
    "audience": "NEW_USER",
    "category": "ACCOUNTS",
    "generated": false,
    "methods": [
      {
        "enabled": true,
        "method": "EMAIL"
      },
      {
        "enabled": true,
        "method": "SMS"
      }
    ],
    "reminder": "NONE",
    "required": true,
    "type": "ACCOUNT_ACTIVATION"
  },
  {
    "audience": "NEW_USER",
    "category": "ACCOUNTS",
    "generated": false,
    "methods": [
      {
        "enabled": true,
        "method": "EMAIL"
      }
    ],
    "reminder": "NONE",
    "required": false,
    "type": "ACCOUNT_ACTIVATION_AFTER_MIGRATION"
  },
  {
    "audience": "NEW_USER",
    "category": "ACCOUNTS",
    "generated": false,
    "methods": [
      {
        "enabled": true,
        "method": "EMAIL"
      }
    ],
    "reminder": "NONE",
    "required": true,
    "type": "BRANDED_ACCOUNT_ACTIVATION"
  },
  {
    "audience": "NEW_USER",
    "category": "ACCOUNTS",
    "generated": false,
    "methods": [
      {
        "enabled": true,
        "method": "EMAIL"
      }
    ],
    "reminder": "NONE",
    "required": false,
    "type": "ACCOUNT_ACTIVATION_CREATED_BY_ASSISTED_SALES"
  },
  {
    "audience": "NEW_USER",
    "category": "ACCOUNTS",
    "generated": false,
    "methods": [
      {
        "enabled": true,
        "method": "EMAIL"
      }
    ],
    "reminder": "NONE",
    "required": false,
    "type": "ACTIVE_USER_TEMP_PASSWORD"
  },
  {
    "audience": "NEW_USER",
    "category": "ACCOUNTS",
    "generated": false,
    "methods": [
      {
        "enabled": true,
        "method": "EMAIL"
      },
      {
        "enabled": true,
        "method": "SMS"
      }
    ],
    "reminder": "NONE",
    "required": true,
    "type": "NEW_USER"
  }
]

GET /notification/v1/templates

List notification templates List notification templates for the current channel

Parameters

Parameter Type Data Type Default Description
directSales query boolean false List only the developers notification templates

Responses

Status Meaning Description Definition
200 OK Read notification templates successfully. NotificationTemplateDefinition

List notification common elements

List common element definitions that is present in each notification that is sent e.

Example request


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

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



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

};

$.ajax({
  url: 'https://{marketplaceURL}/api/notification/v1/templates/common',
  method: 'get',
  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})
const request = require('node-fetch');
const headers = {
  'Accept':'application/json',
  'Content-Type':'application/json'

};

fetch('https://{marketplaceURL}/api/notification/v1/templates/common',
{
  method: 'GET',headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
require 'rest-client'
require 'json'

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

result = RestClient.get 'https://{marketplaceURL}/api/notification/v1/templates/common',

params: {
},
headers: headers

p JSON.parse(result)
import requests
headers = {
  'Accept': 'application/json',
  'Content-Type': 'application/json'
}

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

params={
},
headers = headers)

print r.json()
URL obj = new URL("https://{marketplaceURL}/api/notification/v1/templates/common");
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

[
  {
    "methods": [
      "EMAIL",
      "SMS"
    ],
    "position": "BOTTOM",
    "type": "UNSUBSCRIBE"
  }
]

GET /notification/v1/templates/common

List notification common elements List common element definitions that is present in each notification that is sent e.g. an unsubscribe message in an email footer.

Responses

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

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 = {
  'Accept':'application/json',
  'Content-Type':'application/json'

};

$.ajax({
  url: 'https://{marketplaceURL}/api/notification/v1/templates/common/email/{type}',
  method: 'get',
  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})
const request = require('node-fetch');
const headers = {
  'Accept':'application/json',
  'Content-Type':'application/json'

};

fetch('https://{marketplaceURL}/api/notification/v1/templates/common/email/{type}',
{
  method: 'GET',headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
require 'rest-client'
require 'json'

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

result = RestClient.get 'https://{marketplaceURL}/api/notification/v1/templates/common/email/{type}',

params: {
},
headers: headers

p JSON.parse(result)
import requests
headers = {
  'Accept': 'application/json',
  'Content-Type': 'application/json'
}

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

params={
},
headers = headers)

print r.json()
URL obj = new URL("https://{marketplaceURL}/api/notification/v1/templates/common/email/{type}");
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": "This is a test.",
  "defaultCommonElement": false,
  "enabled": true,
  "id": 4,
  "locale": "en_US",
  "partner": "APPDIRECT",
  "type": "UNSUBSCRIBE"
}

GET /notification/v1/templates/common/email/{type}

Retrieve common email element by type Retrieve common email element by type for the current channel

Parameters

Parameter Type Data Type Default Description
*type path string Notification common element type

Responses

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

Retrieve an email template by type

This call returns all details from a specific email template type.

Example request


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

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



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

};

$.ajax({
  url: 'https://{marketplaceURL}/api/notification/v1/templates/email/{type}',
  method: 'get',
  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})
const request = require('node-fetch');
const headers = {
  'Accept':'application/json',
  'Content-Type':'application/json'

};

fetch('https://{marketplaceURL}/api/notification/v1/templates/email/{type}',
{
  method: 'GET',headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
require 'rest-client'
require 'json'

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

result = RestClient.get 'https://{marketplaceURL}/api/notification/v1/templates/email/{type}',

params: {
},
headers: headers

p JSON.parse(result)
import requests
headers = {
  'Accept': 'application/json',
  'Content-Type': 'application/json'
}

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

params={
},
headers = headers)

print r.json()
URL obj = new URL("https://{marketplaceURL}/api/notification/v1/templates/email/{type}");
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": "Hello,\u003cbr/\u003eCongratulations! You have a new {PARTNER_STORE_LABEL} account ready to be activated.\u003cbr/\u003eYour account has been created with the username {USER_EMAIL}\u003cbr/\u003eTo activate your account please use the following link:\u003cbr/\u003e{ACTIVATION_URL}\u003cbr/\u003e\u003cbr/\u003eIf you have any questions, our Support Team is standing by. You can\u003cbr/\u003eemail us at {SUPPORT_EMAIL}, call us at {SUPPORT_PHONE},\u003cbr/\u003eor start a chat with us on the website at {SUPPORT_URL}.\u003cbr/\u003e\n\u003cbr/\u003eThank you!\u003cbr/\u003eYour friends at {PARTNER_LABEL}",
  "defaultTemplate": false,
  "directSales": false,
  "enabled": true,
  "fallbackEmailTemplateId": 10,
  "id": 2,
  "locale": "en_US",
  "partner": "APPDIRECT",
  "reminderPattern": "pattern...",
  "subject": "Please verify your email address for {PARTNER_LABEL}",
  "type": "ACCOUNT_ACTIVATION"
}

GET /notification/v1/templates/email/{type}

Retrieve an email template by type This call returns all details from a specific email template type.

Parameters

Parameter Type Data Type Default Description
*type path string Email template type
directSales query boolean false Get the developer email template

Responses

Status Meaning Description Definition
200 OK Email template read. NotificationEmailTemplateWS
404 Not Found Customized email template or default email template not found.

List all notification parameters for a notification type

This call returns all parameter details from a notification template for a specified template type.

Example request


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

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



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

};

$.ajax({
  url: 'https://{marketplaceURL}/api/notification/v1/templates/parameters/{type}',
  method: 'get',
  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})
const request = require('node-fetch');
const headers = {
  'Accept':'application/json',
  'Content-Type':'application/json'

};

fetch('https://{marketplaceURL}/api/notification/v1/templates/parameters/{type}',
{
  method: 'GET',headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
require 'rest-client'
require 'json'

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

result = RestClient.get 'https://{marketplaceURL}/api/notification/v1/templates/parameters/{type}',

params: {
},
headers: headers

p JSON.parse(result)
import requests
headers = {
  'Accept': 'application/json',
  'Content-Type': 'application/json'
}

r = requests.get('https://{marketplaceURL}/api/notification/v1/templates/parameters/{type}',

params={
},
headers = headers)

print r.json()
URL obj = new URL("https://{marketplaceURL}/api/notification/v1/templates/parameters/{type}");
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

[
  {
    "parameterName": "{SUPPORT_EMAIL}",
    "type": "SUPPORT_EMAIL",
    "valueType": "SINGLE"
  },
  {
    "parameterName": "{BASE_URL}",
    "type": "BASE_URL",
    "valueType": "SINGLE"
  },
  {
    "parameterName": "{SUPPORT_PHONE}",
    "type": "SUPPORT_PHONE",
    "valueType": "SINGLE"
  },
  {
    "parameterName": "{ACTIVATION_URL}",
    "type": "ACTIVATION_URL",
    "valueType": "SINGLE"
  },
  {
    "parameterName": "{COMPANY_NAME}",
    "type": "COMPANY_NAME",
    "valueType": "SINGLE"
  },
  {
    "parameterName": "{PARTNER_LABEL}",
    "type": "PARTNER_LABEL",
    "valueType": "SINGLE"
  },
  {
    "parameterName": "{PARTNER_STORE_LABEL}",
    "type": "PARTNER_STORE_LABEL",
    "valueType": "SINGLE"
  },
  {
    "parameterName": "{USER_EMAIL}",
    "type": "USER_EMAIL",
    "valueType": "SINGLE"
  },
  {
    "parameterName": "{ACTIVATION_TOKEN}",
    "type": "ACTIVATION_TOKEN",
    "valueType": "SINGLE"
  },
  {
    "parameterName": "{SUPPORT_URL}",
    "type": "SUPPORT_URL",
    "valueType": "SINGLE"
  },
  {
    "parameterName": "{MARKETPLACE_LOGO_URL}",
    "type": "MARKETPLACE_LOGO_URL",
    "valueType": "SINGLE"
  }
]

GET /notification/v1/templates/parameters/{type}

List all notification parameters for a notification type This call returns all parameter details from a notification template for a specified template type.

Parameters

Parameter Type Data Type Default Description
*type path string Notification type

Responses

Status Meaning Description Definition
200 OK Success NotificationTemplateParameter

Retrieve an SMS template by type

This call returns all details for a specific sms template type.

Example request


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

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



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

};

$.ajax({
  url: 'https://{marketplaceURL}/api/notification/v1/templates/sms/{type}',
  method: 'get',
  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})
const request = require('node-fetch');
const headers = {
  'Accept':'application/json',
  'Content-Type':'application/json'

};

fetch('https://{marketplaceURL}/api/notification/v1/templates/sms/{type}',
{
  method: 'GET',headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
require 'rest-client'
require 'json'

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

result = RestClient.get 'https://{marketplaceURL}/api/notification/v1/templates/sms/{type}',

params: {
},
headers: headers

p JSON.parse(result)
import requests
headers = {
  'Accept': 'application/json',
  'Content-Type': 'application/json'
}

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

params={
},
headers = headers)

print r.json()
URL obj = new URL("https://{marketplaceURL}/api/notification/v1/templates/sms/{type}");
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

{
  "Subject": "subject...",
  "content": "activate that bad boy",
  "directSales": false,
  "enabled": true,
  "id": 269,
  "locale": "en_US",
  "type": "ACCOUNT_ACTIVATION"
}

GET /notification/v1/templates/sms/{type}

Retrieve an SMS template by type This call returns all details for a specific sms template type.

Parameters

Parameter Type Data Type Default Description
*type</