Create Sales Tracking Code

This method allows the creation of an additional Sales Tracking Code belonging to the selected type.

Parameter List

PropertyTypeDescriptionRequired
typeString

The category name this code falls under. Fusebill supports 5 distinct categories. By default the names are "Sales Tracking Code 1", "Sales Tracking Code 2",..."Sales Tracking Code 5" but they can be customized.

If you rename your Sales Tracking code, those names or the default names can be used.

Yes
codeString

The code from the category pick-list. **er List"
}
[/block]

[block:**

Yes
nameString

The name associated with the code **ameter List"
}
[/block]

[bl**

Yes
descriptionString

A description of the pick-list value **ter List"
}
[/block]

[block:**

Optional
emailString

An email associated with the sales tracking code. **/block]

[block:parameters]
**

Optional
Examples
curl –X POST https://secure.fusebill.com/v1/salesTrackingCodes \ 
  -H "Content-Type: application/json" \ 
  -H "Authorization: Basic {APIKey}" \ 
  -d "{type:'Sales Agent',code:'Smith',name:'Agent Smith'}"
//Json data 
string jsonData = "{'type':'Sales Agent','code':'Smith','name':'Agent Smith'}"; 
//Setup API key 
string apiKey = "{APIKey}"; 
//Configure URI 
WebRequest request = WebRequest.Create("HTTPS://secure.fusebill.com/v1/salesTrackingCodes"); 
//Add Content type 
request.ContentType = "application/json"; 
//Add Api key authorization 
request.Headers.Add(HttpRequestHeader.Authorization, "Basic "+apiKey); 
//Set request method 
request.Method = "POST"; 
//Add the json data to request 
using (var streamWriter = new StreamWriter(request.GetRequestStream())) 
{ 
  streamWriter.Write(jsonData); 
  streamWriter.Flush(); 
  streamWriter.Close(); 
} 
//Perform the request 
var httpResponse = (HttpWebResponse)request.GetResponse(); 
//Record the response from our request 
var result = ""; 
using (var streamReader = new StreamReader(httpResponse.GetResponseStream())) 
{ 
  result = streamReader.ReadToEnd(); 
}
#Import library JSON 
import json 
#Import library Requests 
import requests 
#Pass in a dictionary to the Headers parameter 
headers = {'Authorization' : 'Basic {APIKey}', 'Content-Type' : 'application/json'} 
#Pass in a dict to the Payload parameter 
payload ={'type':'Sales Agent','code':'Smith','name':'Agent Smith'}
#Pass in your URI, Payload and Headers 
r = requests.post('https://secure.fusebill.com/v1/SalesTrackingCodes', data=json.dumps(payload), headers=headers) 
print(r.content)
{
    "type":"Sales Tracking Code 1",
    "code":"Foxtrot",
    "name":"Sample name",
    "description":"some descriptive text",
    "email":"[email protected]"
}
Response
{
    "type": "Sales Tracking Code 2",
    "code": "123", 
    "name": "Bob Smith",
    "description": "sample string sample sting",
    "email": "[email protected]",
    "status": "Active",
    "deletable": true,
    "id": 35397,
    "uri": "https://secure.fusebill.com/v1/salesTrackingCodes/35397"
}
{
    "ErrorId": 0,
    "HttpStatusCode": 400,
    "Errors": [
        {
            "Key": "Api Error",
            "Value": "Unknown sales tracking code type Sales Tracking Code 6. Valid types are: Sales Tracking Code 1, Sales Tracking Code 2, Sales Tracking Code 3, Sales Tracking Code 4, Sales Tracking Code 5"
        }
    ]
}
Response
200
Language
Credentials
Header
LoadingLoading…