Skip to main content

Step 2: RequestCreateOrder

Create Order is an interface provided to merchants to submit a pre-order with brief transaction information provided, such as a short code, merchant order ID, order amount, etc. In the subscription payment scenario, the mandate information should be submitted. The interface will respond with a prepayId, which is necessary to evoke the checkout page. The contract details will be shown on the checkout page when the pre-order is for a subscription payment business.

Quick Step on create order:

  1. The Merchant Server sends a request with payment details to create an order, including mandate or subscription payment information.

  2. The Merchant Server receives an order ID after successfully creating the order, which opens the checkout page in the Mobile Money Customer App.

  3. Customer enters their PIN and sends a payment request.

  4. The App Server invokes the payOrder interface to process the payment and create a mandate contract.

  5. The Order Service notifies the merchant server in the background about the result of the contract signing.

    Note The price at which the fee is deducted in create order must align with the specified price determined by the system (SP poral).

Create apply Request Create Order service

Create a file at API\service\requestCreateOrderService.js:

API\service\requestCreateOrder.js
INSERT CODE HERE

// module.exports = createOrder;

Request Parameters

HEADER PARAMETERS

ParameterData TypeM/ODescription
X-APP-KeyStringMFabric App ID, provided by fabric portal of Ethio telecom
AuthorizationStringMApp Token for authentication

REQUEST BODY SCHEMA

ParameterData TypeM/ODescription
timestampstringM<= 13 characters ^[0-9][1-9][0-9]$
Time when a request is sent. UTC timestamp. The unit is second
methodstringMSet to ‘payment.preorder’, fixed for this interface
-payment.preorder
nonce_strstringM<= 256 characters [\w-]+
Random character string containing a maximum of 256 characters,including uppercase letters, lowercase letters, digits, but not specialcharacters
sign_typestringMSignature type. Currently, HmacSHA256 and SHA256WithRSA aresupported."
enum:
#VALUE!
#VALUE!
#VALUE!
signStringM<= 512 characters \S+
Request signature.
BC4EE8D710BAC6A7E33DE4511A1CE7723
024615EEF491B80DEF7DC743D4DADBE
versionStringM<= 4 characters  [0-9.]*
Interface version number. Only support 1.0 now
M
biz_contentMultiple mandate objects
notify_urlStringM<= 512 characters 
redirect_urlString<= 512 characters 
appidStringM<= 32 characters  ^[A-Za-z0-9]+$
APP ID of the Mandate order
This field is entered when a mandating order is created.
merch_codeStringM<= 16 characters  ^[A-Za-z0-9]+$
Application ID allocated to a merchant by Mobile Payment systemmerch_order_id
The order number generated by the merchant side. It must bein the form of letters, numbers, and underscores. Other special characters are not allowed
trade_typeStringTrade type. The option are InApp、Cross-App、Checkout、WebCheckout、PWA、QrCode、NativeApp"
enum:
InApp
Cross-App
Checkout
WebCheckout
PWA
QrCode
NativeApp
BankTrade
“Mandate”
titleStringM<= 512 characters 
total_amountStringM<= 20 characters 
trans_currencyStringM<= 3 characters  \w+
Three-letter code complying with international standards, for example, MMK (Kyat)
timeout_expressStringM<= 10 characters  [0-9]*m$
Latest payment time allowed for an order. The transaction will be closed after the deadline. The value ranges from 1 minute to 120 minutes.The value of this parameter cannot contain dots. For example, the value1.5 hours must be converted to 90 minutes. If this parameter is not set,120 minutes is used by default
business_typeStringexample: "Buy goods"
business type
maxLength: 32
pattern: "[\s\w-]*"
payee_identifierStringexample: "1563161657"
payee identifier"
pattern: "^[A-Za-z0-9]*$"
payee_identifier_typeStringexample: "01"
payee identifier type
pattern: "[0-9]*"
payee_typeStringexample: "1000"
payee type
pattern: "[0-9]*"
callback_infoStringAfter the payment is successful, Payment will notify the merchant server of the callback request to return this field as it is, and the merchant can pass the business parameters according to its own needs. Must be in URL encoding format.
maxLength: 64
pattern: "[\s\w-%]*"
noteStringexample: "hello"
note
maxLength: 256
pattern: "[\s\w-]*"
operator_idStringexample: "0000"
Operator ID
maxLength: 128
pattern: "^[A-Za-z0-9]+$"
mandate_dataStringMmandate data
remain_daysString
pattern: "^[1-9]
sub_identifierStringmaxLength: 32
pattern: "^[A-Za-z0-9]+$"

Response Parameters

ParameterData TypeM/ODescription
resultStringexample: "SUCCESS"
SUCCESS or FAIL. When this field is FAIL, the code field is a specific business error code.
codeStringexample: "0"
Return code. 0 is successful, the rest is the business error code
msgStringexample: "Success"
Return information, simple error description.
nonce_strStringexample: "274E40E9388047778768B67068B9C8AF"
Random character string. 256 characters or fewer.
maxLength: 256
signStringMexample: "BC4EE8D710BAC6A7E33DE4511A1CE772
3024615EEF491B80DEF7DC743D4DADBE"
Specifies a signature.
maxLength: 512
sign_typeStringSignature type. Currently, HmacSHA256 and SHA256WithRSA are supported.
enum:
#VALUE!
#VALUE!
biz_contentM
merch_order_idStringMexample: "201907161732001"
The order number generated by the merchant side. It must be in the form of letters, numbers, and underscores. Other special characters are not allowed.
maxLength: 64
pattern: "^[A-Za-z0-9]+$"
prepay_idStringexample: "007a6bd3175cdb3c658545a4f3f85fac23143239021"
ID of the customer payment process.When return_code is SUCCESS,this value will return
maxLength: 128
pattern: "^[A-Za-z0-9]+$"
qrcodeStringexample: "1801208886097590927019026"
This parameter is valid only when trade_type is set to PAY_BY_QRCODE during order placement.
maxLength: 128
pattern: "^[A-Za-z0-9]+$"
errorCodeString
errorMsgString