REST Methods

Overview

The REST API allows you to bypass the need to download a WSDL and access the resources and methods available in the system directly. This approach uses the standard web methods such as GET, PUT, and POST in order to retrieve, create, update, and delete records from the different BillingPlatform entities and objects as needed.

In general, the resources are accessible using the following format:

https://BillingPlatform domain/org/rest/2.0/resource

Where:

  • BillingPlatform domain - URL of the org such as my.billingplatform.com or sandbox.billingplatform.com.
  • org - Your org name.
  • resource - REST resource such as the entity name or LOGIN/LOGOUT.

Message bodies for single record manipulation:

Message bodies where needed are written in JSON format, such as the example message body for a POST (Create in CRUD/SOAP terms) function call against the ACCOUNT entity:

{
	"brmObjects":{
		"Name":"My New Rest Account",
		"Status":"ACTIVE",
		"AccountType":"Required"
	}
}

Message bodies for multiple records manipulation:

The majority of the BillingPlatform API functions (create, upsert, update, delete, etc.) allow you to manipulate multiple records in one API call, typically by passing multiple records of type brmObject. This is done by containing the collection of brmObjects into an array. For example, if we bulk up the web service call above to create more than one Account record, the following JSON message is used:

{
	"brmObjects":[
		{
			"Name":"My New REST Account 01",
			"Status":"ACTIVE",
			"AccountType":"Required"
		},
		{
			"Name":"My New REST Account 02",
			"Status":"ACTIVE",
			"AccountType":"Required"
		},
		{
			"Name":"My New REST Account 03",
			"Status":"ACTIVE",
			"AccountType":"Required"
		},
		{
			"Name":"My New REST Account 04",
			"Status":"ACTIVE",
			"AccountType":"Required"
		}
	]
}

This will create multiple Account records using only one API function call.

Methods

LOGIN

This request is necessary in order to obtain a session identification number from BillingPlatform that will be required for all REST requests. Login is a POST request that requires no headers and the login parameter is required in the URL. The session is configured to time out after 2 hours of inactivity.

Sample REST Login Request:

URL: https://my.billingplatform.com/myorg/rest/2.0/login

Method: POST

{
	"username":"my.username",
	"password":"password"
}

Sample REST Login Response:

{
	"loginResponse": [
	{
		"SessionID": "qIYsMgFsRbbXRUlxaLnTFWPxbdfCiYabkmBGvzgj",
		"ErrorCode": "0",
		"ErrorText": []
	}
    ]
}

LOGOUT

The method to terminate the active web service session. When invoked, it will invalidate the session Id obtained from the login method. Logout is a POST request that requires the sessionid as part of the header. The logout parameter is required in the URL.

Sample REST Logout Request:

URL: https://my.billingplatform.com/myorg/rest/2.0/logout

Method: POST

Header Parameters
Name Value
sessionid Session ID obtained from the LOGIN method.
{}

Sample REST Logout Response:

"{}"

CREATE

The Create method is used to add records to your BillingPlatform organization. Each web service call performs object and field level validations on the data submitted within a set of "BrmObject"s before committing the data to the system.

There are certain fields, like the Id, create timestamp, etc. that are automatically populated by the platform and cannot be modified via the API.

Create is a POST request that requires the sessionid header and the Session Identification number obtained from the Login request as the value. The entity parameter is required in the URL.

Sample REST Create Request (Account Entity):

URL: https://my.billingplatform.com/myorg/rest/2.0/account

Method: POST

Header Parameters
Name Value
sessionid Session ID obtained from the LOGIN method.
{
	"brmObjects":
	{
		"Name": "My First Account",
		"AccountType":"Required",
		"Status":"ACTIVE",
		"Description":"First Test Account"
	}
}

Sample REST Create Response:

{
	"createResponse": [
	{
		"ErrorCode": "0",
		"ErrorText": " ",
		"ErrorElementField": " ",
		"Id": "27471"
	}
	]
}

UPDATE

The Update method is used to update records within your instance of BillingPlatform using the information submitted within the brmObjects included within the update request. The billing system performs validations on the data submitted within a set of brmObjects before committing changes to the data referenced by the unique "Id" included for each object in the request.

Update is a PUT request that requires the sessionid header and the Session Identification number obtained from the Login request as the value. The entity parameter is required in the URL.

Sample REST Update Request (Account Entity):

URL: https://my.billingplatform.com/myorg/rest/2.0/account

Method: PUT

Header Parameters
Name Value
sessionid Session ID obtained from the LOGIN method.
{
	"brmObjects":
	{
		"Name":  "My First Account",
		"Id": "27471"
		"Status": "DEACTIVATED"
	}
}

Sample REST Update Response:

{
	"updateResponse": [
	{
		"ErrorCode": "0",
		"ErrorText": " ",
		"ErrorElementField": " ",
		"Id": "27471"
	}
	]
}

An extra key-value combination can be added if certain fields need to be updated to null. In order to do so, the following fieldsToNull value-key needs to be added:

{
	"brmObjects":
	{
		"fieldsToNull":"SomeFieldName",
		"Id":...
	}
}

In case multiple fields need to be updated to null, the array list of values notation can be used such as the following example

{
	"brmObjects":
	{
		"fieldsToNull":[
			"SomeFieldName1",
			"SomeFieldName2",
			...
			"SomeFieldNameX"
		],
		"Id":...
	}
}

UPSERT

The Upsert method is used to create and update records within your instance of BillingPlatform using the information submitted within the brmObjects included within the update request using a record identifier other than the record ID. The billing system performs validations on the data submitted within a set of brmObjects before committing changes to the data referenced by the unique external key field included for each object in the request.

If the value of the Key exists in the billing system, the record will be updated. If not, the record is inserted. Only fields that have marked as an “External Key” or the Id field can be used in an upsert operation.

Upsert is a PATCH request that requires the sessionid header and the Session Identification number obtained from the Login request as the value. The entity parameter is required in the URL.

Sample REST Update Request (Account Entity):

URL: https://my.billingplatform.com/myorg/rest/2.0/account

Method: PATCH

Header Parameters
Name Value
sessionid Session ID obtained from the LOGIN method.
{
	"externalIDFieldName":"my_external_key",
	"brmObjects":
	{
		"Name":  "My First Account",
		"my_external_key": "unique_value_12345"
		"Status": "DEACTIVATED"
	}
}

Sample REST Upsert Response:

{
	"upsertResponse": [
	{
		"ErrorCode": "0",
		"ErrorText": " ",
		"ErrorElementField": " ",
		"Id": "27471"
	}
	]
}

An extra key-value combination can be added if certain fields need to be updated to null. In order to do so, the following fieldsToNull value-key needs to be added:

{
	"externalIDFieldName":"my_external_key",
	"brmObjects":
	{
		"fieldsToNull":"SomeFieldName",
		"my_external_key": "unique_value_12345"
		...
	}
}

In case multiple fields need to be updated to null, the array list of values notation can be used such as the following example

{
	"externalIDFieldName":"my_external_key",
	"brmObjects":
	{
		"fieldsToNull":[
			"SomeFieldName1",
			"SomeFieldName2",
			...
			"SomeFieldNameX"
		],
		"my_external_key": "unique_value_12345"
		...
	}
}

RETRIEVE

This method allows you to retrieve/search for elements in your enterprise billing system. You can specify a query condition or a list of IDs to retrieve an array of brmObjects. The Query element adheres to the ANSI SQL standards. Ex: "field_name=value", "or, and" operators as well as ">, >=" comparison operators.

Retrieve is a GET request where the query can be passed as a URL parameter by including the following string at the end:

<entity>?queryAnsiSql=<ANSI SQL query>

Sample REST Get Request (Account Entity):

URL: https://my.billingplatform.com/myorg/rest/2.0/account?queryAnsiSql=Id>=20000

Where: 

account is the entity where the records will be retrieved from.

Id>=20000 is a standard ANSI SQL query. This can be replaced by another SQL query in a manner that you would author a WHERE clause.

Method: GET

Header Parameters
Name Value
sessionid Session ID obtained from the LOGIN method.

Sample REST Get Response:

{
	"retrieveResponse": [
	{
		"Id": "20000",
		"Name": "PciptzAMie",
		"Created": "2014-11-03T18:26:11.000Z",
		"AccountTypeId": "1",
		"ParentAccountId": "1",
		"ParentAccountName": "BILLING PLATFORM",
		"Status": "ACTIVE",
		"Type": "Partner Retail"
	},
	{
		"Id": "20001",
		"Name": "bAQXftoxnU",
		"Created": "2014-11-03T18:26:11.000Z",
		"AccountTypeId": "1",
		"ParentAccountId": "1",
		"ParentAccountName": "BILLING PLATFORM",
		"Status": "ACTIVE",
		"Type": "Partner"
	}
	]
}

QUERY

Query requests will add the URL-Encoded Query Statement to the “sql” parameter like so:

https://sandbox.billingplatform.com/<yourOrg>/rest/2.0/query?sql=SELECT+Status%2C+Sum%28GrandTotalAmount%29+as+total++FROM+Invoice++WHERE+BillingProfileObj.AccountObj.Name+like+%27%25Blue%25%27+GROUP+BY+Status

Responses will be returned in JSON format.

Query Results

Query Results come in two basic types:

  1. Hierarchical List of Objects for standard queries
  2. List of Name-value pairs for Queries using aggregate functions

For more information please see the BP Query Language.

Sample REST Query Request:

https://sandbox.billingplatform.com/<yourOrg>/rest/2.0/query?sql=SELECT+Status%2C+Sum%28GrandTotalAmount%29+as+total++FROM+Invoice++WHERE+BillingProfileObj.AccountObj.Name+like+%27%25Blue%25%27+GROUP+BY+Status

Sample REST Query Response:

 {
    "queryResponse": [
        {
            "Id": null,
            "Status": "CLOSED",
            "TOTAL": "25024"
        },
        {
            "Id": null,
            "Status": "CURRENT",
            "TOTAL": "101"
        }
    ]
}

DELETE

The delete operation accepts an object type and ID and is used to purge records from the billing system. Deletion is a DELETE resource that requires the sessionid in the header. The entity for deletion is passed through the URL.

Sample REST Delete Request (Account Entity):

URL: https://my.billingplatform.com/myorg/rest/2.0/delete/account

Method: DELETE

Header Parameters
Name Value
sessionid Session ID obtained from the LOGIN method.
{
	"brmObjects":{
		"Id":"27456"
	}
}

Sample REST Delete Response:

{
	"deleteResponse": [
	{
		"ErrorCode": "0",
		"ErrorText": " ",
		"Id": "27456",
		"Success": "true"
	}
	]
}

An optional tag is EmptyRecycleBin where it can indicate if the record will land in the Recycle Bin after deletion or if it will be permanently deleted immediately. However, this is dependent on the entity configuration. If the Recycle Bin attribute is disabled, all records are permanently deleted automatically regardless if this tag is included or not in the JSON request.

Value Definition
Value Definition
0 Record ends up in the Recycle Bin assuming that is enabled in the entity's configuration. This is also the default behavior if the tag is omitted.
1 Record is permanently deleted and will not end up in the Recycle Bin.

Multiple records can be deleted by passing an array of brmObjects. For example:

{
	"brmObjects":[
		{
			"Id":"27456",
			"EmptyRecycleBin":"0"
		},
		{
			"Id":"27457",
			"EmptyRecycleBin":"0"
		},
		{
			"Id":"27458",
			"EmptyRecycleBin":"1"
		}
	]
}

UNDELETE

The Undelete method is used to restore records within your instance of the enterprise billing system that have been sent to the recycle bin.

Undelete is an UNDELETE resource that requires the sessionid in the header. The entity for update is passed through the URL.

Sample REST Undelete Request (Account Entity):

URL: https://my.billingplatform.com/myorg/rest/2.0/undelete/account

Method: DELETE

Header Parameters
Name Value
sessionid Session ID obtained from the LOGIN method.
{
	"Id":"27417"
}

Sample REST Undelete Response:

{
	"deleteResponse": [
	{
		"ErrorCode": "0",
		"ErrorText": " ",
		"Id": "27417",
		"Success": "true"
	}
	]
}

FILE UPLOAD

BillingPlatform allows you to upload files to entities. You may use the file upload method to upload files that have been Base64 encoded to a field on any object of type "FILE".

File Upload is a POST request that requires the sessionid in the header. The entity, record Id and field where the file will be uploaded to is passed through the URL.

Sample REST File Upload Request (Account Entity):

URL: https://my.billingplatform.com/myorg/rest/2.0/files/account/27471/DOCUMENT

Where:

  • account - Entity name where the file will be coming from.
  • 27471 - Record ID that contains the file that you need.
  • DOCUMENT - Field that houses the file. In this example, the DOCUMENT field contains the file. This can be different depending on the entity configuration.

Method: POST

Header Parameters
Name Value
sessionid Session ID obtained from the LOGIN method.
{
	"FileName":"Document.txt",
	"Data":"dGhpcyBpcyBhIHRlc3QgdGhpcyBpcyBhIHRlc3QgdGhpcyBpcyBhIHRlc3QgdGhpcyBpcyBhIHRlc3QgdGhpcyBpcyBhIHRlc3QgdGhpcyBpcyBhIHRlc3QgdGhpcyBpcyBhIHRlc3QgdGhpcyBpcyBhIHRlc3QgdGhpcyBpcyBhIHRlc3QgdGhpcyBpcyBhIHRlc3QgdGhpcyBpcyBhIHRlc3QgdGhpcyBpcyBhIHRlc3QgdGhpcyBpcyBhIHRlc3QgdGhpcyBpcyBhIHRlc3QgdGhpcyBpcyBhIHRlc3QgdGhpcyBpcyBhIHRlc3QgdGhpcyBpcyBhIHRlc3QgdGhpcyBpcyBhIHRlc3QgdGhpcyBpcyBhIHRlc3QgdGhpcyBpcyBhIHRlc3QgdGhpcyBpcyBhIHRlc3QgdGhpcyBpcyBhIHRlc3QgdGhpcyBpcyBhIHRlc3QgdGhpcyBpcyBhIHRlc3QgdGhpcyBpcyBhIHRlc3QgdGhpcyBpcyBhIHRlc3QgdGhpcyBpcyBhIHRlc3QgdGhpcyBpcyBhIHRlc3QgdGhpcyBpcyBhIHRlc3QgdGhpcyBpcyBhIHRlc3QgdGhpcyBpcyBhIHRlc3QgdGhpcyBpcyBhIHRlc3QgdGhpcyBpcyBhIHRlc3QgdGhpcyBpcyBhIHRlc3QgdGhpcyBpcyBhIHRlc3QgdGhpcyBpcyBhIHRlc3QgdGhpcyBpcyBhIHRlc3QgdGhpcyBpcyBhIHRlc3QgdGhpcyBpcyBhIHRlc3QgdGhpcyBpcyBhIHRlc3QgdGhpcyBpcyBhIHRlc3QgdGhpcyBpcyBhIHRlc3QgdGhpcyBpcyBhIHRlc3QgdGhpcyBpcyBhIHRlc3QgdGhpcyB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": " ",
		"ErrorElementField": " "
	}
	]
}

FILE DOWNLOAD

You can download files using the file download method. Files downloaded will be Base64 encoded and you must use a Base64 decoder in order to convert the downloaded file.

File Download is a GET request that requires the sessionid in the header. The entity, record Id and field name where the file will be downloaded from is passed through the URL.

Sample REST File Download Request (Account Entity):

URL: https://my.billingplatform.com/myorg/rest/2.0/files/account/27471/DOCUMENT

Where:

  • account - Entity name where the file will be coming from.
  • 27471 - Record ID that contains the file that you need.
  • DOCUMENT - Field that houses the file. In this example, the DOCUMENT field contains the file. This can be different depending on the entity configuration.

 

Method: GET

Header Parameters
Name Value
sessionid Session ID obtained from the LOGIN method.

Sample REST File Download Response:

{
	"file_downloadResponse": [
	{
		"ErrorCode": "0",
		"ErrorText": " ",
		"ErrorElementField": " ",
		"Data": "dGhpcyBpcyBhIHRlc3QgdGhpcyBpcyBhIHRlc3QgdGhpcyBpcyBhIHRlc3QgdGhp\ncyBpcyBhIHRlc3QgdGhpcyBpcyBhIHRlc3QgdGhpcyBpcyBhIHRlc3QgdGhpcyBp\ncyBhIHRlc3QgdGhpcyBpcyBhIHRlc3QgdGhpcyBpcyBhIHRlc3QgdGhpcyBpcyBh\nIHRlc3QgdGhpcyBpcyBhIHRlc3QgdGhpcyBpcyBhIHRlc3QgdGhpcyBpcyBhIHRl\nc3QgdGhpcyBpcyBhIHRlc3QgdGhpcyBpcyBhIHRlc3QgdGhpcyBpcyBhIHRlc3Qg\ndGhpcyBpcyBhIHRlc3QgdGhpcyBpcyBhIHRlc3QgdGhpcyBpcyBhIHRlc3QgdGhp\ncyBpcyBhIHRlc3QgdGhpcyBpcyBhIHRlc3QgdGhpcyBpcyBhIHRlc3QgdGhpcyBp\ncyBhIHRlc3QgdGhpcyBpcyBhIHRlc3QgdGhpcyBpcyBhIHRlc3QgdGhpcyBpcyBh\nIHRlc3QgdGhpcyBpcyBhIHRlc3QgdGhpcyBpcyBhIHRlc3QgdGhpcyBpcyBhIHRl\nc3QgdGhpcyBpcyBhIHRlc3Q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BhIHRlc3Qg\ndGhpcyBpcyBhIHRlc3QgdGhpcyBpcyBhIHRlc3QgdGhpcyBpcyBhIHRlc3QgdGhp\ncyBpcyBhIHRlc3QgdGhpcyBpcyBhIHRlc3QgdGhpcyBpcyBhIHRlc3QgdGhpcyBp\ncyBhIHRlc3QgdGhpcyBpcyBhIHRlc3QgdGhpcyBpcyBhIHRlc3QgdGhpcyBpcyBh\nIHRlc3QgdGhpcyBpcyBhIHRlc3QgdGhpcyBpcyBhIHRlc3QgdGhpcyBpcyBhIHRl\n"
	}
	]
}

PUTTING IT ALL TOGETHER

Now that we have an understanding of the REST API methods and a general sense of how they apply to the Account object listed previously, let us put this knowledge to use in a more practical and comprehensive setting. In the next section we will look at how to leverage the REST API to do the following:

  1. Create an Account
  2. Add a billing Profile to the Account
  3. Add an Account Contract
  4. Add a Contract Rate
  5. Add an Account Product
  6. Add an Account Package
  7. Retrieve an Account Product
  8. Update the Rate On the Account Product
  9. Retrieve a Contract Rate
  10. Delete a Contract Rate

Create an Account

POST call:
URL: https://sandbox.billingplatform.com/myorg/rest/2.0/account

{
	"brmObjects":
	{
		"Name":"Account001",
		"AccountType":"Required",
		"Status":"ACTIVE",
		"Description":"My Account"
	}
}

Add a billing Profile to the Account

POST call:
URL: https://sandbox.billingplatform.com/myorg/rest/2.0/BILLING_PROFILE

{
	"brmObjects":
	{
		"AccountId":"27471",
		"BillingCycle":"MONTHLY",
		"BillingCloseDate":"31",
		"PaymentTermDays":"30",
		"MonthlyBillingDate":"1",
		"InvoiceTemplateId":"63",
		"BillingMethod":"MAIL",
		"BillTo":"John Doe",
		"Address1":"742 Evergreen Terrace",
		"Country":"USA",
		"TimeZoneId":"1",
		"Email":"johndoe@companymail.com",
		"CurrencyCode":"USD"
	}
}

Add an Account Contract

POST call:
URL: https://sandbox.billingplatform.com/myorg/rest/2.0/CONTRACT

{
	"brmObjects":
	{
		"AccountId": "27465",
		"ContractNumber": "REST TEST002",
		"ContractStatus": "ACTIVE",
		"StartDate":"20150505",
		"OnEndDate":"Renew",
		"EndDate":"20160606",
		"RateClassId":"10762"
	}
}

Add a Contract Rate

POST call:
URL: https://sandbox.billingplatform.com/myorg/rest/2.0/CONTRACT_RATE

{
	"brmObjects":
	{
		"ContractId": "412",
		"StartDate":"20150505",
		"EndDate":"20150606",
		"ProductId":"12670",
	}
}

Add an Account Product

POST call:
URL: https://sandbox.billingplatform.com/myorg/rest/2.0/ACCOUNT_PRODUCT

{
	"brmObjects":
	{
		"AccountId": "27465",
		"StartDate":"20150505",
		"EndDate":"20150606",
		"ProductId":"12670",
		"RatingMethodId":"2861",
		"Quantity":"1"
	}
}

Add an Account Package

POST call:
URL: https://sandbox.billingplatform.com/myorg/rest/2.0/ACCOUNT_PACKAGE

{
	"brmObjects":
	{
		"AccountId": "27465",
		"StartDate":"20150505",
		"EndDate":"20150606",
		"PackageId":"152"
	}
}

Retrieve an Account Product

GET call:
URL: https://sandbox.billingplatform.com/myorg/rest/2.0/ACCOUNT_PRODUCT/4652

Update the Rate On the Account Product

PUT call:
URL: https://sandbox.billingplatform.com/myorg/rest/2.0/PRICING

{
	"brmObjects":
	{
		"Id":"813877",
		"Rate":"99",
		"CurrencyCode":"USD"
	}
}

Retrieve a Contract Rate

GET call:
URL: https://sandbox.billingplatform.com/myorg/rest/2.0/CONTRACT_RATE/4652

Delete a Contract Rate

DELETE call:
URL: https://sandbox.billingplatform.com/myorg/rest/2.0/delete/CONTRACT_RATE

{
	"brmObjects":{
		"Id":"2215"
	}
}

Error Codes

Error codes when working with REST API are handled using HTTP status codes. Here is a table of the error codes and their definitions:

Error Code Definition
Status 200 OK - REST API operation was successful.
Status 401 Unauthorized - No session ID was provided. To address this, update the HTTP request header to include a valid session ID.
Status 400 Bad Request - The request is missing one or more required parameters or contains invalid characters. Correct the request and re-submit the request.
Status 404 This indicates an either an incorrect URL was used for the HTTP request or the request, typically a GET (RETRIEVE in SOAP), did not return any rows that match the query/filters.
Status 429 Too Many Requests - Too many requests were made within a certain amount of time. Try to space out the API requests to avoid this error.
Status 500

(Internal Error) - The generic error code. Details can be obtained from the error response message which follows the following format:

{
	"errors": [{
		"error_text": "Invalid queryAnsiSql format",
		"error_code": "INVALID_GET_REQUEST_QUERY"
	}]
}


Where:

  • error_text - User friendly description of the error.
  • error_code - Internal ID of the error encountered.

Related Topics

Have more questions? Submit a request

Comments

Powered by Zendesk