Not logged in - Login
< back

Order API Interface Specification

Table of Content

  1. Introduction
    1. Overview
    2. How to send requests
  2. Basic Concepts
    1. Message Transport
    2. Authentication
  3. JSON Message
    1. ORD_AuthenticationRQ/RS
      1. Support Operations
      2. Business Rules
      3. ORD_AuthenticationRQ
      4. Sample Call Url Request
      5. ORD_AuthenticationRS
      6. Sample Message Response Success
      7. Sample Message Response Not Success
    2. ORD_GetOrderRQ/RS
      1. Support Operations
      2. Business Rules
      3. ORD_GetOrderRQ
      4. Sample Call Url Request
      5. ORD_GetOrderRS
      6. Sample Message Response
    3. ORD_GetCustomerRQ/RS
      1. Support Operations
      2. Business Rules
      3. ORD_GetCustomerRQ
      4. Sample Call Url Request
      5. ORD_GetCustomerRS
      6. Sample Message Response
      7. Sample Message Response Not Success
    4. ORD_UpdateOrderRQ/RS
      1. Support Operations
      2. Business Rules
      3. ORD_UpdateOrderRQ
      4. Sample Call Url Request
      5. ORD_UpdateOrderRS
      6. Sample Message Response
    5. ORD_ErrorRS
      1. ORD_ErrorRS 'Status' Values List

1 Introduction

1.1 Overview

The use of this interface for communication with the exPub Service Providers using Call URL over a HTTPS protocol. The interface supports the exchange of:

  • Order List
  • Customer Information

1.2 How to send requests

Test environment data response: https://api.expubwebsites.net/OrderApi/GetOrder?test=true (Get Order List)
https://api.expubwebsites.net/OrderApi/GetInformationCustomer?test=true (Get Customer Information)

The addresses to which to send requests are the following: https://api.expubwebsites.net/OrderApi/Authentication?token={token get from Service Providers} (Check Authentication)
https://api.expubwebsites.net/OrderApi/GetOrder?token={token get from Service Providers} (Get Order List)
https://api.expubwebsites.net/OrderApi/GetInformationCustomer?token={token get from Service Providers}&order_id={order_id} (Get Customer Information)
https://api.expubwebsites.net/OrderApi/UpdateOrder?token={token get from Service Providers}&{Parameter} (Update Order)

You must send your token and parameter request. This can be achieved through various programming methods, which will vary according to the programming language you're using. API will return json string to your program.

2. Basic Concepts

2.1 Message Transport

All messages are transported via HTTPS GET/POST.

2.2 Authentication

The OrderAPI provides the credentials necessary for consuming the WebServices being offered to the receiving system. Security credentials consist of: Token – A login for authentication that is provided by the OrderAPI at the time of the order e.g. the requesting system should have the ability to connect to different URLs. Connections to the different servers may use the same account information

3 JSON Message

3.1 ORD_AuthenticationRQ/RS

This message identifies the initial request for checking authentication.

3.1.1 Support Operations

Portal requests information about the authentication.

3.1.2 Business Rules

This message is only sent from the portal to the Service Providers. Only requests received via GET/POST method will be accepted.

3.1.3 ORD_AuthenticationRQ

This message identifies the initial request for order data. Using this message the requester may retrieve status authentication.

ParameterRequired(R)
Optional(O)
NotesData Type/ Possible values
tokenRA reference for additional message identification, assigned by the requesting host system. When a request message includes an echo token the corresponding response message include an echo token with the identical valueString Length:1 -128

3.1.4 Sample Call Url Request

https://api.expubwebsites.net/OrderApi/Authentication?token=340FDFAE958CD5335A8CD22B390A6F76497ED23BFBBC877467

3.1.5 ORD_AuthenticationRS

The ORD_AuthenticationRS is the message used to indicate the status of processing the ORD_AuthenticationRQ message. This message returns json that meet the requested criteria and/or Warnings, or Errors if the request did not succeed.

Element(E)NameNotesData Type/ Possible values
EAPIAPI NameString Length:1 -20
EVersionThe message version indicated by a decimal value.Decimal
ETokenA reference for additional message identification, assigned by the requesting host system. When a request message includes an echo token the corresponding response message include an echo token with the identical valueString Length:1 -128
EStatusIdentifies the status of the call url request.Integer
EMessageMessage call url request of statusString Length: 1 - 500
ERequestDate RequestTimeStamp

3.1.6 Simple Message Response Success

{"API":"ORD_Authentication","Version":"0.1","Token":"340FDFAE958CL5335A8CD22B390A6F76497ED23BFBAC877467","Status":2,"Message":"Authentication Success","Request":"2015-06-11T09:56:12.6124108+07:00"}

3.1.6 Simple Message Response Not Success (Wrong Token)

{"API":"ORD_Authentication","Version":"0.1","Token":"340FDFAE958CD5335A8CD22B390A6F76497ED23BFBAC87746","Status":6,"Message":"Error Authentication Wrong Token !","Request":"2015-06-11T10:00:01.5397846+07:00"}

3.2 ORD_GetOrderRQ/RS

This message identifies the initial request for order data.

3.2.1 Support Operations

Portal requests information about the order

3.2.2 Business Rules

This message is only sent from the portal to the Service Providers. Only requests received via GET/POST method will be accepted.

3.2.3 ORD_GetOrderRQ

This message identifies the initial request for order data. Using this message the requester may retrieve a list of order

ParameterRequired(R)
Optional(O)
NotesData Type/ Possible values
tokenRA reference for additional message identification, assigned by the requesting host system. When a request message includes an echo token the corresponding response message include an echo token with the identical valueString Length:1 -128
start_dateOformat dateString / (yyyy-MM-dd)
end_dateOformat dateString / (yyyy-MM-dd)

3.2.4 Sample Message Call Url Request

https://api.expubwebsites.net/OrderApi/GetOrder?token=340FDFAE958CD5335A8CD22B390A6F76497ED23BFBAC877467

3.2.4 ORD_GetOrderRS

The ORD_GetOrderRS is the message used to indicate the status of processing the ORD_GetOrderRQ message. This message returns a list of order that meet the requested criteria and/or Warnings, or Errors if the request did not succeed.

Element(E)NameNotesData Type/ Possible values
EAPIAPI NameString Length:1 -20
EVersionThe message version indicated by a decimal value.Decimal
ETokenA reference for additional message identification, assigned by the requesting host system. When a request message includes an echo token the corresponding response message include an echo token with the identical valueString Length:1 -128
EStatusIdentifies the status of the call url request.Integer
EMessageMessage call url request of statusString Length: 1 - 500
ERequestDate RequestTimeStamp
EFoundItemCount OrderInteger
EOrders  
EOrders.OrderIdThe Order that uniquely identifiesInteger
EOrders.ParentOrderIdIdentity Order Another OrderInteger
EOrders.OrderNumberName number of orderString Length: 1 - 20
EOrders.OrderSubtotalThe total amount not including any associated taxDecimal
EOrders.OrderTaxThe price of taxDecimal
EOrders.OrderTotalThe total amount not including any associated taxDecimal
EOrders.OutstandingAmountOutstanding balanceDecimal
EOrders.OrderDiscountThe price of discountDecimal
EOrders.OrderCurrencyCodeCurrency codeString Length: 1 - 3 / Possible values: USD, THB
EOrders.OrderStatusIdOrder StatusInteger / Possible values:
15 = ReadyToInvoice
30 = Complete
EOrders.ShippingFeeThe price of sendingDecimal
EOrders.PaymentFeeThe price of paymentDecimal
EOrders.PaymentStatusIdPayment StatusInteger / Possible values:
10 = Pending
20 = Authorize
30 = Paid
35 = PartiallyRefunded
40 = Refunded
50 = Voided
60 = NotPaid
EOrders.PaidDatePaid DateTimeStamp
EOrders.DeliveryDateDelivery DateTimeStamp
EOrders.PaymentMethodNameText type in payString Length: 1 - 100
EOrders.NotesInformation from customerString Length: 1 - 1000
EOrders.TrackingNumberNumber of EMSString Length: 1 - 100
EOrders.DateCreatedDate of orderDateTime
EOrder.OurRefOur Refferent NumberInteger
EOrder.YourRefYour Refferent NumberInteger
EOrders.BillingFirstNameFirst NameString Length: 1 - 100
EOrders.BillingLastNameLast NameString Length: 1 - 100
EOrders.BillingPhoneNumberTelephone number assigned to a singleString Length: 1 - 50
EOrders.BillingMobileNumberTelephone number assigned to a singleString Length: 1 - 50
EOrders.BillingFaxNumberFax NumberString Length: 1 - 50
EOrders.BillingEmailUsed to pass detailed email informationString Length: 1 - 255
EOrders.BillingCompanyCompany NameString Length: 1 - 100
EOrders.BillingAddress1Contact AddressString Length: 1 - 100
EOrders.BillingAddress2Contact AddressString Length: 1 - 100
EOrders.BillingCityCity NameString Length: 1 - 100
EOrders.BillingStateProvinceState Province NameString Length: 1 - 100
EOrders.BillingZipPostalCodeZip codeString Length: 1 - 30
EOrders.BillingCountryCountry NameString Length: 1 - 100
EOrders.BillingCountryIdCountry CodeString Length: 1 - 2 / Possible values: US, TH, ES,..
EOrders.ShippingStatusIdShipping StatusInteger / Possible values:
10 = NotYetShipped
20 = Shipped
30 = ShippingNotRequired
EOrders.ShippingFirstNameFirst NameString Length: 1 - 100
EOrders.ShippingLastNameLast NameString Length: 1 - 100
EOrders.ShippingPhoneNumberTelephone number assigned to a singleString Length: 1 - 50
EOrders.ShippingMobileNumberTelephone number assigned to a singleString Length: 1 - 50
EOrders.ShippingFaxNumberFax NumberString Length: 1 - 50
EOrders.ShippingEmailUsed to pass detailed email informationString Length: 1 - 255
EShippingCompanyCompany NameString Length: 1 - 100
EOrders.ShippingAddress1Contact AddressString Length: 1 - 100
EOrders.ShippingAddress2Contact AddressString Length: 1 - 100
EOrders.ShippingCityCity NameString Length: 1 - 100
EOrders.ShippingStateProvinceState Province NameString Length: 1 - 100
EOrders.ShippingZipPostalCodeZip codeString Length: 1 - 30
EOrders.ShippingCountryCountry NameString Length: 1 - 100
EOrders.ShippingCountryIdCountry CodeString Length: 1 - 2 / Possible values: US, TH, ES,..
EOrders.PersonLegacyIdExternal Person IdInteger
EOrders.CompanyLegacyIdExternal Company IdInteger
EOrders.OrderProductVariantsInformation about a product in order 
EOrders.OrderProductVariants.OrderProductVariantIdProduct Variant IdInteger
EOrders.OrderProductVariants.UnitPriceThe price of productDecimal
EOrders.OrderProductVariants.QuantityThe quantity of productInteger
EOrders.OrderProductVariants.OrderItemCodeCode of productString Length: 1 - 50
EOrders.OrderProductVariants.OrderItemDescriptionDescription of productString Length: 1 - 200

3.2.5 Sample Message Response

{"API":"ORD_GetOrder","Version":"0.1","Token":"340FDFAE958CD5335A8CD22B390A6F76497ED23BFBAC877467","Status":1,"Message":"Success","Request":"2015-06-17T14:01:50.9078506+07:00","FoundItem":2,"Orders":[{"OrderId":9036,"ParentOrderId":9035,"OrderNumber":"1","OrderSubtotal":295.0000,"OrderTax":0.0000,"OrderTotal":295.0000,"OutstandingAmount":0.0000,"OrderDiscount":0.0000,"OrderCurrencyCode":"USD","OrderStatusId":30,"ShippingFee":0.0000,"PaymentFee":0.0000,"PaymentStatusId":30,"PaidDate":null,"DeliveryDate":null,"PaymentMethodName":"PayPal Express","Notes":null,"TrackingNumber":null,"DateCreated":"2014-03-09T01:53:06.343","OurRef":null,"YourRef":9315,"BillingFirstName":"Bill","BillingLastName":"Smith","BillingPhoneNumber":"1-123-456","BillingMobileNumber":null,"BillingEmail":"{{{bill@billscompany.com}}}","BillingFaxNumber":null,"BillingCompany":null,"BillingAddress1":"2000 Main Street","BillingAddress2":"","BillingCity":"Smallville","BillingStateProvince":"Florida","BillingZipPostalCode":null,"BillingCountry":null,"BillingCountryId":null,"ShippingStatusId":10,"ShippingFirstName":"Bill","ShippingLastName":"Smith","ShippingPhoneNumber":"1-123-456","ShippingMobileNumber":null,"ShippingEmail":"{{{bill@billscompany.com}}}","ShippingFaxNumber":null,"ShippingCompany":null,"ShippingAddress1":"2000 Main Street","ShippingAddress2":"","ShippingCity":"Smallville","ShippingStateProvince":"Florida","ShippingZipPostalCode":"20152","ShippingCountry":null,"ShippingCountryId":null,"OrderProductVariants":[{"OrderProductVariantId":12345,"UnitPrice":295.0000,"Quantity":1,"OrderItemCode":null,"OrderItemDescription":null}]},{"OrderId":5432,"ParentOrderId":0,"OrderNumber":"ORD-541","OrderSubtotal":295.0000,"OrderTax":0.0000,"OrderTotal":295.0000,"OutstandingAmount":295.0000,"OrderDiscount":0.0000,"OrderCurrencyCode":"USD","OrderStatusId":30,"ShippingFee":0.0000,"PaymentFee":0.0000,"PaymentStatusId":10,"PaidDate":null,"DeliveryDate":null,"PaymentMethodName":"Direct Checkout","Notes":null,"TrackingNumber":null,"DateCreated":"2014-03-09T02:24:57.867","OurRef":null,"YourRef":9315,"BillingFirstName":"Bill","BillingLastName":"Smith","BillingPhoneNumber":"1-123-456","BillingMobileNumber":null,"BillingEmail":"{{{bill@billscompany.com}}}","BillingFaxNumber":null,"BillingCompany":null,"BillingAddress1":"2000 Main Street","BillingAddress2":"","BillingCity":"Smallville","BillingStateProvince":"Florida","BillingZipPostalCode":"20152","BillingCountry":null,"BillingCountryId":null,"ShippingStatusId":10,"ShippingFirstName":"Bill","ShippingLastName":"Smith","ShippingPhoneNumber":"1-123-456","ShippingMobileNumber":null,"ShippingEmail":"bill@billscompany.com","ShippingFaxNumber":null,"ShippingCompany":null,"ShippingAddress1":"2000 Main Street","ShippingAddress2":"","ShippingCity":"Smallville","ShippingStateProvince":"Florida","ShippingZipPostalCode":"20152","ShippingCountry":null,"ShippingCountryId":null,"OrderProductVariants":[{"OrderProductVariantId":11706,"UnitPrice":295.0000,"Quantity":1,"OrderItemCode":null,"OrderItemDescription":null}]}]}