#salesOrders.list
#salesOrders.findById
#salesOrders.create
#salesOrders.update
#salesOrders.delete

salesOrders.list

Request

{
/* — search criteria (optional) — */
"companyNumber":"",     // <-- Numeric
"companyName":""
"numberFrom":"",        // <-- Numeric
"numberTo":"",          // <-- Numeric
"reference":"",
"dateFrom":"",          // <-- Date format DD/MM/AAAA
"dateTo":"",            // <-- Date format DD/MM/AAAA
"deliveryDateFrom":"",  // <-- Date format DD/MM/AAAA
"deliveryDateTo":"",    // <-- Date format DD/MM/AAAA
"totalAmountFrom":"",   // <-- Numeric
"totalAmountTo":"",     // <-- Numeric
"remarks":""
}

Response

{
    "data":     {
        "result":         [
                        {
                "version": 5,
                "id": "1982",
                "documentID": 1982,
                "documentTypeID": 2,
                "number": 2,
                "editable": true,
                "canImport": true,
                "statusColor": "#FFFF00",
                "currentStatusID": 10,
                "status": "open",
                "statusDescription": "Abierto",
                "companyID": 11521,
                "companyNumber": 3,
                "companyName": "Petit Sire",
                "equivalenceSurchageEnabled": false,
                "date": "31/01/2011 00:00:00",
                "deliveryDate": "04/02/2011 00:00:00",
                "reference": "ref.12U31U73",
                "carrierID":"22",
                "freights":"2",
                "remarks": "Urgente",
                "totalAmount": 269.9,
                "subtotal": 259.44,
                "userID": 362,
                "userName": "Luis Medina Robles"
            },
                        {
                "version": 4,
                "id": "1937",
                "documentID": 1937,
                "documentTypeID": 2,
                "number": 1,
                "editable": false,
                "canImport": false,
                "statusColor": "#00CC00",
                "currentStatusID": 12,
                "status": "accepted",
                "statusDescription": "Aceptado",
                "companyID": 11521,
                "companyNumber": 3,
                "companyName": "Petit Sire",
                "equivalenceSurchageEnabled": false,
                "date": "18/01/2011 00:00:00",
                "reference": "PD-2011-001",
                "totalAmount": 2236.89,
                "subtotal": 1895.68,
                "userID": 363,
                "userName": "Lara Pérez García"
            }
        ],
        "total": 2
    },
    "success": true
}

salesOrders.findById

Request

{
"id": "1982"
}

Response

{
    "data":     {
        "version": 5,
        "id": "1982",
        "documentID": 1982,
        "documentTypeID": 2,
        "editable": true,
        "canImport": true,

        "companyID": 11521,
        "street1": "84, ru Isaie Sellier",
        "street2": "BP 20003",
        "postalCode": "80531",
        "companyName": "Petit Sire",
        "companyNumber": 3,
        "country": "FRA",
        "phone": "+33 344600813",
        "equivalenceSurchageEnabled": true,

        "currentStatusID": 10,
        "status": "open",
        "statusDescription": "Abierto",
        "featureDescription": "El pedido no ha sido enviado",

        "number": 2,
        "date": "31/01/2011 00:00:00",
        "deliveryDate": "04/02/2011 00:00:00",
        "reference": "ref.12U31U73",
        "paymentTypeID": 1260000001014,
        "paymentTypeName": "Cheque",
        "dueTypeID": 1260000001008,
        "dueTypeName": "A 90 días",
        "carrierID":"22",
        "freights":"2",
        "remarks": "Urgente",
        "printColor": "#222FFE",
        "pdfTemplate": "General",
        "userID": 362,
        "userName": "Luis Medina Robles",

        "taxIdDefault": 1260000001300,
        "taxDescriptionDefault": "IVA General",
        "taxValueDefault": 18,

        "statusInfo":         [
                        {
                "statusDescription": "Abierto",
                "statusName": "open",
                "transitable": true
            },
                        {
                "statusDescription": "Lanzado",
                "statusName": "issued",
                "transitable": true
            },
                        {
                "statusDescription": "Aceptado",
                "statusName": "accepted",
                "transitable": false
            },
                        {
                "statusDescription": "Anulado",
                "statusName": "cancelled",
                "transitable": false
            },
                        {
                "statusDescription": "Rechazado",
                "statusName": "rejected",
                "transitable": false
            }
        ],

        "statesHistory": [        {
            "description": "Abierto",
            "date": "31/01/2011 13:37:51",
            "changeUser": "Luis Medina Robles"
        }],

        "productLines":         [
                        {
                "version": 0,
                "sourceLine": "Manual",
                "id": "5140",
                "lineID": 5140,
                "itemID": 1243,
                "itemReference": "HERMES-B008",
                "description": "Caudal 22 l/min aprox. Inversor.",
                "units": 3,
                "unitAmount": 72.03,
                "amount": 216.09,
                "taxID": 1260000001300,
                "taxDescription": "IVA General",
                "taxValue": 18
            },
                        {
                "version": 0,
                "sourceLine": "Manual",
                "id": "5150",
                "lineID": 5150,
                "itemID": 1232,
                "itemReference": "ATENEA-D005",
                "description": "Embellecedor con manecilla.",
                "units": 1,
                "unitAmount": 43.21,
                "discount": 1,
                "amount": 42.7779,
                "taxID": 1260000001334,
                "taxDescription": "IVA Super Reducido",
                "taxValue": 4
            }
        ],

        "serviceLines": [        {
            "version": 0,
            "sourceLine": "Manual",
            "id": "5149",
            "lineID": 5149,
            "description": "Envío urgente",
            "date": "04/02/2011 00:00:00",
            "units": 1,
            "unitAmount": 20,
            "discount": 1,
            "amount": 19.8,
            "taxID": 1260000001300,
            "taxDescription": "IVA General",
            "taxValue": 18
        }],

        "withhold": true,
        "withholdAmount": 15,
        "salesDiscount": 2,
        "salesDiscountAmount": 5.573358,
        "earlyPaymentDiscount": 5,
        "earlyPaymentDiscountAmount": 13.654727,

        "subtotalWithoutDiscounts": 278.6679,
        "subtotal": 259.44177,
        "withholdTotal": 38.914018,
        "taxesSurchargeTotal": 49.368806,
        "taxesTotal": 41.122516,
        "generalTotal": 269.9,
        "totalLines":         [
                        {
                "id": "5149",
                "taxDescription": "IVA General (18%)",
                "surcharge": 0,
                "totalAmountDiscountsIncluded": 18.43,
                "taxSurchargeAmount": 3.3174,
                "surchargeAmount": 0,
                "taxAmount": 3.3174
            },
                        {
                "id": "5140",
                "taxDescription": "IVA General (18%)",
                "surcharge": 4,
                "totalAmountDiscountsIncluded": 201.18,
                "taxAmount": 36.2124,
                "surchargeAmount": 8.0472,
                "taxSurchargeAmount": 44.2596
            },
                        {
                "id": "5150",
                "taxDescription": "IVA Super Reducido (4%)",
                "surcharge": 0.5,
                "totalAmountDiscountsIncluded": 39.8179,
                "taxAmount": 1.592716,
                "surchargeAmount": 0.19909,
                "taxSurchargeAmount": 1.791806
            }
        ]
    }
    "success": true
}

salesOrders.create

Request

{
	"number":"",                  // If empty, a new one autonumeric is assigned
	"date":"07/02/2011",
	"deliveryDate":"",
	"companyID":"11524",          // id value from customers.list
	"reference":"Ref.11098782",
	"paymentTypeID":"900",        // id value from paymentType.list
	"dueTypeID":"1260000001008",  // id value from dueDateTypes.list
	"remarks":"De oferta enviada en el mes de Enero",
	"withhold":"true",
	"withholdAmount":"15",
	"salesDiscount":"10",
	"earlyPaymentDiscount":"",
	"productLines":
	[
		{
		"itemID":1236,              // id value from items.list
		"units":2,
		"unitAmount":63.55,
		"discount":2,
		"taxID":1260000001334,      // id value from taxes.list
		"remarks":""
		}
	],
	"serviceLines":
	[
		{
		"description":"S1",
		"units":1,
		"unitAmount":28.45,
		"discount":"",
		"taxID":1260000001300,      // id value from taxes.list
		"date":"",
		"remarks":""
		}
	]
}

Response

{
"data": {
"errors": [],
"messages": [ {
"description": "Operación realizada correctamente",
"id": "operation_success"
}],
"warns": []
},
"id": "1994",
"success": true
}

salesOrders.update

Request

{
	"id":"1994",
	"documentID":"1994",
	"date":"07/02/2011",
	"deliveryDate":"20/02/2011",
	"companyID":"11524",           // id value from customers.list
	"reference":"Ref.11098782",
	"paymentTypeID":"900",         // id value from paymentType.list
	"dueTypeID":"1040",            // id value from dueDateTypes.list  
	"carrierID":"21",              // id value from carriers.list
	"freights":"1",                // values: 1=Prepaid shipment, 2=Collect on Delivery
	"remarks":"De oferta enviada en el mes de Enero",
	"productLines":
	[
		{
		"lineID":5153,
		"itemID":1236,            // id value from items.list
		"units":2,
		"unitAmount":63.55,
		"discount":2,
		"taxID":1260000001334,    // id value from taxes.list
		"remarks":""
		},
		{
		"itemID":"1237",          // id value from items.list
		"units":1,
		"unitAmount":72.03,
		"discount":"",
		"taxID":1260000001300,    // id value from taxes.list
		"remarks":""
		}
	],
	"serviceLines":
	[
		{
		"lineID":5154,
		"description":"S1",
		"units":1,
		"unitAmount":28.45,
		"discount":"",
		"taxID":1260000001300,    // id value from taxes.list
		"date":"",
		"remarks":""
		}
	],
	"newStatus":"issued"
}

Response

{
"data": {
"errors": [],
"messages": [ {
"description": "Operación realizada correctamente",
"id": "operation_success"
}],
"warns": []
},
"id": "1994",
"success": true
}

salesOrders.delete

Request

{
"id":"1993",
"version":0
}

Response

{
    "data":     {
        "errors": [],
        "messages": [        {
            "args": ["1913"],
            "description": "Operación realizada correctamente",
            "id": "operation_success"
        }],
        "warns": []
    },
    "success": true
}