1. API
  2. Supplier API

CreateNewOrder

Create an order in Avasam for a customer

Creating an order is only possible once you have a customer and one or more products to add to their records.

 

Call

https://app.avasam.com/api/OrdersCreation/CreateNewOrder

Parameters

The header details for this call are as follows:

Field name

Type

Description

Is Required

GeneralInfo

GeneralInfoModel

Shows detailsfor order (see GeneralInfoModel)

True

CustomerInfo

AddressModel

Shows customer-specific details (see AddressModel)

True

CustomerID

String

Contains the selected seller’s unique id

True

Items

List<ItemModel>

Used for order item details (See ItemModel)

True

Notes

String

Any notes associated with order at creation

False

ShippingService

String

The selected shipping service name

True

OrderType

String

Specify the order type (eg Seller)

True

IsSelf

bool

If supplier created the order manually, set as yes.

False

GeneralInfoModel

Field name

Type

Description

Is Required

ReferenceNum

String

Order reference number

True

ReceivedDate

DateTime

The date &time the order was created

True

Name

String

Shippingaddress – customer’s full name

True

Address

String

Shipping address building address

True

City

String

Shipping city name

True

PostCode

String

Shipping address post code

True

County

String

Shipping address country name

True

PhoneNo

String

Customer phone number

False

Email

String

Customer email address

False

Source

String

Specifies the source of the order (eg Amazon, eBay etc)

True

SubSource

String

Specifies the source of the order (internal reference)

False

Error

List<String>

Always blank

False

ShippingService

String

Avasam shipping service name

True

FirstName

String

Shipping address customer first name

True

SurName

String

Shipping address   customer surname

True

AddressModel

Field name

Type

Description

Is Required

ReferenceNum

String

Order reference number

True

ReceivedDate

DateTime

The date & time the order was created

True

Name

String

Shipping address – customer’s full name

True

Address

String

Shipping address building address

True

City

String

Shipping city name

True

PostCode

String

Shipping address post code

True

County

String

Shipping address country name

True

PhoneNo

String

Customer phone number

False

Email

String

Customer email address

False

Source

String

Specifies the source of the order (eg Amazon, eBay etc)

True

SubSource

String

Specifies the source of the order (internal reference)

False

Error

List<String>

Always blank

False

ShippingService

String

Avasam shipping service name

True

FirstName

String

Shipping address customer first name

True

SurName

String

Shipping address   customer surname

True

ItemModel

Field name

Type

Description

Is Required

_id

String

Item unique id (internal reference)

False

SKU

String

Avasam SKU (External ID)

True

Number

string

Avasam SKU

True

Price

Double

Product RRP

True

Costprice

Double

Product cost price for seller

True

Title

String

Product title

True

Vat

Double

Product VAT rate

True

PackQty

int

How many items included in order when a single SKU item is purchased

True

Image

String

Product main image path

True

IsSelected

bool

Specify if product has been selected (yes or no)

True

ActualPackQty

int

Total number of item in order

True

Discount

double

Used for product discount value

True

Request body

The call is structured as follows:

{

"GeneralInfo":

{

"ReferenceNum":"ODS7529463",

"ReceivedDate":"22/01/2021, 19:19",

"Name":"Test user Test user surname",

"Address":"Test address detail",

"City":"London",

"PostCode":"Ygv2637",

"County":"United Kingdom",

"PhoneNo":"8787656578",

"Email":"testuser@ebg.com",

"Source":"Avasam",

"SubSource":"",

"Error":[],

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

"FirstName":"Test user",

"SurName":"Test user surname"

},

"CustomerInfo":

{

"ReferenceNum":"ODS7529463",

"ReceivedDate":"22/01/2021, 19:19",

"Name":"Test user Test user surname",

"Address":"Test address detail",

"City":"London",

"PostCode":"Ygv2637",

"County":"United Kingdom",

"PhoneNo":"8787656578",

"Email":"testuser@ebg.com",

"Source":"Avasam",

"SubSource":"",

"Error":[],

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

"FirstName":"Test user",

"SurName":"Test user surname"

},

"CustomerID":"00000000-0000-0000-0000-000000000000",

"Items":

[{

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

        "SKU":"Test56789",

        "Number":"S036570016",

        "Price":12,

        "costprice":23,

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

        "Vat":20,

        "PackQty":1,

        "image":"",

        "IsSelected":true,

        "ActualPackQty":99,

        "Discount":"0"

}],

"Notes":"test create order note",

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

"OrderType":"Sellers",

"IsSelf":false

}

Response

The response from Avasam will come in the following form:

Field

Type

Description

ErrorCode

int

Specifies if an error has been returned
0 = no error
1 = error Should this be Boolean? - No, because we have use int value

Message

String

Error body for order request

id

int

Always returns 0

Response body

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