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

AppReseller 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.

This API doc describes an initial release of APIs which are under active development, they are subject to change. We are actively soliciting feedback from our customers and their partners, and that feedback as well our ongoing testing and development may result in backwards incompatible changes to these APIs. Please ensure that you engage with your account management and AppReseller team before commencing integration.

Use the following URL format to send API calls:

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

For example:

https://myMarketplace.com/api/appReseller/v1/sellableProducts

Generated on Tue Aug 20 2019 16:01:30 GMT-0400 (EDT)

Account

Company details

Example request

curl -X GET https://{marketplaceURL}/api/appReseller/v1/companies/{companyId}?context=type,string,enum,RESELLER%2C%20RESELLER_MANAGER \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \

GET https://{marketplaceURL}/api/appReseller/v1/companies/{companyId}?context=type,string,enum,RESELLER%2C%20RESELLER_MANAGER HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json

var headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
$.ajax({
  url: 'https://{marketplaceURL}/api/appReseller/v1/companies/{companyId}',
  method: 'get',
  data: '?context=type,string,enum,RESELLER%2C%20RESELLER_MANAGER',
  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

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

const headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
fetch('https://{marketplaceURL}/api/appReseller/v1/companies/{companyId}?context=type,string,enum,RESELLER%2C%20RESELLER_MANAGER',
{
  method: 'GET',

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

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

r = requests.get('https://{marketplaceURL}/api/appReseller/v1/companies/{companyId}', params={
  'context': {
  "type": "string",
  "enum": [
    "RESELLER, RESELLER_MANAGER"
  ]
}
}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

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

result = RestClient.get 'https://{marketplaceURL}/api/appReseller/v1/companies/{companyId}',
  params: {
  'context' => 'string'
}, headers: headers

p JSON.parse(result)

URL obj = new URL("https://{marketplaceURL}/api/appReseller/v1/companies/{companyId}?context=type,string,enum,RESELLER%2C%20RESELLER_MANAGER");
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

{
  "actions": [
    "JOIN_COMPANY",
    "DISABLE_COMPANY",
    "MANAGE_CUSTOM_ATTRIBUTES",
    "INVITE_USERS"
  ],
  "active": true,
  "availableAccesses": [],
  "availableRoles": [
    "USER"
  ],
  "availableTaxExemptions": [
    "FEDERAL_GOVERNMENT_US",
    "STATE_GOVERNMENT_US",
    "TRIBE_INDIAN",
    "FOREIGN_DIPLOMAT",
    "CHARITABLE_ORG",
    "RELIGIOUS_ORG",
    "RESALE",
    "COMMERCIAL_AGRICULTURAL",
    "INDUSTRIAL_PRODUCTION",
    "DIRECT_MAIL_US",
    "DIRECT_PAY_PERMIT_US",
    "OTHER",
    "LOCAL_GOVERNMENT_US",
    "COMMERCIAL_AQUACULTURE",
    "COMMERCIAL_FISHERY",
    "NON_RESIDENT_CAN",
    "MEDICAL_DEVICE_WITH_EXEMPT_SALES_TAX_US",
    "MEDICAL_DEVICE_WITH_TAXABLE_SALES_TAX_US"
  ],
  "createdOn": 1523007202000,
  "defaultRole": "USER",
  "enabled": true,
  "grantedAccesses": [],
  "id": "9e00b38b-7918-4a27-b2f6-123b77cfac0b",
  "idpConfigurations": [],
  "name": "C37719018",
  "settings": [],
  "stats": [
    {
      "children": "0",
      "unit": "Free Trials"
    },
    {
      "children": "0",
      "unit": "Expired Free Trials"
    },
    {
      "children": "0",
      "unit": "Purchased Products"
    },
    {
      "children": "0",
      "unit": "Suspended Products"
    },
    {
      "children": "0",
      "unit": "Unpaid Invoices"
    },
    {
      "children": "$0.00",
      "unit": "Total Spent"
    }
  ]
}

GET/appReseller/v1/companies/{companyId}

Retrieves the current reseller company details.

Required Scope and Authorization Rules

Scope Rule
ROLE_RESELLER Allows access as a Reseller for the company.
ROLE_RESELLER_MANAGER Allows access as a Reseller Manager for the company.

Parameters

Parameter Type Data Type Default Description
*companyId path string Company ID
*context query string of enum:
RESELLER, RESELLER_MANAGER
Supported AppReseller contexts

Responses

Status Meaning Description Definition
200 OK Success CompanyDetailsWS
401 Unauthorized Unauthorized
404 Not Found Not found

List companies

Example request

curl -X GET https://{marketplaceURL}/api/appReseller/v1/companies?context=type,string,enum,RESELLER%2C%20RESELLER_MANAGER \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \

GET https://{marketplaceURL}/api/appReseller/v1/companies?context=type,string,enum,RESELLER%2C%20RESELLER_MANAGER HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json

var headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
$.ajax({
  url: 'https://{marketplaceURL}/api/appReseller/v1/companies',
  method: 'get',
  data: '?context=type,string,enum,RESELLER%2C%20RESELLER_MANAGER',
  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

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

const headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
fetch('https://{marketplaceURL}/api/appReseller/v1/companies?context=type,string,enum,RESELLER%2C%20RESELLER_MANAGER',
{
  method: 'GET',

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

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

r = requests.get('https://{marketplaceURL}/api/appReseller/v1/companies', params={
  'context': {
  "type": "string",
  "enum": [
    "RESELLER, RESELLER_MANAGER"
  ]
}
}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

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

result = RestClient.get 'https://{marketplaceURL}/api/appReseller/v1/companies',
  params: {
  'context' => 'string'
}, headers: headers

p JSON.parse(result)

URL obj = new URL("https://{marketplaceURL}/api/appReseller/v1/companies?context=type,string,enum,RESELLER%2C%20RESELLER_MANAGER");
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

[
  {
    "activated": true,
    "createdOn": 1519158286000,
    "externalId": "externalRandom",
    "grantedAccesses": [],
    "id": "386626c0-53e2-4515-8450-4a720bb5d029",
    "name": "Test Name",
    "numOfUsers": 1,
    "phone": "50505055"
  },
  {
    "activated": true,
    "createdOn": 1519158286000,
    "externalId": "externalRandom2",
    "grantedAccesses": [],
    "id": "296626c0-53e2-4515-8450-4a720bb5d040",
    "name": "Test Name 2",
    "numOfUsers": 1,
    "phone": "50505056"
  }
]

GET/appReseller/v1/companies

Retrieves companies depending on context: in the Reseller context, this endpoint lists all companies linked to the current reseller company; in the Reseller Manager context, it lists all referral and reseller companies in the current marketplace

Required Scope and Authorization Rules

Scope Rule
ROLE_RESELLER Allows access as a Reseller for the companies
ROLE_RESELLER_MANAGER Allows access as a Reseller Manager for the companies

Parameters

Parameter Type Data Type Default Description
active query string User activation status
channelAdmin query string of enum:
ONLY_CHANNEL_ADMINS, ONLY_NON_CHANNEL_ADMINS
This enum filters companies that have (or not) permission to manage the marketplace.
*context query string of enum:
RESELLER, RESELLER_MANAGER
Supported AppReseller contexts
enabled query string User enablement status
fromDate query string From date, in timestamp format
page query integer Page number
searchText query string Search text
size query integer Number of results per page
sortField query string of enum:
COMPANY_ID
CREATED_ON
Field to sort by
sortOrder query string Sort order
toDate query string To date, in timestamp format
vendor query string of enum:
ONLY_VENDORS, ONLY_NON_VENDORS, ONLY_RESELLERS
This enum filters companies that can sell (or not) or resell products in the marketplace.

Responses

Status Meaning Description Definition
200 OK Success array of Company
401 Unauthorized Unauthorized

Create company

Example request

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

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

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

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

const request = require('node-fetch');
const inputBody = '{
  "companyAccess": "RESELLER",
  "companySize": "SMALL",
  "createdByCompanyId": "386626c0-53e2-4515-8450-4a720bb5d029",
  "externalId": "externalRandom",
  "name": "Test Name",
  "phone": "50505055",
  "website": "www.new_company.com"
}';
const headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
fetch('https://{marketplaceURL}/api/appReseller/v1/companies',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

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

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

}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

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

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

p JSON.parse(result)

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

Request body

{
  "companyAccess": "RESELLER",
  "companySize": "SMALL",
  "createdByCompanyId": "386626c0-53e2-4515-8450-4a720bb5d029",
  "externalId": "externalRandom",
  "name": "Test Name",
  "phone": "50505055",
  "website": "www.new_company.com"
}

Example response

{
  "createdOn": 1519158286000,
  "externalId": "externalRandom",
  "id": "386626c0-53e2-4515-8450-4a720bb5d029",
  "name": "Test Name",
  "phone": "50505055"
}

POST/appReseller/v1/companies

Create a new company linked to the current reseller.

Required Scope and Authorization Rules

Scope Rule
ROLE_RESELLER Allows access as a Reseller for the company.

Body Parameters

Information about the new company that will be created

AppResellerAccountCompanyCreationRequest object:

Property Type Description
companyAccess AppResellerAccountCompanyApiContext

Context

companySize AppResellerAccountCompanySize

New company's size

createdByCompanyId string

Reseller's company UUID

externalId string

External ID used to identify the new company (must be unique)

name string

New company's name

phone string

New company's phone number

website string

New company's website

Responses

Status Meaning Description Definition
200 OK Success AccountCompanyWS
401 Unauthorized Unauthorized

List users

Example request

curl -X GET https://{marketplaceURL}/api/appReseller/v1/users?context=type,string,enum,RESELLER%2CRESELLER_MANAGER \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \

GET https://{marketplaceURL}/api/appReseller/v1/users?context=type,string,enum,RESELLER%2CRESELLER_MANAGER HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json

var headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
$.ajax({
  url: 'https://{marketplaceURL}/api/appReseller/v1/users',
  method: 'get',
  data: '?context=type,string,enum,RESELLER%2CRESELLER_MANAGER',
  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

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

const headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
fetch('https://{marketplaceURL}/api/appReseller/v1/users?context=type,string,enum,RESELLER%2CRESELLER_MANAGER',
{
  method: 'GET',

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

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

r = requests.get('https://{marketplaceURL}/api/appReseller/v1/users', params={
  'context': {
  "type": "string",
  "enum": [
    "RESELLER",
    "RESELLER_MANAGER"
  ]
}
}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

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

result = RestClient.get 'https://{marketplaceURL}/api/appReseller/v1/users',
  params: {
  'context' => 'string'
}, headers: headers

p JSON.parse(result)

URL obj = new URL("https://{marketplaceURL}/api/appReseller/v1/users?context=type,string,enum,RESELLER%2CRESELLER_MANAGER");
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": [
    {
      "activated": false,
      "companyId": "0a357e6b-0000-000a-0000-680eabb9e322",
      "createdOn": 1525682872000,
      "email": "john@appdirect.com",
      "firstName": "John",
      "id": "0af398ee-0000-000a-0000-a83d70caeff8",
      "invitationRequired": false,
      "lastName": "Grande",
      "memberships": [
        {
          "company": {
            "createdOn": 1525682872000,
            "id": "0a357e6b-0000-000a-0000-680eabb9e322",
            "name": "TestCompany"
          },
          "enabled": true
        }
      ]
    },
    {
      "activated": false,
      "companyId": "a5811d92-0000-000a-0000-3c69e47fe126",
      "createdOn": 1461321550000,
      "email": "george@appdirect.com",
      "firstName": "George",
      "id": "47e70302-0000-000a-0000-a01cb6129c6c",
      "invitationRequired": false,
      "lastName": "Common",
      "memberships": [
        {
          "company": {
            "createdOn": 1461321550000,
            "id": "a5811d92-0000-000a-0000-3c69e47fe126",
            "name": "C4027287"
          },
          "enabled": true
        }
      ]
    }
  ],
  "page": {
    "number": 0,
    "size": 10,
    "totalElements": 2,
    "totalPages": 1
  }
}

GET/appReseller/v1/users

In the Reseller Manager context, this request retrieves all Resellers and Referral users. In the Reseller context, it retrieves all users that belong to companies linked to the reseller.

Required Scope and Authorization Rules

Scope Rule
ROLE_RESELLER Allows access as a Reseller for reading the users from companies that are linked to mine.
ROLE_RESELLER_MANAGER Allows access as a Reseller Manager for reading the users whose company are Reseller or Referral.

Parameters

Parameter Type Data Type Default Description
active query string of enum:
ONLY_ACTIVE
ONLY_INACTIVE
ONLY_PENDING_INVITE
List of user activation status
companyId query string User company ID
*context query string of enum:
RESELLER
RESELLER_MANAGER
Supported appReseller contexts
fromDate query string From date, in timestamp format
page query integer Page number
partner query string User partner
searchText query string Search text
size query integer Number of results per page
sortField query string of enum:
CUSTOMER_ID
EMAIL
FIRST_NAME
Field to sort by
sortOrder query string Sort order
toDate query string To date, in timestamp format

Responses

Status Meaning Description Definition
200 OK Success UserPagedReadResponse
401 Unauthorized Unauthorized

Create user

Example request

curl -X POST https://{marketplaceURL}/api/appReseller/v1/users?context=type,string,enum,RESELLER%2CRESELLER_MANAGER \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \

POST https://{marketplaceURL}/api/appReseller/v1/users?context=type,string,enum,RESELLER%2CRESELLER_MANAGER HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json

var headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
$.ajax({
  url: 'https://{marketplaceURL}/api/appReseller/v1/users',
  method: 'post',
  data: '?context=type,string,enum,RESELLER%2CRESELLER_MANAGER',
  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const request = require('node-fetch');
const inputBody = '{
  "companyId": "4c00cad1-f741-0zf6-bb00-0000e73cec00",
  "createdByCompanyId": "386626c0-53e2-0000-0000-4a720bb5d000",
  "email": "user@appdirect.com",
  "externalId": "01",
  "firstName": "James",
  "lastName": "Smith"
}';
const headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
fetch('https://{marketplaceURL}/api/appReseller/v1/users?context=type,string,enum,RESELLER%2CRESELLER_MANAGER',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

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

r = requests.post('https://{marketplaceURL}/api/appReseller/v1/users', params={
  'context': {
  "type": "string",
  "enum": [
    "RESELLER",
    "RESELLER_MANAGER"
  ]
}
}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

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

result = RestClient.post 'https://{marketplaceURL}/api/appReseller/v1/users',
  params: {
  'context' => 'string'
}, headers: headers

p JSON.parse(result)

URL obj = new URL("https://{marketplaceURL}/api/appReseller/v1/users?context=type,string,enum,RESELLER%2CRESELLER_MANAGER");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

Request body

{
  "companyId": "4c00cad1-f741-0zf6-bb00-0000e73cec00",
  "createdByCompanyId": "386626c0-53e2-0000-0000-4a720bb5d000",
  "email": "user@appdirect.com",
  "externalId": "01",
  "firstName": "James",
  "lastName": "Smith"
}

Example response

{
  "companyId": "460fad0d-19e2-4eec-a756-59c15dc7a56a",
  "email": "test4@yopmail.com",
  "firstName": "user4",
  "id": "6d375008-3b19-4cb8-bbb9-dcd9fce99432",
  "lastName": "user4",
  "memberships": [
    {
      "company": {
        "createdOn": 1525682872000,
        "externalId": "external11",
        "id": "460fad0d-19e2-4eec-a756-59c15dc7a56a",
        "name": "Company3",
        "phone": null
      }
    }
  ]
}

POST/appReseller/v1/users

Create a new user in a company linked to the Reseller company.

Required Scope and Authorization Rules

Scope Rule
ROLE_RESELLER Allows access as a Reseller for the company.

Parameters

Parameter Type Data Type Default Description
*context query string of enum:
RESELLER
RESELLER_MANAGER
Supported appReseller contexts

Body Parameters

Information about the user to create

UserCreationRequest object:

Property Type Description
companyId string

New user's company ID

createdByCompanyId string

Reseller's company ID

email string

New user's email (must be unique)

externalId string

New user's external ID (must be unique)

firstName string

New user's First Name

lastName string

New user's Last Name

Responses

Status Meaning Description Definition
200 OK Success UserCreationResponse
401 Unauthorized Unauthorized
500 Internal Server Error User not created

User details

Example request

curl -X GET https://{marketplaceURL}/api/appReseller/v1/users/{userId}?context=type,string,enum,RESELLER%2CRESELLER_MANAGER&companyId=type,string \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \

GET https://{marketplaceURL}/api/appReseller/v1/users/{userId}?context=type,string,enum,RESELLER%2CRESELLER_MANAGER&companyId=type,string HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json

var headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
$.ajax({
  url: 'https://{marketplaceURL}/api/appReseller/v1/users/{userId}',
  method: 'get',
  data: '?context=type,string,enum,RESELLER%2CRESELLER_MANAGER&companyId=type,string',
  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

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

const headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
fetch('https://{marketplaceURL}/api/appReseller/v1/users/{userId}?context=type,string,enum,RESELLER%2CRESELLER_MANAGER&companyId=type,string',
{
  method: 'GET',

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

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

r = requests.get('https://{marketplaceURL}/api/appReseller/v1/users/{userId}', params={
  'context': {
  "type": "string",
  "enum": [
    "RESELLER",
    "RESELLER_MANAGER"
  ]
},  'companyId': {
  "type": "string"
}
}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

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

result = RestClient.get 'https://{marketplaceURL}/api/appReseller/v1/users/{userId}',
  params: {
  'context' => 'string',
'companyId' => 'string'
}, headers: headers

p JSON.parse(result)

URL obj = new URL("https://{marketplaceURL}/api/appReseller/v1/users/{userId}?context=type,string,enum,RESELLER%2CRESELLER_MANAGER&companyId=type,string");
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

{
  "actions": [
    "SEND_RESET_PASSWORD_EMAIL"
  ],
  "activated": true,
  "availableRoles": [
    {
      "name": "BILLING_ADMIN",
      "permission": "READ"
    },
    {
      "name": "SYS_ADMIN",
      "permission": "READ"
    }
  ],
  "companyId": "c5fe2ca9-3db1-0000-0000-0cf0a01bd437",
  "createdOn": 1465984400000,
  "customAttributes": [],
  "email": "c4201720@appdirect.com",
  "enabled": true,
  "firstName": "John",
  "id": "64535371-9e83-0000-0000-61cb17bc0c9e",
  "invitationRequired": false,
  "lastName": "Grande",
  "memberships": [
    {
      "company": {
        "id": "c5fe2ca9-0000-408c-0000-0cf0a01bd437",
        "name": "C4200000"
      },
      "enabled": true,
      "roles": [
        "BILLING_ADMIN",
        "SYS_ADMIN",
        "RESELLER"
      ]
    }
  ],
  "partner": "APPDIRECT",
  "settings": [
    {
      "permission": "READ",
      "setting": "SYS_ADMIN",
      "value": "true"
    },
    {
      "permission": "READ",
      "setting": "BILLING_ADMIN",
      "value": "true"
    }
  ]
}

GET/appReseller/v1/users/{userId}

Get a single user details

Required Scope and Authorization Rules

Scope Rule
ROLE_RESELLER Allows access as a Reseller for the company.
ROLE_RESELLER_MANAGER Allows access as a Reseller Manager for the company.

Parameters

Parameter Type Data Type Default Description
*companyId query string User's company ID (some user details depend on the specified company)
*context query string of enum:
RESELLER
RESELLER_MANAGER
Supported appReseller contexts
*userId path string User ID

Responses

Status Meaning Description Definition
200 OK Success UserReadResponse
401 Unauthorized Unauthorized

Catalog

List sellable products

Example request

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

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

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

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

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

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

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

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

r = requests.get('https://{marketplaceURL}/api/appReseller/v1/catalog/sellableProducts', params={

}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

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

result = RestClient.get 'https://{marketplaceURL}/api/appReseller/v1/catalog/sellableProducts',
  params: {
  }, headers: headers

p JSON.parse(result)

URL obj = new URL("https://{marketplaceURL}/api/appReseller/v1/catalog/sellableProducts");
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": [
    {
      "blurb": "Product 1 short description",
      "id": "cf6ab187-000a-4571-8089-000019d68801",
      "imageUrl": "https://appdirect.com/resource1",
      "name": "Product name 1",
      "provider": "Appdirect",
      "visible": true
    },
    {
      "blurb": "Product 2 short description",
      "id": "9b997bfc-000a-4ee3-b9f2-66d634ee993f",
      "imageUrl": "https://appdirect.com/resource2",
      "name": "Product name 2",
      "provider": "Appdirect",
      "visible": true
    }
  ],
  "links": [],
  "page": {
    "number": 0,
    "size": 50,
    "totalElements": 2,
    "totalPages": 1
  }
}

GET/appReseller/v1/catalog/sellableProducts

Retrieve all products that a Reseller can sell.

Required Scope and Authorization Rules

Scope Rule
ROLE_RESELLER Allows access as a Reseller for the company.

Parameters

Parameter Type Data Type Default Description
page query integer Page number
searchText query string Search text
size query integer Number of results per page
targetUserId query string Current user ID

Responses

Status Meaning Description Definition
200 OK Success AppResellerCatalogProductPageWS
401 Unauthorized Unauthorized

Edition details

Example request

curl -X GET https://{marketplaceURL}/api/appReseller/v1/catalog/sellableProducts/{productId}/editions \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \

GET https://{marketplaceURL}/api/appReseller/v1/catalog/sellableProducts/{productId}/editions HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json

var headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
$.ajax({
  url: 'https://{marketplaceURL}/api/appReseller/v1/catalog/sellableProducts/{productId}/editions',
  method: 'get',

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

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

const headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
fetch('https://{marketplaceURL}/api/appReseller/v1/catalog/sellableProducts/{productId}/editions',
{
  method: 'GET',

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

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

r = requests.get('https://{marketplaceURL}/api/appReseller/v1/catalog/sellableProducts/{productId}/editions', params={

}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

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

result = RestClient.get 'https://{marketplaceURL}/api/appReseller/v1/catalog/sellableProducts/{productId}/editions',
  params: {
  }, headers: headers

p JSON.parse(result)

URL obj = new URL("https://{marketplaceURL}/api/appReseller/v1/catalog/sellableProducts/{productId}/editions");
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

[
  {
    "id": "12fe4576-0000-4d7b-bdf4-0000cd112b27",
    "name": "IT HelpDesk Session",
    "paymentPlans": [
      {
        "cancellationPeriodLimit": null,
        "costs": [
          {
            "id": 54479,
            "itemPrices": {
              "CAD": 60,
              "GBP": 60,
              "IDR": 0,
              "USD": 60
            },
            "markupPrices": [
              {
                "markupPrices": {
                  "USD": 898989
                },
                "markupType": "CHANNEL_RESELLER_COMPANY"
              }
            ],
            "maxUnits": 111,
            "minUnits": 0,
            "pricingStrategy": "UNIT",
            "unit": "SESSION",
            "unitDependency": null
          }
        ],
        "endOfContractGracePeriod": null,
        "frequency": "ONE_TIME",
        "id": "28e14ece-00a0-0055-8000-0000c4c8e329",
        "minimumServiceLength": null
      }
    ],
    "revenueType": "ONE_TIME"
  }
]

GET/appReseller/v1/catalog/sellableProducts/{productId}/editions

Get product editions, costs and markups.

Required Scope and Authorization Rules

Scope Rule
ROLE_RESELLER Allows access as a Reseller for the company.

Parameters

Parameter Type Data Type Default Description
*productId path string Product ID
targetUserId query string User ID

Responses

Status Meaning Description Definition
200 OK Success array of CatalogEdition
401 Unauthorized Unauthorized

Company Association

Remove company association

Example request

curl -X DELETE https://{marketplaceURL}/api/appReseller/v1/companyAssociations/{companyAssociationId} \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \

DELETE https://{marketplaceURL}/api/appReseller/v1/companyAssociations/{companyAssociationId} HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json

var headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
$.ajax({
  url: 'https://{marketplaceURL}/api/appReseller/v1/companyAssociations/{companyAssociationId}',
  method: 'delete',

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

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

const headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
fetch('https://{marketplaceURL}/api/appReseller/v1/companyAssociations/{companyAssociationId}',
{
  method: 'DELETE'

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

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

r = requests.delete('https://{marketplaceURL}/api/appReseller/v1/companyAssociations/{companyAssociationId}', params={

}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

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

result = RestClient.delete 'https://{marketplaceURL}/api/appReseller/v1/companyAssociations/{companyAssociationId}',
  params: {
  }, headers: headers

p JSON.parse(result)

URL obj = new URL("https://{marketplaceURL}/api/appReseller/v1/companyAssociations/{companyAssociationId}");
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/appReseller/v1/companyAssociations/{companyAssociationId}

Deletes a company association.

Required Scope and Authorization Rules

Scope Rule
ROLE_CHANNEL_ADMIN Allows access as a Marketplace Manager for the marketplace.
ROLE_PARTNER Allows access to read and write all marketplace data.
ROLE_RESELLER_MANAGER Allows access as a Reseller Manager for reading the users whose company are Reseller or Referral.

Parameters

Parameter Type Data Type Default Description
*companyAssociationId path string Company Association ID

Responses

Status Meaning Description Definition
204 No Content No Content

List company associations

Example request

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

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

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

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

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

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

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

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

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

}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

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

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

p JSON.parse(result)

URL obj = new URL("https://{marketplaceURL}/api/appReseller/v1/companyAssociations");
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": [
    {
      "createdOn": 1531839782000,
      "customerCompany": {
        "id": "0dc2860e-0000-40f7-0000-ef0000a30000",
        "name": "Customer1"
      },
      "id": "c39b8bcd-db7a-46d0-939f-facdeb1d6967",
      "resellerCompany": {
        "id": "0a69093c-0000-4f8d-0000-5e0000630000",
        "name": "Reseller1"
      }
    },
    {
      "createdOn": 1531839782000,
      "customerCompany": {
        "id": "0dc2860e-0000-40f7-0000-e0000600000a",
        "name": "Customer2"
      },
      "id": "c39b8bcd-db7a-46d0-939f-facdeb1d6967",
      "resellerCompany": {
        "id": "0a69093c-0000-4f8d-0000-5000020000ef",
        "name": "Reseller2"
      }
    }
  ],
  "page": {
    "number": 0,
    "size": 10,
    "totalElements": 2,
    "totalPages": 1
  }
}

GET/appReseller/v1/companyAssociations

Retrieves all customer company associations.

Required Scope and Authorization Rules

Scope Rule
ROLE_CHANNEL_ADMIN Allows access as a Marketplace Manager for the marketplace.
ROLE_PARTNER_READ Allows access to read all marketplace data.
ROLE_RESELLER_MANAGER Allows access as a Reseller Manager for reading the users whose company are Reseller or Referral.

Parameters

Parameter Type Data Type Default Description
createdOn query string Date filter, defined by upper or lower inclusive or exclusive limits, in Unix timestamp format. Acceptable values are: gte([timestamp]) - 'greater than or equal to'; or lte([timestamp]) - 'less than or equal to'
customerCompanyId query string Customer company ID
number query integer Page number
resellerCompanyId query string Reseller company ID
searchText query string Search term used to search on different fields of the customer company association.
size query integer Number of results per page
sort query string Sort field and order. For ascending sort order, use the '+[FieldName]' format. For descending order, use the '-[FieldName]' format.

Responses

Status Meaning Description Definition
200 OK Success CustomerCompanyAssociationPagedReadResponse

Create company association

Example request

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

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

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

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

const request = require('node-fetch');
const inputBody = '{
  "type": "object",
  "title": "CustomerCompanyAssociationCreationRequest",
  "required": [
    "customerCompanyId",
    "resellerCompanyId"
  ],
  "properties": {
    "customerCompanyId": {
      "description": "Customer company ID",
      "type": "string"
    },
    "resellerCompanyId": {
      "description": "Reseller company ID",
      "type": "string"
    }
  }
}';
const headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
fetch('https://{marketplaceURL}/api/appReseller/v1/companyAssociations',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

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

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

}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

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

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

p JSON.parse(result)

URL obj = new URL("https://{marketplaceURL}/api/appReseller/v1/companyAssociations");
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());

Example response

{
  "createdOn": 1531839782000,
  "customerCompany": {
    "id": "0dc2860e-0000-40f7-0000-ef0000a30000",
    "name": "Customer"
  },
  "id": "c39b8bcd-db7a-46d0-939f-facdeb1d6967",
  "resellerCompany": {
    "id": "0a69093c-0000-4f8d-0000-5e0000630000",
    "name": "Reseller"
  }
}

POST/appReseller/v1/companyAssociations

Creates an association (link) between a customer company and a reseller company.

Required Scope and Authorization Rules

Scope Rule
ROLE_CHANNEL_ADMIN Allows access as a Marketplace Manager for the marketplace.
ROLE_PARTNER Allows access to read and write all marketplace data.
ROLE_RESELLER_MANAGER Allows access as a Reseller Manager for the marketplace.

Body Parameters

Information about the association to create

CustomerCompanyAssociationCreationRequest object:

Property Type Description
customerCompanyId string

Customer company ID

resellerCompanyId string

Reseller company ID

Responses

Status Meaning Description Definition
200 OK Success CustomerCompanyAssociation
404 Not Found Resource does not exist
409 Conflict Conflict CustomerCompanyAssociationConflictResponse

Leads

Resellers, Referral Users, Developers, and Reseller Managers can use the Leads API to create, read, and update leads, disqualify and delete leads, assign leads, associate companies with leads, and read lead-related activities.
Manual leads (leads that Resellers, Referral Users, Developers, and Reseller Managers create) can be viewed by only their creators.
Only profile owners and Reseller Managers can view company profile leads (leads that anonymous users create when they click Contact Us on a reseller company profile page).
Reseller Managers can view product profile leads (leads that anonymous users create when they click Contact Us on a product profile page). Marketplace Managers can configure product profile leads so that the Developers who own the product profile can also view the leads.

List activities

Example request

curl -X GET https://{marketplaceURL}/api/lead/v2/leads/{leadId}/activities?context=type,string,enum,RESELLER%2CREFERRAL%2CDEVELOPER%2CRESELLER_MANAGER&companyId=type,string \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \

GET https://{marketplaceURL}/api/lead/v2/leads/{leadId}/activities?context=type,string,enum,RESELLER%2CREFERRAL%2CDEVELOPER%2CRESELLER_MANAGER&companyId=type,string HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json

var headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
$.ajax({
  url: 'https://{marketplaceURL}/api/lead/v2/leads/{leadId}/activities',
  method: 'get',
  data: '?context=type,string,enum,RESELLER%2CREFERRAL%2CDEVELOPER%2CRESELLER_MANAGER&companyId=type,string',
  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

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

const headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
fetch('https://{marketplaceURL}/api/lead/v2/leads/{leadId}/activities?context=type,string,enum,RESELLER%2CREFERRAL%2CDEVELOPER%2CRESELLER_MANAGER&companyId=type,string',
{
  method: 'GET',

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

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

r = requests.get('https://{marketplaceURL}/api/lead/v2/leads/{leadId}/activities', params={
  'context': {
  "type": "string",
  "enum": [
    "RESELLER",
    "REFERRAL",
    "DEVELOPER",
    "RESELLER_MANAGER"
  ]
},  'companyId': {
  "type": "string"
}
}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

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

result = RestClient.get 'https://{marketplaceURL}/api/lead/v2/leads/{leadId}/activities',
  params: {
  'context' => 'string',
'companyId' => 'string'
}, headers: headers

p JSON.parse(result)

URL obj = new URL("https://{marketplaceURL}/api/lead/v2/leads/{leadId}/activities?context=type,string,enum,RESELLER%2CREFERRAL%2CDEVELOPER%2CRESELLER_MANAGER&companyId=type,string");
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": [
    {
      "actorCompany": {
        "id": "386626c0-53e2-4515-8450-4a720bb5d029",
        "name": "Reseller Company"
      },
      "allowedResourcesAccess": [
        "ACTOR_COMPANY"
      ],
      "createdOn": 1528922810000,
      "id": "9d0957c8-d78d-44ac-9789-4b60a5859a3a",
      "partner": "APPDIRECT",
      "verb": "LEAD_CONVERSION_REQUESTED",
      "verbContext": "COMPANY"
    },
    {
      "actorCompany": {
        "id": "386626c0-1234-4515-8450-4a720bb5d029",
        "name": "Reseller Company"
      },
      "allowedResourcesAccess": [
        "ACTOR_COMPANY"
      ],
      "createdOn": 1528922659000,
      "id": "259558f5-da66-4ce9-aede-0f15f68478f5",
      "partner": "APPDIRECT",
      "verb": "LEAD_CREATED",
      "verbContext": "COMPANY"
    },
    {
      "actorCompany": {
        "id": "6b4bd452-895d-4098-aaaa-e6046b238e0f",
        "name": "Appdirect"
      },
      "allowedResourcesAccess": [
        "ACTOR_COMPANY"
      ],
      "createdOn": 1528922904000,
      "id": "c6350331-caa9-4942-b53c-611df7d7c1d7",
      "partner": "APPDIRECT",
      "verb": "LEAD_CONVERSION_APPROVED",
      "verbContext": "MARKETPLACE"
    },
    {
      "actorCompany": {
        "id": "386626c0-1234-4515-8450-4a720bb5d029",
        "name": "Reseller Company"
      },
      "allowedResourcesAccess": [
        "ACTOR_COMPANY"
      ],
      "createdOn": 1528922952000,
      "id": "49479105-36a9-4740-b9a3-b768c6755378",
      "partner": "APPDIRECT",
      "verb": "LEAD_CONVERTED",
      "verbContext": "COMPANY"
    },
    {
      "actorCompany": {
        "id": "386626c0-1234-4515-8450-4a720bb5d029",
        "name": "Reseller Company"
      },
      "allowedResourcesAccess": [
        "ACTOR_COMPANY"
      ],
      "contextQuote": {
        "applicationName": "AUTO_WEBAPP_NEW",
        "friendlyId": "I4HNJM",
        "id": "5f7a98c8-deac-40b2-8cef-cd41af042233"
      },
      "createdOn": 1528923325000,
      "id": "45e3a909-e3ec-46fc-8b08-bcc264fdc2f7",
      "partner": "APPDIRECT",
      "verb": "LEAD_QUOTE_LINKED",
      "verbContext": "COMPANY"
    }
  ],
  "page": {
    "number": 0,
    "size": 5,
    "totalElements": 17,
    "totalPages": 4
  }
}

GET/lead/v2/leads/{leadId}/activities

Retrieves a list of all lead activities visible for a given context. You can filter the list using optional query parameters.

Required Scope and Authorization Rules

Scope Rule
ROLE_DEVELOPER Allows access as a Developer for the company
ROLE_REFERRAL Allows access as a Referral for the company
ROLE_RESELLER Allows access as a Reseller for the company
ROLE_RESELLER_MANAGER Allows access as a Reseller Manager for the marketplace

Parameters

Parameter Type Data Type Default Description
*companyId query string Company ID of the user who is retrieving the list
*context query string of enum:
RESELLER
REFERRAL
DEVELOPER
RESELLER_MANAGER
The supported lead's API contexts
creationDateOrder query string of enum:
ASC
DESC
DESC Type of ordering used (ascending or descending) for the creation date
fromDate query number Date on which the lead activity was created (lower bound) in Unix timestamp format
*leadId path string Lead ID
page query integer 0 Page number
size query integer 50 Number of results per page
toDate query number Date on which the lead activity was created (upper bound) in Unix timestamp format

Responses

Status Meaning Description Definition
200 OK Success LeadActivityPagedReadResponse
401 Unauthorized Unauthorized
404 Not Found Not Found

Assign lead

Example request

curl -X POST https://{marketplaceURL}/api/lead/v2/assignment?context=type,string,enum,RESELLER%2CREFERRAL%2CDEVELOPER%2CRESELLER_MANAGER&companyId=type,string \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \

POST https://{marketplaceURL}/api/lead/v2/assignment?context=type,string,enum,RESELLER%2CREFERRAL%2CDEVELOPER%2CRESELLER_MANAGER&companyId=type,string HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json

var headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
$.ajax({
  url: 'https://{marketplaceURL}/api/lead/v2/assignment',
  method: 'post',
  data: '?context=type,string,enum,RESELLER%2CREFERRAL%2CDEVELOPER%2CRESELLER_MANAGER&companyId=type,string',
  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const request = require('node-fetch');
const inputBody = '{
  "leadId": "29a1dc26-8088-475c-ba75-7b73915a0fab",
  "recipient": {
    "companyId": "386626c0-1234-4515-8450-4a720bb5d029",
    "participantType": "COMPANY"
  }
}';
const headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
fetch('https://{marketplaceURL}/api/lead/v2/assignment?context=type,string,enum,RESELLER%2CREFERRAL%2CDEVELOPER%2CRESELLER_MANAGER&companyId=type,string',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

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

r = requests.post('https://{marketplaceURL}/api/lead/v2/assignment', params={
  'context': {
  "type": "string",
  "enum": [
    "RESELLER",
    "REFERRAL",
    "DEVELOPER",
    "RESELLER_MANAGER"
  ]
},  'companyId': {
  "type": "string"
}
}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

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

result = RestClient.post 'https://{marketplaceURL}/api/lead/v2/assignment',
  params: {
  'context' => 'string',
'companyId' => 'string'
}, headers: headers

p JSON.parse(result)

URL obj = new URL("https://{marketplaceURL}/api/lead/v2/assignment?context=type,string,enum,RESELLER%2CREFERRAL%2CDEVELOPER%2CRESELLER_MANAGER&companyId=type,string");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

Request body

{
  "leadId": "29a1dc26-8088-475c-ba75-7b73915a0fab",
  "recipient": {
    "companyId": "386626c0-1234-4515-8450-4a720bb5d029",
    "participantType": "COMPANY"
  }
}

Example response

{
  "lead": {
    "createdOn": 1534465177000,
    "creator": {
      "companyId": "6b4bd452-895d-4098-aa56-e6046b238e0f",
      "companyName": "Appdirect",
      "id": "833d4c99-1939-4366-a5ae-6fb7ae3ec1be",
      "role": "RESELLER_MANAGER"
    },
    "customAttributes": {},
    "customer": {
      "company": {
        "city": "Beverly Hills",
        "country": "US",
        "name": "Acme",
        "state": "CA",
        "street1": "1234 Main St",
        "street2": "1st floor",
        "zip": "90210"
      },
      "contact": {
        "email": "john.doe@acme.com",
        "firstName": "John",
        "lastName": "Doe",
        "phone": "+14455555555"
      }
    },
    "id": "29a1dc26-8088-475c-ba75-7b73915a0fab",
    "lastModified": 1534857159000,
    "leadType": "MANUAL",
    "notes": "Some notes",
    "partner": "APPDIRECT",
    "recipient": {
      "companyId": "386626c0-53e2-4515-8450-4a720bb5d029",
      "companyName": "Reseller Company",
      "participantType": "COMPANY"
    },
    "referrer": {
      "participantType": "CHANNEL",
      "partner": "APPDIRECT"
    },
    "status": "ASSIGNED"
  }
}

POST/lead/v2/assignment

Assigns a lead to a Reseller company. The assignee will be able to see that lead as long as is not assigned to another company. The owner of the lead retains visibility even if it is assigned to another company.

Required Scope and Authorization Rules

Scope Rule
ROLE_RESELLER_MANAGER Allows access as a Reseller Manager for the marketplace

Parameters

Parameter Type Data Type Default Description
*companyId query string Company ID of the user who is assigning the lead
*context query string of enum:
RESELLER
REFERRAL
DEVELOPER
RESELLER_MANAGER
The supported lead's API contexts

Body Parameters

Information about the person to whom the lead is being assigned

LeadAssignmentRequest object:

Property Type Description
leadId string

Lead ID

recipient LeadParticipant

The participant to whom the lead is being assigned

Responses

Status Meaning Description Definition
201 Created Lead assigned LeadAssignmentResponse
400 Bad Request Error attempting to assign the lead (missing required data, for example)
401 Unauthorized Unauthorized
404 Not Found Not Found

Associate lead

Example request

curl -X POST https://{marketplaceURL}/api/lead/v2/companyAssociation?context=type,string,enum,RESELLER%2CREFERRAL%2CDEVELOPER%2CRESELLER_MANAGER&companyId=type,string \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \

POST https://{marketplaceURL}/api/lead/v2/companyAssociation?context=type,string,enum,RESELLER%2CREFERRAL%2CDEVELOPER%2CRESELLER_MANAGER&companyId=type,string HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json

var headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
$.ajax({
  url: 'https://{marketplaceURL}/api/lead/v2/companyAssociation',
  method: 'post',
  data: '?context=type,string,enum,RESELLER%2CREFERRAL%2CDEVELOPER%2CRESELLER_MANAGER&companyId=type,string',
  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const request = require('node-fetch');
const inputBody = '{
  "leadId": "ce9d1713-7a48-43e4-bb43-b6880a19df24",
  "user": {
    "companyId": "62377315-61ba-4b50-9891-02799bef4257",
    "id": "1661c8d8-357b-4e8d-a0b9-a571ff00924b"
  }
}';
const headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
fetch('https://{marketplaceURL}/api/lead/v2/companyAssociation?context=type,string,enum,RESELLER%2CREFERRAL%2CDEVELOPER%2CRESELLER_MANAGER&companyId=type,string',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

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

r = requests.post('https://{marketplaceURL}/api/lead/v2/companyAssociation', params={
  'context': {
  "type": "string",
  "enum": [
    "RESELLER",
    "REFERRAL",
    "DEVELOPER",
    "RESELLER_MANAGER"
  ]
},  'companyId': {
  "type": "string"
}
}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

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

result = RestClient.post 'https://{marketplaceURL}/api/lead/v2/companyAssociation',
  params: {
  'context' => 'string',
'companyId' => 'string'
}, headers: headers

p JSON.parse(result)

URL obj = new URL("https://{marketplaceURL}/api/lead/v2/companyAssociation?context=type,string,enum,RESELLER%2CREFERRAL%2CDEVELOPER%2CRESELLER_MANAGER&companyId=type,string");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

Request body

{
  "leadId": "ce9d1713-7a48-43e4-bb43-b6880a19df24",
  "user": {
    "companyId": "62377315-61ba-4b50-9891-02799bef4257",
    "id": "1661c8d8-357b-4e8d-a0b9-a571ff00924b"
  }
}

Example response

{
  "convertedCompany": {
    "id": "62377315-61ba-4b50-9891-02799bef4257",
    "name": "Acme"
  },
  "convertedUser": {
    "companyId": "62377315-61ba-4b50-9891-02799bef4257",
    "id": "1661c8d8-357b-4e8d-a0b9-a571ff00924b"
  },
  "createdOn": 1534845351000,
  "creator": {
    "companyId": "6b4bd452-895d-4098-aa56-e6046b238e0f",
    "companyName": "Appdirect",
    "id": "833d4c99-1939-4366-a5ae-6fb7ae3ec1be",
    "role": "CHANNEL_ADMIN"
  },
  "customAttributes": {},
  "customer": {
    "company": {
      "city": "Beverly Hills",
      "companyExists": true,
      "country": "US",
      "linked": false,
      "name": "Globex",
      "state": "CA",
      "street1": "1234 Main St",
      "zip": "90210"
    },
    "contact": {
      "email": "jane.doe@company.com",
      "firstName": "Jane",
      "lastName": "Doe"
    }
  },
  "id": "ce9d1713-7a48-43e4-bb43-b6880a19df24",
  "lastModified": 1534845352000,
  "leadType": "MANUAL",
  "partner": "APPDIRECT",
  "recipient": {
    "participantType": "CHANNEL",
    "partner": "APPDIRECT"
  },
  "referrer": {
    "participantType": "CHANNEL",
    "partner": "APPDIRECT"
  },
  "status": "SUBMITTED"
}

POST/lead/v2/companyAssociation

Associates a lead with an existing marketplace user and company

Required Scope and Authorization Rules

Scope Rule
ROLE_RESELLER Allows access as a Reseller for the company
ROLE_RESELLER_MANAGER Allows access as a Reseller Manager for the marketplace

Parameters

Parameter Type Data Type Default Description
*companyId query string Company ID of the user who is updating the lead
*context query string of enum:
RESELLER
REFERRAL
DEVELOPER
RESELLER_MANAGER
The supported lead's API contexts

Body Parameters

Information about the user/company that the lead is being associated with

LeadCompanyAssociationRequest object:

Property Type Description
leadId string

Lead ID

user LeadUser

The user and company who are being associated with the lead

Responses

Status Meaning Description Definition
200 OK Lead associated LeadResponse
400 Bad Request Error attempting to associate the lead (missing required data, for example)
401 Unauthorized Unauthorized
404 Not Found Not Found

Convert lead

Example request

curl -X POST https://{marketplaceURL}/api/lead/v2/conversion?context=type,string,enum,RESELLER%2CREFERRAL%2CDEVELOPER%2CRESELLER_MANAGER&companyId=type,string&leadId=type,string \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \

POST https://{marketplaceURL}/api/lead/v2/conversion?context=type,string,enum,RESELLER%2CREFERRAL%2CDEVELOPER%2CRESELLER_MANAGER&companyId=type,string&leadId=type,string HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json

var headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
$.ajax({
  url: 'https://{marketplaceURL}/api/lead/v2/conversion',
  method: 'post',
  data: '?context=type,string,enum,RESELLER%2CREFERRAL%2CDEVELOPER%2CRESELLER_MANAGER&companyId=type,string&leadId=type,string',
  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

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

const headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
fetch('https://{marketplaceURL}/api/lead/v2/conversion?context=type,string,enum,RESELLER%2CREFERRAL%2CDEVELOPER%2CRESELLER_MANAGER&companyId=type,string&leadId=type,string',
{
  method: 'POST',

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

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

r = requests.post('https://{marketplaceURL}/api/lead/v2/conversion', params={
  'context': {
  "type": "string",
  "enum": [
    "RESELLER",
    "REFERRAL",
    "DEVELOPER",
    "RESELLER_MANAGER"
  ]
},  'companyId': {
  "type": "string"
},  'leadId': {
  "type": "string"
}
}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

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

result = RestClient.post 'https://{marketplaceURL}/api/lead/v2/conversion',
  params: {
  'context' => 'string',
'companyId' => 'string',
'leadId' => 'string'
}, headers: headers

p JSON.parse(result)

URL obj = new URL("https://{marketplaceURL}/api/lead/v2/conversion?context=type,string,enum,RESELLER%2CREFERRAL%2CDEVELOPER%2CRESELLER_MANAGER&companyId=type,string&leadId=type,string");
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());

Example response

{
  "lead": {
    "convertedCompany": {
      "id": "b3577d6f-8f29-454e-9d9d-da99e1e9618f",
      "name": "Acme"
    },
    "convertedUser": {
      "companyId": "b3577d6f-8f29-454e-9d9d-da99e1e9618f",
      "id": "6f3b8110-4e66-49bd-aec9-2e2fbe8c54ea"
    },
    "createdOn": 1534846329000,
    "customer": {
      "company": {
        "companyExists": true,
        "linked": true,
        "name": "Acme"
      },
      "contact": {
        "email": "john.doe@acme.com",
        "firstName": "John",
        "lastName": "Doe"
      }
    },
    "id": "94890613-265d-4635-93d1-9fdddf70cf73",
    "lastModified": 1534985564812,
    "leadType": "COMPANY",
    "partner": "APPDIRECT",
    "profileCompany": {
      "id": "386626c0-53e2-4515-8450-4a720bb5d029",
      "name": "Reseller Company"
    },
    "recipient": {
      "companyId": "386626c0-53e2-4515-8450-4a720bb5d029",
      "companyName": "Reseller Company",
      "participantType": "COMPANY"
    },
    "referrer": {
      "participantType": "CHANNEL",
      "partner": "APPDIRECT"
    },
    "reseller": {
      "companyId": "386626c0-1234-4515-8450-4a720bb5d029",
      "id": "01d75b7c-ea78-4dc2-9e58-6ad217bddcbd"
    },
    "status": "CONVERTED"
  }
}

POST/lead/v2/conversion

Converts the lead to a marketplace company

Required Scope and Authorization Rules

Scope Rule
ROLE_RESELLER Allows access as a Reseller for the company

Parameters

Parameter Type Data Type Default Description
*companyId query string Company ID of the user who is converting the lead
*context query string of enum:
RESELLER
REFERRAL
DEVELOPER
RESELLER_MANAGER
The supported lead's API contexts
*leadId query string Lead ID

Responses

Status Meaning Description Definition
200 OK Success LeadConversionResponse
400 Bad Request Error attempting to convert the lead (for example, it is not possible to convert the lead)
401 Unauthorized Unauthorized
404 Not Found Not Found
409 Conflict Conflict

Approve conversion request

Example request

curl -X POST https://{marketplaceURL}/api/lead/v2/conversionApproval?context=type,string,enum,RESELLER%2CREFERRAL%2CDEVELOPER%2CRESELLER_MANAGER&leadId=type,string \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \

POST https://{marketplaceURL}/api/lead/v2/conversionApproval?context=type,string,enum,RESELLER%2CREFERRAL%2CDEVELOPER%2CRESELLER_MANAGER&leadId=type,string HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json

var headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
$.ajax({
  url: 'https://{marketplaceURL}/api/lead/v2/conversionApproval',
  method: 'post',
  data: '?context=type,string,enum,RESELLER%2CREFERRAL%2CDEVELOPER%2CRESELLER_MANAGER&leadId=type,string',
  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

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

const headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
fetch('https://{marketplaceURL}/api/lead/v2/conversionApproval?context=type,string,enum,RESELLER%2CREFERRAL%2CDEVELOPER%2CRESELLER_MANAGER&leadId=type,string',
{
  method: 'POST',

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

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

r = requests.post('https://{marketplaceURL}/api/lead/v2/conversionApproval', params={
  'context': {
  "type": "string",
  "enum": [
    "RESELLER",
    "REFERRAL",
    "DEVELOPER",
    "RESELLER_MANAGER"
  ]
},  'leadId': {
  "type": "string"
}
}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

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

result = RestClient.post 'https://{marketplaceURL}/api/lead/v2/conversionApproval',
  params: {
  'context' => 'string',
'leadId' => 'string'
}, headers: headers

p JSON.parse(result)

URL obj = new URL("https://{marketplaceURL}/api/lead/v2/conversionApproval?context=type,string,enum,RESELLER%2CREFERRAL%2CDEVELOPER%2CRESELLER_MANAGER&leadId=type,string");
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());

Example response

{
  "lead": {
    "createdOn": 1534846329000,
    "customAttributes": {},
    "customer": {
      "company": {
        "name": "Acme"
      },
      "contact": {
        "email": "john.doe@acme.com",
        "firstName": "John",
        "lastName": "Doe"
      }
    },
    "id": "94890613-265d-4635-93d1-9fdddf70cf73",
    "lastModified": 1534984995000,
    "leadType": "COMPANY",
    "partner": "APPDIRECT",
    "profileCompany": {
      "id": "386626c0-1234-4515-8450-4a720bb5d029",
      "name": "Reseller Company"
    },
    "recipient": {
      "companyId": "386626c0-1234-4515-8450-4a720bb5d029",
      "companyName": "Reseller Company",
      "participantType": "COMPANY"
    },
    "referrer": {
      "participantType": "CHANNEL",
      "partner": "APPDIRECT"
    },
    "status": "CONVERSION_APPROVED"
  }
}

POST/lead/v2/conversionApproval

Approves the conversion request made by a Reseller company

Required Scope and Authorization Rules

Scope Rule
ROLE_RESELLER_MANAGER Allows access as a Reseller Manager for the marketplace

Parameters

Parameter Type Data Type Default Description
*context query string of enum:
RESELLER
REFERRAL
DEVELOPER
RESELLER_MANAGER
The supported lead's API contexts
*leadId query string Lead ID

Responses

Status Meaning Description Definition
200 OK Lead conversion approval successful LeadConversionResponse
400 Bad Request Error attempting to approve the request (for example, conversion is already approved)
401 Unauthorized Unauthorized
404 Not Found Not Found

Request conversion approval

Example request

curl -X POST https://{marketplaceURL}/api/lead/v2/conversionRequest?context=type,string,enum,RESELLER%2CREFERRAL%2CDEVELOPER%2CRESELLER_MANAGER&companyId=type,string&leadId=type,string \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \

POST https://{marketplaceURL}/api/lead/v2/conversionRequest?context=type,string,enum,RESELLER%2CREFERRAL%2CDEVELOPER%2CRESELLER_MANAGER&companyId=type,string&leadId=type,string HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json

var headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
$.ajax({
  url: 'https://{marketplaceURL}/api/lead/v2/conversionRequest',
  method: 'post',
  data: '?context=type,string,enum,RESELLER%2CREFERRAL%2CDEVELOPER%2CRESELLER_MANAGER&companyId=type,string&leadId=type,string',
  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

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

const headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
fetch('https://{marketplaceURL}/api/lead/v2/conversionRequest?context=type,string,enum,RESELLER%2CREFERRAL%2CDEVELOPER%2CRESELLER_MANAGER&companyId=type,string&leadId=type,string',
{
  method: 'POST',

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

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

r = requests.post('https://{marketplaceURL}/api/lead/v2/conversionRequest', params={
  'context': {
  "type": "string",
  "enum": [
    "RESELLER",
    "REFERRAL",
    "DEVELOPER",
    "RESELLER_MANAGER"
  ]
},  'companyId': {
  "type": "string"
},  'leadId': {
  "type": "string"
}
}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

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

result = RestClient.post 'https://{marketplaceURL}/api/lead/v2/conversionRequest',
  params: {
  'context' => 'string',
'companyId' => 'string',
'leadId' => 'string'
}, headers: headers

p JSON.parse(result)

URL obj = new URL("https://{marketplaceURL}/api/lead/v2/conversionRequest?context=type,string,enum,RESELLER%2CREFERRAL%2CDEVELOPER%2CRESELLER_MANAGER&companyId=type,string&leadId=type,string");
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());

Example response

{
  "lead": {
    "createdOn": 1534846329000,
    "customAttributes": {},
    "customer": {
      "company": {
        "name": "Acme"
      },
      "contact": {
        "email": "john.doe@acme.com",
        "firstName": "John",
        "lastName": "Doe"
      }
    },
    "id": "94890613-265d-4635-93d1-9fdddf70cf73",
    "lastModified": 1534846331000,
    "leadType": "COMPANY",
    "partner": "APPDIRECT",
    "profileCompany": {
      "id": "386626c0-1234-4515-8450-4a720bb5d029",
      "name": "Reseller Company"
    },
    "recipient": {
      "participantType": "CHANNEL",
      "partner": "APPDIRECT"
    },
    "referrer": {
      "companyId": "386626c0-1234-4515-8450-4a720bb5d029",
      "companyName": "Reseller Company",
      "participantType": "COMPANY"
    },
    "status": "PENDING_CONVERSION_APPROVAL"
  }
}

POST/lead/v2/conversionRequest

Request permission to convert the lead to a marketplace company

Required Scope and Authorization Rules

Scope Rule
ROLE_RESELLER Allows access as a Reseller for the company

Parameters

Parameter Type Data Type Default Description
*companyId query string Company ID of the user who is requesting the lead conversion
*context query string of enum:
RESELLER
REFERRAL
DEVELOPER
RESELLER_MANAGER
The supported lead's API contexts
*leadId query string Lead ID

Responses

Status Meaning Description Definition
200 OK Lead conversion request successful LeadConversionResponse
400 Bad Request Error attempting to request approval (for example, approval has already been requested)
401 Unauthorized Unauthorized
404 Not Found Not Found

Create lead

Example request

curl -X POST https://{marketplaceURL}/api/lead/v2/leads?context=type,string,enum,RESELLER%2CREFERRAL%2CDEVELOPER%2CRESELLER_MANAGER&companyId=type,string \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \

POST https://{marketplaceURL}/api/lead/v2/leads?context=type,string,enum,RESELLER%2CREFERRAL%2CDEVELOPER%2CRESELLER_MANAGER&companyId=type,string HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json

var headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
$.ajax({
  url: 'https://{marketplaceURL}/api/lead/v2/leads',
  method: 'post',
  data: '?context=type,string,enum,RESELLER%2CREFERRAL%2CDEVELOPER%2CRESELLER_MANAGER&companyId=type,string',
  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const request = require('node-fetch');
const inputBody = '{
  "customer": {
    "company": {
      "city": "Miami",
      "country": "US",
      "name": "Acme",
      "state": "FL",
      "street1": "1234 Main St",
      "street2": "30th Floor, Apt B",
      "zip": "33033"
    },
    "contact": {
      "email": "john.doe@acme.com",
      "firstName": "John",
      "lastName": "Doe",
      "phone": "+13055555555"
    }
  },
  "leadType": "MANUAL",
  "partner": "APPDIRECT"
}';
const headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
fetch('https://{marketplaceURL}/api/lead/v2/leads?context=type,string,enum,RESELLER%2CREFERRAL%2CDEVELOPER%2CRESELLER_MANAGER&companyId=type,string',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

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

r = requests.post('https://{marketplaceURL}/api/lead/v2/leads', params={
  'context': {
  "type": "string",
  "enum": [
    "RESELLER",
    "REFERRAL",
    "DEVELOPER",
    "RESELLER_MANAGER"
  ]
},  'companyId': {
  "type": "string"
}
}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

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

result = RestClient.post 'https://{marketplaceURL}/api/lead/v2/leads',
  params: {
  'context' => 'string',
'companyId' => 'string'
}, headers: headers

p JSON.parse(result)

URL obj = new URL("https://{marketplaceURL}/api/lead/v2/leads?context=type,string,enum,RESELLER%2CREFERRAL%2CDEVELOPER%2CRESELLER_MANAGER&companyId=type,string");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

Request body

{
  "customer": {
    "company": {
      "city": "Miami",
      "country": "US",
      "name": "Acme",
      "state": "FL",
      "street1": "1234 Main St",
      "street2": "30th Floor, Apt B",
      "zip": "33033"
    },
    "contact": {
      "email": "john.doe@acme.com",
      "firstName": "John",
      "lastName": "Doe",
      "phone": "+13055555555"
    }
  },
  "leadType": "MANUAL",
  "partner": "APPDIRECT"
}

Example response

{
  "createdOn": 1534875428054,
  "creator": {
    "companyId": "fb2ea14d-2be2-4572-b607-2d70500c14f3",
    "companyName": "Referral Company",
    "id": "e0f7521e-a297-4d02-942e-a8ee3216d5e5",
    "role": "REFERRAL"
  },
  "customer": {
    "company": {
      "city": "Miami",
      "country": "US",
      "name": "Acme",
      "state": "FL",
      "street1": "1234 Main St",
      "street2": "30th Floor, Apt B",
      "zip": "33033"
    },
    "contact": {
      "email": "john.doe@companysrl.com",
      "firstName": "John",
      "lastName": "Doe",
      "phone": "+13055555555"
    }
  },
  "id": "cc146924-afe3-4f6f-b368-2279e1e2039e",
  "lastModified": 1534875428054,
  "leadType": "MANUAL",
  "partner": "APPDIRECT",
  "recipient": {
    "companyId": "fb2ea14d-2be2-4572-b607-2d70500c14f3",
    "companyName": "Referral Company",
    "participantType": "COMPANY"
  },
  "referrer": {
    "companyId": "fb2ea14d-2be2-4572-b607-2d70500c14f3",
    "companyName": "Referral Company",
    "participantType": "COMPANY"
  },
  "status": "ASSIGNED"
}

POST/lead/v2/leads

Creates a manual, company profile or product profile lead. Manual leads are always visible only to those who created them. Company profile leads are visible to the profile owners as well as the Reseller Managers, while product profile leads are always visible to the Reseller Managers and can be configured so that the Developers who own the product profile can see them too.

Required Scope and Authorization Rules

Scope Rule
ROLE_DEVELOPER Allows access as a Developer for the company
ROLE_REFERRAL Allows access as a Referral for the company
ROLE_RESELLER Allows access as a Reseller for the company
ROLE_RESELLER_MANAGER Allows access as a Reseller Manager for the marketplace

Parameters

Parameter Type Data Type Default Description
*companyId query string Company ID of the user who is creating the lead
*context query string of enum:
RESELLER
REFERRAL
DEVELOPER
RESELLER_MANAGER
The supported lead's API contexts

Body Parameters

Information about the lead to create

LeadCreationRequest object:

Property Type Description
creator LeadUser

Information about the marketplace user who created the lead (required if the lead type is MANUAL)

customAttributes object

Custom attributes associated with the lead. This is a key-value object where the values are a set of strings associated with a given key, which is also a String.

customer LeadCustomer

Information about the customer and the customer's company

leadType LeadType

Lead type

notes string

Notes attached to the lead

partner string

Marketplace partner code

profileCompany LeadCompany

Information about the company profile from which the lead originated (required if the lead type is COMPANY)

profileProduct LeadProduct

Information about the product profile from which the lead originated (required if the lead type is PRODUCT)

profileProductEdition LeadProductEdition

Information about the edition from the product profile from which the lead originated (required if the lead type is PRODUCT). This object also requires profileProduct.

reseller LeadUser

Information about the reseller associated with the lead (required if the lead was created manually by a reseller)

Responses

Status Meaning Description Definition
201 Created Lead created LeadResponse
400 Bad Request Error attempting to create the lead (missing required data, for example)
401 Unauthorized Unauthorized
404 Not Found Not Found

Discard lead

Example request

curl -X DELETE https://{marketplaceURL}/api/lead/v2/leads/{leadId}?context=type,string,enum,RESELLER%2CREFERRAL%2CDEVELOPER%2CRESELLER_MANAGER&companyId=type,string \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \

DELETE https://{marketplaceURL}/api/lead/v2/leads/{leadId}?context=type,string,enum,RESELLER%2CREFERRAL%2CDEVELOPER%2CRESELLER_MANAGER&companyId=type,string HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json

var headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
$.ajax({
  url: 'https://{marketplaceURL}/api/lead/v2/leads/{leadId}',
  method: 'delete',
  data: '?context=type,string,enum,RESELLER%2CREFERRAL%2CDEVELOPER%2CRESELLER_MANAGER&companyId=type,string',
  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

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

const headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
fetch('https://{marketplaceURL}/api/lead/v2/leads/{leadId}?context=type,string,enum,RESELLER%2CREFERRAL%2CDEVELOPER%2CRESELLER_MANAGER&companyId=type,string',
{
  method: 'DELETE'

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

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

r = requests.delete('https://{marketplaceURL}/api/lead/v2/leads/{leadId}', params={
  'context': {
  "type": "string",
  "enum": [
    "RESELLER",
    "REFERRAL",
    "DEVELOPER",
    "RESELLER_MANAGER"
  ]
},  'companyId': {
  "type": "string"
}
}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

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

result = RestClient.delete 'https://{marketplaceURL}/api/lead/v2/leads/{leadId}',
  params: {
  'context' => 'string',
'companyId' => 'string'
}, headers: headers

p JSON.parse(result)

URL obj = new URL("https://{marketplaceURL}/api/lead/v2/leads/{leadId}?context=type,string,enum,RESELLER%2CREFERRAL%2CDEVELOPER%2CRESELLER_MANAGER&companyId=type,string");
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/lead/v2/leads/{leadId}

Deletes or disqualifies a lead (depending on type and assignment)

Required Scope and Authorization Rules

Scope Rule
ROLE_DEVELOPER Allows access as a Developer for the company
ROLE_REFERRAL Allows access as a Referral for the company
ROLE_RESELLER Allows access as a Reseller for the company
ROLE_RESELLER_MANAGER Allows access as a Reseller Manager for the marketplace

Parameters

Parameter Type Data Type Default Description
*companyId query string Company ID of the user who is discarding the lead
*context query string of enum:
RESELLER
REFERRAL
DEVELOPER
RESELLER_MANAGER
The supported lead's API contexts
*leadId path string Lead ID

Responses

Status Meaning Description Definition
204 No Content Lead deleted or disqualified
400 Bad Request Error attempting to discard a lead that cannot be deleted or disqualified
401 Unauthorized Unauthorized
404 Not Found Not Found

List leads

Example request

curl -X GET https://{marketplaceURL}/api/lead/v2/leads?context=type,string,enum,RESELLER%2CREFERRAL%2CDEVELOPER%2CRESELLER_MANAGER&companyId=type,string \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \

GET https://{marketplaceURL}/api/lead/v2/leads?context=type,string,enum,RESELLER%2CREFERRAL%2CDEVELOPER%2CRESELLER_MANAGER&companyId=type,string HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json

var headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
$.ajax({
  url: 'https://{marketplaceURL}/api/lead/v2/leads',
  method: 'get',
  data: '?context=type,string,enum,RESELLER%2CREFERRAL%2CDEVELOPER%2CRESELLER_MANAGER&companyId=type,string',
  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

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

const headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
fetch('https://{marketplaceURL}/api/lead/v2/leads?context=type,string,enum,RESELLER%2CREFERRAL%2CDEVELOPER%2CRESELLER_MANAGER&companyId=type,string',
{
  method: 'GET',

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

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

r = requests.get('https://{marketplaceURL}/api/lead/v2/leads', params={
  'context': {
  "type": "string",
  "enum": [
    "RESELLER",
    "REFERRAL",
    "DEVELOPER",
    "RESELLER_MANAGER"
  ]
},  'companyId': {
  "type": "string"
}
}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

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

result = RestClient.get 'https://{marketplaceURL}/api/lead/v2/leads',
  params: {
  'context' => 'string',
'companyId' => 'string'
}, headers: headers

p JSON.parse(result)

URL obj = new URL("https://{marketplaceURL}/api/lead/v2/leads?context=type,string,enum,RESELLER%2CREFERRAL%2CDEVELOPER%2CRESELLER_MANAGER&companyId=type,string");
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": [
    {
      "createdOn": 1534531428,
      "creator": {
        "companyId": "6b4bd452-895d-4098-aa56-e6046b238e0f",
        "companyName": "AppDirect",
        "id": "833d4c99-1939-4366-a5ae-6fb7ae3ec1be",
        "role": "CHANNEL_ADMIN"
      },
      "customAttributes": {},
      "customer": {
        "company": {
          "city": "Beverly Hills",
          "country": "US",
          "name": "Acme",
          "state": "CA",
          "street1": "1234 Main St",
          "zip": "90210"
        },
        "contact": {
          "email": "john.doe@acme.com",
          "firstName": "John",
          "lastName": "Doe",
          "phone": "+14455555555"
        }
      },
      "id": "29a1dc26-8088-475c-ba75-7b73915a0fab",
      "lastModified": 1534531428,
      "leadType": "MANUAL",
      "partner": "APPDIRECT",
      "recipient": {
        "participantType": "CHANNEL",
        "partner": "APPDIRECT"
      },
      "referrer": {
        "participantType": "CHANNEL",
        "partner": "APPDIRECT"
      },
      "status": "SUBMITTED"
    },
    {
      "convertedCompany": {
        "id": "dba89c75-f10c-4314-8a98-0692d04594d3",
        "name": "Acme"
      },
      "convertedUser": {
        "companyId": "dba89c75-f10c-4314-8a98-0692d04594d3",
        "id": "ad38f05b-7508-4c70-8ef8-c7929f35e414"
      },
      "createdOn": 1534531428,
      "creator": {
        "companyId": "386626c0-53e2-4515-8450-4a720bb5d029",
        "companyName": "Reseller Company",
        "id": "01d75b7c-ea78-4dc2-9e58-6ad217bddcbd",
        "role": "RESELLER"
      },
      "customAttributes": {},
      "customer": {
        "company": {
          "city": "Beverly Hills",
          "companyExists": true,
          "country": "US",
          "name": "Globex",
          "state": "CA",
          "street1": "5678 Main Av",
          "zip": "90210"
        },
        "contact": {
          "email": "jane.doe@globex.com",
          "firstName": "Jane",
          "lastName": "Doe",
          "phone": "+18008888080"
        }
      },
      "id": "acfce97c-5428-4310-b841-3bf7cca4e047",
      "lastModified": 1534531428,
      "leadType": "MANUAL",
      "partner": "APPDIRECT",
      "recipient": {
        "companyId": "386626c0-53e2-4515-8450-4a720bb5d029",
        "companyName": "Reseller Company",
        "participantType": "COMPANY"
      },
      "referrer": {
        "participantType": "CHANNEL",
        "partner": "APPDIRECT"
      },
      "reseller": {
        "companyId": "386626c0-53e2-4515-8450-4a720bb5d029",
        "id": "01d75b7c-ea78-4dc2-9e58-6ad217bddcbd"
      },
      "result": "WON",
      "status": "CONVERTED"
    }
  ],
  "page": {
    "number": 0,
    "size": 10,
    "totalElements": 2,
    "totalPages": 1
  }
}

GET/lead/v2/leads

Retrieves a list of all leads visible for a given context. You can filter the list using optional query parameters. Manual leads are always visible only to those who created them. Company profile leads are visible to the profile owners as well as the Reseller Managers, while product profile leads are always visible to the Reseller Managers and can be configured so that the Developers who own the product profile can see them too.

Required Scope and Authorization Rules

Scope Rule
ROLE_DEVELOPER Allows access as a Developer for the company
ROLE_REFERRAL Allows access as a Referral for the company
ROLE_RESELLER Allows access as a Reseller for the company
ROLE_RESELLER_MANAGER Allows access as a Reseller Manager for the marketplace

Parameters

Parameter Type Data Type Default Description
*companyId query string Company ID of the user who retrieved the list
*context query string of enum:
RESELLER
REFERRAL
DEVELOPER
RESELLER_MANAGER
The supported lead's API contexts
fromDate query number Date on which the lead was created (lower bound) in Unix timestamp format
page query integer 0 Page number
searchText query string Search text, which filters the list of leads
size query integer 50 Number of results per page
sortField query string of enum:
DATE
COMPANY_NAME
DATE The field by which to order the results
sortOrder query string of enum:
ASC
DESC
DESC Type of ordering used (ascending or descending)
status query string of enum:
CONVERTED
DISQUALIFIED
DELETED
PENDING_CONVERSION_APPROVAL
CONVERSION_APPROVED
PENDING_SUBMISSION
SUBMITTED
ASSIGNED
LEGACY
PENDING_FOR_MANAGERS
ACCEPTED_FOR_MANAGERS
The lead status. PENDING_FOR_MANAGERS requires SUBMITTED and PENDING_CONVERSION_APPROVAL; ACCEPTED_FOR_MANAGERS requires ASSIGNED, CONVERSION_APPROVED, CONVERTED, DELETED, DISQUALIFIED and LEGACY.
toDate query number Date on which the lead was created (upper bound) in Unix timestamp format

Responses

Status Meaning Description Definition
200 OK Success LeadPagedReadResponse
401 Unauthorized Unauthorized
404 Not Found Not Found

Get lead details

Example request

curl -X GET https://{marketplaceURL}/api/lead/v2/leads/{leadId}?context=type,string,enum,RESELLER%2CREFERRAL%2CDEVELOPER%2CRESELLER_MANAGER&companyId=type,string \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \

GET https://{marketplaceURL}/api/lead/v2/leads/{leadId}?context=type,string,enum,RESELLER%2CREFERRAL%2CDEVELOPER%2CRESELLER_MANAGER&companyId=type,string HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json

var headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
$.ajax({
  url: 'https://{marketplaceURL}/api/lead/v2/leads/{leadId}',
  method: 'get',
  data: '?context=type,string,enum,RESELLER%2CREFERRAL%2CDEVELOPER%2CRESELLER_MANAGER&companyId=type,string',
  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

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

const headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
fetch('https://{marketplaceURL}/api/lead/v2/leads/{leadId}?context=type,string,enum,RESELLER%2CREFERRAL%2CDEVELOPER%2CRESELLER_MANAGER&companyId=type,string',
{
  method: 'GET',

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

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

r = requests.get('https://{marketplaceURL}/api/lead/v2/leads/{leadId}', params={
  'context': {
  "type": "string",
  "enum": [
    "RESELLER",
    "REFERRAL",
    "DEVELOPER",
    "RESELLER_MANAGER"
  ]
},  'companyId': {
  "type": "string"
}
}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

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

result = RestClient.get 'https://{marketplaceURL}/api/lead/v2/leads/{leadId}',
  params: {
  'context' => 'string',
'companyId' => 'string'
}, headers: headers

p JSON.parse(result)

URL obj = new URL("https://{marketplaceURL}/api/lead/v2/leads/{leadId}?context=type,string,enum,RESELLER%2CREFERRAL%2CDEVELOPER%2CRESELLER_MANAGER&companyId=type,string");
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

{
  "createdOn": 1534465177000,
  "creator": {
    "companyId": "6b4bd452-895d-4098-aa56-e6046b238e0f",
    "companyName": "AppDirect",
    "id": "833d4c99-1939-4366-a5ae-6fb7ae3ec1be",
    "role": "CHANNEL_ADMIN"
  },
  "customAttributes": {},
  "customer": {
    "company": {
      "city": "Beverly Hills",
      "country": "US",
      "name": "Acme",
      "state": "CA",
      "street1": "1234 Main St",
      "zip": "90210"
    },
    "contact": {
      "email": "john.doe@acme.com",
      "firstName": "John",
      "lastName": "Doe",
      "phone": "+14455555555"
    }
  },
  "id": "29a1dc26-8088-475c-ba75-7b73915a0fab",
  "lastModified": 1534465179000,
  "leadType": "MANUAL",
  "partner": "APPDIRECT",
  "recipient": {
    "participantType": "CHANNEL",
    "partner": "APPDIRECT"
  },
  "referrer": {
    "participantType": "CHANNEL",
    "partner": "APPDIRECT"
  },
  "status": "SUBMITTED"
}

GET/lead/v2/leads/{leadId}

Retrieves a single lead and its details

Required Scope and Authorization Rules

Scope Rule
ROLE_DEVELOPER Allows access as a Developer for the company
ROLE_REFERRAL Allows access as a Referral for the company
ROLE_RESELLER Allows access as a Reseller for the company
ROLE_RESELLER_MANAGER Allows access as a Reseller Manager for the marketplace

Parameters

Parameter Type Data Type Default Description
*companyId query string Company ID of the user who is retrieving the lead
*context query string of enum:
RESELLER
REFERRAL
DEVELOPER
RESELLER_MANAGER
The supported lead's API contexts
*leadId path string Lead ID

Responses

Status Meaning Description Definition
200 OK Success LeadResponse
401 Unauthorized Unauthorized
404 Not Found Not Found

Update lead

Example request

curl -X PATCH https://{marketplaceURL}/api/lead/v2/leads/{leadId}?context=type,string,enum,RESELLER%2CREFERRAL%2CDEVELOPER%2CRESELLER_MANAGER&companyId=type,string \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \

PATCH https://{marketplaceURL}/api/lead/v2/leads/{leadId}?context=type,string,enum,RESELLER%2CREFERRAL%2CDEVELOPER%2CRESELLER_MANAGER&companyId=type,string HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json

var headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
$.ajax({
  url: 'https://{marketplaceURL}/api/lead/v2/leads/{leadId}',
  method: 'patch',
  data: '?context=type,string,enum,RESELLER%2CREFERRAL%2CDEVELOPER%2CRESELLER_MANAGER&companyId=type,string',
  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const request = require('node-fetch');
const inputBody = '{
  "customer": {
    "company": {
      "name": "Globex",
      "street2": "5th floor"
    },
    "contact": {
      "email": "jane.doe@globex.com",
      "firstName": "Jane",
      "lastName": "Doe"
    }
  },
  "notes": "Updated company name, added floor and changed person to be contacted"
}';
const headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
fetch('https://{marketplaceURL}/api/lead/v2/leads/{leadId}?context=type,string,enum,RESELLER%2CREFERRAL%2CDEVELOPER%2CRESELLER_MANAGER&companyId=type,string',
{
  method: 'PATCH',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

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

r = requests.patch('https://{marketplaceURL}/api/lead/v2/leads/{leadId}', params={
  'context': {
  "type": "string",
  "enum": [
    "RESELLER",
    "REFERRAL",
    "DEVELOPER",
    "RESELLER_MANAGER"
  ]
},  'companyId': {
  "type": "string"
}
}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

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

result = RestClient.patch 'https://{marketplaceURL}/api/lead/v2/leads/{leadId}',
  params: {
  'context' => 'string',
'companyId' => 'string'
}, headers: headers

p JSON.parse(result)

URL obj = new URL("https://{marketplaceURL}/api/lead/v2/leads/{leadId}?context=type,string,enum,RESELLER%2CREFERRAL%2CDEVELOPER%2CRESELLER_MANAGER&companyId=type,string");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("PATCH");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

Request body

{
  "customer": {
    "company": {
      "name": "Globex",
      "street2": "5th floor"
    },
    "contact": {
      "email": "jane.doe@globex.com",
      "firstName": "Jane",
      "lastName": "Doe"
    }
  },
  "notes": "Updated company name, added floor and changed person to be contacted"
}

Example response

{
  "createdOn": 1534465177000,
  "creator": {
    "companyId": "6b4bd452-895d-4098-aa56-e6046b238e0f",
    "companyName": "Appdirect",
    "id": "833d4c99-1939-4366-a5ae-6fb7ae3ec1be",
    "role": "CHANNEL_ADMIN"
  },
  "customAttributes": {},
  "customer": {
    "company": {
      "city": "Beverly Hills",
      "country": "US",
      "name": "Globex",
      "state": "CA",
      "street1": "1234 Main St",
      "street2": "5th floor",
      "zip": "90210"
    },
    "contact": {
      "email": "jane.doe@globex.com",
      "firstName": "Jane",
      "lastName": "Jane",
      "phone": "+14455555555"
    }
  },
  "id": "29a1dc26-8088-475c-ba75-7b73915a0fab",
  "lastModified": 1534857159000,
  "leadType": "MANUAL",
  "notes": "Updated company name, added floor and changed person to be contacted",
  "partner": "APPDIRECT",
  "recipient": {
    "participantType": "CHANNEL",
    "partner": "APPDIRECT"
  },
  "referrer": {
    "participantType": "CHANNEL",
    "partner": "APPDIRECT"
  },
  "status": "SUBMITTED"
}

PATCH/lead/v2/leads/{leadId}

Updates the contact information or notes from a lead

Required Scope and Authorization Rules

Scope Rule
ROLE_DEVELOPER Allows access as a Developer for the company
ROLE_REFERRAL Allows access as a Referral for the company
ROLE_RESELLER Allows access as a Reseller for the company
ROLE_RESELLER_MANAGER Allows access as a Reseller Manager for the marketplace

Parameters

Parameter Type Data Type Default Description
*companyId query string Company ID of the user who is updating the lead
*context query string of enum:
RESELLER
REFERRAL
DEVELOPER
RESELLER_MANAGER
The supported lead's API contexts
*leadId path string Lead ID

Body Parameters

Information about the lead to update

LeadUpdateRequest object:

Property Type Description
customer LeadCustomer

Information about the customer and the customer's company

notes string

Notes attached to the lead

Responses

Status Meaning Description Definition
200 OK Success LeadResponse
400 Bad Request Error attempting to update a lead (for example, it is not possible to modify the lead)
401 Unauthorized Unauthorized
404 Not Found Not Found

Opportunities

Add item

Example request

curl -X POST https://{marketplaceURL}/api/appReseller/v1/opportunities/{opportunityId}/items \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \

POST https://{marketplaceURL}/api/appReseller/v1/opportunities/{opportunityId}/items HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json

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

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

const request = require('node-fetch');
const inputBody = '{
  "id": "37f56046-2cec-4bf4-a4e2-5a733dc849a9",
  "pricingPlanId": "a22c03e9-9e27-4e85-8433-78f246345685",
  "subscriptionCustomAttributes": {
    "intended_os": [
      "other",
      "ios",
      "macos"
    ],
    "sales_agent_id": [
      "R353113R"
    ]
  },
  "units": [
    {
      "quantity": "8",
      "unit": "USER"
    }
  ],
  "vendorRequiredFields": {
    "email": [
      "john.doe@acme.com"
    ],
    "lastname": [
      "doe"
    ],
    "name": [
      "jonh"
    ]
  }
}';
const headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
fetch('https://{marketplaceURL}/api/appReseller/v1/opportunities/{opportunityId}/items',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

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

r = requests.post('https://{marketplaceURL}/api/appReseller/v1/opportunities/{opportunityId}/items', params={

}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

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

result = RestClient.post 'https://{marketplaceURL}/api/appReseller/v1/opportunities/{opportunityId}/items',
  params: {
  }, headers: headers

p JSON.parse(result)

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

Request body

{
  "id": "37f56046-2cec-4bf4-a4e2-5a733dc849a9",
  "pricingPlanId": "a22c03e9-9e27-4e85-8433-78f246345685",
  "subscriptionCustomAttributes": {
    "intended_os": [
      "other",
      "ios",
      "macos"
    ],
    "sales_agent_id": [
      "R353113R"
    ]
  },
  "units": [
    {
      "quantity": "8",
      "unit": "USER"
    }
  ],
  "vendorRequiredFields": {
    "email": [
      "john.doe@acme.com"
    ],
    "lastname": [
      "doe"
    ],
    "name": [
      "jonh"
    ]
  }
}

Example response

{
  "id": "37f56046-2cec-4bf4-a4e2-5a733dc849a9",
  "pricingPlanId": "a22c03e9-9e27-4e85-8433-78f246345685",
  "subscriptionCustomAttributes": {
    "intended_os": [
      "other",
      "ios",
      "macos"
    ],
    "sales_agent_id": [
      "R353113R"
    ]
  },
  "units": [
    {
      "quantity": "8",
      "unit": "USER"
    }
  ],
  "vendorRequiredFields": {
    "email": [
      "john.doe@acme.com"
    ],
    "lastname": [
      "doe"
    ],
    "name": [
      "jonh"
    ]
  }
}

POST/appReseller/v1/opportunities/{opportunityId}/items

Adds an item to the opportunity

Required Scope and Authorization Rules

Scope Rule
ROLE_CHANNEL_ADMIN Allows access as a Marketplace Manager for the opportunity
ROLE_RESELLER Allows access as a Reseller for the opportunity
ROLE_SALES_SUPPORT Allows access as a Sales Support for the opportunity

Parameters

Parameter Type Data Type Default Description
*opportunityId path string Opportunity ID

Body Parameters

Information about the item being added

OpportunityItem object:

Property Type Description
id string

Item ID

pricingPlanId string

Pricing plan ID

productId string

Product ID

subscriptionCustomAttributes CustomAttribute

Custom attributes related to the subscription

units array of Unit

List of units (quantity and type) associated with the item

vendorRequiredFields CustomAttribute

Custom attributes related to vendor required fields for the subscription

Responses

Status Meaning Description Definition
200 OK Success OpportunityItem
400 Bad Request Bad Request OpportunityError
401 Unauthorized Unauthorized OpportunityError
404 Not Found Not found OpportunityError
409 Conflict Conflict OpportunityError

Create opportunity

Example request

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

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

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

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

const request = require('node-fetch');
const inputBody = '{
  "currency": "USD",
  "customerCompanyId": "498c62ea-ad14-48e6-96ce-5400c617444c",
  "customerId": "505f0a0c-57a7-4d9e-9fac-66bbf557ac4d",
  "items": [
    {
      "pricingPlanId": "85d30404-c56b-4dff-9f3b-06636477fe55",
      "units": [
        {
          "quantity": 10,
          "unit": "USER"
        }
      ]
    },
    {
      "pricingPlanId": "d12931cf-eac6-45fa-8965-d33b1c5698b0",
      "units": []
    }
  ],
  "ownerCompanyId": "6a62244e-aa2f-461b-8c7a-3a0e091be9d3",
  "ownerId": "d781ac09-b4fe-4d57-8ba2-4640fc5b7c49"
}';
const headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
fetch('https://{marketplaceURL}/api/appReseller/v1/opportunities',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

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

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

}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

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

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

p JSON.parse(result)

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

Request body

{
  "currency": "USD",
  "customerCompanyId": "498c62ea-ad14-48e6-96ce-5400c617444c",
  "customerId": "505f0a0c-57a7-4d9e-9fac-66bbf557ac4d",
  "items": [
    {
      "pricingPlanId": "85d30404-c56b-4dff-9f3b-06636477fe55",
      "units": [
        {
          "quantity": 10,
          "unit": "USER"
        }
      ]
    },
    {
      "pricingPlanId": "d12931cf-eac6-45fa-8965-d33b1c5698b0",
      "units": []
    }
  ],
  "ownerCompanyId": "6a62244e-aa2f-461b-8c7a-3a0e091be9d3",
  "ownerId": "d781ac09-b4fe-4d57-8ba2-4640fc5b7c49"
}

Example response

{
  "availableActions": [
    "EDIT",
    "FINALIZE"
  ],
  "createdOn": "1546300800000",
  "currency": "USD",
  "customerUser": {
    "company": {
      "id": "100",
      "name": "Stark Industries"
    },
    "email": "ubrownfield@stark.com",
    "firstName": "Ulysses",
    "id": "498c62ea-ad14-48e6-96ce-5400c617444c",
    "lastName": "Brownfield"
  },
  "id": "ef6c414f-39da-401f-a4b8-81adc6190fda",
  "items": [
    {
      "id": "4ccf689b-4339-4fc9-a8b3-b05c5a87c1be",
      "pricingPlanId": "4bc864b5-f63f-4933-be19-3700aa9a8cc4",
      "subscriptionCustomAttributes": {
        "intended_os": [
          "other",
          "ios",
          "macos"
        ],
        "sales_agent_id": [
          "R353113R"
        ]
      },
      "units": [
        {
          "quantity": "20",
          "unit": "USER"
        }
      ],
      "vendorRequiredFields": {
        "email": [
          "john.doe@acme.com"
        ],
        "lastname": [
          "doe"
        ],
        "name": [
          "jonh"
        ]
      }
    },
    {
      "id": "dece524d-0466-4185-b3bb-1f8a300c37cd",
      "pricingPlanId": "80b85538-ffc1-4c4b-acb1-1bf87c8c2fc4",
      "units": []
    }
  ],
  "name": "Jarvis Iniative",
  "ownerUser": {
    "company": {
      "id": "1",
      "name": "Acme Corp."
    },
    "email": "john.doe@acme.com",
    "firstName": "John",
    "id": "d781ac09-b4fe-4d57-8ba2-4640fc5b7c49",
    "lastName": "Doe"
  },
  "purchaseEffectiveDate": "1577750400000",
  "status": "OPEN"
}

POST/appReseller/v1/opportunities

Creates a new opportunity

Required Scope and Authorization Rules

Scope Rule
ROLE_RESELLER Allows access as a Reseller for the opportunity
ROLE_SALES_SUPPORT Allows access as a Sales Support for the opportunity

Parameters

Parameter Type Data Type Default Description
context query string of enum:
RESELLER
SSR
Context of the opportunity

Body Parameters

Information about the opportunity being created

OpportunityCreationRequest object:

Property Type Description
currency OpportunityCurrency

The currency using the ISO-4217 currency code

customerCompanyId string

Customer company ID

customerId string

Customer ID (must be unique)

items array of OpportunityItem

List of items in the opportunity

name string

Opportunity name

ownerCompanyId string

Sales agent company ID

ownerId string

Sales agent ID (must be unique)

purchaseEffectiveDate number

Opportunity purchase effective date, in UNIX Epoch milliseconds

Responses

Status Meaning Description Definition
200 OK Success Opportunity
400 Bad Request Bad Request OpportunityError
401 Unauthorized Unauthorized OpportunityError
409 Conflict Conflict OpportunityError

Remove item

Example request

curl -X DELETE https://{marketplaceURL}/api/appReseller/v1/opportunities/{opportunityId}/items/{itemId} \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \

DELETE https://{marketplaceURL}/api/appReseller/v1/opportunities/{opportunityId}/items/{itemId} HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json

var headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
$.ajax({
  url: 'https://{marketplaceURL}/api/appReseller/v1/opportunities/{opportunityId}/items/{itemId}',
  method: 'delete',

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

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

const headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
fetch('https://{marketplaceURL}/api/appReseller/v1/opportunities/{opportunityId}/items/{itemId}',
{
  method: 'DELETE',

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

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

r = requests.delete('https://{marketplaceURL}/api/appReseller/v1/opportunities/{opportunityId}/items/{itemId}', params={

}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

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

result = RestClient.delete 'https://{marketplaceURL}/api/appReseller/v1/opportunities/{opportunityId}/items/{itemId}',
  params: {
  }, headers: headers

p JSON.parse(result)

URL obj = new URL("https://{marketplaceURL}/api/appReseller/v1/opportunities/{opportunityId}/items/{itemId}");
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());

Example response

{
  "code": "NOT_FOUND",
  "message": "No opportunity found with the given ID",
  "status": 404
}

DELETE/appReseller/v1/opportunities/{opportunityId}/items/{itemId}

Removes an item from the opportunity

Required Scope and Authorization Rules

Scope Rule
ROLE_CHANNEL_ADMIN Allows access as a Marketplace Manager for the opportunity
ROLE_RESELLER Allows access as a Reseller for the opportunity
ROLE_SALES_SUPPORT Allows access as a Sales Support for the opportunity

Parameters

Parameter Type Data Type Default Description
*itemId path string Item ID
*opportunityId path string Opportunity ID

Responses

Status Meaning Description Definition
204 No Content No Content
401 Unauthorized Unauthorized OpportunityError
404 Not Found Not found OpportunityError

Edit item

Example request

curl -X PUT https://{marketplaceURL}/api/appReseller/v1/opportunities/{opportunityId}/items/{itemId} \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \

PUT https://{marketplaceURL}/api/appReseller/v1/opportunities/{opportunityId}/items/{itemId} HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json

var headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
$.ajax({
  url: 'https://{marketplaceURL}/api/appReseller/v1/opportunities/{opportunityId}/items/{itemId}',
  method: 'put',

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

const request = require('node-fetch');
const inputBody = '{
  "customPrices": [
    {
      "costId": "e5f403a3-7ba0-45d4-8117-8dd8cbceb6c6",
      "price": 100
    },
    {
      "costId": "9742e09a-e1b4-4b9e-b1a7-66df3e41cebe",
      "price": 20
    }
  ],
  "id": "37f56046-2cec-4bf4-a4e2-5a733dc849a9",
  "pricingPlanId": "a22c03e9-9e27-4e85-8433-78f246345685",
  "subscriptionCustomAttributes": {
    "intended_os": [
      "other",
      "ios",
      "macos"
    ],
    "sales_agent_id": [
      "R353113R"
    ]
  },
  "units": [
    {
      "quantity": "8",
      "unit": "USER"
    }
  ],
  "vendorRequiredFields": {
    "email": [
      "john.doe@acme.com"
    ],
    "lastname": [
      "Doe"
    ],
    "name": [
      "John"
    ]
  }
}';
const headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
fetch('https://{marketplaceURL}/api/appReseller/v1/opportunities/{opportunityId}/items/{itemId}',
{
  method: 'PUT',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

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

r = requests.put('https://{marketplaceURL}/api/appReseller/v1/opportunities/{opportunityId}/items/{itemId}', params={

}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

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

result = RestClient.put 'https://{marketplaceURL}/api/appReseller/v1/opportunities/{opportunityId}/items/{itemId}',
  params: {
  }, headers: headers

p JSON.parse(result)

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

Request body

{
  "customPrices": [
    {
      "costId": "e5f403a3-7ba0-45d4-8117-8dd8cbceb6c6",
      "price": 100
    },
    {
      "costId": "9742e09a-e1b4-4b9e-b1a7-66df3e41cebe",
      "price": 20
    }
  ],
  "id": "37f56046-2cec-4bf4-a4e2-5a733dc849a9",
  "pricingPlanId": "a22c03e9-9e27-4e85-8433-78f246345685",
  "subscriptionCustomAttributes": {
    "intended_os": [
      "other",
      "ios",
      "macos"
    ],
    "sales_agent_id": [
      "R353113R"
    ]
  },
  "units": [
    {
      "quantity": "8",
      "unit": "USER"
    }
  ],
  "vendorRequiredFields": {
    "email": [
      "john.doe@acme.com"
    ],
    "lastname": [
      "Doe"
    ],
    "name": [
      "John"
    ]
  }
}

Example response

{
  "id": "37f56046-2cec-4bf4-a4e2-5a733dc849a9",
  "pricingPlanId": "a22c03e9-9e27-4e85-8433-78f246345685",
  "subscriptionCustomAttributes": {
    "intended_os": [
      "other",
      "ios",
      "macos"
    ],
    "sales_agent_id": [
      "R353113R"
    ]
  },
  "units": [
    {
      "quantity": "8",
      "unit": "USER"
    }
  ],
  "vendorRequiredFields": {
    "email": [
      "john.doe@acme.com"
    ],
    "lastname": [
      "doe"
    ],
    "name": [
      "jonh"
    ]
  }
}

PUT/appReseller/v1/opportunities/{opportunityId}/items/{itemId}

Edits an item in the opportunity

Required Scope and Authorization Rules

Scope Rule
ROLE_CHANNEL_ADMIN Allows access as a Marketplace Manager for the opportunity
ROLE_RESELLER Allows access as a Reseller for the opportunity
ROLE_SALES_SUPPORT Allows access as a Sales Support for the opportunity

Parameters

Parameter Type Data Type Default Description
*itemId path string Item ID
*opportunityId path string Opportunity ID

Body Parameters

Information about the item being edited

OpportunityItemUpdateRequest object:

Property Type Description
customPrices array of object

List of custom prices per cost

id string

Item ID

pricingPlanId string

Pricing plan ID

subscriptionCustomAttributes CustomAttribute

Custom attributes as key-value pairs. Values must be a string array

units array of Unit

List of units (quantity and type) associated with the item

vendorRequiredFields CustomAttribute

Custom attributes as key-value pairs. Values must be a string array

Responses

Status Meaning Description Definition
200 OK Success OpportunityItem
400 Bad Request Bad Request OpportunityError
401 Unauthorized Unauthorized OpportunityError
404 Not Found Not found OpportunityError

Finalize opportunity

Example request

curl -X POST https://{marketplaceURL}/api/appReseller/v1/opportunities/{opportunityId}/finalize \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \

POST https://{marketplaceURL}/api/appReseller/v1/opportunities/{opportunityId}/finalize HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json

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

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

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

const headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
fetch('https://{marketplaceURL}/api/appReseller/v1/opportunities/{opportunityId}/finalize',
{
  method: 'POST',

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

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

r = requests.post('https://{marketplaceURL}/api/appReseller/v1/opportunities/{opportunityId}/finalize', params={

}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

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

result = RestClient.post 'https://{marketplaceURL}/api/appReseller/v1/opportunities/{opportunityId}/finalize',
  params: {
  }, headers: headers

p JSON.parse(result)

URL obj = new URL("https://{marketplaceURL}/api/appReseller/v1/opportunities/{opportunityId}/finalize");
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());

Example response

{
  "availableActions": [],
  "createdOn": "1546300800000",
  "currency": "USD",
  "customerUser": {
    "company": {
      "id": "100",
      "name": "Stark Industries"
    },
    "email": "ubrownfield@stark.com",
    "firstName": "Ulysses",
    "id": "498c62ea-ad14-48e6-96ce-5400c617444c",
    "lastName": "Brownfield"
  },
  "id": "ef6c414f-39da-401f-a4b8-81adc6190fda",
  "name": "Jarvis Iniative",
  "ownerUser": {
    "company": {
      "id": "1",
      "name": "Acme Corp."
    },
    "email": "john.doe@acme.com",
    "firstName": "John",
    "id": "d781ac09-b4fe-4d57-8ba2-4640fc5b7c49",
    "lastName": "Doe"
  },
  "partner": "APPDIRECT",
  "purchaseEffectiveDate": "1577750400000",
  "purchaseId": "21dc3107-ca53-47e4-818d-92d4bdad4bc9",
  "status": "CLOSED"
}

POST/appReseller/v1/opportunities/{opportunityId}/finalize

Finalizes an opportunity

Required Scope and Authorization Rules

Scope Rule
ROLE_CHANNEL_ADMIN Allows access as a Marketplace Manager for the opportunity
ROLE_RESELLER Allows access as a Reseller for the opportunity
ROLE_SALES_SUPPORT Allows access as a Sales Support for the opportunity

Parameters

Parameter Type Data Type Default Description
*opportunityId path string Opportunity ID

Responses

Status Meaning Description Definition
200 OK Success Opportunity
401 Unauthorized Unauthorized OpportunityError
404 Not Found Not found OpportunityError

List items

Example request

curl -X GET https://{marketplaceURL}/api/appReseller/v1/opportunities/{opportunityId}/items \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \

GET https://{marketplaceURL}/api/appReseller/v1/opportunities/{opportunityId}/items HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json

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

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

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

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

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

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

r = requests.get('https://{marketplaceURL}/api/appReseller/v1/opportunities/{opportunityId}/items', params={

}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

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

result = RestClient.get 'https://{marketplaceURL}/api/appReseller/v1/opportunities/{opportunityId}/items',
  params: {
  }, headers: headers

p JSON.parse(result)

URL obj = new URL("https://{marketplaceURL}/api/appReseller/v1/opportunities/{opportunityId}/items");
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

{
  "id": "37f56046-2cec-4bf4-a4e2-5a733dc849a9",
  "pricing": [
    {
      "costId": "cd3c7c22-sd64-4bag-8a4v-5e84d90ab291",
      "costType": "RECURRING_FLAT",
      "costTypeCategory": "RECURRING",
      "description": "RECURRING_FLAT",
      "priceRanges": [],
      "pricingStrategy": "FREE",
      "quantity": "1.0000000000",
      "salePrice": "0.0000000000",
      "totalSalePrice": "0.0000000000"
    },
    {
      "costId": "kl3c7c24-sd33-4bui-8a4v-8u84d98ab333",
      "costType": "INCLUDED",
      "costTypeCategory": "RECURRING",
      "description": "INCLUDED",
      "priceRanges": [],
      "pricingStrategy": "UNLIMITED",
      "salePrice": "0.0000000000",
      "totalSalePrice": "0.0000000000",
      "unit": "USER"
    }
  ],
  "pricingPlan": {
    "id": "031d9ed2-3df1-44f5-876a-6b4318ba7bdb",
    "name": "Recurring Edition with Unlimited Included Users"
  },
  "product": {
    "id": "cc0c7c28-ea65-4bab-8a4a-5e84d90ab291",
    "logo": "https://logs.acme.com/400x400/ddd/000.png&text=Appsome+App",
    "name": "Appsome Webapp",
    "type": "WEB_APP"
  },
  "subscriptionCustomAttributes": {
    "intended_os": [
      "other",
      "ios",
      "macos"
    ],
    "sales_agent_id": [
      "R353113R"
    ]
  },
  "units": [
    {
      "quantity": "8",
      "unit": "USER"
    }
  ],
  "vendorRequiredFields": {
    "email": [
      "john.doe@acme.com"
    ],
    "lastname": [
      "doe"
    ],
    "name": [
      "jonh"
    ]
  }
}

GET/appReseller/v1/opportunities/{opportunityId}/items

Lists all items in an opportunity

Required Scope and Authorization Rules

Scope Rule
ROLE_CHANNEL_ADMIN Allows access as a Marketplace Manager for the opportunity
ROLE_RESELLER Allows access as a Reseller for the opportunity
ROLE_SALES_SUPPORT Allows access as a Sales Support for the opportunity

Parameters

Parameter Type Data Type Default Description
*opportunityId path string Opportunity ID

Responses

Status Meaning Description Definition
200 OK Success OpportunityItemDetail
401 Unauthorized Unauthorized OpportunityError
404 Not Found Not found OpportunityError

List opportunities

Example request

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

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

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

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

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

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

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

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

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

}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

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

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

p JSON.parse(result)

URL obj = new URL("https://{marketplaceURL}/api/appReseller/v1/opportunities");
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": [
    {
      "createdOn": 1557861989000,
      "customerUser": {
        "company": {
          "id": "100",
          "name": "Stark Industries"
        },
        "email": "ubrownfield@stark.com",
        "firstName": "Ulysses",
        "id": "498c62ea-ad14-48e6-96ce-5400c617444c",
        "lastName": "Brownfield"
      },
      "id": "ef6c414f-39da-401f-a4b8-81adc6190fda",
      "name": "Jarvis Iniative",
      "ownerType": "PLATFORM_OWNER",
      "ownerUser": {
        "company": {
          "id": "1",
          "name": "Acme Corp."
        },
        "email": "john.doe@acme.com",
        "firstName": "John",
        "id": "d781ac09-b4fe-4d57-8ba2-4640fc5b7c49",
        "lastName": "Doe"
      },
      "purchaseEffectiveDate": 1577750400000,
      "status": "CLOSED"
    },
    {
      "createdOn": 1557861989000,
      "customerUser": {
        "company": {
          "id": "100",
          "name": "Stark Industries"
        },
        "email": "gsymons@stark.com",
        "firstName": "Gary",
        "id": "e0a6bec0-7e25-43a1-b601-6a8cec5a847f",
        "lastName": "Symons"
      },
      "id": "70826bb4-bb6c-43b8-9c39-2c4e481a8b5e",
      "name": null,
      "ownerType": "PLATFORM_OWNER",
      "ownerUser": {
        "company": {
          "id": "2",
          "name": "Globex Inc."
        },
        "email": "jane.smith@globex.com",
        "firstName": "Jane",
        "id": "d11cf5ef-6270-492f-9d2c-07fa01eeb5c2",
        "lastName": "Smith"
      },
      "purchaseEffectiveDate": null,
      "status": "OPEN"
    }
  ],
  "page": {
    "number": 1,
    "size": 10,
    "totalElements": 2,
    "totalPages": 1
  }
}

GET/appReseller/v1/opportunities

Retrieves all opportunities

Required Scope and Authorization Rules

Scope Rule
ROLE_CHANNEL_ADMIN Allows access as a Marketplace Manager for the opportunity
ROLE_RESELLER Allows access as a Reseller for the opportunity
ROLE_SALES_SUPPORT Allows access as a Sales Support for the opportunity

Parameters

Parameter Type Data Type Default Description
context query string of enum:
RESELLER
SSR
Context of the opportunity
createdOn query array of string Opportunity creation date filter, defined by upper or lower inclusive or exclusive limits, in Unix timestamp format. Acceptable values are: gte([timestamp]) - 'greater than or equal to'; or lte([timestamp]) - 'less than or equal to'
customerId query string Customer ID
number query integer 1 Page number
ownerId query string Sales agent ID
purchaseEffectiveDate query array of string Opportunity purchase effective date filter, defined by upper or lower inclusive or exclusive limits, in Unix timestamp format. Acceptable values are: gte([timestamp]) - 'greater than or equal to'; or lte([timestamp]) - 'less than or equal to'
searchText query string General text search filter used for any ID (opportunity, sales agent, sales agent company, customer, or customer company) and opportunity name
size query integer 10 Number of results per page
sort query string Sort field and order. For ascending sort order, use the '+[FieldName]' format. For descending order, use the '-[FieldName]' format.
status query string of enum:
OPEN
CLOSED
PENDING_REVIEW
Opportunity status

Responses

Status Meaning Description Definition
200 OK Success OpportunityPage

Get opportunity details

Example request

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

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

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

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

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

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

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

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

r = requests.get('https://{marketplaceURL}/api/appReseller/v1/opportunities/{opportunityId}', params={

}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

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

result = RestClient.get 'https://{marketplaceURL}/api/appReseller/v1/opportunities/{opportunityId}',
  params: {
  }, headers: headers

p JSON.parse(result)

URL obj = new URL("https://{marketplaceURL}/api/appReseller/v1/opportunities/{opportunityId}");
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

{
  "availableActions": [
    "EDIT",
    "FINALIZE"
  ],
  "createdOn": "1546300800000",
  "currency": "USD",
  "customerUser": {
    "company": {
      "id": "100",
      "name": "Stark Industries"
    },
    "email": "ubrownfield@stark.com",
    "firstName": "Ulysses",
    "id": "498c62ea-ad14-48e6-96ce-5400c617444c",
    "lastName": "Brownfield"
  },
  "id": "ef6c414f-39da-401f-a4b8-81adc6190fda",
  "items": [
    {
      "id": "4ccf689b-4339-4fc9-a8b3-b05c5a87c1be",
      "pricingPlanId": "4bc864b5-f63f-4933-be19-3700aa9a8cc4",
      "subscriptionCustomAttributes": {
        "intended_os": [
          "other",
          "ios",
          "macos"
        ],
        "sales_agent_id": [
          "R353113R"
        ]
      },
      "units": [
        {
          "quantity": "20",
          "unit": "USER"
        }
      ],
      "vendorRequiredFields": {
        "email": [
          "john.doe@acme.com"
        ],
        "lastname": [
          "doe"
        ],
        "name": [
          "jonh"
        ]
      }
    },
    {
      "id": "dece524d-0466-4185-b3bb-1f8a300c37cd",
      "pricingPlanId": "80b85538-ffc1-4c4b-acb1-1bf87c8c2fc4",
      "units": []
    }
  ],
  "name": "Jarvis Iniative",
  "ownerUser": {
    "company": {
      "id": "1",
      "name": "Acme Corp."
    },
    "email": "john.doe@acme.com",
    "firstName": "John",
    "id": "d781ac09-b4fe-4d57-8ba2-4640fc5b7c49",
    "lastName": "Doe"
  },
  "purchaseEffectiveDate": "1577750400000",
  "status": "OPEN"
}

GET/appReseller/v1/opportunities/{opportunityId}

Read an opportunity

Required Scope and Authorization Rules

Scope Rule
ROLE_CHANNEL_ADMIN Allows access as a Marketplace Manager for the opportunity
ROLE_RESELLER Allows access as a Reseller for the opportunity
ROLE_SALES_SUPPORT Allows access as a Sales Support for the opportunity

Parameters

Parameter Type Data Type Default Description
*opportunityId path string Opportunity ID

Responses

Status Meaning Description Definition
200 OK Success Opportunity
401 Unauthorized Unauthorized OpportunityError
404 Not Found Not found OpportunityError

Request opportunity review

Example request

curl -X POST https://{marketplaceURL}/api/opportunities/{opportunityId}/requestReview \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \

POST https://{marketplaceURL}/api/opportunities/{opportunityId}/requestReview HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json

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

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

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

const headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
fetch('https://{marketplaceURL}/api/opportunities/{opportunityId}/requestReview',
{
  method: 'POST',

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

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

r = requests.post('https://{marketplaceURL}/api/opportunities/{opportunityId}/requestReview', params={

}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

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

result = RestClient.post 'https://{marketplaceURL}/api/opportunities/{opportunityId}/requestReview',
  params: {
  }, headers: headers

p JSON.parse(result)

URL obj = new URL("https://{marketplaceURL}/api/opportunities/{opportunityId}/requestReview");
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());

Example response

{
  "code": "NOT_FOUND",
  "message": "No opportunity found with the given ID",
  "status": 404
}

POST/opportunities/{opportunityId}/requestReview

Requests a review of the specified opportunity

Required Scope and Authorization Rules

Scope Rule
ROLE_CHANNEL_ADMIN Allows access as a Marketplace Manager for the opportunity
ROLE_RESELLER Allows access as a Reseller for the opportunity
ROLE_SALES_SUPPORT Allows access as a Sales Support for the opportunity

Parameters

Parameter Type Data Type Default Description
*opportunityId path string Opportunity ID

Responses

Status Meaning Description Definition
204 No Content No Content
401 Unauthorized Unauthorized OpportunityError
404 Not Found Not found OpportunityError

Update opportunity

Example request

curl -X PATCH https://{marketplaceURL}/api/appReseller/v1/opportunities/{opportunityId} \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \

PATCH https://{marketplaceURL}/api/appReseller/v1/opportunities/{opportunityId} HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json

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

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

const request = require('node-fetch');
const inputBody = '{
  "name": "New opportunity",
  "purchaseCustomAttributes": {
    "paid_off_platform_contact": [
      "janet.doe@accounting.acme.com"
    ]
  },
  "purchaseEffectiveDate": 1577750400000
}';
const headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
fetch('https://{marketplaceURL}/api/appReseller/v1/opportunities/{opportunityId}',
{
  method: 'PATCH',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

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

r = requests.patch('https://{marketplaceURL}/api/appReseller/v1/opportunities/{opportunityId}', params={

}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

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

result = RestClient.patch 'https://{marketplaceURL}/api/appReseller/v1/opportunities/{opportunityId}',
  params: {
  }, headers: headers

p JSON.parse(result)

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

Request body

{
  "name": "New opportunity",
  "purchaseCustomAttributes": {
    "paid_off_platform_contact": [
      "janet.doe@accounting.acme.com"
    ]
  },
  "purchaseEffectiveDate": 1577750400000
}

Example response

{
  "availableActions": [
    "EDIT",
    "FINALIZE"
  ],
  "createdOn": "1546300800000",
  "currency": "USD",
  "customerUser": {
    "company": {
      "id": "100",
      "name": "Stark Industries"
    },
    "email": "ubrownfield@stark.com",
    "firstName": "Ulysses",
    "id": "498c62ea-ad14-48e6-96ce-5400c617444c",
    "lastName": "Brownfield"
  },
  "id": "ef6c414f-39da-401f-a4b8-81adc6190fda",
  "items": [
    {
      "id": "4ccf689b-4339-4fc9-a8b3-b05c5a87c1be",
      "pricingPlanId": "4bc864b5-f63f-4933-be19-3700aa9a8cc4",
      "subscriptionCustomAttributes": {
        "intended_os": [
          "other",
          "ios",
          "macos"
        ],
        "sales_agent_id": [
          "R353113R"
        ]
      },
      "units": [
        {
          "quantity": "20",
          "unit": "USER"
        }
      ],
      "vendorRequiredFields": {
        "email": [
          "john.doe@acme.com"
        ],
        "lastname": [
          "doe"
        ],
        "name": [
          "jonh"
        ]
      }
    },
    {
      "id": "dece524d-0466-4185-b3bb-1f8a300c37cd",
      "pricingPlanId": "80b85538-ffc1-4c4b-acb1-1bf87c8c2fc4",
      "units": []
    }
  ],
  "name": "Jarvis Iniative",
  "ownerUser": {
    "company": {
      "id": "1",
      "name": "Acme Corp."
    },
    "email": "john.doe@acme.com",
    "firstName": "John",
    "id": "d781ac09-b4fe-4d57-8ba2-4640fc5b7c49",
    "lastName": "Doe"
  },
  "purchaseEffectiveDate": "1577750400000",
  "status": "OPEN"
}

PATCH/appReseller/v1/opportunities/{opportunityId}

Updates an existing opportunity: name, purchase effective date and purchase custom attributes

Required Scope and Authorization Rules

Scope Rule
ROLE_RESELLER Allows access as a Reseller for the opportunity
ROLE_SALES_SUPPORT Allows access as a Sales Support for the opportunity

Parameters

Parameter Type Data Type Default Description
*opportunityId path string Opportunity ID

Body Parameters

Information about the opportunity being updated

OpportunityUpdateRequest object:

Property Type Description
name string

Opportunity name

purchaseCustomAttributes CustomAttribute

Custom attributes related to the purchase

purchaseEffectiveDate number

Opportunity purchase effective date, in UNIX Epoch milliseconds

Responses

Status Meaning Description Definition
200 OK Success Opportunity
401 Unauthorized Unauthorized OpportunityError
404 Not Found Not found OpportunityError

Orders

List orders

Example request

curl -X GET https://{marketplaceURL}/api/appReseller/v1/orders?context=type,string,enum,RESELLER%2C%20RESELLER_MANAGER&resellerCompanyId=type,string&customerCompanyId=type,string \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \

GET https://{marketplaceURL}/api/appReseller/v1/orders?context=type,string,enum,RESELLER%2C%20RESELLER_MANAGER&resellerCompanyId=type,string&customerCompanyId=type,string HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json

var headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
$.ajax({
  url: 'https://{marketplaceURL}/api/appReseller/v1/orders',
  method: 'get',
  data: '?context=type,string,enum,RESELLER%2C%20RESELLER_MANAGER&resellerCompanyId=type,string&customerCompanyId=type,string',
  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

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

const headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
fetch('https://{marketplaceURL}/api/appReseller/v1/orders?context=type,string,enum,RESELLER%2C%20RESELLER_MANAGER&resellerCompanyId=type,string&customerCompanyId=type,string',
{
  method: 'GET',

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

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

r = requests.get('https://{marketplaceURL}/api/appReseller/v1/orders', params={
  'context': {
  "type": "string",
  "enum": [
    "RESELLER, RESELLER_MANAGER"
  ]
},  'resellerCompanyId': {
  "type": "string"
},  'customerCompanyId': {
  "type": "string"
}
}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

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

result = RestClient.get 'https://{marketplaceURL}/api/appReseller/v1/orders',
  params: {
  'context' => 'string',
'resellerCompanyId' => 'string',
'customerCompanyId' => 'string'
}, headers: headers

p JSON.parse(result)

URL obj = new URL("https://{marketplaceURL}/api/appReseller/v1/orders?context=type,string,enum,RESELLER%2C%20RESELLER_MANAGER&resellerCompanyId=type,string&customerCompanyId=type,string");
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": [
    {
      "applicationName": "AUTO_DISCOUNTS_APP",
      "company": {
        "id": "698555fc-bc65-4163-9fee-16308edec41b",
        "name": "Company A"
      },
      "createdOn": 1529083173000,
      "editionName": "Edition",
      "frequency": "One Time",
      "id": "1234",
      "orderCardId": "4567",
      "status": "ACTIVE",
      "totalFee": "USD350.00"
    },
    {
      "applicationName": "AUTO_DISCOUNTS_APP",
      "company": {
        "id": "386626c0-53e2-4515-8450-4a720bb5d029",
        "name": "Company B"
      },
      "createdOn": 1529083173000,
      "editionName": "Edition",
      "frequency": "One Time",
      "id": "4567",
      "orderCardId": "4567",
      "status": "PENDING MANUAL RECOVERY",
      "totalFee": "USD350.00"
    }
  ],
  "page": {
    "number": 1,
    "size": 10,
    "totalElements": 2,
    "totalPages": 1
  }
}

GET/appReseller/v1/orders

Retrieves a list of all user orders of a linked company. You can filter the list using optional query parameters.

Required Scope and Authorization Rules

Scope Rule
ROLE_RESELLER Allows access as a Reseller for the company
ROLE_RESELLER_MANAGER Allows access as a Reseller Manager for the company

Parameters

Parameter Type Data Type Default Description
*context query string of enum:
RESELLER, RESELLER_MANAGER
Supported billing contexts
createdOn query string Date filter, defined by upper or lower inclusive or exclusive limits, in Unix timestamp format. Acceptable values are: gte([timestamp]) - 'greater than or equal to'; gt([timestamp]) - 'greater than'; lte([timestamp]) - 'less than or equal to'; or lt([timestamp]) - 'less than.'
*customerCompanyId query string User's company ID. Required only for the RESELLER context.
number query integer Page number
paidStatus query string of enum:
PAID, FREE
Status of the subscription related to the payment of this order
pending query boolean Indicates whether order has pending events
*resellerCompanyId query string Reseller's company ID. Required only for the RESELLER_MANAGER context.
searchText query string Search text
size query integer Number of results per page
sort query string Sort field and order. For ascending sort order, use the '+[FieldName]' format. For descending order, use the '-[FieldName]' format.
status query string Order status (valid status are INITIALIZED, PENDING_USER_APPROVAL, PENDING_REMOTE_CREATION, PENDING_MANUAL_RECOVERY, PENDING_ASYNCHRONOUS_CREATION, FREE_TRIAL, ACTIVE, FINISHED, ONE_TIME, CANCELLED, SUSPENDED, FREE_TRIAL_EXPIRED, FREE_TRIAL_CANCELLED, DELETED, FAILED, UPCOMING, PENDING_MIGRATION_ACTIVATION, PENDING_DELAYED_PROVISIONING)
userId query string For RESELLER, the customer's user ID; for RESELLER_MANAGER, the Reseller's user ID

Responses

Status Meaning Description Definition
200 OK Success OrderPagedReadResponse
401 Unauthorized Unauthorized

Payment Methods

List payment methods

Example request

curl -X GET https://{marketplaceURL}/api/appReseller/v1/paymentMethods?ownerId=type,string&companyId=type,string \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \

GET https://{marketplaceURL}/api/appReseller/v1/paymentMethods?ownerId=type,string&companyId=type,string HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json

var headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
$.ajax({
  url: 'https://{marketplaceURL}/api/appReseller/v1/paymentMethods',
  method: 'get',
  data: '?ownerId=type,string&companyId=type,string',
  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

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

const headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
fetch('https://{marketplaceURL}/api/appReseller/v1/paymentMethods?ownerId=type,string&companyId=type,string',
{
  method: 'GET',

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

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

r = requests.get('https://{marketplaceURL}/api/appReseller/v1/paymentMethods', params={
  'ownerId': {
  "type": "string"
},  'companyId': {
  "type": "string"
}
}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

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

result = RestClient.get 'https://{marketplaceURL}/api/appReseller/v1/paymentMethods',
  params: {
  'ownerId' => 'string',
'companyId' => 'string'
}, headers: headers

p JSON.parse(result)

URL obj = new URL("https://{marketplaceURL}/api/appReseller/v1/paymentMethods?ownerId=type,string&companyId=type,string");
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": [
    {
      "accountDisplay": "1111",
      "billingAddress": {
        "city": "Beverly Hills",
        "country": "US",
        "state": "CA",
        "street1": "Alden",
        "zip": "94203"
      },
      "default": true,
      "id": "5d399e4a-cae3-0000-0000-85be1db90000",
      "owner": {
        "firstName": "John",
        "id": "833d4c99-1939-0000-0000-6fb7ae30000",
        "lastName": "Jordan"
      },
      "paymentMethodType": "CARD",
      "properties": {
        "brand": "VISA",
        "cardHolderName": "John Jordan",
        "expirationMonth": "10",
        "expirationYear": "2100"
      }
    }
  ],
  "page": {
    "number": 0,
    "size": 1,
    "totalElements": 1,
    "totalPages": 1
  }
}

GET/appReseller/v1/paymentMethods

Retrieves a list of the specified user's payment methods

Required Scope and Authorization Rules

Scope Rule
ROLE_RESELLER Allows access as a Reseller for the company.
ROLE_SALES_SUPPORT Allows access as a Sales Support Representative.

Parameters

Parameter Type Data Type Default Description
*companyId query string Company ID
number query integer Page number starting at 1. The default value is 1.
*ownerId query string User ID
paymentMethodType query string Payment method type
size query integer Number of results per page. The default value is 50.

Responses

Status Meaning Description Definition
200 OK Success AppResellerPaymentMethodPagedReadResponse
401 Unauthorized Unauthorized

Remove payment methods

Example request

curl -X DELETE https://{marketplaceURL}/api/appReseller/v1/paymentMethods/{paymentMethodId} \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \

DELETE https://{marketplaceURL}/api/appReseller/v1/paymentMethods/{paymentMethodId} HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json

var headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
$.ajax({
  url: 'https://{marketplaceURL}/api/appReseller/v1/paymentMethods/{paymentMethodId}',
  method: 'delete',

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

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

const headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
fetch('https://{marketplaceURL}/api/appReseller/v1/paymentMethods/{paymentMethodId}',
{
  method: 'DELETE'

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

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

r = requests.delete('https://{marketplaceURL}/api/appReseller/v1/paymentMethods/{paymentMethodId}', params={

}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

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

result = RestClient.delete 'https://{marketplaceURL}/api/appReseller/v1/paymentMethods/{paymentMethodId}',
  params: {
  }, headers: headers

p JSON.parse(result)

URL obj = new URL("https://{marketplaceURL}/api/appReseller/v1/paymentMethods/{paymentMethodId}");
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/appReseller/v1/paymentMethods/{paymentMethodId}

Deletes a user's payment methods

Required Scope and Authorization Rules

Scope Rule
ROLE_RESELLER Allows access as a Reseller for the company.
ROLE_SALES_SUPPORT Allows access as a Sales Support Representative.

Parameters

Parameter Type Data Type Default Description
*paymentMethodId path string Payment method ID

Responses

Status Meaning Description Definition
204 No Content No Content

Create payment method

Example request

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

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

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

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

const request = require('node-fetch');
const inputBody = '{
  "billingAddress": {
    "city": "Beverly Hills",
    "country": "US",
    "state": "CA",
    "street1": "Alden",
    "zip": "94203"
  },
  "companyId": "6b4bd452-895d-0000-0000-e6046b230000",
  "ownerId": "833d4c99-1939-0000-0000-6fb7ae30000",
  "paymentMethodType": "CARD",
  "properties": {
    "brand": "VISA",
    "cardHolderName": "John Jordan",
    "expirationMonth": "10",
    "expirationYear": "2100",
    "number": "0000-0000-0000-0000",
    "securityCode": "000"
  }
}';
const headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
fetch('https://{marketplaceURL}/api/appReseller/v1/paymentMethods',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

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

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

}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

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

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

p JSON.parse(result)

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

Request body

{
  "billingAddress": {
    "city": "Beverly Hills",
    "country": "US",
    "state": "CA",
    "street1": "Alden",
    "zip": "94203"
  },
  "companyId": "6b4bd452-895d-0000-0000-e6046b230000",
  "ownerId": "833d4c99-1939-0000-0000-6fb7ae30000",
  "paymentMethodType": "CARD",
  "properties": {
    "brand": "VISA",
    "cardHolderName": "John Jordan",
    "expirationMonth": "10",
    "expirationYear": "2100",
    "number": "0000-0000-0000-0000",
    "securityCode": "000"
  }
}

Example response

{
  "accountDisplay": "1111",
  "billingAddress": {
    "city": "Beverly Hills",
    "country": "US",
    "state": "CA",
    "street1": "Alden",
    "zip": "94203"
  },
  "default": true,
  "id": "5d399e4a-cae3-0000-0000-85be1db90000",
  "owner": {
    "firstName": "John",
    "id": "833d4c99-1939-0000-0000-6fb7ae30000",
    "lastName": "Jordan"
  },
  "paymentMethodType": "CARD",
  "properties": {
    "brand": "VISA",
    "cardHolderName": "John Jordan",
    "expirationMonth": "10",
    "expirationYear": "2100"
  }
}

POST/appReseller/v1/paymentMethods

Creates a payment method on behalf of the specified user

Required Scope and Authorization Rules

Scope Rule
ROLE_RESELLER Allows access as a Reseller.
ROLE_SALES_SUPPORT Allows access as a Sales Support Representative.

Body Parameters

Information about the user and the new payment method

AppResellerPaymentMethodRequest object:

Property Type Description
billingAddress BillingAddress

User's billing address

companyId string

ID of the user's company

ownerId string

ID of the user for whom to create the payment method

paymentMethodType string

Payment method types supported by AppReseller

properties object

List of payment method properties. Varies by payment method type

Responses

Status Meaning Description Definition
200 OK Success AppResellerPaymentMethod
401 Unauthorized Unauthorized

Subscription Assignments

Unassign product

Example request

curl -X DELETE https://{marketplaceURL}/api/appReseller/v1/subscriptionAssignments/{subscriptionAssignmentId} \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \

DELETE https://{marketplaceURL}/api/appReseller/v1/subscriptionAssignments/{subscriptionAssignmentId} HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json

var headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
$.ajax({
  url: 'https://{marketplaceURL}/api/appReseller/v1/subscriptionAssignments/{subscriptionAssignmentId}',
  method: 'delete',

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

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

const headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
fetch('https://{marketplaceURL}/api/appReseller/v1/subscriptionAssignments/{subscriptionAssignmentId}',
{
  method: 'DELETE'

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

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

r = requests.delete('https://{marketplaceURL}/api/appReseller/v1/subscriptionAssignments/{subscriptionAssignmentId}', params={

}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

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

result = RestClient.delete 'https://{marketplaceURL}/api/appReseller/v1/subscriptionAssignments/{subscriptionAssignmentId}',
  params: {
  }, headers: headers

p JSON.parse(result)

URL obj = new URL("https://{marketplaceURL}/api/appReseller/v1/subscriptionAssignments/{subscriptionAssignmentId}");
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/appReseller/v1/subscriptionAssignments/{subscriptionAssignmentId}

Unassign a product from a user.

Required Scope and Authorization Rules

Scope Rule
ROLE_RESELLER Allows access as a Reseller for the company.

Parameters

Parameter Type Data Type Default Description
*subscriptionAssignmentId path string Subscription Assignment ID.

Responses

Status Meaning Description Definition
204 No Content Unassignment request accepted or assignment not found
400 Bad Request Assignment application not enabled for usage
401 Unauthorized User not authenticated
409 Conflict Assignment status not compatible

List subscription assignments

Example request

curl -X GET https://{marketplaceURL}/api/appReseller/v1/subscriptionAssignments?subscriptionId=type,string \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \

GET https://{marketplaceURL}/api/appReseller/v1/subscriptionAssignments?subscriptionId=type,string HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json

var headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
$.ajax({
  url: 'https://{marketplaceURL}/api/appReseller/v1/subscriptionAssignments',
  method: 'get',
  data: '?subscriptionId=type,string',
  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

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

const headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
fetch('https://{marketplaceURL}/api/appReseller/v1/subscriptionAssignments?subscriptionId=type,string',
{
  method: 'GET',

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

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

r = requests.get('https://{marketplaceURL}/api/appReseller/v1/subscriptionAssignments', params={
  'subscriptionId': {
  "type": "string"
}
}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

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

result = RestClient.get 'https://{marketplaceURL}/api/appReseller/v1/subscriptionAssignments',
  params: {
  'subscriptionId' => 'string'
}, headers: headers

p JSON.parse(result)

URL obj = new URL("https://{marketplaceURL}/api/appReseller/v1/subscriptionAssignments?subscriptionId=type,string");
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": [
    {
      "createdOn": 1529083173000,
      "id": "63bf81c2-8e01-48b7-a8b1-46a0efa0e823",
      "status": "ACTIVE",
      "subscriptionId": "386626c0-53e2-4515-8450-4a720bb5d029",
      "user": {
        "firstName": "Michael",
        "id": "386626c0-53e2-4515-8450-4a720bb5d029",
        "lastName": "Jordan"
      }
    },
    {
      "createdOn": 1527863555000,
      "id": "5cdf116b-0603-4d26-88d8-5e1afd625931",
      "status": "CANCELLED",
      "subscriptionId": "386626c0-53e2-4515-8450-4a720bb5d029",
      "user": {
        "firstName": "Mary",
        "id": "bb14ace3-4490-47e8-84f1-ab6a85da69e5",
        "lastName": "Gonzalez"
      }
    }
  ],
  "page": {
    "number": 1,
    "size": 50,
    "totalElements": 2,
    "totalPages": 1
  }
}

GET/appReseller/v1/subscriptionAssignments

Retrieves a list of assignments for a given subscription. You can filter the list using optional query parameters.

Required Scope and Authorization Rules

Scope Rule
ROLE_RESELLER Allows access as a Reseller for the company.

Parameters

Parameter Type Data Type Default Description
createdOn query string Date filter, defined by upper or lower inclusive limits, in Unix timestamp format. Acceptable values are: gte([timestamp]) - 'greater than or equal to'; lte([timestamp]) - 'less than or equal to'.
number query integer Page number starting at 1. The default value is 1.
size query integer Number of results per page. The default value is 50.
sort query string Sort field and order. For ascending sort order, use the '+[FieldName]' format. For descending order, use '-[FieldName]' format. The default value is '-createdOn'.
status query string Subscription status (valid values are PENDING_REQUIRED_DATA, PENDING_SEAT_AVAILABILITY, PENDING_USER_ACTIVATION, PENDING_REMOTE_CREATION, SUBSCRIPTION_SUSPENDED_FREE_TRIAL_EXPIRED, SUBSCRIPTION_SUSPENDED_RENEW_CONTRACT, SUBSCRIPTION_SUSPENDED_PAY_INVOICE, SUBSCRIPTION_SUSPENDED_MANUAL_SUSPENSION, FAILED, ACTIVE, PENDING_REMOTE_CANCELLATION, CANCELLED). The filter format is: in([status], ...).
*subscriptionId query string Subscription ID purchased by the Reseller company
userId query string User ID. Use the in([id], ...) format to filter by multiple IDs, or the userId=[id] format to filter by a single ID.

Responses

Status Meaning Description Definition
200 OK Success AppResellerSubscriptionAssignmentList
401 Unauthorized Unauthorized

Assign product

Example request

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

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

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

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

const request = require('node-fetch');
const inputBody = '{
  "subscriptionId": "386626c0-53e2-4515-8450-4a720bb5d029",
  "userId": "2c061df6-4313-45e0-8709-a0ca19b0aaa3"
}';
const headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
fetch('https://{marketplaceURL}/api/appReseller/v1/subscriptionAssignments',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

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

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

}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

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

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

p JSON.parse(result)

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

Request body

{
  "subscriptionId": "386626c0-53e2-4515-8450-4a720bb5d029",
  "userId": "2c061df6-4313-45e0-8709-a0ca19b0aaa3"
}

Example response

{
  "createdOn": 1529083173000,
  "id": "63bf81c2-8e01-48b7-a8b1-46a0efa0e823",
  "status": "ACTIVE",
  "subscriptionId": "386626c0-53e2-4515-8450-4a720bb5d029",
  "user": {
    "firstName": "Michael",
    "id": "386626c0-53e2-4515-8450-4a720bb5d029",
    "lastName": "Jordan"
  }
}

POST/appReseller/v1/subscriptionAssignments

Assign a seat of a purchased product to a user who is a member of a linked marketplace company

Required Scope and Authorization Rules

Scope Rule
ROLE_RESELLER Allows access as a Reseller for the company.

Body Parameters

Information about user and subscription to be assigned

AppResellerSubscriptionAssignmentRequestWS object:

Property Type Description
subscriptionId string

ID of the product subscription to assign to the user

userId string

ID of the user to whom the product will be assigned

Responses

Status Meaning Description Definition
200 OK Assignment created AppResellerSubscriptionAssignmentWS
401 Unauthorized Unauthorized
409 Conflict Conflict SubscriptionAssociationConflictResponse

Subscriptions

Cancel subscription

Example request

curl -X DELETE https://{marketplaceURL}/api/appReseller/v1/subscriptions/{subscriptionId} \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \

DELETE https://{marketplaceURL}/api/appReseller/v1/subscriptions/{subscriptionId} HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json

var headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
$.ajax({
  url: 'https://{marketplaceURL}/api/appReseller/v1/subscriptions/{subscriptionId}',
  method: 'delete',

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

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

const headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
fetch('https://{marketplaceURL}/api/appReseller/v1/subscriptions/{subscriptionId}',
{
  method: 'DELETE'

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

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

r = requests.delete('https://{marketplaceURL}/api/appReseller/v1/subscriptions/{subscriptionId}', params={

}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

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

result = RestClient.delete 'https://{marketplaceURL}/api/appReseller/v1/subscriptions/{subscriptionId}',
  params: {
  }, headers: headers

p JSON.parse(result)

URL obj = new URL("https://{marketplaceURL}/api/appReseller/v1/subscriptions/{subscriptionId}");
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/appReseller/v1/subscriptions/{subscriptionId}

Cancel a subscription on behalf of a user who is a member of a company linked to the current reseller

Required Scope and Authorization Rules

Scope Rule
ROLE_RESELLER Allows access as a Reseller for the company

Parameters

Parameter Type Data Type Default Description
*subscriptionId path string Subscription ID

Responses

Status Meaning Description Definition
204 No Content Subscription not found
409 Conflict Subscription has a pending event and can't be deleted

List subscriptions

Example request

curl -X GET https://{marketplaceURL}/api/appReseller/v1/subscriptions?context=type,string,enum,RESELLER%2C%20RESELLER_MANAGER&resellerCompanyId=type,string&customerCompanyId=type,string \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \

GET https://{marketplaceURL}/api/appReseller/v1/subscriptions?context=type,string,enum,RESELLER%2C%20RESELLER_MANAGER&resellerCompanyId=type,string&customerCompanyId=type,string HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json

var headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
$.ajax({
  url: 'https://{marketplaceURL}/api/appReseller/v1/subscriptions',
  method: 'get',
  data: '?context=type,string,enum,RESELLER%2C%20RESELLER_MANAGER&resellerCompanyId=type,string&customerCompanyId=type,string',
  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

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

const headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
fetch('https://{marketplaceURL}/api/appReseller/v1/subscriptions?context=type,string,enum,RESELLER%2C%20RESELLER_MANAGER&resellerCompanyId=type,string&customerCompanyId=type,string',
{
  method: 'GET',

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

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

r = requests.get('https://{marketplaceURL}/api/appReseller/v1/subscriptions', params={
  'context': {
  "type": "string",
  "enum": [
    "RESELLER, RESELLER_MANAGER"
  ]
},  'resellerCompanyId': {
  "type": "string"
},  'customerCompanyId': {
  "type": "string"
}
}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

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

result = RestClient.get 'https://{marketplaceURL}/api/appReseller/v1/subscriptions',
  params: {
  'context' => 'string',
'resellerCompanyId' => 'string',
'customerCompanyId' => 'string'
}, headers: headers

p JSON.parse(result)

URL obj = new URL("https://{marketplaceURL}/api/appReseller/v1/subscriptions?context=type,string,enum,RESELLER%2C%20RESELLER_MANAGER&resellerCompanyId=type,string&customerCompanyId=type,string");
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": [
    {
      "activeOrder": {
        "createdOn": 1529083173000,
        "editionName": "Edition",
        "frequency": "One Time",
        "id": "1553",
        "status": "PENDING MANUAL RECOVERY",
        "totalFee": "USD350.00"
      },
      "applicationName": "AUTO_DISCOUNTS_APP",
      "company": {
        "id": "698555fc-bc65-4163-9fee-16308edec41b",
        "name": "Company A"
      },
      "id": "386626c0-53e2-4515-8450-4a720bb5d029",
      "pendingEvent": "SUBSCRIPTION_CHANGE",
      "status": "ACTIVE",
      "user": {
        "firstName": "Michael",
        "id": "386626c0-53e2-4515-8450-4a720bb5d029",
        "lastName": "Jordan"
      }
    },
    {
      "activeOrder": {
        "createdOn": 1529083173000,
        "editionName": "Recurring Edition",
        "frequency": "One Time",
        "id": "3345",
        "status": "PENDING MANUAL RECOVERY",
        "totalFee": "USD350.00"
      },
      "applicationName": "AUTO_DISCOUNTS_APP",
      "company": {
        "id": "386626c0-53e2-4515-8450-4a720bb5d029",
        "name": "Company B"
      },
      "id": "38e8bb4a-d737-4564-afee-e68edb00fd38",
      "pendingEvent": "SUBSCRIPTION_CHANGE",
      "status": "ACTIVE",
      "user": {
        "firstName": "Michael",
        "id": "386626c0-53e2-4515-8450-4a720bb5d029",
        "lastName": "Jordan"
      }
    }
  ],
  "page": {
    "number": 1,
    "size": 10,
    "totalElements": 2,
    "totalPages": 1
  }
}

GET/appReseller/v1/subscriptions

Retrieves a list of all user subscriptions of a linked company. You can filter the list using optional query parameters.

Required Scope and Authorization Rules

Scope Rule
ROLE_RESELLER Allows access as a Reseller for the company
ROLE_RESELLER_MANAGER Allows access as a Reseller Manager for the company

Parameters

Parameter Type Data Type Default Description
*context query string of enum:
RESELLER, RESELLER_MANAGER
Supported billing contexts
createdOn query string Date filter, defined by upper or lower inclusive or exclusive limits, in Unix timestamp format. Acceptable values are: gte([timestamp]) - 'greater than or equal to'; gt([timestamp]) - 'greater than'; lte([timestamp]) - 'less than or equal to'; or lt([timestamp]) - 'less than.'
*customerCompanyId query string User's company ID. Required only for RESELLER context
number query integer Page number
paidStatus query string of enum:
PAID, FREE
Status of the subscription related to the payment
pending query boolean Indicates whether subscription has pending events
*resellerCompanyId query string Reseller's company ID
searchText query string Search text
size query integer Number of results per page
sort query string Sort field and order. For ascending sort order, use the '+[FieldName]' format. For descending order, use the '-[FieldName]' format.
status query string of enum:
INITIALIZED
FAILED
FREE_TRIAL
FREE_TRIAL_EXPIRED
ACTIVE
SUSPENDED
CANCELLED
Subscription status. Acceptable values are: [status] - 'equal to'; or in([status1],[status2]) - 'status in the list'. For example, status=FAILED or status=in(FAILED,ACTIVE)
userId query string For RESELLER, the customer's user ID; for RESELLER_MANAGER, the Reseller's user ID

Responses

Status Meaning Description Definition
200 OK Success SubscriptionList
401 Unauthorized Unauthorized

Subscription details

Example request

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

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

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

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

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

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

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

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

r = requests.get('https://{marketplaceURL}/api/appReseller/v1/subscriptions/{subscriptionId}', params={

}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

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

result = RestClient.get 'https://{marketplaceURL}/api/appReseller/v1/subscriptions/{subscriptionId}',
  params: {
  }, headers: headers

p JSON.parse(result)

URL obj = new URL("https://{marketplaceURL}/api/appReseller/v1/subscriptions/{subscriptionId}");
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

{
  "activeOrder": {
    "createdOn": 1529083173000,
    "editionName": "Edition",
    "frequency": "One Time",
    "id": "1553",
    "orderLines": [
      {
        "quantity": "1",
        "unit": "USER"
      }
    ],
    "paymentPlanId": "30ccf1e7-1937-40cb-8e73-851a226fd4ea",
    "status": "PENDING MANUAL RECOVERY",
    "totalFee": "USD350.00"
  },
  "applicationName": "AUTO_DISCOUNTS_APP",
  "company": {
    "id": "698555fc-bc65-4163-9fee-16308edec41b",
    "name": "Company A"
  },
  "createdOn": 1529083173000,
  "id": "386626c0-53e2-4515-8450-4a720bb5d029",
  "pendingEvent": "SUBSCRIPTION_CHANGE",
  "referenceCode": "bundle09",
  "status": "ACTIVE",
  "user": {
    "firstName": "Michael",
    "id": "2c061df6-4313-45e0-8709-a0ca19b0aaa3",
    "lastName": "Jordan"
  }
}

GET/appReseller/v1/subscriptions/{subscriptionId}

Read a subscription by ID

Required Scope and Authorization Rules

Scope Rule
ROLE_RESELLER Allows access as a Reseller

Parameters

Parameter Type Data Type Default Description
*subscriptionId path string Subscription ID

Responses

Status Meaning Description Definition
200 OK Success AppResellerSubscriptionWS
401 Unauthorized Unauthorized
404 Not Found Not found

Create subscription

Example request

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

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

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

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

const request = require('node-fetch');
const inputBody = '{
  "orderLines": [
    {
      "quantity": "1",
      "unit": "USER"
    }
  ],
  "parentSubscriptionId": "386626c0-53e2-4515-8450-4a720bb5d029",
  "paymentPlanId": "30ccf1e7-1937-40cb-8e73-851a226fd4ea",
  "targetCompanyId": "698555fc-bc65-4163-9fee-16308edec41b",
  "targetUserId": "2c061df6-4313-45e0-8709-a0ca19b0aaa3"
}';
const headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
fetch('https://{marketplaceURL}/api/appReseller/v1/subscriptions',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

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

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

}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

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

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

p JSON.parse(result)

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

Request body

{
  "orderLines": [
    {
      "quantity": "1",
      "unit": "USER"
    }
  ],
  "parentSubscriptionId": "386626c0-53e2-4515-8450-4a720bb5d029",
  "paymentPlanId": "30ccf1e7-1937-40cb-8e73-851a226fd4ea",
  "targetCompanyId": "698555fc-bc65-4163-9fee-16308edec41b",
  "targetUserId": "2c061df6-4313-45e0-8709-a0ca19b0aaa3"
}

Example response

{
  "activeOrder": {
    "createdOn": 1529083173000,
    "editionName": "Edition",
    "frequency": "One Time",
    "id": "1553",
    "orderLines": [
      {
        "quantity": "1",
        "unit": "USER"
      }
    ],
    "paymentPlanId": "30ccf1e7-1937-40cb-8e73-851a226fd4ea",
    "status": "PENDING MANUAL RECOVERY",
    "totalFee": "USD350.00"
  },
  "applicationName": "AUTO_DISCOUNTS_APP",
  "company": {
    "id": "698555fc-bc65-4163-9fee-16308edec41b",
    "name": "Company A"
  },
  "createdOn": 1529083173000,
  "id": "386626c0-53e2-4515-8450-4a720bb5d029",
  "pendingEvent": "SUBSCRIPTION_CHANGE",
  "referenceCode": "bundle09",
  "status": "ACTIVE",
  "user": {
    "firstName": "Michael",
    "id": "2c061df6-4313-45e0-8709-a0ca19b0aaa3",
    "lastName": "Jordan"
  }
}

POST/appReseller/v1/subscriptions

Create a new subscription on behalf of a user who is a member of a marketplace company linked to the current reseller company

Required Scope and Authorization Rules

Scope Rule
ROLE_RESELLER Allows access as a Reseller for the company

Body Parameters

Information about the new subscription that will be created

AppResellerSubscriptionCreationRequest object:

Property Type Description
orderLines string

Unit type and quantity

parentSubscriptionId string

ID of an add-on product's parent subscription

paymentPlanId string

(Required) Edition Payment Plan ID

targetCompanyId string

(Required) ID of the company in which the Reseller will create the new subscription

targetUserId string

(Required) ID of the user for whom the Reseller will create the new subscription

Responses

Status Meaning Description Definition
200 OK Success AppResellerSubscriptionWS
401 Unauthorized Unauthorized
409 Conflict Subscription already created

Update subscription

Example request

curl -X PUT https://{marketplaceURL}/api/appReseller/v1/subscriptions/{subscriptionId} \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \

PUT https://{marketplaceURL}/api/appReseller/v1/subscriptions/{subscriptionId} HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json

var headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
$.ajax({
  url: 'https://{marketplaceURL}/api/appReseller/v1/subscriptions/{subscriptionId}',
  method: 'put',

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

const request = require('node-fetch');
const inputBody = '{
  "orderLines": [
    {
      "quantity": "15",
      "unit": "USER"
    }
  ],
  "paymentPlanId": "30ccf1e7-1937-40cb-8e73-851a226fd4ea"
}';
const headers = {
    'Content-Type':'application/json',
    'Accept':'application/json'
};
fetch('https://{marketplaceURL}/api/appReseller/v1/subscriptions/{subscriptionId}',
{
  method: 'PUT',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

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

r = requests.put('https://{marketplaceURL}/api/appReseller/v1/subscriptions/{subscriptionId}', params={

}, headers = headers)

print r.json()

require 'rest-client'
require 'json'

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

result = RestClient.put 'https://{marketplaceURL}/api/appReseller/v1/subscriptions/{subscriptionId}',
  params: {
  }, headers: headers

p JSON.parse(result)

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

Request body

{
  "orderLines": [
    {
      "quantity": "15",
      "unit": "USER"
    }
  ],
  "paymentPlanId": "30ccf1e7-1937-40cb-8e73-851a226fd4ea"
}

Example response

{
  "activeOrder": {
    "createdOn": 1529083173000,
    "editionName": "Edition",
    "frequency": "One Time",
    "id": "1553",
    "orderLines": [
      {
        "quantity": "15",
        "unit": "USER"
      }
    ],
    "paymentPlanId": "30ccf1e7-1937-40cb-8e73-851a226fd4ea",
    "status": "PENDING MANUAL RECOVERY",
    "totalFee": "USD350.00"
  },
  "applicationName": "AUTO_DISCOUNTS_APP",
  "company": {
    "id": "698555fc-bc65-4163-9fee-16308edec41b",
    "name": "Company A"
  },
  "createdOn": 1529083173000,
  "id": "386626c0-53e2-4515-8450-4a720bb5d029",
  "pendingEvent": "SUBSCRIPTION_CHANGE",
  "referenceCode": "bundle09",
  "status": "ACTIVE",
  "user": {
    "firstName": "Michael",
    "id": "2c061df6-4313-45e0-8709-a0ca19b0aaa3",
    "lastName": "Jordan"
  }
}

PUT/appReseller/v1/subscriptions/{subscriptionId}

Upgrade or downgrade a subscription on behalf of a user who is a member of a marketplace company linked to the current reseller company.
When you upgrade or downgrade subscriptions, you must provide both the paymentPlanId and the orderLines objects in the request even if the units are not changing.

Required Scope and Authorization Rules

Scope Rule
ROLE_RESELLER Allows access as a Reseller for the company

Parameters

Parameter Type Data Type Default Description
*subscriptionId path string Subscription ID

Body Parameters

Information about the new values to set to the subscription

AppResellerSubscriptionUpdateRequest object:

Property Type Description
orderLines array of OrderLineDetailsWS

Unit type and quantity

paymentPlanId string

Edition Payment Plan ID

Responses

Status Meaning Description Definition
200 OK Success AppResellerSubscriptionWS
401 Unauthorized Unauthorized
404 Not Found Not found
409 Conflict Subscription has a pending event and can't be updated

Definitions

AccountCompany

{
  "type": "object",
  "title": "AccountCompany",
  "properties": {
    "createdOn": {
      "description": "Company's creation date, in UNIX Epoch milliseconds",
      "type": "number"
    },
    "externalId": {
      "description": "External ID used to identify the company (must be unique)",
      "type": "string"
    },
    "id": {
      "description": "Company's identifier",
      "type": "string"
    },
    "name": {
      "description": "Company's name",
      "type": "string"
    }
  }
}
Name Type Description
createdOn number Company's creation date, in UNIX Epoch milliseconds
externalId string External ID used to identify the company (must be unique)
id string Company's identifier
name string Company's name

AppResellerAccountApiContext

Supported appReseller contexts

Enumeration of

AppResellerAccountCompanyApiContext

Supported AppReseller contexts

Enumeration of

AppResellerAccountCompanyAccessCode

Type of company access

Enumeration of

AppResellerAccountCompanyAction

Type of company action

Enumeration of

AppResellerAccountCompanyCreationRequest

{
  "companyAccess": "RESELLER",
  "companySize": "SMALL",
  "createdByCompanyId": "386626c0-53e2-4515-8450-4a720bb5d029",
  "externalId": "externalRandom",
  "name": "Test Name",
  "phone": "50505055",
  "website": "www.new_company.com"
}
Name Type Description
companyAccess AppResellerAccountCompanyApiContext Context
companySize AppResellerAccountCompanySize New company's size
createdByCompanyId string Reseller's company UUID
externalId string External ID used to identify the new company (must be unique)
name string New company's name
phone string New company's phone number
website string New company's website

AppResellerAccountCompanySetting

{
  "description": "Company setting",
  "type": "object",
  "title": "AppResellerAccountCompanySetting",
  "properties": {
    "permission": {
      "allOf": [
        {
          "$ref": "#/components/schemas/ReadWritePermission"
        },
        {
          "description": "Company setting read/write permissions"
        }
      ]
    },
    "setting": {
      "allOf": [
        {
          "$ref": "#/components/schemas/AppResellerAccountCompanySettingCode"
        },
        {
          "description": "Company setting code"
        }
      ]
    },
    "value": {
      "description": "Company setting value",
      "type": "string"
    }
  }
}

Company setting

Name Type Description
permission ReadWritePermission Company setting read/write permissions
setting AppResellerAccountCompanySettingCode Company setting code
value string Company setting value

AppResellerAccountCompanySettingCode

Company Setting Code

Enumeration of

AppResellerAccountCompanySize

Size of the new company

Enumeration of

AppResellerAccountCompany

{
  "createdOn": 1522950634000,
  "externalId": "external11",
  "id": "460fad0d-19e2-4eec-a756-59c15dc7a56a",
  "name": "Company3"
}
Name Type Description
createdOn number Company creation date, in timestamp format
externalId string Company's external ID
id string Company ID
name string Company name

AppResellerAccountIdentityProvider

{
  "description": "Configured Identity provider",
  "type": "object",
  "title": "AppResellerAccountIdentityProvider",
  "properties": {
    "id": {
      "description": "Identity provider identifier",
      "type": "string"
    },
    "name": {
      "description": "Identity provider name",
      "type": "string"
    },
    "partner": {
      "description": "Identity provider partner",
      "type": "string"
    }
  }
}

Configured Identity provider

Name Type Description
id string Identity provider identifier
name string Identity provider name
partner string Identity provider partner

AppResellerAccountTaxExemptionCode

Company tax exemption codes

Enumeration of

AppResellerAccountUserCompanyMembership

{
  "type": "object",
  "title": "AppResellerAccountUserCompanyMembership",
  "properties": {
    "company": {
      "allOf": [
        {
          "$ref": "#/components/schemas/AppResellerAccountCompanyWS"
        },
        {
          "description": "User's company"
        }
      ]
    },
    "enabled": {
      "description": "Indicates whether user's company membership is enabled",
      "type": "boolean"
    },
    "mosiUser": {
      "allOf": [
        {
          "$ref": "#/components/schemas/MosiUser"
        },
        {
          "description": "Microsoft user (if set)"
        }
      ]
    },
    "roles": {
      "description": "User roles in the Company",
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/Role"
      }
    }
  }
}
Name Type Description
company AppResellerAccountCompany User's company
enabled boolean Indicates whether user's company membership is enabled
mosiUser MosiUser Microsoft user (if set)
roles array of Role User roles in the Company

AppResellerAccountUserSettingCode

User role setting code

Enumeration of

AppResellerSubscriptionCreationRequest

{
  "orderLines": [
    {
      "quantity": "1",
      "unit": "USER"
    }
  ],
  "parentSubscriptionId": "386626c0-53e2-4515-8450-4a720bb5d029",
  "paymentPlanId": "30ccf1e7-1937-40cb-8e73-851a226fd4ea",
  "targetCompanyId": "698555fc-bc65-4163-9fee-16308edec41b",
  "targetUserId": "2c061df6-4313-45e0-8709-a0ca19b0aaa3"
}
Name Type Description
orderLines string Unit type and quantity
parentSubscriptionId string ID of an add-on product's parent subscription
paymentPlanId string (Required) Edition Payment Plan ID
targetCompanyId string (Required) ID of the company in which the Reseller will create the new subscription
targetUserId string (Required) ID of the user for whom the Reseller will create the new subscription

AppResellerSubscriptionUpdateRequest

{
  "orderLines": [
    {
      "quantity": "15",
      "unit": "USER"
    }
  ],
  "paymentPlanId": "30ccf1e7-1937-40cb-8e73-851a226fd4ea"
}
Name Type Description
orderLines array of OrderLineDetailsWS Unit type and quantity
paymentPlanId string Edition Payment Plan ID

CatalogEdition

{
  "type": "object",
  "title": "CatalogEdition",
  "properties": {
    "PaymentPlanWS": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/AppResellerCatalogPaymentPlanWS"
      }
    },
    "RevenueModelType": {
      "$ref": "#/components/schemas/RevenueModelType"
    },
    "id": {
      "description": "Edition ID",
      "type": "string"
    },
    "name": {
      "description": "Edition name",
      "type": "string"
    }
  }
}
Name Type Description
PaymentPlanWS array of PaymentPlans
RevenueModelType RevenueModelType Supported revenue model types
id string Edition ID
name string Edition name

MarkupPrices

{
  "type": "object",
  "title": "MarkupPrices",
  "properties": {
    "markupPrices": {
      "description": "Markup Prices",
      "additionalProperties": {
        "type": "string",
        "properties": {
          "currency": {
            "type": "string"
          },
          "value": {
            "type": "number"
          }
        }
      }
    },
    "markupType": {
      "$ref": "#/components/schemas/MarkupPricingType"
    }
  }
}
Name Type Description
markupPrices undefined Markup Prices
markupType MarkupPricingType Markup pricing types

PaymentPlans

{
  "type": "object",
  "title": "PaymentPlans",
  "properties": {
    "cancellationPeriodLimit": {
      "description": "Number of days where you can cancel your contract",
      "type": "integer"
    },
    "costs": {
      "description": "Catalog plan costs",
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/AppResellerCatalogPlanCostWS"
      }
    },
    "endOfContractGracePeriod": {
      "description": "Grace period after the end of the contract",
      "type": "integer"
    },
    "frecuency": {
      "allOf": [
        {
          "$ref": "#/components/schemas/PricingDuration"
        },
        {
          "description": "Billing frequency"
        }
      ]
    },
    "id": {
      "description": "Payment Plan ID",
      "type": "string"
    },
    "minimumServiceLength": {
      "description": "Minimum pricing duration of the pricing plan",
      "type": "integer"
    }
  }
}
Name Type Description
cancellationPeriodLimit integer Number of days where you can cancel your contract
costs array of CatalogPlanCosts Catalog plan costs
endOfContractGracePeriod integer Grace period after the end of the contract
frecuency PricingDuration Billing frequency
id string Payment Plan ID
minimumServiceLength integer Minimum pricing duration of the pricing plan

CatalogPlanCosts

{
  "type": "object",
  "title": "CatalogPlanCosts",
  "properties": {
    "id": {
      "description": "Plan Cost ID",
      "type": "string"
    },
    "itemPrices": {
      "description": "Payment Plan prices",
      "additionalProperties": {
        "type": "string",
        "properties": {
          "currency": {
            "type": "string"
          },
          "value": {
            "type": "number"
          }
        }
      }
    },
    "markupPrices": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/AppResellerCatalogMarkupPriceWS"
      }
    },
    "maxUnits": {
      "description": "Maximum number of units",
      "type": "integer"
    },
    "minUnits": {
      "description": "Minimum number of units",
      "type": "integer"
    },
    "pricingStrategy": {
      "allOf": [
        {
          "$ref": "#/components/schemas/PricingStrategy"
        },
        {
          "description": "Pricing strategy"
        }
      ]
    },
    "unit": {
      "allOf": [
        {
          "$ref": "#/components/schemas/PricingUnit"
        },
        {
          "description": "Cost unit"
        }
      ]
    },
    "unitDependency": {
      "allOf": [
        {
          "$ref": "#/components/schemas/PricingUnit"
        },
        {
          "description": "Dependency unit"
        }
      ]
    }
  }
}
Name Type Description
id string Plan Cost ID
itemPrices undefined Payment Plan prices
markupPrices array of MarkupPrices
maxUnits integer Maximum number of units
minUnits integer Minimum number of units
pricingStrategy PricingStrategy Pricing strategy
unit PricingUnit Cost unit
unitDependency PricingUnit Dependency unit

ProductCatalogPage

{
  "type": "object",
  "title": "ProductCatalogPage",
  "properties": {
    "content": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/AppResellerCatalogProductWS"
      }
    },
    "links": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "page": {
      "$ref": "#/components/schemas/PageMetadata"
    }
  }
}
Name Type Description
content array of ProductCatalog
links array of string
page PageMetadata

ProductCatalog

{
  "type": "object",
  "title": "ProductCatalog",
  "properties": {
    "blurb": {
      "description": "Product short description",
      "type": "string"
    },
    "id": {
      "description": "Product ID",
      "type": "string"
    },
    "imageUrl": {
      "description": "Product image URL",
      "type": "string"
    },
    "name": {
      "description": "Product name",
      "type": "string"
    },
    "provider": {
      "description": "Company provider",
      "type": "string"
    },
    "visible": {
      "description": "Determines whether product is visible in catalog (true/false)",
      "type": "boolean"
    }
  }
}
Name Type Description
blurb string Product short description
id string Product ID
imageUrl string Product image URL
name string Product name
provider string Company provider
visible boolean Determines whether product is visible in catalog (true/false)

Company

{
  "type": "object",
  "title": "Company",
  "properties": {
    "activated": {
      "description": "Indicates whether company is activated",
      "type": "boolean"
    },
    "createdOn": {
      "description": "Date when new company was created, in UNIX Epoch milliseconds",
      "type": "number"
    },
    "externalId": {
      "description": "External ID used to identify the company (must be unique)",
      "type": "string"
    },
    "grantedAccesses": {
      "description": "Company granted accesses",
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/AppResellerAccountCompanyAccess"
      }
    },
    "id": {
      "description": "Company's ID",
      "type": "string"
    },
    "name": {
      "description": "New company's name",
      "type": "string"
    },
    "numOfUsers": {
      "description": "Number of users in the company",
      "type": "number"
    },
    "phone": {
      "description": "Company's phone number",
      "type": "string"
    }
  }
}
Name Type Description
activated boolean Indicates whether company is activated
createdOn number Date when new company was created, in UNIX Epoch milliseconds
externalId string External ID used to identify the company (must be unique)
grantedAccesses array of AppResellerAccountCompanyApiContext Company granted accesses
id string Company's ID
name string New company's name
numOfUsers number Number of users in the company
phone string Company's phone number

orderLightWS

{
  "createdOn": 1529083173000,
  "editionName": "Edition",
  "frequency": "One Time",
  "id": "1234",
  "orderCartId": "4567",
  "status": "PENDING MANUAL RECOVERY",
  "totalFee": "USD350.00"
}
Name Type Description
createdOn number Creation date of the order, in Unix timestamp format
editionName string Edition name
frequency string Frequency (valid values are MONTHLY, QUARTERLY, SIX_MONTHS, YEARLY, TWO_YEARS, THREE_YEARS, DAILY)
id string Order ID
orderCartId string Order cart ID
status string Order status (valid values are INITIALIZED, PENDING_USER_APPROVAL, PENDING_REMOTE_CREATION, PENDING_MANUAL_RECOVERY, PENDING_ASYNCHRONOUS_CREATION, FREE_TRIAL, ACTIVE, FINISHED, ONE_TIME, CANCELLED, SUSPENDED, FREE_TRIAL_EXPIRED, FREE_TRIAL_CANCELLED, DELETED, FAILED, UPCOMING, PENDING_MIGRATION_ACTIVATION, PENDING_DELAYED_PROVISIONING)
totalFee string Total fee for the order

AppResellerPaymentMethod

{
  "description": "Payment method information",
  "type": "object",
  "title": "AppResellerPaymentMethod",
  "required": [
    "id",
    "default",
    "paymentMethodType",
    "billingAddress",
    "owner"
  ],
  "properties": {
    "accountDisplay": {
      "description": "Account display text, such as the last 4 digits of the credit card number",
      "type": "string"
    },
    "billingAddress": {
      "allOf": [
        {
          "$ref": "#/components/schemas/BillingAddress"
        },
        {
          "description": "Billing address"
        }
      ]
    },
    "default": {
      "description": "Indicates whether this is the user's default payment method",
      "type": "boolean"
    },
    "id": {
      "description": "Payment method ID",
      "type": "string"
    },
    "owner": {
      "allOf": [
        {
          "$ref": "#/components/schemas/UserAssociation"
        },
        {
          "description": "User associated with the billing address"
        }
      ]
    },
    "paymentMethodType": {
      "description": "Payment method types supported by AppReseller",
      "type": "string"
    },
    "properties": {
      "description": "List of payment method properties. Varies by payment method type",
      "type": "object",
      "additionalProperties": {
        "type": "string"
      }
    }
  }
}

Payment method information

Name Type Description
accountDisplay string Account display text, such as the last 4 digits of the credit card number
billingAddress BillingAddress Billing address
default boolean Indicates whether this is the user's default payment method
id string Payment method ID
owner AppResellerUserAssociation User associated with the billing address
paymentMethodType string Payment method types supported by AppReseller
properties object List of payment method properties. Varies by payment method type

AppResellerPaymentMethodPagedReadResponse

{
  "description": "List of payment methods",
  "type": "object",
  "title": "AppResellerPaymentMethodPagedReadResponse",
  "required": [
    "page",
    "content"
  ],
  "properties": {
    "content": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/AppResellerPaymentMethod"
      }
    },
    "page": {
      "allOf": [
        {
          "$ref": "#/components/schemas/PageMetadata"
        },
        {
          "description": "Page information"
        }
      ]
    }
  }
}

List of payment methods

Name Type Description
content array of AppResellerPaymentMethod
page PageMetadata Page information

AppResellerPaymentMethodRequest

{
  "billingAddress": {
    "city": "Beverly Hills",
    "country": "US",
    "state": "CA",
    "street1": "Alden",
    "zip": "94203"
  },
  "companyId": "6b4bd452-895d-0000-0000-e6046b230000",
  "ownerId": "833d4c99-1939-0000-0000-6fb7ae30000",
  "paymentMethodType": "CARD",
  "properties": {
    "brand": "VISA",
    "cardHolderName": "John Jordan",
    "expirationMonth": "10",
    "expirationYear": "2100",
    "number": "0000-0000-0000-0000",
    "securityCode": "000"
  }
}

Creates a payment method for the specified user

Name Type Description
billingAddress BillingAddress User's billing address
companyId string ID of the user's company
ownerId string ID of the user for whom to create the payment method
paymentMethodType string Payment method types supported by AppReseller
properties object List of payment method properties. Varies by payment method type

AppResellerSubscriptionActiveOrderWS

{
  "createdOn": 1529083173000,
  "editionName": "Edition",
  "frequency": "One Time",
  "id": "1234",
  "orderCartId": "4567",
  "orderLines": [
    {
      "quantity": "1",
      "unit": "USER"
    }
  ],
  "paymentPlanId": "30ccf1e7-1937-40cb-8e73-851a226fd4ea",
  "status": "PENDING MANUAL RECOVERY",
  "totalFee": "USD350.00"
}
Name Type Description
createdOn number Creation date of the order, in Unix timestamp format
editionName string Edition name
frequency string Frequency (valid values are MONTHLY, QUARTERLY, SIX_MONTHS, YEARLY, TWO_YEARS, THREE_YEARS, DAILY)
id string Order ID
orderCartId string Order cart ID
orderLines array of OrderLineDetailsWS Unit type and quantity
paymentPlanId string Edition Payment Plan ID
status string Order status (valid values are INITIALIZED, PENDING_USER_APPROVAL, PENDING_REMOTE_CREATION, PENDING_MANUAL_RECOVERY, PENDING_ASYNCHRONOUS_CREATION, FREE_TRIAL, ACTIVE, FINISHED, ONE_TIME, CANCELLED, SUSPENDED, FREE_TRIAL_EXPIRED, FREE_TRIAL_CANCELLED, DELETED, FAILED, UPCOMING, PENDING_MIGRATION_ACTIVATION, PENDING_DELAYED_PROVISIONING)
totalFee string Total fee for the order

AppResellerSubscriptionAssignmentList

{
  "content": [
    {
      "createdOn": 1529083173000,
      "id": "63bf81c2-8e01-48b7-a8b1-46a0efa0e823",
      "status": "ACTIVE",
      "subscriptionId": "386626c0-53e2-4515-8450-4a720bb5d029",
      "user": {
        "firstName": "Michael",
        "id": "386626c0-53e2-4515-8450-4a720bb5d029",
        "lastName": "Jordan"
      }
    },
    {
      "createdOn": 1527863555000,
      "id": "5cdf116b-0603-4d26-88d8-5e1afd625931",
      "status": "CANCELLED",
      "subscriptionId": "386626c0-53e2-4515-8450-4a720bb5d029",
      "user": {
        "firstName": "Mary",
        "id": "bb14ace3-4490-47e8-84f1-ab6a85da69e5",
        "lastName": "Gonzalez"
      }
    }
  ],
  "page": {
    "number": 1,
    "size": 50,
    "totalElements": 2,
    "totalPages": 1
  }
}

Assignment of a product to a user

Name Type Description
content array of AppResellerSubscriptionAssignment List of subscription assignments
page PageMetadata Page information

AppResellerSubscriptionAssignmentRequestWS

{
  "subscriptionId": "386626c0-53e2-4515-8450-4a720bb5d029",
  "userId": "2c061df6-4313-45e0-8709-a0ca19b0aaa3"
}

Request to assign a product to a user

Name Type Description
subscriptionId string ID of the product subscription to assign to the user
userId string ID of the user to whom the product will be assigned

AppResellerSubscriptionAssignment

{
  "createdOn": 1529083173000,
  "id": "63bf81c2-8e01-48b7-a8b1-46a0efa0e823",
  "status": "ACTIVE",
  "subscriptionId": "386626c0-53e2-4515-8450-4a720bb5d029",
  "user": {
    "firstName": "Michael",
    "id": "386626c0-53e2-4515-8450-4a720bb5d029",
    "lastName": "Jordan"
  }
}

Assignment of a product to a user

Name Type Description
createdOn number Assignment creation date, in timestamp format
id string Assignment ID
status UserEntitlementStatus Assignment status
subscriptionId string ID of the subscription assigned to the user
user AppResellerUserAssociation User to whom the product is assigned

AppResellerSubscriptionLightWS

{
  "activeOrder": {
    "createdOn": 1529083173000,
    "editionName": "Edition",
    "frequency": "One Time",
    "id": "1553",
    "status": "PENDING MANUAL RECOVERY",
    "totalFee": "USD350.00"
  },
  "applicationName": "AUTO_DISCOUNTS_APP",
  "company": {
    "id": "698555fc-bc65-4163-9fee-16308edec41b",
    "name": "Company A"
  },
  "id": "386626c0-53e2-4515-8450-4a720bb5d029",
  "pendingEvent": "SUBSCRIPTION_CHANGE",
  "status": "ACTIVE",
  "user": {
    "firstName": "Michael",
    "id": "386626c0-53e2-4515-8450-4a720bb5d029",
    "lastName": "Jordan"
  }
}
Name Type Description
activeOrder orderLightWS Active order associated with this subscription
applicationName string Name of the application related to the subscription
company AppResellerCompanyAssociation A minimum version of a company: includes only the company ID and name
id string Subscription ID
pendingEventType EventType Pending event related to the subscription
status string Subscription status (valid values are INITIALIZED, FAILED, FREE_TRIAL, FREE_TRIAL_EXPIRED, ACTIVE, SUSPENDED, or CANCELLED)
user AppResellerUserAssociation A minimum version of a user: includes only the user ID, first name, and last name

AppResellerSubscriptionWS

{
  "activeOrder": {
    "createdOn": 1529083173000,
    "editionName": "Edition",
    "frequency": "One Time",
    "id": "1553",
    "orderLines": [
      {
        "quantity": "1",
        "unit": "USER"
      }
    ],
    "paymentPlanId": "30ccf1e7-1937-40cb-8e73-851a226fd4ea",
    "status": "PENDING MANUAL RECOVERY",
    "totalFee": "USD350.00"
  },
  "applicationName": "AUTO_DISCOUNTS_APP",
  "company": {
    "id": "698555fc-bc65-4163-9fee-16308edec41b",
    "name": "Company A"
  },
  "createdOn": 1529083173000,
  "id": "386626c0-53e2-4515-8450-4a720bb5d029",
  "pendingEvent": "SUBSCRIPTION_CHANGE",
  "referenceCode": "bundle09",
  "status": "ACTIVE",
  "user": {
    "firstName": "Michael",
    "id": "2c061df6-4313-45e0-8709-a0ca19b0aaa3",
    "lastName": "Jordan"
  }
}
Name Type Description
activeOrder AppResellerSubscriptionActiveOrderWS Active order associated with this subscription
applicationName string Name of the application related to the subscription
company AppResellerCompanyAssociation A minimum version of a company: includes only the company ID and name
createdOn number Creation date of the subscription, in Unix timestamp format
id string Subscription ID
pendingEventType EventType Pending event related to the subscription
referenceCode string Code provided by Resellers and Sales Agents while purchasing a subscription
status string Subscription status (valid values are INITIALIZED, FAILED, FREE_TRIAL, FREE_TRIAL_EXPIRED, ACTIVE, SUSPENDED, or CANCELLED)
user AppResellerUserAssociation A minimum version of a user: includes only the user ID, first name, and last name

AppResellerUserActions

User actions

Enumeration of

AppResellerUserRoleWS

{
  "type": "object",
  "title": "AppResellerUserRoleWS",
  "properties": {
    "name": {
      "description": "Role name",
      "type": "string"
    },
    "permission": {
      "allOf": [
        {
          "$ref": "#/components/schemas/ReadWritePermission"
        },
        {
          "description": "Write permission"
        }
      ]
    }
  }
}
Name Type Description
name string Role name
permission ReadWritePermission Write permission

AppResellerUserSetting

{
  "description": "User setting",
  "type": "object",
  "title": "AppResellerUserSetting",
  "properties": {
    "permission": {
      "allOf": [
        {
          "$ref": "#/components/schemas/ReadWritePermission"
        },
        {
          "description": "User setting permission"
        }
      ]
    },
    "setting": {
      "allOf": [
        {
          "$ref": "#/components/schemas/AppResellerAccountUserSettingCode"
        },
        {
          "description": "User role setting code"
        }
      ]
    },
    "value": {
      "description": "User setting value",
      "type": "string"
    }
  }
}

User setting

Name Type Description
permission ReadWritePermission User setting permission
setting AppResellerAccountUserSettingCode User role setting code
value string User setting value

ApplicationSummaryStat

{
  "description": "Company application summary statistic",
  "type": "object",
  "title": "ApplicationSummaryStat",
  "properties": {
    "children": {
      "description": "Summary statistic value",
      "type": "string"
    },
    "unit": {
      "description": "Summary statistic name",
      "type": "string"
    }
  }
}

Company application summary statistic

Name Type Description
children string Summary statistic value
unit string Summary statistic name

AttributeType

Enumeration of

AvailableAction

Opportunity available action

Enumeration of

BillingAddress

{
  "city": "Beverly Hills",
  "country": "US",
  "state": "CA",
  "street1": "Alden",
  "zip": "94203"
}

Billing address

Name Type Description
city string City or town
companyName string Company name
country string Country code in ISO-3166 format
fax string Fax number
faxExtension string Fax number extension
phone string Phone number
poBox string Post office box number
salutation string Personal salutation
state string State, province, or region
street1 string First line of a street address
street2 string Second line of a street address, such as apartment or unit number
zip string ZIP or postal code

Company

{
  "id": "1",
  "name": "Acme Corp."
}
Name Type Description
id string Company ID
name string Company name

AppResellerCompanyAssociation

{
  "id": "698555fc-bc65-4163-9fee-16308edec41b",
  "name": "Company A"
}

A minimum version of a company: includes only the company ID and name

Name Type Description
id string Company ID
name string Company name

CompanyDetails

{
  "type": "object",
  "title": "CompanyDetails",
  "properties": {
    "actions": {
      "description": "Actions available for the current user on this company",
      "type": "array",
      "items": {
        "description": "Type of company action",
        "type": "string",
        "title": "AppResellerAccountCompanyAction",
        "enum": [
          "ENABLE_ON_DEVICES_SALES_AUTOMATION",
          "DISABLE_ON_DEVICES_SALES_AUTOMATION",
          "VERIFY_EMAIL_DOMAIN",
          "UNVERIFY_EMAIL_DOMAIN",
          "ENABLE_COMPANY",
          "DISABLE_COMPANY",
          "LINK_RESELLER_TO_CUSTOMER",
          "LINK_CUSTOMER_TO_RESELLER",
          "INVITE_USERS",
          "MANAGE_PRODUCT_CATALOG",
          "LEAVE_COMPANY",
          "JOIN_COMPANY",
          "MANAGE_CUSTOM_ATTRIBUTES",
          "MOSI_DOMAINS_MANAGEMENT"
        ]
      }
    },
    "active": {
      "description": "Indicates whether company has completed registration",
      "type": "boolean"
    },
    "availableAccesses": {
      "description": "Available accesses that the company can have",
      "type": "array",
      "items": {
        "description": "Type of company access",
        "type": "string",
        "title": "AppResellerAccountCompanyAccessCode",
        "enum": [
          "RESELLER",
          "REFERRAL",
          "CUSTOMER",
          "DEVELOPER",
          "MARKETPLACE",
          "SALES_SUPPORT_REPRESENTATIVE",
          "ENTERPRISE_CUSTOMER"
        ]
      }
    },
    "availableRoles": {
      "description": "Available roles that can be assigned to the company users",
      "type": "array",
      "items": {
        "type": "string",
        "title": "Role",
        "enum": [
          "USER",
          "APPLICATION",
          "PARTNER",
          "PARTNER_READ",
          "COMPANY",
          "CLIENT",
          "CHECKOUT_USER",
          "BILLING_ADMIN",
          "SYS_ADMIN",
          "DEVELOPER",
          "CHANNEL_PRODUCT_SUPPORT",
          "CHANNEL_SUPPORT",
          "CHANNEL_ADMIN",
          "CORPORATE_ADMIN",
          "SUPERUSER",
          "SUPER_SUPPORT",
          "ANALYTICS_ADMIN",
          "LAYOUT_DESIGNER",
          "SALES_SUPPORT",
          "RESTRICTED_SALES_SUPPORT",
          "RESELLER",
          "RESELLER_MANAGER",
          "TESTER",
          "MONITORING",
          "SYSTEM"
        ]
      }
    },
    "availableTaxExemptions": {
      "description": "Tax exemptions that the company can have",
      "type": "array",
      "items": {
        "description": "Company tax exemption codes",
        "type": "string",
        "title": "AppResellerAccountTaxExemptionCode",
        "enum": [
          "FEDERAL_GOVERNMENT_US",
          "STATE_GOVERNMENT_US",
          "TRIBE_INDIAN",
          "FOREIGN_DIPLOMAT",
          "CHARITABLE_ORG",
          "RELIGIOUS_ORG",
          "RESALE",
          "COMMERCIAL_AGRICULTURAL",
          "INDUSTRIAL_PRODUCTION",
          "DIRECT_MAIL_US",
          "DIRECT_PAY_PERMIT_US",
          "OTHER",
          "LOCAL_GOVERNMENT_US",
          "COMMERCIAL_AQUACULTURE",
          "COMMERCIAL_FISHERY",
          "NON_RESIDENT_CAN",
          "MEDICAL_DEVICE_WITH_EXEMPT_SALES_TAX_US",
          "MEDICAL_DEVICE_WITH_TAXABLE_SALES_TAX_US"
        ]
      }
    },
    "channel": {
      "description": "Company's partner",
      "type": "string"
    },
    "createdOn": {
      "description": "Company's creation date, in UNIX Epoch milliseconds",
      "type": "number"
    },
    "defaultRole": {
      "type": "string",
      "title": "Role",
      "enum": [
        "USER",
        "APPLICATION",
        "PARTNER",
        "PARTNER_READ",
        "COMPANY",
        "CLIENT",
        "CHECKOUT_USER",
        "BILLING_ADMIN",
        "SYS_ADMIN",
        "DEVELOPER",
        "CHANNEL_PRODUCT_SUPPORT",
        "CHANNEL_SUPPORT",
        "CHANNEL_ADMIN",
        "CORPORATE_ADMIN",
        "SUPERUSER",
        "SUPER_SUPPORT",
        "ANALYTICS_ADMIN",
        "LAYOUT_DESIGNER",
        "SALES_SUPPORT",
        "RESTRICTED_SALES_SUPPORT",
        "RESELLER",
        "RESELLER_MANAGER",
        "TESTER",
        "MONITORING",
        "SYSTEM"
      ],
      "description": "Default assigned company users role",
      "properties": {}
    },
    "domain": {
      "description": "Company's email domain",
      "type": "string"
    },
    "domainVerified": {
      "description": "The verified domain address",
      "type": "string"
    },
    "enabled": {
      "description": "Indicates whether company can log in to the marketplace",
      "type": "boolean"
    },
    "externalId": {
      "description": "External ID used to identify the company (must be unique)",
      "type": "string"
    },
    "grantedAccesses": {
      "description": "Assigned accesses that the company has",
      "type": "array",
      "items": {
        "description": "Type of company access",
        "type": "string",
        "title": "AppResellerAccountCompanyAccessCode",
        "enum": [
          "RESELLER",
          "REFERRAL",
          "CUSTOMER",
          "DEVELOPER",
          "MARKETPLACE",
          "SALES_SUPPORT_REPRESENTATIVE",
          "ENTERPRISE_CUSTOMER"
        ]
      }
    },
    "id": {
      "description": "Company's identifier",
      "type": "string"
    },
    "idpConfigurations": {
      "description": "Company's configured identity providers",
      "type": "array",
      "items": {
        "description": "Configured Identity provider",
        "type": "object",
        "title": "AppResellerAccountIdentityProvider",
        "properties": {
          "id": {
            "description": "Identity provider identifier",
            "type": "string"
          },
          "name": {
            "description": "Identity provider name",
            "type": "string"
          },
          "partner": {
            "description": "Identity provider partner",
            "type": "string"
          }
        }
      }
    },
    "name": {
      "description": "Company's name",
      "type": "string"
    },
    "phone": {
      "description": "Company's phone number",
      "type": "string"
    },
    "profilePicture": {
      "description": "Company's profile picture URL",
      "type": "string"
    },
    "settings": {
      "description": "Company settings available to Company Reseller Managers",
      "type": "array",
      "items": {
        "description": "Company setting",
        "type": "object",
        "title": "AppResellerAccountCompanySetting",
        "properties": {
          "permission": {
            "allOf": [
              {
                "description": "Type of company write permissions",
                "type": "string",
                "title": "ReadWritePermission",
                "enum": [
                  "READ",
                  "WRITE"
                ]
              },
              {
                "description": "Company setting read/write permissions"
              }
            ]
          },
          "setting": {
            "allOf": [
              {
                "description": "Company Setting Code",
                "type": "string",
                "title": "AppResellerAccountCompanySettingCode",
                "enum": [
                  "ON_DEVICES_SALES_AUTOMATION",
                  "TAX_RATE",
                  "TAX_EXEMPTION_CODE",
                  "CREATE_LEADS",
                  "CREATE_COMPANIES",
                  "CREATE_OPPORTUNITIES",
                  "CLOUD_MANAGEMENT",
                  "TWO_FACTOR_AUTHENTICATION",
                  "IDENTITY_DATA_PROVIDER",
                  "EXTERNAL_ID",
                  "THIRTY_DAYS_PURCHASE_LIMIT_EXEMPT",
                  "DEFAULT_USER_ROLE"
                ]
              },
              {
                "description": "Company setting code"
              }
            ]
          },
          "value": {
            "description": "Company setting value",
            "type": "string"
          }
        }
      }
    },
    "stats": {
      "description": "Company applications summary stats",
      "type": "array",
      "items": {
        "description": "Company application summary statistic",
        "type": "object",
        "title": "ApplicationSummaryStat",
        "properties": {
          "children": {
            "description": "Summary statistic value",
            "type": "string"
          },
          "unit": {
            "description": "Summary statistic name",
            "type": "string"
          }
        }
      }
    },
    "subdomain": {
      "description": "Company's sub domain",
      "type": "string"
    }
  }
}
Name Type Description
actions array of AppResellerAccountCompanyAction Actions available for the current user on this company
active boolean Indicates whether company has completed registration
availableAccesses array of AppResellerAccountCompanyAccessCode Available accesses that the company can have
availableRoles array of Role Available roles that can be assigned to the company users
availableTaxExemptions array of AppResellerAccountTaxExemptionCode Tax exemptions that the company can have
channel string Company's partner
createdOn number Company's creation date, in UNIX Epoch milliseconds
defaultRole Role Default assigned company users role
domain string Company's email domain
domainVerified string The verified domain address
enabled boolean Indicates whether company can log in to the marketplace
externalId string External ID used to identify the company (must be unique)
grantedAccesses array of AppResellerAccountCompanyAccessCode Assigned accesses that the company has
id string Company's identifier
idpConfigurations array of AppResellerAccountIdentityProvider Company's configured identity providers
name string Company's name
phone string Company's phone number
profilePicture string Company's profile picture URL
settings array of AppResellerAccountCompanySetting Company settings available to Company Reseller Managers
stats array of ApplicationSummaryStat Company applications summary stats
subdomain string Company's sub domain

CostType

Type of cost

Enumeration of

CostTypeCategory

Category of cost

Enumeration of

CustomAttribute

{
  "customAttributes": {
    "multivalue_key": [
      "key_value_1",
      "key_value_2"
    ],
    "single_key": [
      "key_value"
    ]
  }
}

Custom attributes as key-value pairs. Values must be a string array

None

CustomAttributeLightV2

{
  "attributeKey": "...",
  "attributeType": "MULTISELECT",
  "label": "...",
  "value": "...",
  "valueKeys": [
    "...",
    "..."
  ],
  "valueOptions": [
    {
      "optionKey": "...",
      "optionLabel": "..."
    },
    {
      "optionKey": "...",
      "optionLabel": "..."
    }
  ]
}
Name Type Description
attributeKey string
attributeType AttributeType
label string
value string
valueKeys array of string
valueOptions array of CustomAttributeLocalizedValueOption

CustomAttributeLocalizedValueOption

{
  "optionKey": "...",
  "optionLabel": "..."
}
Name Type Description
optionKey string
optionLabel string

{
  "description": "Custom prices for a given cost",
  "type": "object",
  "required": [
    "costId",
    "price"
  ],
  "properties": {
    "costId": {
      "description": "Cost ID",
      "type": "string"
    },
    "price": {
      "description": "Custom price for cost",
      "type": "string"
    }
  }
}

Custom prices for a given cost

Name Type Description
costId string Cost ID
price string Custom price for cost

CustomerCompanyAssociation

{
  "type": "object",
  "title": "CustomerCompanyAssociation",
  "required": [
    "id",
    "resellerCompany",
    "customerCompany",
    "createdOn"
  ],
  "properties": {
    "createdOn": {
      "description": "Date on which new customer company association was created, in UNIX Epoch milliseconds",
      "type": "number"
    },
    "customerCompany": {
      "$ref": "#/components/schemas/CompanyAssociation"
    },
    "id": {
      "description": "Customer company ID",
      "type": "string"
    },
    "resellerCompany": {
      "$ref": "#/components/schemas/CompanyAssociation"
    }
  }
}
Name Type Description
createdOn number Date on which new customer company association was created, in UNIX Epoch milliseconds
customerCompany AppResellerCompanyAssociation A minimum version of a company: includes only the company ID and name
id string Customer company ID
resellerCompany AppResellerCompanyAssociation A minimum version of a company: includes only the company ID and name

CustomerCompanyAssociationConflictResponse

{
  "code": "RESELLER_REQUIRED",
  "message": "Acme is not a reseller company",
  "status": 409
}
Name Type Description
code IllegalCompanyAssociationTypes Invalid company association types
message string Code description
status number HTTP status

CustomerCompanyAssociationCreationRequest

{
  "type": "object",
  "title": "CustomerCompanyAssociationCreationRequest",
  "required": [
    "customerCompanyId",
    "resellerCompanyId"
  ],
  "properties": {
    "customerCompanyId": {
      "description": "Customer company ID",
      "type": "string"
    },
    "resellerCompanyId": {
      "description": "Reseller company ID",
      "type": "string"
    }
  }
}
Name Type Description
customerCompanyId string Customer company ID
resellerCompanyId string Reseller company ID

CustomerCompanyAssociationPagedReadResponse

{
  "type": "object",
  "title": "CustomerCompanyAssociationPagedReadResponse",
  "required": [
    "page",
    "content"
  ],
  "properties": {
    "content": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/CustomerCompanyAssociation"
      }
    },
    "page": {
      "allOf": [
        {
          "$ref": "#/components/schemas/PageMetadata"
        },
        {
          "description": "Page information"
        }
      ]
    }
  }
}
Name Type Description
content array of CustomerCompanyAssociation
page PageMetadata Page information

EventType

Enumeration of

IllegalCompanyAssociationTypes

Invalid company association types

Enumeration of

IllegalSubscriptionAssociationTypes

Invalid subscription association types

Enumeration of

LeadActivity

{
  "actorCompany": {
    "id": "386626c0-1234-4515-8450-4a720bb5d029",
    "name": "Reseller Company"
  },
  "allowedResourcesAccess": [
    "CONTEXT_QUOTE",
    "ACTOR_COMPANY"
  ],
  "contextQuote": {
    "applicationName": "Appsome Product",
    "friendlyId": "ZVVZNQ",
    "id": "df4e34c4-4f82-458d-ba4a-db68c27878a6"
  },
  "createdOn": 1533222783000,
  "id": "633d1fa9-16ce-4448-8741-85960ecee365",
  "partner": "APPDIRECT",
  "verb": "LEAD_QUOTE_LINKED",
  "verbContext": "COMPANY"
}

Information about the lead activity

Name Type Description
actorCompany LeadCompany Information about the company that acted on the lead
allowedResourcesAccess array of LeadActivityResource The lead's activity resource (the type of object that the activity refers to)
contextApplication LeadProduct Information about the product profile from where the lead originated or the linked product
contextCompany LeadCompany Information about the company whose user the lead was assigned to
contextPurchaseOrder LeadPurchaseOrder Information about the linked order
contextQuote LeadQuote Information about the linked quote
createdOn number Date on which the activity was created, in UNIX Epoch milliseconds
id string Lead activity ID
partner string Marketplace partner code
verb LeadActivityVerb Lead activity action (or verb)
verbContext LeadActivityVerbContext Lead activity action's context (or verb context)

LeadActivityPagedReadResponse

{
  "description": "Paged response as an array of lead activity objects",
  "type": "object",
  "title": "LeadActivityPagedReadResponse",
  "required": [
    "page",
    "content"
  ],
  "properties": {
    "content": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/LeadActivity"
      }
    },
    "page": {
      "allOf": [
        {
          "$ref": "#/components/schemas/PageMetadata"
        },
        {
          "description": "Page information"
        }
      ]
    }
  }
}

Paged response as an array of lead activity objects

Name Type Description
content array of LeadActivity
page PageMetadata Page information

LeadActivityResource

The lead's activity resource (the type of object that the activity refers to)

Enumeration of

LeadActivityVerb

Lead activity action (or verb)

Enumeration of

LeadActivityVerbContext

Lead activity action's context (or verb context)

Enumeration of

LeadAssignmentRequest

{
  "leadId": "29a1dc26-8088-475c-ba75-7b73915a0fab",
  "recipient": {
    "companyId": "386626c0-1234-4515-8450-4a720bb5d029",
    "participantType": "COMPANY"
  }
}

Information about the person to whom the lead is being assigned

Name Type Description
leadId string Lead ID
recipient LeadParticipant The participant to whom the lead is being assigned

LeadAssignmentResponse

{
  "description": "Information about the assigned lead",
  "type": "object",
  "title": "LeadAssignmentResponse",
  "required": [
    "lead"
  ],
  "properties": {
    "lead": {
      "allOf": [
        {
          "$ref": "#/components/schemas/LeadResponse"
        },
        {
          "description": "The assigned lead"
        }
      ]
    }
  }
}

Information about the assigned lead

Name Type Description
lead LeadResponse The assigned lead

LeadCompany

{
  "id": "386626c0-53e2-4515-ffff-4a720bb5d029",
  "name": "Reseller Company"
}

Information about the marketplace company related to the lead

Name Type Description
id string Company ID
name string Company name

LeadCompanyAssociationRequest

{
  "leadId": "ce9d1713-7a48-43e4-bb43-b6880a19df24",
  "user": {
    "companyId": "62377315-61ba-4b50-9891-02799bef4257",
    "id": "1661c8d8-357b-4e8d-a0b9-a571ff00924b"
  }
}

Contains information about user and company to associate with the lead

Name Type Description
leadId string Lead ID
user LeadUser The user and company who are being associated with the lead

LeadConversionResponse

{
  "description": "Information about the lead conversion",
  "type": "object",
  "title": "LeadConversionResponse",
  "required": [
    "lead"
  ],
  "properties": {
    "lead": {
      "allOf": [
        {
          "$ref": "#/components/schemas/LeadResponse"
        },
        {
          "description": "The lead that has been converted or is in the conversion approval process"
        }
      ]
    }
  }
}

Information about the lead conversion

Name Type Description
lead LeadResponse The lead that has been converted or is in the conversion approval process

LeadCreationRequest

{
  "customer": {
    "company": {
      "city": "Miami",
      "country": "US",
      "name": "Acme",
      "state": "FL",
      "street1": "1234 Main St",
      "street2": "30th Floor, Apt B",
      "zip": "33033"
    },
    "contact": {
      "email": "john.doe@acme.com",
      "firstName": "John",
      "lastName": "Doe",
      "phone": "+13055555555"
    }
  },
  "leadType": "MANUAL",
  "partner": "APPDIRECT"
}

The lead creation request object. Some fields are mandatory depending on the type of the lead.

Name Type Description
creator LeadUser Information about the marketplace user who created the lead (required if the lead type is MANUAL)
customAttributes object Custom attributes associated with the lead. This is a key-value object where the values are a set of strings associated with a given key, which is also a String.
customer LeadCustomer Information about the customer and the customer's company
leadType LeadType Lead type
notes string Notes attached to the lead
partner string Marketplace partner code
profileCompany LeadCompany Information about the company profile from which the lead originated (required if the lead type is COMPANY)
profileProduct LeadProduct Information about the product profile from which the lead originated (required if the lead type is PRODUCT)
profileProductEdition LeadProductEdition Information about the edition from the product profile from which the lead originated (required if the lead type is PRODUCT). This object also requires profileProduct.
reseller LeadUser Information about the reseller associated with the lead (required if the lead was created manually by a reseller)

LeadCustomer

{
  "customer": {
    "company": {
      "city": "Beverly Hills",
      "country": "US",
      "name": "Acme",
      "size": "RANGE_1_9",
      "state": "CA",
      "street1": "1234 Main St",
      "street2": "Suite 100",
      "zip": "90210"
    },
    "contact": {
      "email": "john.doe@acme.com",
      "firstName": "John",
      "lastName": "Doe",
      "phone": "+14455555555"
    }
  }
}

Information about the customer and customer company

Name Type Description
company LeadCustomerCompany Information about the customer's company, including address and company size
contact LeadCustomerContact Customer contact information

LeadCustomerCompany

{
  "company": {
    "city": "Beverly Hills",
    "country": "US",
    "name": "Acme",
    "size": "RANGE_1_9",
    "state": "CA",
    "street1": "1234 Main St",
    "street2": "Suite 100",
    "zip": "90210"
  }
}

Information about the customer's company, including address and company size

Name Type Description
city string City or town
country string The two-letter country code, in ISO 3166 format
name string Company Name
size string Company size, as determined by number of employees
state string State, province, or region
street1 string First line of street address
street2 string Second line of street address (suite, floor, and so on)
zip string ZIP or postal code

LeadCustomerContact

{
  "contact": {
    "email": "john.doe@acme.com",
    "firstName": "John",
    "lastName": "Doe",
    "phone": "+14455555555",
    "phoneExtension": "123"
  }
}

Customer contact information

Name Type Description
email string Email address
firstName string First name
lastName string Last name
phone string Phone number
phoneExtension string Phone number extension

LeadPagedReadResponse

{
  "description": "Paged response as an array of lead objects",
  "type": "object",
  "title": "LeadPagedReadResponse",
  "required": [
    "page",
    "content"
  ],
  "properties": {
    "content": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/LeadResponse"
      }
    },
    "page": {
      "allOf": [
        {
          "$ref": "#/components/schemas/PageMetadata"
        },
        {
          "description": "Page information"
        }
      ]
    }
  }
}

Paged response as an array of lead objects

Name Type Description
content array of LeadResponse
page PageMetadata Page information

LeadParticipant

{
  "participantType": "CHANNEL",
  "partner": "APPDIRECT"
}

Information about the person who is receiving or referring the lead

Name Type Description
companyId string The company's ID (only for COMPANY types)
companyName string The company's name (only for COMPANY types)
participantType string The type of the participant involved. It can be CUSTOMER (an anonymous participant), COMPANY (a Reseller, Referral or Developer company participant) or CHANNEL (a Partner participant).
partner string The partner code of the marketplace (only for CHANNEL types)

LeadProduct

{
  "id": "009fd909-aaaa-4e37-bbad-701f87724bca",
  "name": "Appsome Product",
  "provider": "APPDIRECT"
}

Information about the product related to a lead

Name Type Description
id string Product ID
name string Product name
provider string Marketplace partner code

LeadProductEdition

{
  "id": "d4610cd4-09d5-abcd-a769-a47666a1c311",
  "name": "Enterprise Edition"
}

Information about the product edition related to a lead

Name Type Description
id string Edition ID
name string Edition name

LeadPurchaseOrder

{
  "id": 1234
}

Information about the purchase order linked to the lead

Name Type Description
id number Purchase order ID

LeadQuote

{
  "applicationName": "AUTO_WEBAPP_NEW",
  "friendlyId": "ZVVZNQ",
  "id": "df4e34c4-4f82-458d-ba4a-db68c27878a6"
}

Information about a quote linked to the lead

Name Type Description
applicationName string The product name from the quote
friendlyId string Quote ID in friendly format
id string Quote ID

LeadResponse

{
  "description": "The lead response. Depending on the action and status, some information might not be available.",
  "type": "object",
  "title": "LeadResponse",
  "required": [
    "id",
    "partner",
    "leadType",
    "status",
    "customer",
    "createdOn",
    "lastModified",
    "referrer",
    "recipient"
  ],
  "properties": {
    "convertedCompany": {
      "allOf": [
        {
          "$ref": "#/components/schemas/LeadCompany"
        },
        {
          "description": "Information about the marketplace's converted customer's company (only after the lead is converted)"
        }
      ]
    },
    "convertedUser": {
      "allOf": [
        {
          "$ref": "#/components/schemas/LeadUser"
        },
        {
          "description": "Information about the marketplace's converted customer (only after the lead is converted)"
        }
      ]
    },
    "createdOn": {
      "description": "The date on which the lead was created, in UNIX Epoch milliseconds",
      "type": "number"
    },
    "creator": {
      "allOf": [
        {
          "$ref": "#/components/schemas/LeadUser"
        },
        {
          "description": "Information about the marketplace user who created the lead (only if lead type is MANUAL)"
        }
      ]
    },
    "customAttributes": {
      "description": "Custom attributes associated with the lead",
      "type": "object"
    },
    "customer": {
      "allOf": [
        {
          "$ref": "#/components/schemas/LeadCustomer"
        },
        {
          "description": "Information about the customer and the customer's company"
        }
      ]
    },
    "id": {
      "description": "Lead ID",
      "type": "string"
    },
    "lastModified": {
      "description": "The date on which the lead was last modified, in UNIX Epoch milliseconds",
      "type": "number"
    },
    "leadType": {
      "allOf": [
        {
          "$ref": "#/components/schemas/LeadType"
        },
        {
          "description": "Lead type"
        }
      ]
    },
    "notes": {
      "description": "Notes attached to the lead",
      "type": "string"
    },
    "partner": {
      "description": "Marketplace partner code",
      "type": "string"
    },
    "profileCompany": {
      "allOf": [
        {
          "$ref": "#/components/schemas/LeadCompany"
        },
        {
          "description": "Information about the company profile from which the lead originated (only if the lead type is COMPANY)"
        }
      ]
    },
    "profileProduct": {
      "allOf": [
        {
          "$ref": "#/components/schemas/LeadProduct"
        },
        {
          "description": "Information about the product profile from which the lead originated (only if the lead type is PRODUCT)"
        }
      ]
    },
    "profileProductEdition": {
      "allOf": [
        {
          "$ref": "#/components/schemas/LeadProductEdition"
        },
        {
          "description": "Information about the edition from the product profile from which the lead originated (only if the lead type is PRODUCT)"
        }
      ]
    },
    "recipient": {
      "allOf": [
        {
          "$ref": "#/components/schemas/LeadParticipant"
        },
        {
          "description": "Information about the user or partner who is receiving the lead"
        }
      ]
    },
    "referrer": {
      "allOf": [
        {
          "$ref": "#/components/schemas/LeadParticipant"
        },
        {
          "description": "Information about the customer, user, or partner who is referring the lead"
        }
      ]
    },
    "reseller": {
      "allOf": [
        {
          "$ref": "#/components/schemas/LeadUser"
        },
        {
          "description": "Information about the reseller associated with the lead (only if created manually by a reseller)"
        }
      ]
    },
    "result": {
      "allOf": [
        {
          "$ref": "#/components/schemas/LeadResult"
        },
        {
          "description": "Additional status information about the lead (only after the lead is converted)"
        }
      ]
    },
    "status": {
      "allOf": [
        {
          "$ref": "#/components/schemas/LeadStatus"
        },
        {
          "description": "Lead status"
        }
      ]
    }
  }
}

The lead response. Depending on the action and status, some information might not be available.

Name Type Description
convertedCompany LeadCompany Information about the marketplace's converted customer's company (only after the lead is converted)
convertedUser LeadUser Information about the marketplace's converted customer (only after the lead is converted)
createdOn number The date on which the lead was created, in UNIX Epoch milliseconds
creator LeadUser Information about the marketplace user who created the lead (only if lead type is MANUAL)
customAttributes object Custom attributes associated with the lead
customer LeadCustomer Information about the customer and the customer's company
id string Lead ID
lastModified number The date on which the lead was last modified, in UNIX Epoch milliseconds
leadType LeadType Lead type
notes string Notes attached to the lead
partner string Marketplace partner code
profileCompany LeadCompany Information about the co