ADDEDIT Buyer API V1

Updated on 2015-10-01
Current Version: Version 1
Deprecated Version: NA
Requests Allowed: GET&SOAP

 

Summary:

Returns "Buyer ### Created" or "Buyer ### Updated"


Resource/WSDL Page:

http://<your_domain_here>/api/1/addedit.asmx?op=Buyer


Parameters

api_key

Required

Type: STRING

Max Length: 50 Char.

Must be a valid API key (existing and NOT expired)

Example Values: Fo35NRAqvFLXoZxqB4aVMhh

buyer_id

Required

Type: INTEGER

Max Length: N/A

Buyer’s CAKE entity ID. Obtained with EXPORT Buyers API

Pass 0 to create a new Buyer. 

Passing a value greater than 0 will edit the Buyer with that ID.

buyer_name

Required

Type: STRING

Max Length: 50 Char.

This is used to set or change the Buyer’s name.

On edit, pass NULL to remove and set to blank, otherwise you can skip by passing no value.

account_status_id

Required

Type: INTEGER

Max Length: N/A

 

Buyer Account Status ID. Obtained via GET AccountStatuses API

Pass 0 to skip

Example Values: 1

account_manager_id

Required

Type: INTEGER

Max Length: N/A

Account Manager ID

Pass 0 on account creation to use default account manager

Pass 0 on edit to skip

Example Values: 1 

address_street

Required

Type: STRING

Max Length: 60 Char

Pass NULL to erase

Pass “” to skip

Example Values: 123 Main Street

address_street2

Required

Type: STRING

Max Length

Pass NULL to erase

Pass “” to skip

Example Values: Apt 123

address­_city

Required

Type: STRING

Max Length: 30 Char.

Pass NULL to erase

Pass “” to skip

Example Values: Newport Beach

address­_state

Required

Type: STRING

Max Length: 20 Char.

Pass NULL to erase

Pass “” to skip

Example Values: CA

address­_zip_code

Required

Type: STRING

Max Length: 10 Char.

Pass NULL to erase

Pass “” to skip

Example Values: 92660

address­_country

Required

Type: STRING

Max Length: 30 Char

Pass NULL to erase

Pass “” to skip

Example Values: USA

website

Required

Type: STRING

Max Length: 100 Char.

Pass NULL to erase

Pass “” to skip

Example Values:  (URL Encoded) http%3A%2F%2Fgetcake.com

billing_cycle_id

Required

Type: INTEGER

Max Length: N/A

Billing cycle to apply to Buyer 

Obtained via GET BillingCycles API

Pass 0 to skip

Example Values: 1 = Weekly, 2 = Bi-Monthly, 3 = Monthly

credit_type

Required

Type: ENUM

Max Length: N/A

Identifies whether the Buyer is using credit or not.

Pass “limited” to enable credit

Pass “unlimited” to disable credit

Pass “no_change” to skip 

credit_limit

Required

Type: INTEGER

Max Length: N/A

Pass numerical credit limit if ENABLED was used for credit_type.

Pass -1 to skip


**Note all optional parameters still need to be passed through in the actual call. These parameters do not need a value (therefore you can use a null value). 

 

Example Request

GET

http://demo.cakemarketing.com/api/1/addedit.asmx/Buyer?api_key=dNJFmId9rI&buyer_id=1423&buyer_name=&account_status_id=1&account_manager_id=3541&address_street=123+Main+Street&address_street2=Apt+123&address_city=Newport_Beach&address_state=CA&address_zip_code=92660&address_country=USA&website=http://getcake.com&billing_cycle_id=0&credit_type=limited&credit_limit=45000 


Sample XML Response:


<buyer_addedit_response><success>true</success><message>Buyer (1423) Updated Successfully</message><row_count>0</row_count><buyer_id>1423</buyer_id></buyer_addedit_response>


Example Error Messages:

Error Message

Likely Cause

Invalid API Key

API Key does not exist or is expired

Invalid Buyer Name

buyer_name is NULL, empty or exceeds 50 chars.

Invalid Buyer ID

buyer_id is <0 or is >0, but doesn’t match an existing Buyer’s ID.

Invalid Account Manager ID

account_manager_id is <0 or is >0, but doesn’t match an existing employee contact in CAKE.

Invalid Account Status ID

account_status_id value is not in list of available status ID’s.

Invalid Billing Cycle ID

Billing_cycle_id value is not in list of available status ID’s.

Expected URL Format ‘http://www.example.com’

website URL does not have proper formatting.

Website Exceeds 100

website length is greater than 100 chars.

Address Street Exceeds 60

address_street length is greater than 60 chars.

Address Street 2 Exceeds 60

address_street2 length is greater than 60 chars.

Address City Exceeds 30

address_city length is greater than 30 chars.

Address State Exceeds 20

address_state length is greater than 20 chars.

Address Zip Code Exceeds 10

address_zip_code length is greater than 10 chars.

Country Exceeds 30

address_country length is greater than 30 chars.

Invalid Credit Type

credit_type value is not in list of available types.

Invalid Credit Limit

credit_limit value is not a numerical value.