Account Pricing REST API
Resource URL Summary
Retrieve the Account specific Pricing
GET /seiapi/v3/trans/Account/${AccountNum}/Pricing
Retrieve the Account specific Pricing for a Product
GET /seiapi/v3/trans/Account/${AccountNum}/Pricing/${ProductNum}
Insert or Update Account specific Pricing
PUT /seiapi/v3/trans/Account/${AccountNum}/Pricing
Delete any Account specific Pricing
DELETE /seiapi/v3/trans/Account/${AccountNum}/Pricing
API Specific Parameters
Parameter | Description |
---|---|
| Identifies the Account Location Related Objects Account Object |
${ProductNum} | Identifies the product number |
HTTP Headers
This API uses the default ServiceMobility HTTP Headers.
API Specifics
Retrieve the Account specific Pricing
This REST API will return the Pricing for the Account with the specified ID. The Account with the specified ID must already exist in the system.
URL
GET /seiapi/v3/trans/Account/${AccountNum}/Pricing
HTTP Request Body
This request does not require a request body.
HTTP Response
On success, an HTTP response code of 200 will be returned, and the response body will contain a Pricing Object.
If the account does not have any specific pricing defined an HTTP response code of 404 (not found) will be returned.
Retrieve the Account specific Pricing for a Product
This REST API will return the Pricing for the Product with the specified ID, for the Account with the specified ID. The Product with the specified ID and the Account with the specified ID must already exist in the system.
URL
GET /seiapi/v3/trans/Account/${AccountNum}/Pricing/${ProductNum}
HTTP Request Body
This request does not require a request body.
HTTP Response
On success, an HTTP status code of 200 will be returned, and the response body will contain a valid object with a price.
If the account does not have any specific pricing defined an HTTP response code of 404 (not found) will be returned.
{ "Price" : 0.0 }
Insert or Update Account specific Pricing
A PUT request is always an update, not a full replace. During a PUT request, new items will be added to the account pricing which existing items in the PUT request will be updated with the new price. If a item, in the PUT request, has the Delete property set to true, then that item will be removed from the account pricing.
PUT /seiapi/v3/trans/Account/${AccountNum}/Pricing
HTTP Request
The request body contains a single Pricing Object.
HTTP Response
On success the HTTP response code will be 200.
Delete any Account specific Pricing
This REST API will delete the Pricing for the Account with the specified ID from the system. The Account with the specified ID must already exist in the system.
URL
DELETE /seiapi/v3/trans/Account/${AccountNum}/Pricing
HTTP Request Body
This request does not require a request body.
HTTP Response
On success the HTTP response code will be 200.
If you try and delete account specific pricing when there currently is not any setup then an HTTP response code of 404 (not found) will be returned.
Examples
The following examples assume the specified product numbers are valid and already exist in the main product catalog.
Example 1: Add Account Pricing
Initial Account Pricing
{ }
PUT Request
{ "900" : { "Price" : 19.99 }, "901" : { "Price" : 29.99 }, "902" : { "Price" : 39.99 } }
Result
{ "900" : { "Price" : 19.99 }, "901" : { "Price" : 29.99 }, "902" : { "Price" : 39.99 } }
Example 2: Update Account Pricing
Initial Account Pricing
{ "900" : { "Price" : 19.99 }, "901" : { "Price" : 29.99 }, "902" : { "Price" : 39.99 } }
PUT Request
{ "900" : { "Price" : 9.99 }, "901" : { "Price" : 29.99, "Delete" : true } }
Result
{ "900" : { "Price" : 9.99 }, "902" : { "Price" : 39.99 } }