# 1. Create food order

# Brief Description

  • After J&T confirms the completion of the payment, needs to send a request to Swifood to create an order. Swifood will then create the order for the merchant and push the instruction to print the payment receipt to the connected printer.

# HTTP Request Information

# Request URL

  • {domain}/open-api/order/jt/create

# Request Method

  • POST

# Request Header

Parameter Name Required Type Description
Content-Type Yes string application/json

# Request Body Parameters

Parameter Name Required Type Length Limit Example Description
appId Yes string - 45eebd745dcf0b5f6d6f9fcde28cd9fe8116a892 App id (provided by Swifood)
storeKey Yes string 100 CVIEIYUNHTS0 Store key (provided by Swifood)
param Yes string - - Request param content string
sign Yes string - RSA sign of param

# Param Parameters

Parameter Name Required Type Length Limit Example Description
paymentWay Yes int - 1 Payment Method : 1:online 2:offline (Online mode is not supported)
paymentChannel No string 1 - 200 QRPH_DYNAMIC_QR Payment channel (Required for online payment) Payment channel list
paymentTransactionId No string 1 - 50 Payment order id (Required for online payment)
paymentAmount No int 1 - 100000000 100 Payment amount (Actual payment), The unit is cent
discountAmount No int 1 - 100000000 10 Discount amount, The unit is cent
productInfo Yes List 1 - 50 - Product info
AWB Yes string 1 - 50 sender AWB
name Yes string 1 - 50 sender Name
mobile Yes string 1 - 14 sender mobile
address Yes string 1 - 200 sender address

# Product Info Param

Parameter Name Required Type Length Limit Example Description
productName Yes string 1 - 50 coffee Product name
price Yes integer 0 - 1000000 100 Unit price of product after tax, Unit: cents
quantity Yes integer 1 - 1000 1 Product quantity

# Request body example

{
  "appId": "45eebd745dcf0b5f6d6f9fcde28cd9fe8116a892",
  "storeKey": "CVIEIYUNHTS0",
  "sign": "abcdef",
  "param": "{\"productInfo\": [{\"productName\": \"item\",\"price\": 100,\"quantity\": 1}],\"customPrintContext\": \"test custom\",\"paymentWay\": 1,\"paymentTransaction\": \"ON12384876123\",\"paymentAmount\": 100,\"discountAmount\": 10, \"discountType\": 1,\"AWB\": \"12384876123132\",\"name\": \"Kim\",\"mobile\": \"0912345678\",\"address\": \"test Address\"}"
}

# Response Example

# Code Refer to this list

# Response Parameters

Parameter Name Type Example Description
code int 10000 Status Code Refer to List
message string success Status Code Information
data string - Response Param
{
  "code": 10000,
  "message": "success",
  "data": "{\"orderNo\":\"TB*******431\"}"
}

# Failed Response Example

{
    "code":21000,
    "message":"Service error, please contact administrator",
    "data":null
}

# Payment Channel

Channel Name Channel Code
QRPH QRPH_DYNAMIC_QR
GCash WebPay GCASH_URL
Grab WebPay GRPY_URL
UnionBank UBPB_URL
BPI BPIA_URL
Maya PAYMAYA_URL
ShopeePay SHOPEE_URL
UnionBank UBPB_URL
WechatPay WECHAT_URL
Alipay ZFB_URL
GCash QR GCASH_DYNAMIC_QR
GCash Scan QR GCASH_CPM
GCash QR GCASH_DYNAMIC_QR