Object model

API version 1.0
Friday, 20 of February 2015

Introduction

The purpose of this section is to describe the Repcamp platform's Objects. Each object is described through its list of fields and its resource request / response action list.

Repcamp platform is composed by the following objects: Customer, Address, Product, Category, Manufacturers, Order, Media.


Customer

Customer of a company. All orders and commercial actions are linked to a customer object.

 

Field Guide

Field name Type Constraint Description
_id ObjectId Key Auto Internal Unique ID of the customer.
"_id" : ObjectId("530c7d72177dde00280006a4")
contract ObjectId Uni. Req. Subscription code
"contract" : "0a57cb53ba59c468a87c78d84028"
code String Uni. Req. Customer's ERP/external code. That's the code normally used to identify an specific customer externally.
"code" : "001PR"
comercial_name String Req. Customer's commercial name. That's the name showed in the main position in the customer screen of the mobile app
"comercial_name" : "Maname"
fiscal_name String Req. Customer's fiscal name.
"fiscal_name" : "Maname & Company Ltd."
vat_number String Opt. Customer's Vat Number.
"vat_number" : "D58709832"
telephone String Opt. Customer's telephone.
"telephone" : "(831) 758-7214"
email String Opt. Customer's e-mail.
"email" : "comercial@maname.com"
address String Opt. Customer's adress.
"address" : "26485 Ynez Road Temecula"
city String Opt. Customer's city.
"city" : "Temecula"
zip String Opt. Customer's adress ZIP code.
"zip" : "92591"
state String Opt. Customer's state.
"state" : "CA"
state_code String Opt. Code of the state.
CA
country String Opt. Customer's country.
"country" : "United States"
country_code String Opt. Code of the country
ES
latitude Double Opt. Customer's address latitude.
"latitude" : 33.5220079
longitude Double Opt. Customer's address longitude.
"longitude" : -117.1584848
discount Double Opt. Customer's % disccount.
"discount" : 0
payment_method String Opt. Customer's payment method.
"payment_method" : "Immediately"
pricelist String Opt.

Pricelist assigned to a customer
"pricelist" : "12212PR"

reps JsonArray Opt.

Array of the reps who own the customers
"reps": [
      {"code": "54c2657b07caf6c4d8000017","_id": "54c2687b1dde4100000008af", "assigned_at": "2015-01-22T10:08:05.870Z"},
      { "user": "54c2657b07caf6c4d8000017",  "_id": "54c268d31dde410000001778", "assigned_at": "2015-01-22T10:08:05.870Z"
      }

addresses JsonArray Opt.

Array of the customer's addresses
"addresses": [
      {"code": "RX23","_id": "54c2687b1dde4100000008af", "description": "StoreHouse, Barcelona","address":"Carrer Suecia 64", "address_2":"", "city":"Barcelona","zip":"03080","state":"Barcelona","state_code":"222","country":"spain", "longitude":"2122.22","latitude":"2122", "email":"storehose@sydornne.io", "telephone":"34 667200121",
"visiting":"1" ,"billing":"0","shipping":"1" },
{"code": "RX24","_id": "54c2687b1dde4100000008ac", "description": "StoreHouse, Madrid","address":"Calle Dinamarca 64", "address_2":"", "city":"Madrid","zip":"43870","state":"Madrid","state_code":"1111","country":"spain", "longitude":"22.22","latitude":"2812", "email":"storehose@sydornne.io", "telephone":"34 6637200121", "visiting":"1" ,"billing":"1","shipping":"1"}

status Integer Req. Status of the object (1 Active / 0 Blocked )
"status" : 1
updated_at DateTime Auto Update datetime. Auto generated
"updated_at" : ISODate("2014-02-25T11:29:00.671Z")
created_at DateTime Auto Create datetime. Auto generated
"created_at" : ISODate("2014-02-25T11:24:34.243Z")

 

Customer JSON representation sample

{
    "__v" : 1,
    "_id" : ObjectId("54c2687b1dde410000000a59"),
    "address" : "CR. D´OLOT, 14",
    "city" : "VILAFANT",
    "code" : "286",
    "comercial_name" : "MONT GORGOT, JOSEP",
    "contract" : "cae91e45aed80f3a3fe285c3c8c1a7e78d82d473",
    "country" : "ESPAÑA",
    "created_at" : ISODate("2015-01-23T15:27:55.741Z"),
    "discount" : 0,
    "email" : "josepmont@hotmail.com",
    "fiscal_name" : "MONT GORGOT, JOSEP",
    "language" : "es",
    "latitude" : 42.2486443,
    "longitude" : 2.9381984,
    "payment_method" : "60 dies",
    "pricelist" : "0",
    "reps" : [ 
        {
            "user" : ObjectId("54c2639a07caf6c4d8000012"),
            "_id" : ObjectId("54c2687b1dde410000000a5a"),
            "assigned_at" : ISODate("2015-01-22T10:08:05.870Z")
        }, 
        {
            "user" : ObjectId("54c2639a07caf6c4d8000012"),
            "_id" : ObjectId("54c268d41dde41000000182a"),
            "assigned_at" : ISODate("2015-01-22T10:08:05.870Z")
        }
    ],
    "addresses" : [ 
       "addresses": [
      {   "code": "RX23",
          "_id": "54c2687b1dde4100000008af",
          "description": "StoreHouse, Barcelona",
          "address":"Carrer Suecia 64", 
          "address_2":"", 
          "city":"Barcelona",
          "zip":"03080",
          "state":"Barcelona",
          "state_code":"222",
          "country":"spain",
          "longitude":"2122.22",
          "latitude":"2122",
          "email":"storehose@sydornne.io",
          "telephone":"34 667200121",
          "visiting":"1" ,
          "billing":"0",
          "shipping":"1" }

    ],
    "state" : "GIRONA",
    "status" : 1,
    "telephone" : "972 67 15 91",
    "updated_at" : ISODate("2015-01-29T07:19:38.000Z"),
    "vat_number" : "40430761G",
    "zip" : "17740"
}

 

Usages


Address

Adress of a customer.

 

Field Guide

Field name Type Constraint Description
_id ObjectId Key Auto Internal Unique ID of the customer.
"_id" : ObjectId("530c7d72177dde00280006a4")
contract ObjectId Uni. Req. Subscription code
"contract" : "0a57cb53ba59c468a87c78d84028"
code String Opt. Adress's ERP/external code. That's the code normally used to identify an specific adress externally.
"code" : "001PR"
name String Opt. Address name. 
"name" : "Storehouse"
description String Opt. Address description.
"description" : "Casa"
address String Opt. Address
"address" : "Swedden Street Nº23"
address_2 String Opt. Address additional line
"address_2" : "Swedden Street Nº77210"
city String Opt. Customer's city.
"city" : "Temecula"
zip String Opt. Customer's adress ZIP code.
"zip" : "92591"
state String Opt. Customer's state.
"state" : "CA"
country String Opt. Address country.
"country" : "United States"
latitude Double Opt. Address latitude.
"latitude" : 33.5220079
longitude Double Opt. Address longitude.
"longitude" : -117.1584848
country_code String Opt. country code
"country_code" : "1221"
state_code String Opt. State code
"state_code" : "RX223"
telephone_1 String Opt.

Telephone
"telephone_1" : "34 663 077 100"

telephone_2 String Opt.

Telephone 2
"telephone_2": "93 7992 2212"

billing Integer Req. Billing address (1=true, 0=false)
"billing" : 1
shippping Integer Req. Shipping address (1=true, 0=false)
"shipping" : 1
visiting Integer Req. Visiting address (1=true, 0=false)
"visiting" : 1
status Integer Req. Status of the object (1 Active / 0 Blocked )
"status" : 1
updated_at DateTime Auto Update datetime. Auto generated
"updated_at" : ISODate("2014-02-25T11:29:00.671Z")
created_at DateTime Auto Create datetime. Auto generated
"created_at" : ISODate("2014-02-25T11:24:34.243Z")

 

Product

Company's product.

 

Field Guide

Field name Type Constraint Description
_id ObjectId Key Auto Internal Unique ID of the product.
"_id" : ObjectId("530c7d72177dde00280006a4")
contract ObjectId Uni. Req. Subscription code
"contract" : "0a57cb53ba59c468a87c78d84028"
code String Uni. Req. Product's ERP/external code. That's the code normally used to identify an specific product externally.
"code" : "PR0001"
name String Req. Product's name. That's the name showed in the main position in the product screen of the mobile app
""name" : "Vintage Whitey""
description String Opt. Description of the product
"description" : "Informacion adicional\nObservaciones varias"
price Double Opt. Product price
"price" : 250
suggested_price String Opt. Product suggested price
"suggested_price" :300
cost String Opt. Cost price of the product
"cost" : 180
tax String Opt. Tax of the product
 "tax" : 21
discount String Opt. Disccount
  "discount" : 0
minimum String Opt.

Min. buying units
"minimum" : "0"

maximum String Opt. Ma.x buying units
"maximum" : "999999999"
stock String Opt. Product's stock
"stock" : "12"
unit Double Opt. Type of unit
"unit" : meter
subtract Double Opt. Substract stock (Yes/not)
 
"substract" : 1
sort_order Double Opt. Sort Order (the product position where it has to be placed in the catalog)
"sort_order" : 10
image_uri String Opt. Uri of product's image
"image_uri" : "https://www.repcamp.com/repo/base/11232424316783/image001.jpg"
weight Integer Opt. Product's weight
"weight" : 100
weight_class Integer Opt. Type of measurement units
"weight class" : kg
length Integer Opt. Product's lenght
"status" : 1
width Integer Opt. Product's width
"width" : 10
height Integer Opt. Product's height
"height" : 10
length_class Integer Opt. Type of measurement units
"legnth_class" : mm
manufacturer Integer Opt. Code of the product's manufacturer
"manufacturer" : ObjectId("54b8f7d7bffd08381f0001be")
categories Integer Opt. Array of categories that the product belogns.
 "categories" : [ObjectId("54b8f7d7bffd08381f0001b9"), ObjectId("54b8f7d7bffd08381f0001b2")],
date_available Integer Opt. Avaiable date
"date_available" :  ISODate("2015-01-16T11:36:58.07Z")
featured Integer Opt. Featured flag
"featured" : 1
status Integer Opt. Status of the object (1 Active / 0 Blocked )
"status" : 1
updated_at DateTime Auto Update datetime. Auto generated
"updated_at" : ISODate("2014-02-25T11:29:00.671Z")
created_at DateTime Auto Create datetime. Auto generated
"created_at" : ISODate("2014-02-25T11:24:34.243Z")

 

Product JSON representation sample

{
  "code" : "0001PR",
  "_id" : ObjectId("54b8f7dabffd08381f0001d6"),
  "manufacturer" : ObjectId("54b8f7d7bffd08381f0001be"),
  "contract" : "cae91e45aed80f3a3fe285c3c8c1a7e78d82d473",
  "length_class" : "0",
  "weight_class" : "0",
  "sort_order" : 0,
  "stock" : 16002,
  "discount" : 0,
  "tax" : 21,
  "cost" : 0,
  "suggested_price" : 0,
  "description" : "Informacion adicional\nObservaciones varias",
  "name" : "Vintage Whitey",
  "image_updated_at" : ISODate("2015-01-16T11:36:58.07Z"),
  "stock_updated_at" : ISODate("2015-01-16T11:36:58.07Z"),
  "updated_at" : ISODate("2015-01-16T11:36:58.07Z"),
  "created_at" : ISODate("2015-01-16T11:36:58.07Z"),
  "status" : 1,
  "featured" : 0,
  "categories" : [ObjectId("54b8f7d7bffd08381f0001b9"), ObjectId("54b8f7d7bffd08381f0001b2")],
  "height" : 0,
  "width" : 0,
  "length" : 0,
  "weight" : 0,
  "subtract" : 1,
  "maximum" : 99999999,
  "minimum" : 1,
  "price" : 250,
  "__v" : 0
}
 

Usages


Category

Product category.

 

Field Guide

Field name Type Constraint Description
_id ObjectId Key Auto Internal Unique ID of the category.
"_id" : ObjectId("530c7d72177dde00280006a4")
contract ObjectId Uni. Req. Subscription code
"contract" : "0a57cb53ba59c468a87c78d84028"
code String Uni. Req. Category's ERP/external code. That's the code used to identify an specific category externally.
"code" : "CT0011"
name String Req. Category's name. That's the name showed in the main position in the product screen of the mobile app
""name" : "Computers"
parent ObjectId OPt. Parent ID
"parent" : "0a57cb53ba59c468a87c78d84028"
level Integer Opt. Level in the hierarchy
"level" : 2
sort_order Integer Opt. Position of the category
"parent" : "0a57cb53ba59c468a87c78d84028"
updated_at DateTime Auto Update datetime. Auto generated
"updated_at" : ISODate("2014-02-25T11:29:00.671Z")
created_at DateTime Auto Create datetime. Auto generated
"created_at" : ISODate("2014-02-25T11:24:34.243Z")

 

Category JSON representation sample

{
"updated_at": "2015-01-16T20:00:39.211Z",
"created_at": "2015-01-16T11:36:55.538Z",
"path": "54b8f7d7bffd08381f0001b2",
"contract": "cae91e45aed80f3a3fe285c3c8c1a7e78d82d473",
"name": "Boards",
"code": "CT001",
"_id": "54b8f7d7bffd08381f0001b2",
"__v": 0,
"status": 1,
"sort_order": 0,
"level": 1,
"id": "54b8f7d7bffd08381f0001b2"
}
 

 

Usages


Manufacturer

Product manufacturer

 

Field Guide

Field name Type Constraint Description
_id ObjectId Key Auto Internal Unique ID of the manufacturer.
"_id" : ObjectId("530c7d72177dde00280006a4")
contract ObjectId Uni. Req. Subscription code
"contract" : "0a57cb53ba59c468a87c78d84028"
code String Uni. Req. Manufacturer's ERP/external code. That's the code used to identify an specific manufacturer externally.
"code" : "MNF0001"
name String Req. Manufacturer's name. That's the name showed in the main position in the product screen of the mobile app
""name" : "Adeltic""
sort_order Integer Opt. Position of the manufacturer
"parent" : "0a57cb53ba59c468a87c78d84028"
updated_at DateTime Auto Update datetime. Auto generated
"updated_at" : ISODate("2014-02-25T11:29:00.671Z")
created_at DateTime Auto Create datetime. Auto generated
"created_at" : ISODate("2014-02-25T11:24:34.243Z")

 

Manufacturer JSON representation sample

{
"updated_at": "2015-01-16T20:00:39.571Z",
"created_at": "2015-01-16T11:36:55.788Z",
"description": "",
"contract": "cae91e45aed80f3a3fe285c3c8c1a7e78d82d473",
"sort_order": 0,
"name": "Santa Cruz",
"code": "BR05",
"_id": "54b8f7d7bffd08381f0001bb",
"__v": 0,
"status": 1
}

 

Usages


Order

Order

 

Field Guide

Field name Type Constraint Description
_id ObjectId Key Auto Internal Unique ID of the manufacturer.
"_id" : ObjectId("530c7d72177dde00280006a4")
contract ObjectId Uni. Req. Subscription code
"contract" : "0a57cb53ba59c468a87c78d84028"
code String Uni. Req. Manufacturer's ERP/external code. That's the code used to identify an specific manufacturer externally.
"code" : "MNF0001"
name String Req. Manufacturer's name. That's the name showed in the main position in the product screen of the mobile app
""name" : "Adeltic""
comments String Opt. Comments attached to the order
"comments" : "Deliver on the office"
currency String Req. Currency code of the order
"currency": "EUR"
currency_symbol String Req. Currency Symbol
"currency_symbol": "€"
customer_code String Req. Customer external code
"customer_code": "7"
customer_id ObjectId Req. Customer ID

"customer_id": "54afcb55a866fba81c00016d"

customer_info JsonObject Req. Object that contains all the information of the customer
Link:customer_info
customer_name String Req. Fiscal name of the customer

"customer_name": "Agrolait|Agrolait",

delivery_date DateTime Opt. Date expected the order will be delivered
"delivey_date" : "2015-01-17T00:37:39.078Z"
discount Double Opt. Order disccount
"discount": 0
internalcode Integer Req. Internal code
"internalcode": 9
internalcode_pre String Req. Internal code Prefix
"internalcode_pre": "OIDUR"
unique_code String Req. Unique Code
"unique_code" : "OIDUR9"
payment_address JsonObject Req. Payment address
Link to : adress_object
payment_method String Req. Payment method of the order
"payment_method": "Immediate Payment"
pdf String Optee. URI of the document PDF
"pdf": "http://slsdev.kriter.net/images_ext/cae91e45aed80f3a3fe285c3c8c1a7e78d82d473/files/1918D928-EC40-4C69-BAFE-CCDED189EF14.pdf"
ref String Opt. Order Reference to facilitate the search
"ref": "ENTIENDA-12"
rep_id ObjectId Req. Internal ID of the rep who has made the order
"rep_id": "54760688beb6f42c15000078"
rep_info JsonObject Req. JsonObject that contains the rep info
"parent" : "0a57cb53ba59c468a87c78d84028"
round Integer Req. Position of the manufacturer
Link to : rep_info
shipping_address JsonObject Req. Shipping adress
Link to : Shipping adress object
status Integer Req. Status of the order
"status": 3
type Integer Req.

Type of the order
"type": 0

totals JsonArray Req. JsonArray of totals
Link to : Totals
lines JsonArray Req. JsonArray of lines
Link to : Lines
updated_at DateTime Auto Update datetime. Auto generated
"updated_at" : ISODate("2014-02-25T11:29:00.671Z")
created_at DateTime Auto Create datetime. Auto generated
"created_at" : ISODate("2014-02-25T11:24:34.243Z")

 

Customer_info

 

Field Guide

Field name Type Constraint Description
_id ObjectId Key Auto Internal Unique ID of the customer.
"_id" : ObjectId("530c7d72177dde00280006a4")
code String Uni. Req. Customer's ERP/external code. That's the code normally used to identify an specific customer externally.
"code" : "001PR"
comercial_name String Req. Customer's commercial name. That's the name showed in the main position in the customer screen of the mobile app
"comercial_name" : "Maname"
fiscal_name String Req. Customer's fiscal name.
"fiscal_name" : "Maname & Company Ltd."
vat_number String Opt. Customer's Vat Number.
"vat_number" : "D58709832"
telephone String Opt. Customer's telephone.
"telephone" : "(831) 758-7214"
email String Opt. Customer's e-mail.
"email" : "comercial@maname.com"
address String Opt. Customer's adress.
"address" : "26485 Ynez Road Temecula"
city String Opt. Customer's city.
"city" : "Temecula"
zip String Opt. Customer's adress ZIP code.
"zip" : "92591"
state String Opt. Customer's state.
"state" : "CA"
country String Opt. Customer's country.
"country" : "United States"
latitude Double Opt. Customer's address latitude.
"latitude" : 33.5220079
longitude Double Opt. Customer's address longitude.
"longitude" : -117.1584848
discount Double Opt. Customer's % disccount.
"discount" : 0
payment_method String Opt. Customer's payment method.
"payment_method" : "Immediately"
status Integer Req. Status of the object (1 Active / 0 Blocked )
"status" : 1
 
 

OrderLine

Field name Type Constraint Description
line String Uni. Req. Line id is GUID
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 Double Req. Quantity of items
2
sort_order Double Req. The order of the line to be presented
20150120132026
served_units Double Opt.

The number of served units
0

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

OrderTotal

Field name Type Constraint Description
local_id String Uni. Req. Generated GUID.
368F1457-F695-4201-85C1-7E18153F0F92
sort_order integer 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 Double Req. Amount value
230

Order Status Code-Reference

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

 

 

Order JSON representation sample

{
"__v": 0,
"_id": "54b9aed3928484000000000b",
"code": "1918D928-EC40-4C69-BAFE-CCDED189EF14",
"comments": "",
"contract": "cae91e45aed80f3a3fe285c3c8c1a7e78d82d473",
"created_at": "2015-01-17T00:37:39.078Z",
"created_at_local": "20150117013738",
"currency": "EUR",
"currency_symbol": "€",
"currency_value": 1,
"customer_code": "7",
"customer_id": "54afcb55a866fba81c00016d",
"customer_info": {
	"_id": "54afcb55a866fba81c00016d",
	"code": "7",
	"vat_number": "",
	"fiscal_name": "Agrolait",
	"comercial_name": "Agrolait",
	"description": "BG45-Bla bla bla bla",
	"discount": 0,
	"payment_method": "Immediate Payment",
	"status": 1,
	"address": "69 rue de Namur",
	"address_2": "",
	"city": "Wavre",
	"zip": "1300",
	"country": "Belgium",
	"state": "Brussels",
	"telephone": "+32 10 588 558",
	"telephone_2": "658 66 66 66",
	"email": "agrolait@yourcompany.example.com",
	"latitude": 0,
	"longitude": 0
},
"customer_name": "Agrolait|Agrolait",
"delivery_date": "",
"discount": 0,
"internalcode": 9,
"internalcode_pre": "OIDUR",
"payment_address": {
	"address": "69 rue de Namur",
	"address_2": "",
	"city": "Wavre",
	"zip": "1300",
	"country": "Belgium",
	"state": "Brussels",
	"telephone": "+32 10 588 558",
	"telephone_2": "658 66 66 66",
	"email": "agrolait@yourcompany.example.com",
	"latitude": 0,
	"longitude": 0
},
"payment_method": "Immediate Payment",
"pdf": "http://slsdev.kriter.net/images_ext/cae91e45aed80f3a3fe285c3c8c1a7e78d82d473/files/1918D928-EC40-4C69-BAFE-CCDED189EF14.pdf",
"ref": "Ref",
"rep_id": "54760688beb6f42c15000078",
"rep_info": {
	"firstname": "Marc",
	"lastname": "Mora",
	"email": "marc.mora@kriter.net"
},
"round": 2,
"shipping_address": {
	"address": "69 rue de Namur",
	"address_2": "",
	"city": "Wavre",
	"zip": "1300",
	"country": "Belgium",
	"state": "Brussels",
	"telephone": "+32 10 588 558",
	"telephone_2": "658 66 66 66",
	"email": "agrolait@yourcompany.example.com",
	"latitude": 0,
	"longitude": 0
},
"status": 3,
"type": 0,
"unique_code": "OIDUR9",
"updated_at": "2015-01-19T17:46:53.816Z",
"totals": [
	{
	"local_id": "CCDA693F-6091-4A62-9955-13E92AF4BEF9",
	"sort_order": "1",
	"code": "subtotal",
	"description": "Subtotal",
	"text": "900,00 €",
	"value": 900
	},
	{
	"local_id": "7B86A192-6402-4859-A2B3-4A1498670310",
	"sort_order": "2",
	"code": "headerDisc",
	"description": "Descuento",
	"text": "0,00 €",
	"value": 0
	},
	{
	"local_id": "8D82E74E-7E48-40D6-A511-34D61366BE8F",
	"sort_order": "3",
	"code": "subtotalDisc",
	"description": "Total Neto",
	"text": "900,00 €",
	"value": 900
	},
	{
	"local_id": "671249E9-655D-4D70-92D8-F78482A2E384",
	"sort_order": "4",
	"code": "taxes",
	"description": "Tasas",
	"text": "189,00 €",
	"value": 189
	},
	{
	"local_id": "8BA7604C-3308-4302-BC03-9E585179B04C",
	"sort_order": "5",
	"code": "total",
	"description": "Total",
	"text": "1.089,00 €",
	"value": 1089
	}
],
"lines": [
	{
	"line": "68CF5FFE-F225-4B3E-AD03-3FE761C097C2",
	"product_id": "54b8f7d9bffd08381f0001cd",
	"code": "0010PR",
	"related_line": "",
	"description": "Arctic Wax",
	"sort_order": "20150117013708",
	"manufacturer_name": "Lost",
	"category_name": "Gadgets",
	"units": 1,
	"served_units": 0,
	"unit_price": 30,
	"final_unit_price": 30,
	"discount_description": "",
	"discount": 0,
	"discount2": 0,
	"discount3": 0,
	"tax_description": "21.0%",
	"tax": "21.0",
	"subtotal": 30,
	"total": 30,
	"cost": 0,
	"status": 0
	},
	{
	"line": "5737860E-76C0-4468-9380-430B8887A1F7",
	"product_id": "54b8f7d9bffd08381f0001c4",
	"code": "0019PR",
	"related_line": "",
	"description": "Beelish Thick",
	"sort_order": "20150117013709",
	"manufacturer_name": "Santa Cruz",
	"category_name": "Gadgets",
	"units": 1,
	"served_units": 0,
	"unit_price": 20,
	"final_unit_price": 20,
	"discount_description": "",
	"discount": 0,
	"discount2": 0,
	"discount3": 0,
	"tax_description": "21.0%",
	"tax": "21.0",
	"subtotal": 20,
	"total": 20,
	"cost": 0,
	"status": 0
	},
	{
	"line": "B677D78C-EF02-4535-BF99-E2EAADD5690A",
	"product_id": "54b8f7d9bffd08381f0001cf",
	"code": "0008PR",
	"related_line": "",
	"description": "B

 

PriceList

Field name Type Constraint Description
_id ObjectId Key Auto Internal Unique ID of the pricelist
"_id" : ObjectId("530c7d72177dde00280006a4")
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 Integer 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

Usages

 

 

Pricelist JSON representation sample

{
"__v": 0,
"_id": "54b8f7dabffd08381f0001d8",
"code": "0",
"contract": "cae91e45aed80f3a3fe285c3c8c1a7e78d82d473",
"created_at": "2015-01-16T11:36:58.851Z",
"description": "General",
"unique_code": "0$0",
"updated_at": "2015-01-23T15:29:25.757Z",
"end_date": "2037-12-31T00:00:00.000Z",
"start_date": "2015-01-23T16:29:27.914Z",
"type": "price_discount"
}

 

PriceListLine

Field name Type Constraint Description
_id ObjectId Key Auto Internal Unique ID of the pricelist line.
"_id" : ObjectId("530c7d72177dde00280006a4")
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 Double Opt. Product Price
250
quantity Double Opt. Quantity in case the price is defined per volume.
5
discount1 Double Opt. First discount
10
discount2 Double Opt. Second discount
 5
discount3 Double Opt. Third discount
0
minimum Double Opt.

Minimum or recurrent quantity that triggers the bonus
5

bonus Double 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

 

PricelistLine JSON representation sample

  {
   "pricelist_code":"PLA2",
  "unique_code":"PL0012",
  "code" : "PR0011",
  "quantity" : 40,
  "discount1" : 7,
  "discount2" : 7,
  "discount3" : 12,
  "type" : "priceqty"
  }

 

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
units BigDecimal Req. Number of sold units
4
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 String 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

LastSale JSON representation sample

{
    "_id" : ObjectId("54e5f8c006c0898812000032"),
    "order_id" : ObjectId("54be4814b884d608a300000c"),
    "customer_id" : ObjectId("54b8f7d6bffd08381f0001ac"),
    "product_id" : ObjectId("54b8f7d9bffd08381f0001cd"),
    "product_description" : "0010PR\\Arctic Wax",
    "units" : 1,
    "unit_price" : 30,
    "final_unit_price" : 30,
    "discount_description" : "",
    "discount" : 0,
    "discount2" : 0,
    "discount3" : 0,
    "subtotal" : 30,
    "cost" : 0,
    "document_id" : "AEC72429-8898-4B60-ABB8-077F45A5EB36",
    "contract" : "cae91e45aed80f3a3fe285c3c8c1a7e78d82d473",
    "created_at" : ISODate("2015-02-19T14:52:48.000Z"),
    "updated_at" : ISODate("2015-02-19T14:52:48.000Z")
}

 

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

 

Country/State JSON representation sample

{
    "_id" : ObjectId("54c65e2ede4340840a00003b"),
    "code" : "AS",
    "name" : "American Samoa",
    "states" : [ 
        {
            "code" : "117",
            "name" : "Eastern"
        }, 
        {
            "code" : "118",
            "name" : "Manu'a"
        }, 
        {
            "code" : "119",
            "name" : "Rose Island"
        }, 
        {
            "code" : "120",
            "name" : "Swains Island"
        }, 
        {
            "code" : "121",
            "name" : "Western"
        }
    ],
    "contract" : "cae91e45aed80f3a3fe285c3c8c1a7e78d82d473",
    "created_at" : ISODate("2015-01-26T15:33:02.000Z"),
    "updated_at" : ISODate("2015-01-26T15:33:02.000Z")
}