Open Platform(API)

PFC Open Platform is an open platform based on the PFC (Royal Logistics ) sales business. Provide the our partners and customers products information, order information, shipping charge calculation , parcel tracking information and so on , users can easily integrated into our website or system, to realize the seamless connection of all the information.

How to Use

1.First of all, you need to have a PFC account
2.Enter into the user center enable the API service, access to get the secret key(Identifier)

Authorization

1.Use API need to apply from the user center,the system will generate an identifier automatically,the identifier can be blocked up or changed.
2.API Can only take out your own account information.
3.The API service request Address: "http://www.pfcexpress.com/webservice/APIWebService.asmx"

API user authorization types

Need

Acquire the country names

  1. Application scenarios: queries supported by the PFC by the state
  2. Function Name:getCountry(secretkey)
  3. Submit parameters:secretkey(API Key)
  4. Authorization: need
  5. Return:JSON

Input parameters

Field Type Whether must Default Description Example
Secretkey String Must Key d0fc2606-611f-443a-aea2-aa209673a32c80000

Return result

Field Type Whether must Default Description Example
ShortName String Must The national shorthand AF
EnName String Must Country English name Afghanistan
Cnname String Must Country Chinese name 阿富汗
Base_placeId String Must Country Code 20

Error code Show

Country ID Country Code Country CnName Country EnName

API sample tool

For Example

.NET Example

  1. First step:In your own project:asp.net,add web quotation,Provide the API service website address offered by PFC. Be assumed to be:"http://pfcexpress.com/webservice/APIWebService.asmx"
  2. Second step:Initialization,then use the method,can obtain the data
    pfc.pfcwebservice p=new pfc.pfcwebservice();
    string result = p.getCountry(secretkey);

Returns the sample

  
[{"ShortName":"AF","EnName":"Afghanistan","Cnname":"\u963F\u5BCC\u6C57","Base_placeId":"20"}]

Search supporting service modes

  1. Application of scene:Gets a list of valid means of transport(Chinese name,English name,code,delivery time,icon)
  2. Function:getChannel(secretkey)
  3. Submit parameters:secretkey(API Key)
  4. Authorization: need
  5. Return:JSON

Input parameters

Field Type Whether must Default Description Example
Secretkey String Must Key d0fc2606-611f-443a-aea2-aa209673a32c80000

Return result

Field Type Whether must Default Description Example
Base_ChannelInfoID String Must Channel code 46
ChannelCode String Must Transport code CNDHL
CnName String Must Transport Chinese name 大陆DHL普货价
EnName String Must Transport English name CNDHL
Reftime String Must Prescription 2 - 4
ShortenImage String Optional Transport icons 635195880046832907_dhl.gif

Error Code Show

API sample tool

For Example

.NET Example

  1. First step:In your own project:asp.net,add web quotation,Provide the API service website address offered by PFC.Be assumed to be: "http://pfcexpress.com/webservice/APIWebService.asmx"
  2. Second step:Initialization,then use the method,can obtain the data
    pfc.pfcwebservice p=new pfc.pfcwebservice();
    string result = p.getChannel (secretkey);

Returns the sample

[{"base_Channelinfoid":"46","ChannelCode":"CNDHL","CnName":"\u5927\u9646DHL\u666E\u8D27\u4EF7","enname":"CNDHL","reftime":"2 - 4","shortenimage":"635195880046832907_dhl.gif"}
                              

Shipping query

  1. Application of scene:According to the country and the weight and volume to get all transportation prices(Transportation Chinses name CHCnName,English name.
  2. CHEnName,code ChannelCode,delivery time RefTime,icon,totao amount MinSaleAmountTotal)
  3. Function name:getFeeByCWV(string country,stringweight,stringvolume,stringcustomerid, string secretkey)
  4. If you can identify the account of the total cost of discount
  5. Submit the parameter:country code, weight, volume, customerID ,scretkey --identifier
  6. Authorization: need
  7. Back:JSON

Input parameters

Field Type Whether must Default Description Example
country String Must Country code Austria-澳大利亚
Weight String Must Weight 0.25(kg)
Volume String Must Volume 0.25cm³
Customer ID String Must Customer ID 80000
Identifier String Must Key d0fc2606-611f-443a-aea2-aa209673a32c80000

Return result

Field Type The return value Description
CHCnName string 香港邮政航空大包 Service Chinese name
CHEnName string HKBPOST Service English name
ChannelCode string HKBPOST Channel code
RefTime string 7 - 14 Reference prescription
MinSaleAmountTotal string 109.740 Total amount

Error Code

API sample tool

For Example

.NET Example

  1. First step:In your own project:asp.net,add web quotation,Provide the API service website address offered by PFC.Be assumed to be:"http://pfcexpress.com/webservice/APIWebService.asmx"
  2. Second step:Initialization,then use the method,can obtain the data
    pfc.pfcwebservice p=new pfc.pfcwebservice();
    string result = p.getFeeByCWV(country,weight, volume,stringcustomerid, secretkey);

Returns the sample

    [{"CHCnName":"\u9999\u6E2F\u90AE\u653F\u822A\u7A7A\u5927\u5305","CHEnName":"HKBPOST","ChannelCode":"HKBPOST","RefTime":"7 - 14","MinSaleAmountTotal":"200.620"}

Parcel information checking

  1. Application of scene:Get through the order number or a tracking number(order state,total amount,order number,tracking number)
  2. Function name:getPackage(string orderNo,stringcustomerid, string secretkey)
  3. Submit the parameter:strwhere(order number or tracking number), customerid(customerID),scretkey(Key)
  4. Authorization: need
  5. Return:JSON

Input parameters

Field Type Whether must Default Description Example
OrderNo String Must Order No R800001407290002
CustomerId String Must Customer number 80000
SecretKey String Must Key d0fc2606-611f-443a-aea2-aa209673a32c80000
Remark String Optional Remark Null

Return result

Field Type The return value Description
OrderNo String R800001407290002 Order No
TrackingNo String Tracking number
field1 String 234234 Turn number
OrderStatus String 6 Order status 1
OrderStatus2 String 已发货 Order status 2
TotalAmount String 6027.250 The total cost
EnName String Albania Recipient countries
ChannelCode String GBPOST Channel Code

Error code

API sample tool

For Example

.NET Example

  1. First step:In your own project:asp.net,add web quotation,Provide the API service website address offered by PFC.Be assumed to be:"http://pfcexpress.com/webservice/APIWebService.asmx"
  2. Second step:Initialization,then use the method,can obtain the data
    pfc.pfcwebservice p=new pfc.pfcwebservice();
    string result = p.getPackage(orderNO, string customerid, secretkey);

Returns the sample

    [{"OrderNo":"R800001411160002","TrackingNo":"DDU1371690781102767","field1":"","OrderStatus2":"\u5DF2\u53D1\u8D27","TotalAmount":"26.500","ChannelCode":"GBPOST","EnName":"Argentina","OrderStatus":"6"}]

Create Order

  1. Application scenarios: users can set up by API order information into the system
  2. The requested address: "http://www.pfcexpress.com/webservice/APIWebService.asmx"
  3. Authorization: need
  4. The input parameters:Such as

Input parameters

Field Type Whether must Default Description Example
Secretkey String Must Key d0fc2606-611f-443a-aea2-aa209673a32c80000
Style String Must Order types(Fulfillment orders or Ordinary orders)Fulfillment orders is 1,Ordinary orders is 2 2
GFF_CustomerID String Must Customer ID 80000
ConsigneeName String Must The recipient name lemon
Base_ChannelInfoID String Must Transport(channel) 91
Country String Must Recipient countries 221
State String Must State Vlaams Brabant
City String Must City Londerzeel
OrderStatus String Must Order status --to be modified (Draft), to be sent, has sent (confirm) 1
Address1 String Must Address 1 United States,,,MN.USA
Address2 String Optional Address 2 United States,,,MN.USA
CsRefNo String Optional Customer reference number 1122
Zipcode String Optional Zip code 2134342
Contact String Optional Contact 180344345665
CusRemark String Optional Customer order note Null
TrackingNo String Optional Tracking Number RT209114500HK
OrderNo String Optional Order No R800001411160002--If it is modified, put in order number; if it is new, do not fill out
MaterialRefNo String Must Item 1 product code pfc11
MaterialQuantity String Must Item 1 Quantity 100
Price String Must Item 1 Price 10.2
Weight String Must Item 1 Weight 10
EnName String Must Item 1 Products English name MP31232
Warehouse ID String Must Item 1 Warehouse ID 302
ProducingArea String Optional Item 1 Country of origin
MaterialRefNo String Must Item 2 product code A0002
MaterialQuantity String Must Item 2 Quantity 100
Price String Must Item 2 Price 10.2
Weight String Must Item 2 Weight 10
EnName String Must Item 2 Product English name MP31232
Warehouse ID String Must Item 2 Warehouse ID 302
ProducingArea String Optional Item 2 Country of origin
...... ...... ...... ...... ...... ......

Case

string strorderinfo = "Style:2;GFF_CustomerID:80000;GFF_ReceiveSendAddressID:;ConsigneeName:Ameerahmed;Country:84;Base_ChannelInfoID:CNGZGH;State:Paris-;City:Paris;OrderStatus:1;Address1:144 rue de rennes, 5eme etage – CODE 6335A – NOM –COTTIN AMEER;Address2:;CsRefNo:D4N3YZMJ69LI;Zipcode:75006;Contact:+33643052323;CusRemark:;TrackingNo:;";
string strorderproduct = "MaterialRefNo:VB40021,MaterialQuantity:1,Price:27.5,Weight:0.2,EnName:Handheld Massager,WarehouseID:302,ProducingArea:112,CnName:,;MaterialRefNo:VB40021,MaterialQuantity:1,Price:27.5,Weight:0.2,EnName:Handheld Massager,WarehouseID:302,ProducingArea:112,CnName:,;";
string stradd = "";(Do not fill NULL)
string key = "ca0c0b19-4d8c-46b2-b91b-10fb3b44da9f80000";

Return result

Field Type Whether must Example Description
complete Boolean No True The success of that submission The output parameters after the submission of returns generated by the system order number and return message, order number and prompt information separated with '-', if the error returned error code returned information shown in column directly return a string of success: the order preserving and submitted successfully! -DL140887 (tracking number); R800001409100028 (Order No.) Note: the tracking number back tracking number, no tracking number does not return, order No. shall return error information is returned instance: save failed, please check whether the data entry error! Error recipient countries! System matching to the corresponding recipient countries order new successful, successful forecast results of an example: order preserving and submitted successfully! -DL140887 (tracking number); R800001409100028 (Order No.) prediction results: Forecast: 1 records!, successful prediction of 1 records orders new successful, forecast failure results of example: order preserving and submitted to the success! -DL140887 (tracking number); R800001409100028 (Order No.) prediction results: forecast failure Order No.: R800001409090003 error message: order validation errors, the error message [0] for the weight of the commodity can not

Returns the sample

Description Example
Order to save and submit success R800001411160002

Error Code

Error Code Error description The solution
Save failed, please check whether the error data entry item!! According to the prompt enter the correct data

API sample tool


For Example

.NET Example

  1. First step:In your own project:asp.net,add web quotation,Provide the API service website address offered by PFC.Be assumed to be:http://pfcexpress.com/webservice/APIWebService.asmx
  2. Second step:Initialization,then use the method,can obtain the data
    pfc.pfcwebservice p = newpfc.pfcwebservice();
    string result = p. InsertUpdateOrder(strorderinfo, strorderproduct, stradd, secretkey);

Returns the sample

Order to save and submit success!-R800001501190004 

Create Order(v2)

  1. Application scenarios: users can set up by API order information into the system
  2. The requested address: "http://www.pfcexpress.com/webservice/v2/CreateShipment.aspx"
  3. Authorization: need
  4. The input parameters:Such as

Parameter description

Field type Must/Optional Description Demo
Type Int Must Order types(Fulfillment orders or Ordinary orders)Fulfillment orders is 1,Ordinary orders is 2 2
INorOut Int Must 0 export 1 import 0
WarehouseId String Optional Fulfillment orders is must 302
CsRefNo String Optional Customer reference number 201710100001
CustomerId String Must Customer ID(80000) 80000
ChannelId String Must Transport(channel) 91
Sender String Optional Send Name PFCexpress
SendAddress String Optional Send Address San Fernando
SendPhone String Optional Send Phone 400-66566-88888
SendEmail String Optional Send Email sales@pfcexpress.com
SendCompany String Optional Send Company pfc.inc
ShipToName String Must Consignee Name zhangshan
ShipToPhoneNumber String Must Consignee Contact 4008888888
ShipToCountry String Must Consignee Country code(US) US
ShipToState String Must Consignee State UT
ShipToCity String Must Consignee City Cedar City
ShipToAdress1 String Must Consignee Adress1 1225 W Harding Ave Apt 32
ShipToAdress2 String Optional Consignee Adress2
ShipToZipCode String Must Consignee ZipCode 84720
ShipToCompanyName String Optional Consignee CompanyName Company.inc
ShipToEmail String Optional Consignee Email Email@me.com
OrderStatus Int Must Order status --to be modified (Draft), to be sent, has sent (confirm) 1
TrackingNo String Optional Tracking Number
BatteryFlag String Optional Battery? 0 No 1 Yes default 0 0
CODFee decimal Optional CODFee 500.00
IDCardNo String Optional IDCardNo Must
Remark String Optional Remark
Products Array Must Products info
SKU String Must SKU SKU0001
EnName String Must Products English name Reflective clothes
CnName String Optional Products Chinese name 反光衣
MaterialQuantity Int Must Quantity 1
Price decimal Must Unit Price(USD) 10.00
Weight decimal Weight Unit Weight(KG) 0.5
Length decimal Optional Length(/CM) 0.5
Width decimal Optional Width(/CM) 0.5
High decimal Optional High(/CM) 0.5
ProducingArea String Optional ProducingArea CN
HSCode String Optional HSCode HS8888888

Request Demo

.NET demo

string serverurl = "http://www.pfcexpress.com/";
string acition = "webservice/v2/CreateShipment.aspx";
string apikey = "75273d06-3371-4cfb-9fa3-4621644d53b180000";
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(serverurl + acition);
request.ContentType = "application/json";
request.Accept = "application/json";
request.Headers.Add("Authorization", "Bearer " + apikey);
request.Method = "Post";
byte[] data = Encoding.UTF8.GetBytes(Body);
request.ContentLength = data.Length;
using (Stream requestStream = request.GetRequestStream())
{
requestStream.Write(data, 0, data.Length);
}
try
{
using (WebResponse response = request.GetResponse())
{
using (StreamReader reader = new StreamReader(response.GetResponseStream()))
{
string text = reader.ReadToEnd();
}
}
}
catch (WebException ex)
{
throw ex;
}

JAVA demo

try {
String serverurl="http://www.pfcexpress.com/";
String action="webservice/v2/CreateShipment.aspx";
String apikey="75273d06-3371-4cfb-9fa3-4621644d53b180000";
URL url = new URL(serverurl+action);
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setDoOutput(true);
conn.setDoInput(true);
conn.setUseCaches(false);
conn.setRequestMethod("POST");
conn.setRequestProperty("Connection", "Keep-Alive");
conn.setRequestProperty("Charset", "UTF-8");
byte[] data = Body.getBytes();
conn.setRequestProperty("Content-Length", String.valueOf(data.length));
conn.setRequestProperty("Content-Type", "application/json");
conn.setRequestProperty("Authorization", "Bearer " + apikey);
conn.connect();
OutputStream out = conn.getOutputStream();
out.write((shipment.toString()).getBytes());
out.flush();
out.close();
System.out.println(conn.getResponseCode());
if (conn.getResponseCode() == 200) {
System.out.println("ok");
InputStream in = conn.getInputStream();
String result = null;
try {
byte[] rsdata = new byte[in.available()];
in.read(rsdata);
result = new String(rsdata);
System.out.println(result);
} catch (Exception e1) {
e1.printStackTrace();
} } else {
System.out.println("no++");
}
} catch (Exception e) {
}

PHP demo

$serverurl = "http://www.pfcexpress.com/";
$acition = "webservice/v2/CreateShipment.aspx";
$apikey = "75273d06-3371-4cfb-9fa3-4621644d53b180000";
$params=array(
'Type'=>2,
'CustomerId'=>'80000',
'ChannelId'=>'DPD',
'Sender'=>'Ken',
'SendPhone'=>'73948563',
'SendAddress'=>'20 Orley Ave',
'SendCompany'=>'CS',
'SendEmail'=>'fjyer@huangjia.com',
'ShipToName'=>'Eric',
'ShipToPhoneNumber'=>'2025551212',
'ShipToCountry'=>'US',
'ShipToState'=>'DC',
'ShipToCity'=>'Washington',
'ShipToAdress1'=>'475 L Enfant Plaza SW',
'ShipToAdress2'=>'',
'ShipToZipCode'=>'20260',
'ShipToCompanyName'=>'Express',
'OrderStatus'=>1,
'TrackingNo'=>'',
'Remark'=>'',
'BatteryFlag'=>0,
'INorOut'=>0,
'CODFee'=>0,
'IDCardNo'=>'',
'CsRefNo'=>'JH008',
'WarehouseId'=>'',
'Products'=>array(
array(
'CnName'=>'手机',
'EnName'=>'Mobile',
'Weight'=>0.1,
'Price'=>5800,
'ProducingArea'=>'America',
'HSCode'=>'65421',
'SKU'=>'SK001',
'Length'=>0.1,
'Width'=>0.2,
'High'=>0.3,
'MaterialQuantity'=>1
),
array(
'CnName'=>'鞋子',
'EnName'=>'shoes',
'Weight'=>0.2,
'Price'=>120,
'ProducingArea'=>'France',
'HSCode'=>'65421',
'SKU'=>'SK002',
'Length'=>0.1,
'Width'=>0.2,
'High'=>0.3,
'MaterialQuantity'=>1
)
)
);
$jsonparams=json_encode($params);
$headers=array('Authorization: '.'Bearer '.$apikey,'Content-type: application/json');
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $serverurl.$acition);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonparams);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 60);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$json = curl_exec($ch);
curl_close($ch);
$result=json_decode($json, true);
print_r($result);

Returned data

No. type name type Explain
1 status Int 200 Success
500:Unknown error
501: API key is not correct
502:Parameter error
503: Can not find the country code
504: Can not find the channel code
505: Sender not found
506: CsRefNo repeat
507: The TrackingNo is already exist(TrackingNo is unique)
508: Forecast failure
509: Insufficient inventory
510: Parameter error
511:Can not find the product
512:Order status incorrect
513: The order type is incorrect
2 msg string Information prompt
3 data string Returned data

Response

Success

Success: { "status": 200, "msg": "Success", "data": { "TrackingNo": null, "OrderNo": "R800001709270001", "CsRefNo": "JH0010", "LablesUrl": null } }

failed

failed: { "status": 506, "msg": "CsRefNo repeat", "data": null }

Through the API check the storage status

  1. For the users of the application scenario can through the API to check the SKU/bar code stored information
  2. If need to be authorized ,please go to the user center to apply the key---the identifier .
  3. Query website address:"http://www.pfcexpress.com/webservice/APIWebService.asmx/getStock"
  4. Input parameter:
  5. Authorization: need
  6. Return:Json

Input parameters

Field Type Whether must Default Description Example
skuorcode String Must SKU/Bar code A00001
customerid String Must Customer id 80000
Secretkey String Must Key d0fc2606-611f-443a-aea2-aa209673a32c80000
WarehouseName String Must Storage (SZWH- Shenzhen West Licang (302), GZWH (381) HKWH- Hongkong Guangzhou storage warehouse(382)) 302

Return result

Field The return value Description
OutinQuantity 8662 The amount of inventory
Stock 6 The occupation number
CnName MP31243 112\uFF0C Products Chinese name
EnName MP31 Products English name
OutinQuantity 1 The amount of inventory
Stock 1 The occupation number
CnName MP31243 112\uFF0C Products Chinese name
EnName MP31 Products English name

Error code

Error code Error Description The solution

API sample tool


For Example

.NET Example

  1. First step:In your own project:asp.net,add web quotation,Provide the API service website address offered by PFC.Be assumed to be:"http://pfcexpress.com/webservice/APIWebService.asmx "
  2. Second step:Initialization,then use the method,can obtain the data
    string result = p. getStock (skuorcode, customerid, secretkey, WarehouseName);
    Such as:p.getStock(S4-ACHEB, 80003,2acd2496-78f8-4eac-ba9c-fd152c2fb41e80003,302)

Returns the sample

    [{"OutinQuantity":"8662","Stock":"6","CnName":"MP31243 112\uFF0C","EnName":"MP31"},{"OutinQuantity":"1","Stock":"1","CnName":"MP31243 112\uFF0C","EnName":"MP31"}]

Orders tracking information

  1. The application scenario users can be through the API check the order tracking information.
  2. Query website address:"http://www.pfcexpress.com/webservice/APIWebService.asmx/getOrder_Track"
  3. Input parameter:OrderNo(tracking information ,tracking number)
  4. Output parameter:back json character string

Input parameters

Field Type Whether must Default Description Example
Order number/Tracking number String Must Order No/TrackingNo R800001411160002

Return result

Description The return value
The delivery of content SHENZHEN - CHINA:PFC交运发往目的地(Departed Facility in PFC)
Time 2014-11-16 16:19:55

Error Code

Error Code Error Description The Solution

API sample tool

For Example

.NET Example

  1. First step:In your own project:asp.net,add web quotation, Provide the API service website address offered by PFC.Be assumed to be: "http://www.pfcexpress.com/webservice/APIWebService.asmx"
  2. Second step:Initialization,then use the method, can obtain the data. pfc.pfcwebservice p = newpfc.pfcwebservice();
    string result = p. getOrder_Track("R807521408070065")

Returns the sample

 Describe                                                    The last delivery time
SHENZHEN - CHINA:PFC交运发往目的地(Departed Facility in PFC)   2014-11-16 16:32:09
SHENZHEN - CHINA:PFC收取包裹(Shipment picked up) 	             2014-11-16 16:19:55

Print the shipping labels

  1. Users of application scenarios can access the address directly fill in the corresponding information can print label
  2. Query website address:
    "http://www.pfcexpress.com/Manage/PrintPage/Print_PDF.aspx?OrderNo=RP05851311190001,&type=A4"(A4label)
    "http://www.pfcexpress.com/Manage/PrintPage/Print_PDF.aspx?OrderNo=RP05851311190001,&type=(heat-sensitive Label)"
  3. Rameter introduction:OrderNo can fill order number,tracking number.RP05851311190001,RP05851311190001 Use the semicolon to separate.
  4. Type:Print format =A4 or Heat sensitive

Input parameters

Field Type Whether must Default Description Example
type     Printing paper format: A4 print A4 size; Blank thermal printing format. A4
Order number   Must Order Number/Tracking Number R800001411160002
API Tools

Acquire the fulfillment information

  1. Users of application scenarios can be through API to get the fulfillment details
  2. Query website address: "http://www.pfcexpress.com/webservice/APIWebService.asmx"

Input parameters

Field Type Whether must Default Description Example
Secretkey String Must Key d0fc2606-611f-443a-aea2-aa209673a32c80000

Return result Show

API Tools

For Example

.NET Example

  1. First step:In your own project:asp.net,add web quotation, Provide the API service website address offered by PFC.Be assumed to be: "http://www.pfcexpress.com/webservice/APIWebService.asmx"
  2. Second step:Initialization,then use the method, can obtain the data.
    pfc.pfcwebservice p = newpfc.pfcwebservice();
    string result = p. GetWarehouse();//back to the character string

Returns the sample

 302:SZWH-Shenzhen warehouse;381:GZWH-Guangzhou warehouse;382:HKWH-Hongkong warehouse;457:Shenzhen VIP warehouse
                              

Technical support

API questions please email to: sales@pfcexpress.com

Please Wait