Reselling Products

This is a scenario in which the reseller sells delegated plans to its customers.

Create Customers

If the reseller needs to subscribe a client to a service plan for the first time, the external system must first create a customer account and only then place an order for the service plan. For every customer, the platform must have two linked APS resources, one based on the PAAccount APS type and the other based on the BssAccountInformation APS type.

Collect Source Data

Before sending a request to create an account, the external system must prepare the following source data:

  • Contact data. Since an account represents a company with contact data, that data must be collected first.

  • Parent APS ID. An account must be linked to its parent account through the parent link. When creating an account under a reseller, the link must be specified explicitly, otherwise the platform will try to create the account directly under the provider and as a result, it will return an error message. In our case, the parent must be the reseller itself. To get it, the system must read a list of accounts filtered by any property that uniquely identifies the reseller; for example, identify the reseller by the email address. To make the response shorter as only APS ID is needed, the select filter will omit superfluous data:

    GET /aps/2/collections/accounts?eq(techContact.email,mw@aps.test),select(aps.id)
    

    The response will contain the aps section only, where the id property will be the APS ID of the reseller.

  • APS ID of the BssAccountInformation APS resource. Since both APS resources must be created and linked in one request, the APS ID for the BssAccountInformation APS resource must be generated prior to sending the request. That APS ID allows the external system to request linking the new PAAccount APS resource to the new BssAccountInformation APS resource while creating both APS resources.

    Before sending a request, you also need to generate a UUID using an online generator, for example, Online UUID Generator or your system can generate it using a respective method from its library. This is a sample Python-3 script:

    #!/usr/bin/env python3
    
    import uuid
    
    uuid = uuid.uuid1()
    print ('Random UUID: ', end = '')
    print (uuid)
    

    For example:

    $ ./uuid-gen.py
    Random UUID: 424eef0c-d847-11e8-8a73-60fb42f13c76
    

Request Account Creation

Once you collected all necessary account properties, send a request similar to the following, adjusted to your scenario:

POST /aps/2/resources/

[
   { "aps":{
         "type":"http://parallels.com/pa/bss-account-info/1.0",
         "id":"424eef0c-d847-11e8-8a73-60fb42f13c76"
      },
      "taxStatus": "COMPANY",
      "localeId": "en_US"
   },
   { "aps":{
         "type":"http://parallels.com/aps/types/pa/account/1.2"
      },
      "type":"CLIENT",
      "personal":false,
      "companyName":"1st APS inc",
      "bssAccountInfo":{
         "aps": {
            "id":"424eef0c-d847-11e8-8a73-60fb42f13c76"
         }
      },
      "parent":{
         "aps": {
            "id":"78ee642d-3b8a-48f1-af12-90563e38bd18"
         }
      },
      "addressPostal":{
         "countryName":"us",
         "locality":"APS",
         "postalCode":"12345",
         "region":"VA",
         "streetAddress":"11, APS"
      },
      "adminContact":{
         "email":"ps1@aps.test",
         "givenName":"Peter",
         "familyName":"Snape",
         "telVoice":"1(888)1234567"
      },
      "billingContact":{
         "email":"ps1@aps.test",
         "givenName":"Peter",
         "familyName":"Snape",
         "telVoice":"1(888)1234567"
      },
      "techContact":{
         "email":"ps1@aps.test",
         "givenName":"Peter",
         "familyName":"Snape",
         "telVoice":"1(888)1234567"
      }
   }
]

The response will contain the JSON representation of both new APS resources:

HTTP/1.1 200 OK

[
  {
    "aps": {
      "type": "http://parallels.com/pa/bss-account-info/1.0",
      "id": "424eef0c-d847-11e8-8a73-60fb42f13c76",
      "status": "aps:ready",
      "revision": 4,
      "modified": "2019-03-15T13:39:31Z",
      "package": {
        "id": "92ccf5e8-fc07-4e7f-8875-5c19c8545870",
        "href": "/aps/2/packages/92ccf5e8-fc07-4e7f-8875-5c19c8545870"
      }
    },
    "accountCurrencyCode": "USD",
    "accountId": 1000006,
    "externalARManagement": false,
    "fullyRegistered": false,
    "localeId": "en_US",
    "taxStatus": "COMPANY",
    "customerClass": {
      "aps": {
        "link": "weak",
        "href": "/aps/2/resources/f4c39772-9ad7-4be7-9b71-0bd34b28e1be",
        "id": "f4c39772-9ad7-4be7-9b71-0bd34b28e1be"
      }
    },
    "ownCustomerClasses": {
      "aps": {
        "link": "collection",
        "href": "/aps/2/resources/424eef0c-d847-11e8-8a73-60fb42f13c76/ownCustomerClasses"
      }
    },
    "paAccount": {
      "aps": {
        "link": "weak",
        "href": "/aps/2/resources/26ae28d2-0303-4189-8e1d-02796ee5de3b",
        "id": "26ae28d2-0303-4189-8e1d-02796ee5de3b"
      }
    }
  },
  {
    "aps": {
      "type": "http://parallels.com/aps/types/pa/account/1.2",
      "id": "26ae28d2-0303-4189-8e1d-02796ee5de3b",
      "status": "aps:ready",
      "revision": 4,
      "modified": "2019-03-15T13:39:31Z",
      "package": {
        "id": "a4487539-725d-4259-9845-ef059fafed5b",
        "href": "/aps/2/packages/a4487539-725d-4259-9845-ef059fafed5b"
      }
    },
    "addressPostal": {
      "countryName": "us",
      "locality": "APS",
      "postalCode": "12345",
      "region": "VA",
      "streetAddress": "11, APS"
    },
    "adminContact": {
      "email": "ps1@aps.test",
      "familyName": "Snape",
      "givenName": "Peter",
      "locale": "en_US",
      "middleName": "",
      "organizationName": "",
      "telVoice": "1#888#1234567#"
    },
    "billingContact": {
      "email": "ps1@aps.test",
      "familyName": "Snape",
      "givenName": "Peter",
      "locale": "en_US",
      "middleName": "",
      "organizationName": "",
      "telVoice": "1#888#1234567#"
    },
    "companyName": "1st APS inc",
    "id": 1000006,
    "locked": false,
    "personal": false,
    "techContact": {
      "email": "ps1@aps.test",
      "familyName": "Snape",
      "givenName": "Peter",
      "locale": "en_US",
      "middleName": "",
      "organizationName": "",
      "telVoice": "1#888#1234567#"
    },
    "type": "CLIENT",
    "accounts": {
      "aps": {
        "link": "collection",
        "href": "/aps/2/resources/26ae28d2-0303-4189-8e1d-02796ee5de3b/accounts"
      }
    },
    "brands": {
      "aps": {
        "link": "collection",
        "href": "/aps/2/resources/26ae28d2-0303-4189-8e1d-02796ee5de3b/brands"
      }
    },
    "bssAccountInfo": {
      "aps": {
        "link": "weak",
        "href": "/aps/2/resources/424eef0c-d847-11e8-8a73-60fb42f13c76",
        "id": "424eef0c-d847-11e8-8a73-60fb42f13c76"
      }
    },
    "domains": {
      "aps": {
        "link": "collection",
        "href": "/aps/2/resources/26ae28d2-0303-4189-8e1d-02796ee5de3b/domains"
      }
    },
    "parent": {
      "aps": {
        "link": "weak",
        "href": "/aps/2/resources/78ee642d-3b8a-48f1-af12-90563e38bd18",
        "id": "78ee642d-3b8a-48f1-af12-90563e38bd18"
      }
    },
    "subscriptions": {
      "aps": {
        "link": "collection",
        "href": "/aps/2/resources/26ae28d2-0303-4189-8e1d-02796ee5de3b/subscriptions"
      }
    },
    "templates": {
      "aps": {
        "link": "collection",
        "href": "/aps/2/resources/26ae28d2-0303-4189-8e1d-02796ee5de3b/templates"
      }
    },
    "users": {
      "aps": {
        "link": "collection",
        "href": "/aps/2/resources/26ae28d2-0303-4189-8e1d-02796ee5de3b/users"
      }
    }
  }
]

In all later operations with the account, refer to the APS ID of the newly created PAAccount APS resource.

Note

When you create an account through API, there will not be any users in it. Follow the next section to create at least one user (admin) in the customer account.

Create Users

The Manage Users document explains various ways of creating users. To allow users to create their passwords themselves, let us first create a customer admin (staff member) and then reset the password in the newly created user configuration.

Note

To manage users as explained in this section, an external system must be granted the right to call custom operations with the POST method on the http://parallels.com/aps/types/pa/service-user APS type for service users and http://parallels.com/aps/types/pa/admin-user APS type for admins.

Create Staff Member

To create an admin user from the PAAdminUser APS type bound to the recently created customer, in the POST request specify the APS ID of the respective PAAccount APS resource followed by the users link as in the following example:

POST /aps/2/resources/26ae28d2-0303-4189-8e1d-02796ee5de3b/users

{
   "aps": {
      "type": "http://parallels.com/aps/types/pa/admin-user/1.2"
   },
   "isAccountAdmin": true,
   "login": "annp1@aps.test",
   "password": "p@$$w0rd",
   "email": "ann.peterson@mailinator.com",
   "givenName": "Ann",
   "familyName": "Peterson",
   "fullName": "Ann Peterson",
   "telVoice": "1(888)1234567",
   "addressPostal": {
      "streetAddress":"11, ISVone",
      "locality":"Herndon",
      "region":"VA",
      "countryName":"us",
      "postalCode":"12345"
   }
}

The response will look like the example below:

HTTP/1.1 200 OK

{
  "aps": {
    "type": "http://parallels.com/aps/types/pa/admin-user/1.2",
    "id": "cea81f53-30e3-4d60-89bf-165bcfd45a95",
    "status": "aps:ready",
    "revision": 4,
    "modified": "2019-03-15T14:37:28Z",
    "package": {
      "id": "a4487539-725d-4259-9845-ef059fafed5b",
      "href": "/aps/2/packages/a4487539-725d-4259-9845-ef059fafed5b"
    }
  },
  "addressPostal": {
    "countryName": "us",
    "locality": "Herndon",
    "postalCode": "12345",
    "region": "VA",
    "streetAddress": "11, ISVone"
  },
  "disabled": false,
  "displayName": "Ann Peterson",
  "email": "ann.peterson@mailinator.com",
  "familyName": "Peterson",
  "fullName": "Ann Peterson",
  "givenName": "Ann",
  "isAccountAdmin": true,
  "locale": "en_US",
  "locked": false,
  "login": "annp1@aps.test",
  "memberId": 1000003,
  "servicesMode": "NONE",
  "telVoice": "1(888)1234567",
  "userId": 9,
  "organization": {
    "aps": {
      "link": "strong",
      "href": "/aps/2/resources/26ae28d2-0303-4189-8e1d-02796ee5de3b",
      "id": "26ae28d2-0303-4189-8e1d-02796ee5de3b"
    }
  },
  "services": {
    "aps": {
      "link": "collection",
      "href": "/aps/2/resources/cea81f53-30e3-4d60-89bf-165bcfd45a95/services"
    }
  }
}

Reset User Password

Reset the user’s password by calling the resetPassword custom operation that follows the user APS ID in the request URL:

POST /aps/2/resources/cea81f53-30e3-4d60-89bf-165bcfd45a95/resetPassword

The response must contain the “200 OK” return code without body.

The platform makes the user inactive and sends an invitation to the user email address with a link to the user panel, for example:

Dear Ann Peterson,

A request to reset the password for your user annp1@aps.test on the North-West Distributor portal has been received.
To set up your new password, use the following link:
https://aps-test-provider.example/cp/recover/?secret=853ho4RRbPD6aYe98I6YE6Ds&login=annp1%40aps.test

The link will expire in 48 hours and can be used only once.

If you did not request a password reset, please ignore this message.

Sincerely,
North-West Distributor Team

On receiving that invitation, the user will be able to set a password which will activate the user resource in the platform.

Send Invitation to Inactive Users

If it is necessary to resend an invitation to a user, call the invite custom operation (specify the user APS ID in the request URL):

POST /aps/2/resources/cea81f53-30e3-4d60-89bf-165bcfd45a95/invite

In response, the platform must return the “200 OK” code without body.

Activate Users

Similarly, the external system can activate a user by calling the activate operation:

POST /aps/2/resources/cea81f53-30e3-4d60-89bf-165bcfd45a95/activate

In response, the platform must return the “200 OK” code without body.

Identify Payment Methods

The customer admin must add its payment methods, for example, a bank card, by logging in the platform user panel and configuring the customer profile there. After that, the reseller’s external system can use those methods for order creation operations.

Note

To use the operation described here, the external system must be granted the GET method on the http://www.odin.com/billing/payment-method-management APS type.

GET /aps/2/services/payment-method-manager/paymentMethods?accountId=26ae28d2-0303-4189-8e1d-02796ee5de3b

The response will contain a list of methods like those in the following example:

HTTP/1.1 200 OK

[
  {
    "id": 12,
    "paymentSystemId": "Visa",
    "paymentSystem": "Visa",
    "ownerAccountId": "26ae28d2-0303-4189-8e1d-02796ee5de3b",
    "number": "****1111",
    "name": "Visa ****1111",
    "type": "CREDIT_CARD",
    "perCustomer": true,
    "status": "ACTIVE",
    "ratified": "NOT_REQUIRED",
    "defaultMethod": true
  },
  {
    "id": 0,
    "paymentSystemId": "Check/Cash",
    "paymentSystem": "Check/Cash",
    "ownerAccountId": null,
    "number": null,
    "name": "Check/Cash",
    "type": "MANUAL",
    "perCustomer": false,
    "status": "ACTIVE",
    "ratified": "NOT_REQUIRED",
    "defaultMethod": false
  },
  {
    "id": 3,
    "paymentSystemId": "Demo.Redirect",
    "paymentSystem": "Demo Payment Gateway",
    "ownerAccountId": null,
    "number": null,
    "name": "Demo Payment Gateway",
    "type": "EXTERNAL",
    "perCustomer": false,
    "status": "ACTIVE",
    "ratified": "NOT_REQUIRED",
    "defaultMethod": false
  }
]

Order Products for Customers

The sequence of the operations in this section shows how first, the reseller can estimate a sales order that will subscribe a customer to a service plan, then estimate its own costs for that sales operation, and finally place a sales order to subscribe the customer to the service plan.

Note

To manage orders as explained below, an external system must be granted the right to call custom operations exposed by the http://www.odin.com/billing/order-management APS type with both GET and POST methods.

In the following three POST requests exposed by the OrderManagementApplication APS type, the body is absolutely the same, and only the URLs are different. An order can contain requests for many service plans at once, but for simplicity, we will estimate and order only one subscription for a service plan in this example.

Estimate Sales Orders

Call the estimateOrder custom operation to estimate a sales order as in the following example:

POST /aps/2/services/order-manager/orders/estimate

{
   "type": "SALES",
   "accountId": "26ae28d2-0303-4189-8e1d-02796ee5de3b",
   "paymentMethodId": "12",
   "products": [
      {
         "planId": "51615892-655d-409d-a922-4423a8188b2e",
         "period": {
            "unit": "MONTHS",
            "duration": 1
         }
      }
   ],
   "resources": [
      {
         "resourceId": "098a7165-8666-4f8d-8037-e34665e664e4",
         "amount": 2
      }
   ]
}

The above request estimates a one-month subscription to the service plan identified by its APS ID. The requested amount (2) of the specified resource consists of the included value (in our sample plan, it is 1) and the additional amount (also 1). So, the request estimates the additional amount of the resource identified by its APS ID.

The response contains the order structure estimation including the total price followed by the details of the price, discounts, and taxes:

HTTP/1.1 200 OK

{
  "total": {
    "value": "7.31",
    "code": "USD"
  },
  "subTotal": {
    "value": "6.52",
    "code": "USD"
  },
  "taxTotal": {
    "value": "0.79",
    "code": "USD"
  },
  "exclusiveTaxTotal": {
    "value": "0.79",
    "code": "USD"
  },
  "details": [
    {
      "type": "PLAN_SETUP",
      "planId": "51615892-655d-409d-a922-4423a8188b2e",
      "period": {
        "unit": "MONTHS",
        "duration": 1
      },
      "description": "User Management Demo Setup",
      "quantity": "1.0",
      "lowerBound": "0.0",
      "unitOfMeasure": "item",
      "unitPrice": {
        "value": "2.0",
        "code": "USD"
      },
      "extendedPrice": {
        "value": "1.8",
        "code": "USD"
      },
      "discount": {
        "type": "PERCENT",
        "value": "10.0",
        "amount": "0.2"
      },
      "taxAmount": {
        "value": "0.22",
        "code": "USD"
      },
      "exclusiveTaxAmount": {
        "value": "0.22",
        "code": "USD"
      }
    },
    {
      "type": "PLAN_RECURRING",
      "planId": "51615892-655d-409d-a922-4423a8188b2e",
      "period": {
        "unit": "MONTHS",
        "duration": 1
      },
      "duration": {
        "unit": "MONTHS",
        "duration": "1.0"
      },
      "description": "User Management Demo Recurring",
      "quantity": "1.0",
      "lowerBound": "0.0",
      "unitOfMeasure": "item",
      "unitPrice": {
        "value": "4.25",
        "code": "USD"
      },
      "extendedPrice": {
        "value": "3.82",
        "code": "USD"
      },
      "discount": {
        "type": "PERCENT",
        "value": "10.0",
        "amount": "0.43"
      },
      "taxAmount": {
        "value": "0.46",
        "code": "USD"
      },
      "exclusiveTaxAmount": {
        "value": "0.46",
        "code": "USD"
      }
    },
    {
      "type": "RESOURCE_RECURRING",
      "planId": "51615892-655d-409d-a922-4423a8188b2e",
      "period": {
        "unit": "MONTHS",
        "duration": 1
      },
      "resourceId": "098a7165-8666-4f8d-8037-e34665e664e4",
      "duration": {
        "unit": "MONTHS",
        "duration": "1.0"
      },
      "description": "User Management Demo - VPS Mainstream Profile Recurring",
      "quantity": "1.0",
      "lowerBound": "0.0",
      "unitOfMeasure": "unit",
      "unitPrice": {
        "value": "1.0",
        "code": "USD"
      },
      "extendedPrice": {
        "value": "0.9",
        "code": "USD"
      },
      "discount": {
        "type": "PERCENT",
        "value": "10.0",
        "amount": "0.1"
      },
      "taxAmount": {
        "value": "0.11",
        "code": "USD"
      },
      "exclusiveTaxAmount": {
        "value": "0.11",
        "code": "USD"
      }
    }
  ]
}

Estimate Sales Order Cost

The external system can estimate the cost of that sales operation for the reseller, which means how much the reseller must pay to the provider or to the higher-level reseller. For this purpose, call the estimateCosts operation as in the following example:

POST /aps/2/services/order-manager/orders/estimateCosts

{
   "type": "SALES",
   "accountId": "26ae28d2-0303-4189-8e1d-02796ee5de3b",
   "paymentMethodId": "12",
   "products": [
      {
         "planId": "51615892-655d-409d-a922-4423a8188b2e",
         "period": {
            "unit": "MONTHS",
            "duration": 1
         }
      }
   ],
   "resources": [
      {
         "resourceId": "098a7165-8666-4f8d-8037-e34665e664e4",
         "amount": 2
      }
   ]
}

In response, the platform returns the same structure as in the previous request, but this time, the price, discount and tax components estimate the cost for the reseller:

HTTP/1.1 200 OK

{
  "total": {
    "value": "6.26",
    "code": "USD"
  },
  "subTotal": {
    "value": "5.44",
    "code": "USD"
  },
  "taxTotal": {
    "value": "0.82",
    "code": "USD"
  },
  "exclusiveTaxTotal": {
    "value": "0.82",
    "code": "USD"
  },
  "details": [
    {
      "type": "PLAN_SETUP",
      "planId": "51615892-655d-409d-a922-4423a8188b2e",
      "period": {
        "unit": "MONTHS",
        "duration": 1
      },
      "description": "User Management Demo Setup",
      "quantity": "1.0",
      "lowerBound": "0.0",
      "unitOfMeasure": "item",
      "unitPrice": {
        "value": "2.0",
        "code": "USD"
      },
      "extendedPrice": {
        "value": "1.5",
        "code": "USD"
      },
      "discount": {
        "type": "PERCENT",
        "value": "25.0",
        "amount": "0.5"
      },
      "taxAmount": {
        "value": "0.23",
        "code": "USD"
      },
      "exclusiveTaxAmount": {
        "value": "0.23",
        "code": "USD"
      }
    },
    {
      "type": "PLAN_RECURRING",
      "planId": "51615892-655d-409d-a922-4423a8188b2e",
      "period": {
        "unit": "MONTHS",
        "duration": 1
      },
      "duration": {
        "unit": "MONTHS",
        "duration": "1.0"
      },
      "description": "User Management Demo Recurring",
      "quantity": "1.0",
      "lowerBound": "0.0",
      "unitOfMeasure": "item",
      "unitPrice": {
        "value": "4.25",
        "code": "USD"
      },
      "extendedPrice": {
        "value": "3.19",
        "code": "USD"
      },
      "discount": {
        "type": "PERCENT",
        "value": "25.0",
        "amount": "1.06"
      },
      "taxAmount": {
        "value": "0.48",
        "code": "USD"
      },
      "exclusiveTaxAmount": {
        "value": "0.48",
        "code": "USD"
      }
    },
    {
      "type": "RESOURCE_RECURRING",
      "planId": "51615892-655d-409d-a922-4423a8188b2e",
      "period": {
        "unit": "MONTHS",
        "duration": 1
      },
      "resourceId": "098a7165-8666-4f8d-8037-e34665e664e4",
      "duration": {
        "unit": "MONTHS",
        "duration": "1.0"
      },
      "description": "User Management Demo - VPS Mainstream Profile Recurring",
      "quantity": "1.0",
      "lowerBound": "0.0",
      "unitOfMeasure": "unit",
      "unitPrice": {
        "value": "1.0",
        "code": "USD"
      },
      "extendedPrice": {
        "value": "0.75",
        "code": "USD"
      },
      "discount": {
        "type": "PERCENT",
        "value": "25.0",
        "amount": "0.25"
      },
      "taxAmount": {
        "value": "0.11",
        "code": "USD"
      },
      "exclusiveTaxAmount": {
        "value": "0.11",
        "code": "USD"
      }
    }
  ]
}

Place Sales Order

Finally, if the above-mentioned estimations satisfy the reseller’s criteria, it is safe to place a sales order as in the following example:

POST /aps/2/services/order-manager/orders

{
   "type": "SALES",
   "accountId": "26ae28d2-0303-4189-8e1d-02796ee5de3b",
   "paymentMethodId": "12",
   "products": [
      {
         "planId": "51615892-655d-409d-a922-4423a8188b2e",
         "period": {
            "unit": "MONTHS",
            "duration": 1
         }
      }
   ],
   "resources": [
      {
         "resourceId": "098a7165-8666-4f8d-8037-e34665e664e4",
         "amount": 2
      }
   ]
}

The response will show the ID of the placed sales order:

HTTP/1.1 200 OK

{
   "orderId": "387b3acc-0cf8-475f-8a3b-21813085dc89"
}

Get Orders

BSS operations in the platform are activated by various types of orders. In the previous sections, you placed a sales order to create a new subscription. To perform other operations with the existing subscription, you will find instructions on how to use other types of orders in the next document.

Get a List of Orders

To retrieve a list of orders created by the reseller, the external system must call the following custom operation:

GET /aps/2/services/order-manager/orders

The response will contain a list of orders as in the following example:

HTTP/1.1 200 OK

[
  {
    "orderId": "387b3acc-0cf8-475f-8a3b-21813085dc89",
    "internalId": 1000015,
    "orderNumber": "SO000001",
    "type": "SO",
    "total": {
      "value": "7.31",
      "code": "USD"
    },
    "taxTotal": {
      "value": "0.79",
      "code": "USD"
    },
    "exclusiveTaxTotal": {
      "value": "1.58",
      "code": "USD"
    },
    "subTotal": {
      "value": "6.52",
      "code": "USD"
    },
    "status": "IN_PROGRESS",
    "paymentStatus": "PROBLEM",
    "provisioningStatus": "NOT_STARTED",
    "ofStatus": "WP",
    "sellerId": "78ee642d-3b8a-48f1-af12-90563e38bd18",
    "buyerId": "26ae28d2-0303-4189-8e1d-02796ee5de3b",
    "orderDate": "2019-03-15",
    "expirationDate": "2019-04-14",
    "creationTime": "2019-03-15T15:40:32Z",
    "orderAttributes": [],
    "endCustomerAttributes": [],
    "endCustomerName": "1st APS inc",
    "endCustomerType": "CUSTOMER"
  },
  {
    "orderId": "09570817-2584-4838-a6a8-79db5c71eb8f",
    "internalId": 1000016,
    "orderNumber": "PO000001",
    "type": "PO",
    "total": {
      "value": "0.0",
      "code": "USD"
    },
    "taxTotal": {
      "value": "0.0",
      "code": "USD"
    },
    "exclusiveTaxTotal": {
      "value": "0.0",
      "code": "USD"
    },
    "subTotal": {
      "value": "0.0",
      "code": "USD"
    },
    "status": "IN_PROGRESS",
    "paymentStatus": "FINISHED",
    "provisioningStatus": "NOT_STARTED",
    "ofStatus": "WP",
    "sellerId": "78ee642d-3b8a-48f1-af12-90563e38bd18",
    "buyerId": "26ae28d2-0303-4189-8e1d-02796ee5de3b",
    "orderDate": "2019-03-15",
    "expirationDate": "2019-04-14",
    "creationTime": "2019-03-15T15:40:32Z",
    "orderAttributes": [],
    "endCustomerAttributes": [],
    "endCustomerName": "1st APS inc",
    "endCustomerType": "CUSTOMER"
  }
]

The sample response contains all sales orders created by the reseller and for each sales order a payment order that the platform created in accordance with its own rules.

Get Order Details

To get detailed representation of an order, the external system must specify that order UUID in the following request:

GET /aps/2/services/order-manager/orders/387b3acc-0cf8-475f-8a3b-21813085dc89

The response will look as follows:

HTTP/1.1 200 OK

{
  "orderId": "387b3acc-0cf8-475f-8a3b-21813085dc89",
  "internalId": 1000015,
  "orderNumber": "SO000001",
  "type": "SO",
  "total": {
    "value": "7.31",
    "code": "USD"
  },
  "taxTotal": {
    "value": "0.79",
    "code": "USD"
  },
  "exclusiveTaxTotal": {
    "value": "0.79",
    "code": "USD"
  },
  "subTotal": {
    "value": "6.52",
    "code": "USD"
  },
  "status": "COMPLETED",
  "subscriptions": [
    "6b7fd35a-76db-4a9a-b162-e26991fe20b3"
  ],
  "bssSubscriptions": [
    "9a907085-58a0-41c8-88b2-f9b12feaaadb"
  ],
  "paymentStatus": "FINISHED",
  "provisioningStatus": "COMPLETED",
  "ofStatus": "CP",
  "sellerId": "78ee642d-3b8a-48f1-af12-90563e38bd18",
  "buyerId": "26ae28d2-0303-4189-8e1d-02796ee5de3b",
  "orderDate": "2019-03-15",
  "expirationDate": "2019-04-14",
  "creationTime": "2019-03-15T15:40:32Z",
  "orderAttributes": [],
  "endCustomerAttributes": [],
  "details": [
    {
      "type": "RESOURCE_RECURRING",
      "planId": "51615892-655d-409d-a922-4423a8188b2e",
      "period": {
        "unit": "MONTHS",
        "duration": 1
      },
      "resourceId": "098a7165-8666-4f8d-8037-e34665e664e4",
      "duration": {
        "unit": "MONTHS",
        "duration": "1.0"
      },
      "description": "User Management Demo - VPS Mainstream Profile Recurring",
      "quantity": "1.0",
      "lowerBound": "0.0",
      "unitOfMeasure": "unit",
      "unitPrice": {
        "value": "1.0",
        "code": "USD"
      },
      "extendedPrice": {
        "value": "0.9",
        "code": "USD"
      },
      "discount": {
        "type": "PERCENT",
        "value": "10.0",
        "amount": "0.1"
      },
      "taxAmount": {
        "value": "0.11",
        "code": "USD"
      },
      "exclusiveTaxAmount": {
        "value": "0.11",
        "code": "USD"
      },
      "resellerCost": {
        "value": "0.86",
        "code": "USD"
      }
    },
    {
      "type": "PLAN_RECURRING",
      "planId": "51615892-655d-409d-a922-4423a8188b2e",
      "period": {
        "unit": "MONTHS",
        "duration": 1
      },
      "duration": {
        "unit": "MONTHS",
        "duration": "1.0"
      },
      "description": "User Management Demo Recurring",
      "quantity": "1.0",
      "unitOfMeasure": "item",
      "unitPrice": {
        "value": "4.25",
        "code": "USD"
      },
      "extendedPrice": {
        "value": "3.82",
        "code": "USD"
      },
      "discount": {
        "type": "PERCENT",
        "value": "10.0",
        "amount": "0.43"
      },
      "taxAmount": {
        "value": "0.46",
        "code": "USD"
      },
      "exclusiveTaxAmount": {
        "value": "0.46",
        "code": "USD"
      },
      "resellerCost": {
        "value": "3.67",
        "code": "USD"
      }
    },
    {
      "type": "PLAN_SETUP",
      "planId": "51615892-655d-409d-a922-4423a8188b2e",
      "period": {
        "unit": "MONTHS",
        "duration": 1
      },
      "description": "User Management Demo Setup",
      "quantity": "1.0",
      "unitOfMeasure": "item",
      "unitPrice": {
        "value": "2.0",
        "code": "USD"
      },
      "extendedPrice": {
        "value": "1.8",
        "code": "USD"
      },
      "discount": {
        "type": "PERCENT",
        "value": "10.0",
        "amount": "0.2"
      },
      "taxAmount": {
        "value": "0.22",
        "code": "USD"
      },
      "exclusiveTaxAmount": {
        "value": "0.22",
        "code": "USD"
      },
      "resellerCost": {
        "value": "1.73",
        "code": "USD"
      }
    }
  ],
  "endCustomerName": "1st APS inc",
  "endCustomerType": "CUSTOMER",
  "resellerCosts": {
    "value": "6.26",
    "code": "USD"
  }
}

Conclusion

This document walked you through the standard process of creating a customer and subscribing that customer to a service plan. Now, the reseller has a subscriber with a subscription that must be managed in accordance with the typical subscription lifecycle as explained in the next document.