Class Reference

Tuesday, 10 of March 2015

Introduction

The purpose of this section is to describe the Repcamp platform's objects through a list fields definition guide. You will notice that there are some diferences when comparing the below objects with the ones found at the API Object reference page. This is because some of the fields are internal attributes used by the system but not needded when synchronizing with third party software.

 

Tips & Tricks

  • When using the SDK you will notice that some objects will have the Getters and Setters methods for all of their attributes but others will only have Getters. This is because some objects are meant to be uploaded/downloaded and some only to be downloaded.
  • All of the objects have required fileds and those have to be fulfiled, but for the optional stuff a good practice would be to leave them null instead of a blank string so the system treats them. Lets imagine you have a customer with no telephone:
  • //Not a good practice
    Customer customer = new Customer();
    customer.setCode("CS00001");
    customer.setFiscal_name("The Name Of The Customer");
    customer.setTelephone("");
    
    
    //The way to go!
    Customer customer = new Customer();
    customer.setCode("CS00001");
    customer.setFiscal_name("The Name Of The Customer");
  • A part from the objects described here you will notice that there are other objects that are actual lists of the ones described below. Those are used by the SDK when pushing arrays of data through the API. There is not need to instantiate them.
  • All of the Objects described below have overwrited the method toString for your convenience.

 

NOTE
Please notice that the code described below is written in JAVA. If you are a C# fanboy just translated the types and method names. Sorry about that ;)


 

 

APIData

This object contains all necessary data to authenticate and perform data upload/download to and from your account at RepCamp.com

Field name Type Constraint Description
url String Req. The API URL
http://api.repcamp.com
username String Req. Yor username at RepCamp.com
john.doe@repcamp.com
password String Req. Your password at RepCamp.com (Encrypted in Sha1)
5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8
apikey String Req. Your API Key
cc0aa9e38fcc529fff5393078ab4a8cb
secretkey String Req. Your Secret Key. Make sure to keep it in a safe place
b6ec1f77f73f0cb3937a3833aa948d9226e23532a0b5aaafd5b113c01142ad5c
apiVersion String Req. The API version you are pointing to. Current version "v1"
v1

 

 

Authtoken

This object contains all necessary data to authenticate and perform data upload/download to and from your account at RepCamp.com. Actually you do not need to instantiate this object as it is done automatically when using the function AuthenticateMe() from the main controller, this is just a food to know information

Field name Type Constraint Description
accesstoken String Req. The token that garants you acces to your account for a limited time
5357a2acd5a0399c36000001
expires String Req. The time that lasts the token
60s
tokenApi String Req. A HMACDigest of the acces token and your secret key
2a99713e60c3e040439a0b31bc97fa34e660abc1
secretkey String Req. Your Secret Key. Make sure to keep it in a safe place
b6ec1f77f73f0cb3937a3833aa948d9226e23532a0b5aaafd5b113c01142ad5c

 

 

Customer

Field name Type Constraint Description
code String Uni. Req. Customer's ERP/external code. That's the code normally used to identify an specific customer externally.
CS00001
comercial_name String Opt. Customer's trade name. That's the name showed in the main position in the customer screen of the mobile app
Maname
fiscal_name String Req. Customer's fiscal name.
Maname & Company Ltd.
vat_number String Opt. Customer's Vat Number.
D58709832
telephone String Opt. Customer's telephone.
(831) 758-7214
telephone_2 String Opt. Customer's secondary telephone.
(831) 758-7214
email String Opt. Customer's e-mail.
comercial@maname.com
address String Opt. Customer's main address.
C/ Pablo Iglesias 63
address_2 String Opt. Customer's main address (Line 2).
PB L1 Corner Office
city String Opt. Customer's city.
Temecula
zip String Opt. Customer's adress ZIP code.
92591
state_code String Opt. Customer's state.
CA
state String Opt. Customer's state code to match with the state codes previously uploaded.
California
country_code String Opt. Customer's country code to match with the country codes previously uploaded.
USA
country String Opt. Customer's country.
United States
latitude BigDecimal Opt. Customer's address latitude.
33.5220079
longitude BigDecimal Opt. Customer's address longitude.
-117.1584848
discount BigDecimal Opt. Customer's % disccount.
5
payment_method String Opt. Customer's payment method.
Immediately
status Short Req. Status of the object (1 Active / 0 Blocked )
1
pricelist String Opt. Code of the customer's price list
01
reps List<String> Opt. List of Rep ids (ERP codes)
[REP01, REP02, REP03]
addresses List<Address> Opt. List of Addresses
[new Address(), new Address(), new Address()]
language String Opt. One of the CustomerLanguageType* 
CustomerLanguageType.ENGLISH
updated_at String Auto Update datetime. Auto generated
2014-02-25T11:29:00.671Z
created_at String Auto Create datetime. Auto generated
2014-02-25T11:24:34.243Z

 

 

Address

Field name Type Constraint Description
code String Uni. Req. Address' code. It is required and unique in the customer's array of addresses.
01
name String Opt. Address short description.
Main Address (Headquarters)
description String Opt. Address long description.
Company main address, ask for Jesse Brown, he runs the place.
telephone String Opt. Address telephone.
(831) 758-7214
telephone_2 String Opt. Address secondary telephone.
(831) 758-7214
email String Opt. Address e-mail.
comercial@maname.com
address String Opt.  Address street.
C/ Pablo Iglesias 63
address_2 String Opt. Address street (Line 2).
PB L1 Corner Office
city String Opt. Address city.
Temecula
zip String Opt. Address adress ZIP code.
92591
state_code String Opt. Address state.
CA
state String Opt. Address state code to match with the state codes previously uploaded.
California
country_code String Opt. Address country code to match with the country codes previously uploaded.
USA
country String Opt. Address country.
United States
latitude BigDecimal Opt. Address address latitude.
33.5220079
longitude BigDecimal Opt. Address address longitude.
-117.1584848
billing Short Opt. Specify if the address is meant for invocing. (1 yes / 0 no)
0
shipping Short Opt. Specify if the address is meant for shipping the orders. (1 yes / 0 no)
1
visiting Short Opt. Specify if the address is meant for visiting (1 yes / 0 no)
1

 

 

Product

Field name Type Constraint Description
code String Uni. Req. Product's ERP/external code. That's the code normally used to identify an specific product externally.
PR0001
name String Req. Product's name. That's the name showed in the main position in the product screen of the mobile app
Vintage Whitey
description String Req. Description of the product
Just some complementary information about the product
price BigDecimal Opt. Product Price
249.99
suggested_price BigDecimal Opt. Product suggested price
300
cost BigDecimal Opt. Cost price of the product
180
tax BigDecimal Opt. Tax of the product
 21
discount BigDecimal Opt. Disccount
 10
minimum BigDecimal Opt.

Min. buying units
1

maximum BigDecimal Opt. Ma.x buying units
999999999
stock BigDecimal Opt. Product's stock
12
unit String Opt. Type of unit
un.
sort_order Short Opt. Sort Order (the product position where it has to be placed in the catalog)
10
manufacturer String Opt. ERP Code of the product's manufacturer
MAN01
categories List<String> Opt. Array of categories that the product belogns.
[CAT01, CAT03, CAT04]
date_available Date Opt. Avaiable date
new Date(2020,06,01)
featured Short Opt. Featured flag 1/0
1
status Short Opt. Status of the object (1 Active / 0 Blocked )
1
updated_at String Auto Update datetime. Auto generated
2014-02-25T11:29:00.671Z
created_at String Auto Create datetime. Auto generated
2014-02-25T11:24:34.243Z

 

 

Category

Field name Type Constraint Description
code String Uni. Req. Category ERP/external code. That's the code normally used to identify an specific category externally.
CT002
name String Req. Category name.
Foam
sort_order Short Opt. Sort Order (the category position where it has to be placed in the catalog)
10
parent_code String Opt. Category ERP/external  parent code.
CT001
status Short Opt. Status of the object (1 Active / 0 Blocked )
1
updated_at String Auto Update datetime. Auto generated
2014-02-25T11:29:00.671Z
created_at String Auto Create datetime. Auto generated
2014-02-25T11:24:34.243Z

 

 

Manufacturer

Field name Type Constraint Description
code String Uni. Req. Manufacturer ERP/external code. That's the code normally used to identify an specific manufacturer externally.
BR001
name String Opt. Manufacturer name. That's the name showed in the main position in the manufacturer screen of the mobile app
Soul
sort_order Short Opt. Sort Order (the manufacturer position where it has to be placed in the catalog)
10
status Short Opt. Status of the object (1 Active / 0 Blocked )
1
updated_at String Auto Update datetime. Auto generated
2014-02-25T11:29:00.671Z
created_at String Auto

Create datetime. Auto generated
2014-02-25T11:24:34.243Z

 

 

Stock

Field name Type Constraint Description
code String Uni. Req. Product's ERP/external code. That's the code normally used to identify an specific product externally.
PR0001
stock BigDecimal Req. Product's stock.
40
stock_updated_at String Auto

Create datetime. Auto generated
2014-02-25T11:24:34.243Z

 

 

PriceList

Field name Type Constraint Description
unique_code String Uni. Req. Price list unique ERP/external code. This is not the code of the price list but the the unique code that identifies a specific version of a price list.
PL01VER01
code String Req. Price list ERP/external code.
PL01
description String Opt. Description of the price list
Winter 2015
type Short Opt. One of the three PriceListType: PRICE, DISCOUNT, PRICE_DISCOUNT
PriceListType.PRICE_DISCOUNT
start_date String Opt. Price List start date
ISODate("2014-02-25T11:29:00.671Z")
end_date String Opt. Price List end date
ISODate("2015-02-25T11:29:00.671Z")
updated_at String Auto Update datetime. Auto generated
2014-02-25T11:29:00.671Z
created_at String Auto Create datetime. Auto generated
2014-02-25T11:24:34.243Z

 

 

PriceListLine

Field name Type Constraint Description
unique_code String Uni. Req. Unique code for the price list line so it is easy to update.
PL01VER01L01
pricelist_code String Req. Price List ERP code
PL01
code String Req. Code of the product
PR0001
price BigDecimal Opt. Product Price
250
quantity BigDecimal Opt. Quantity in case the price is defined per volume.
5
discount1 BigDecimal Opt. First discount
10
discount2 BigDecimal Opt. Second discount
 5
discount3 BigDecimal Opt. Third discount
0
minimum BigDecimal Opt.

Minimum or recurrent quantity that triggers the bonus
5

bonus BigDecimal Opt. Bonus units. This Particular example would be: Every 5 units, 2 bonus units
2
type String Opt. The PriceListLineType, one of this three possible options: PRICE, BONUS, VOLUME
PriceListLineType.PRICE
updated_at String Auto Update datetime. Auto generated
2014-02-25T11:29:00.671Z
created_at String Auto Create datetime. Auto generated
2014-02-25T11:24:34.243Z

 

 

LastSale

Field name Type Constraint Description
unique_code String Uni. Req. Last sale unique code
0-SE-PED-1
rep_unique_code String Opt. Rep code specified at reps managment place
REP01
customer_id String Req. Customer GUID (Generated by the system) Get only. Must exist.
5357a2acd5a0399c36000001
customer_unique_code String Req. Customer ERP code
C0001
product_id String Opt. Product GUID (Generated by the system) Get only.
34143423dads1asdnak13213
product_unique_code String Req. Product ERP SKU. No need to exist.
PR001
product_description String Opt. Product description
SantaCruz
manufacturer String Req. A descriptio name of the prduct's manufacturer
Soul
category String Req. A description of the product's category
Boards
quantity BigDecimal Req. Number of sold units
4
unit String Req. The unit to quantify the product
kg
unit_price BigDecimal Req.

The unit price before applying the discounts 
12.34

final_unit_price BigDecimal Req. Final unit price after applying the discounts
10.22
discount_description String Opt. Discount description message
0% 0% 0%
discount BigDecimal Opt. First discount
0
discount2 BigDecimal Opt. Second discount
0
discount3 BigDecimal Opt. Third discount
0
subtotal BigDecimal Req. Line subtotal, before tax
40
cost BigDecimal Req. Cost of the product
12
date Date Req. Sold at date
2014-02-25T11:29:00.671Z
document_id String Req. The document id
SE-PED-1
updated_at String Auto Update datetime. Auto generated
2014-02-25T11:29:00.671Z
created_at String Auto Create datetime. Auto generated
2014-02-25T11:24:34.243Z

 

 

Order

Field name Type Constraint Description
unique_code String Uni. Req. Unique code for the order
ORD01
internalcode int Auto Auto incremental number
01
internalcode_pre String Auto Prefix of the order. To be set at settings page.
ORD
code String Auto Product ERP code
"price" : 250
ref String Auto Customer reference for the order
REF-01
customer_info Customer Auto Customer info at the moment of the order
Customer Object
customer_code String Auto Customer code at the moment of the order
CS00001
customer_name String Auto Customer name at the moment of the order
Maname & Company Ltd.
payment_method String Auto

Payment method used at the moment of the order
"minimum" : "0"

rep_info OrderRep Auto Rep Info
OrderRep Object
currency String Auto Currency code at the moment of the order
EUR
currency_symbol String Auto Currency Symbol at the moment of the order
comments String Auto General comments on the order
Some orther comments
delivery_date String Auto Suggested delivery date. Does not has to necessarly be date formated.
End of the June
type Short Auto Order type: 0 - Order / 1 - Quotation
0
round double Auto The number of decimals when rounding prices
2
discount BigDecimal Auto General discount
0
subtotal BigDecimal Auto Subtotal price of the order
200.55
total

BigDecimal

Auto Total price of the order
250
created_at_local

String

Auto Device date of order creation in reverse
20150120132038
status

int

Auto Status of the order (Check order status for more information)
2
pdf

String

Auto Url of the PDF generated by the device at the moment of the order
http://slsdev.kriter.net/images_ext/cae91e45aed80f3a3fe285c3c8c1a7e78d82d473/files/1918D928-EC40-4C69-BAFE-CCDED189EF14.pdf
lines

List<OrderLine>

Auto List of order lines
totals

List<OrderTotal>

Auto List of order totals
updated_at String Auto Update datetime. Auto generated
2014-02-25T11:29:00.671Z
created_at String Auto Create datetime. Auto generated
2014-02-25T11:24:34.243Z

 

 

OrderLine

Field name Type Constraint Description
line String Uni. Req. Line id is GUIDMANOLO
30a7e1b3-e763-4789-a54d-fcc53dcf973a
related_line String Req. Related Line GUID
PR001
code String Req. Product code
PR001
description String Req. Product Description
Black Pocket
manufacturer_name String Opt. The manufacturer name of the product
SantaCruz
category_name String Opt. Category of the product
Gadgets
units BigDecimal Req. Quantity of items
2
sort_order Long Req. The order of the line to be presented
20150120132026
served_units BigDecimal Opt.

The number of served units
0

unit_price BigDecimal Req. Product unit price before tax
20
final_unit_price BigDecimal Req. Final unit price
24.2
discount_description String Opt. Discount description message
0% 0% 0%
discount BigDecimal Opt. First discount
0
discount2 BigDecimal Opt. Second discount
0
discount3 BigDecimal Opt. Third discount
0
tax_description String Req. Avaiable date
21%
tax double Req. Product tax
21
subtotal BigDecimal Req. Line subtotal, before tax
40
total BigDecimal Req. Lie total
48.4
cost BigDecimal Req. Cost of the product
12

 

 

OrderRep

Field name Type Constraint Description
email String Opt. Rep's email at the moment of the order.
john.doe@repcamp.com
firstname String Opt. Rep's name at the moment of the order.
John
lastname String Opt. Rep's lastname at the moment of the order.
Doe
code Short Opt. Rep's ERP code at the moment of the order.
REP01

 

 

OrderTotal

Field name Type Constraint Description
local_id String Uni. Req. Generated GUID.
368F1457-F695-4201-85C1-7E18153F0F92
sort_order int Req. Price position when are all painted
1
code String Req. Type identifier
subtotal
description String Req. Description text
Subtotal
text String Req. Amount description
230,00 €
value BigDecimal Req. Amount value
230

 

 

 

OrderStatus

Field name Type Constraint Description
id String Uni. Req. The order unique id.
ORD01
status String Req.

Status number code-reference.
2

 

Order Status Code-Reference

  • -1Canceled
  • 2Pending
  • 3In Process
  • 4Error
  • 5Delivered
  • 6Completed

 

 

Country

Field name Type Constraint Description
code String Uni. Req. Country code.
USA
name String Req. Country name
United States of America
List<State> List<State> Opt. List of states
[new State(), new State, new State()]
updated_at String Auto Update datetime. Auto generated
2014-02-25T11:29:00.671Z
created_at String Auto Create datetime. Auto generated
2014-02-25T11:24:34.243Z

 

 

State

Field name Type Constraint Description
code String Uni. Req. State code. Unique in the list of country states
CA
name String Req. Type identifier
California

 

 

GenericResponse

Field name Type Constraint Description
status int Response Http status (200, 401, 500, etc.)
401
url String Response. Url called
http://api.repcamp.com/v1/customer
message String Response Http message
Unauthorized
bulkResponse BulkResponse Bulk Act. Resp. Detailed information about the bulk upload
singleResponse SingleResponse Error Resp Cause and Item code of the error, when performing add, update and remove actions.

 

 

SingleResponse

Field name Type Constraint Description
id String Error Resp. Code of the item that has failed.
"PR001"
error String Error Resp. A message explaingin why did the call failed
"Product not found"

 

 

BulkResponse

Field name Type Constraint Description
item_type String Response The name of the item attempted to upload.
product
total int Response Total number of items attempted to upload
20
inserts int Response Number of correctly created items
6
updates int Response Number of updated items
12
errors int Error Resp. Number of items that couldn't be created or updated
2
items_error String[ ] Error Resp. Array of codes from the items that have failed
["PR001", "PR002"]