AddNewOrder

Create a new order in Avasam

Call

https://app.avasam.com/apiseeker/OrdersCreation/AddNewOrder

When using the Avasam API, remember that it must be called correctly, using the appropriate method (such as POST) described in this article, and with a valid token (Which can be obtained using the Login call). Otherwise the server may return an error.

Parameters

The header details for this call are as follows:

Field name

Type

Description

Is Required

GeneralInfo

GeneralInfoModel

Used for general detail data

True

CustomerInfo

AddressModel

Used for customer detail data

True

CustomerType

String

Always blank

False

Items

List<ItemModel>

Used for order item detail

True

Shippingservicename

String

Used for shipping service name

True

Shippingserviceid

String

Used for shipping service id

True

Shippingservicecharge

String

Used for shipping service charge value

True

SupplierCode

String

Always blank

False

Notes

String

Used for order note details

False

OrderType

String

Used for order type detail create order time only one type used like – ‘Queue’

True

IsSelf

bool

Always false

False

GeneralInfoModel

Field name

Type

Description

Is Required

ReferenceNum

String

Used for order reference number

True

ReceivedDate

DateTime

Used for order creation date time

True

Name

String

Used for delivery customer full name

True

FirstName

String

Used for delivery customer first name

True

SurName

String

Used for customer surname

True

Address

String

Used for shipping   address

True

City

String

Used for shipping city name

True

PostCode

String

Used for shipping post code

True

County

String

Used for shipping country name

True

PhoneNo

String

Used for customer phone number

False

Email

String

Used for delivery customer email id

False

Error

List<String>

Always blank

False

Source

String

Used for order’s source name

True

SubSource

String

Used for order’s subsource name

False

AddressModel (CustomerInfo)

Field name

Type

Description

Is Required

ReferenceNum

String

Used for order reference number

True

ReceivedDate

DateTime

Used for order creation date time

True

Name

String

Used for delivery customer full name

True

FirstName

String

Used for delivery customer first name

True

SurName

String

Used for customer surname

True

Address

String

Used for shipping   address

True

City

String

Used for shipping city name

True

PostCode

String

Used for shipping post code

True

County

String

Used for shipping country name

True

PhoneNo

String

Used for customer phone number

False

Email

String

Used for delivery customer email id

False

Error

List<String>

Always blank

False

Source

String

Used for order source name

True

SubSource

String

Used for order subsource name

False

ItemModel

Field name

Type

Description

Is Required

_id

String

Used for item unique id

False

SKU

String

Used for product Avasam SKU number

True

Number

string

Used for product Avasam SKU

True

Price

Double

Used for product price

True

Costprice

Double

Used for product cost price

True

Title

String

Used for Product title value

True

BarCode

String

Used for product barcode value

false

Vat

Double

Used for product vat value

True

PackQty

int

Used for create order in use product count value

True

Image

String

Used for product image path

True

Authkey

String

Used for supplier code

True

IsSelected

bool

Used to show if product is selected (yes/no)

True

ActualPackQty

int

Used for product pack quantity

True

VatPer

Double

Used for product VAT value

True

DiscountPer

double

Used for discount per product value

True

 

Request body

The call is structured as follows:

{

"GeneralInfo":

{

"ReferenceNum":"ODS8267541",

"ReceivedDate":"21/01/2021 15:00",

"Name":"MrUser",

"FirstName":"Mr",

"SurName":"User",

"Address":"9, big circle society,OP Road",

"City":"Park Royal",

"PostCode":"NW10 7JB",

"County":"United Kingdom",

"PhoneNo":"+4433011377",

"Email":"user@email.com",

"Error":[],

"Source":"Avasam",

"SubSource":""

},

"CustomerInfo":

{

"ReferenceNum":"ODS8267541",

"ReceivedDate":"21/01/2021 15:00",

"Name":"MrUser",

"FirstName":"Mr",

"SurName":"User",

"Address":"9, big circle society,OP Road",

"City":"Park Royal",

"PostCode":"NW10 7JB",

"County":"United Kingdom",

"PhoneNo":"+4433011377",

"Email":"user@email.com",

"Error":[],

"Source":"Avasam",

"SubSource":""

},

"CustomerType":"",

"Items":

[{

"_id":"00000000-0000-0000-0000-000000000000",

"SKU":"S036570016",

"Number":"S036570016",

"Price":12,

"costprice":23,

"Title":"New Product T-shirt",

"BarCode":null,

"Vat":20,

"PackQty":1,

"image":"https://avasam.s3.amazonaws.com/avasam/05d86d7a-326e-47e9-b391-688579013619/07b2e4c3-b223-4caf-a556-147761eeca44.jpg",

"authkey":"GB010003",

"IsSelected":true,

"ActualPackQty":220,

"VatPer":20,

"DiscountPer":5

}],

"shippingservicename":"Expedited Tracked ( 1 to 2 days)",

"shippingserviceid":"1",

"shippingservicecharge":12.5,

"SupplierCode":"select",

"Notes":"New order create.",

"OrderType":"Queue",

"IsSelf":false

}

Response

 

Field

Type

Description

ErrorCode

int

Error code of order response
0 = no error
1 = error

Message

String

Error body for order request

id

int

Always returns 0

 

 

 

 

 

Response body

The response from Avasam will come in the following form:

{
"ErrorCode": 0,
"Message":
"Order created successfully.","id": 0
}