Example: Customers

In this example, we'll work with Customer records.

Getting Customers

Use the select method to get customers.

https://api.propelware.com/v1/endpoint/{company.endpointId}/select/{objectType}?modTime={date}&page={page}&pageSize={pageSize}

Example:

curl --request GET \
  --url 'https://api.propelware.com/v1/endpoint/c67e83e28abe40e59164fbe5888a178b/select/customer?modTime=1%2F1%2F2016&page=1&pageSize=10' \
  --header 'cache-control: no-cache'
  --header 'authorization: {YOUR API KEY}' \

Here is the JSON response you should expect:

  • CommandGuid identifies the request in logs.
{
    "Meta": {
        "CommandGuid": "e8be6350",
        "StatusCode": 0,
        "Severity": null,
        "Message": null
    },
    "Detail": {
        "Response": [
            {
                "AccountNumber": "",
                "AltContact": "",
                "AltPhone": "",
                "Balance": "10000",
                "BillAddress": {
                    "Addr1": "",
                    "Addr2": "",
                    "Addr3": "",
                    "Addr4": "",
                    "Addr5": "",
                    "City": "",
                    "Country": "",
                    "PostalCode": "",
                    "State": ""
                },
                "CompanyName": "CoName",
                "Contact": "",
                "Email": "",
                "ExternalID": "",
                "FirstName": "Auto",
                "FullName": "API Created Customer #1",
                "ID": "8000003E-1474056584",
                "IsActive": true,
                "LastName": "fly",
                "MiddleName": "",
                "Mobile": "",
                "Name": "API Created Customer #1",
                "ParentRef": {
                    "FullName": "",
                    "ID": ""
                },
                "Phone": "123 456 7890",
                "Salutation": "",
                "ShipAddress": {
                    "Addr1": "",
                    "Addr2": "",
                    "Addr3": "",
                    "Addr4": "",
                    "Addr5": "",
                    "City": "",
                    "Country": "",
                    "PostalCode": "",
                    "State": ""
                },
                "Suffix": ""
            }
        ]
    }
}

Inserting Customers

Use the /endpoint/process method to insert or update Customers.

https://api.propelware.com/v1/endpoint/{company.endpointId}/process/{objectType}

Here is the payload in your request:

{
    "ID": "",
    "ExternalID": "",
    "Name": "API Created Customer #1",
    "FullName": "",
    "CompanyName": "Pied Piper",
    "FirstName": "Richard",
    "LastName": "Hendricks",
    "Phone": "123 456 7890",
    "Balance": 10000,
    "IsActive": true
}

Example:

curl --request POST \
  --url https://api.propelware.com/v1/endpoint/c67e83e28abe40e59164fbe5888a178b/process/customer \
  --header 'cache-control: no-cache' \
  --header 'content-type: application/json' \
  --header 'authorization: {YOUR API KEY}' \
  --data '{    "ID": "",    "ExternalID": "",    "Name": "API Created Customer #1",    "FullName": "",    "CompanyName": "CoName",    "FirstName": "Auto",    "LastName": "fly",    "Phone": "123 456 7890",    "Balance": 10000,    "IsActive": true}'

Here is the JSON response you should expect:

{
	"Meta": {
		"StatusCode": 0,
		"Severity": null,
		"Message": null
	},
	"Detail": {
		"Response": "{\"ID\":\"8000003E-1474056584\",\"RefNumber\":\"\"}"
	}
}