Skip to main content
Skip table of contents

Payment Order Placement

Post a payment transaction on Smobilpay for e-commerce to initiate the payment process.

The payment order request contains information about the payment to be collected:

  • Items included in the order (for presentation to customer in the payment page)

  • Total amount requested from customer for payment (in XAF)

  • Language of customer (to present payment page in customer’s language)

  • Optional information for tracking and increased customer experience

(warning) Validations:

The backend validates the data sent in the payment order:

  • CASE: 1 or more items are submitted in the Payment Order

    • For each item, the quantity multiplied by the unit cost must be equal to the sub-total

    • The sum of all sub-total must be equal to the Total Amount

  • CASE: No items are submitted in the Payment Order

    • The Total Amount is used

URL

/api/order

HTTP method

POST


Request


Content-Type

application/json

Path Params

none

Query Params

none

Header Params

Authorization: Bearer <access token>

Body

OrderPlacementRequest - [JSON]


Example

Request

CODE
{
  "currency": "XAF",
  "customerName": "Che Devert",
  "description": "Order for electronics",
  "email": "maviance.akongnwi.devert@gmail.com",
  "expiryDate": "2018-11-25T14:47:03.597Z",
  "id": {
    "uuid": "45auf-dj76x-78dhg",
    "version": "V1.2"
  },
  "items": [
    {
      "itemId": "12",
      "particulars": "Samsung Galaxy s6",
      "quantity": 2,
      "subTotal": 150000,
      "unitCost": 75000
    },
    {
      "itemId": "14",
      "particulars": "Sony TV HD12",
      "quantity": 1,
      "subTotal": 50000,
      "unitCost": 50000
    }
  ],
  "langKey": "en",
  "merchantReference": "abc123456",
  "orderDate": "2018-11-25T14:47:03.597Z",
  "phoneNumber": "+237653754334",
  "receiptUrl": "www.myshop.com",
  "totalAmount": 200000,
  "optRefOne": "myRef1",
  "optRefTwo": "myRef2"
}


Response

CODE
HTTP/1.1 201 Created 
Content-Type: application/json; charset=UTF-8

{
  "orderTransactionId": "dc332ac8a45e452eb7543e059c586126",
  "merchantReferenceId": "abc123456",
  "redirectUrl": "https://payment.enkap.cm/payment/ui/auth?stxid=dc332ac8a45e452eb7543e059c586126"
}

Data Types

Input Data Types

Name

Type

Required

Maximum Length

Description

id

object

N


id of the transaction generated by your system

id.uuid

string

N


uuid of the transaction generated by your system

id.version

string

N


version of api used for this transaction

langKey

string

N,
default: en

2

The language key used in the payment option portal. It corresponds to the ISO-2 language. Current supported language keys: en, fr

description

string

N

100

The description of the order.

totalAmount

Float

Y


The total amount of the order.

Email

string

N


Email of the customer.

phoneNumber

string

N


This is the contact/phone number of the customer placing the order.

customerName

string

N

50

The name of the customer.

currency

enum [XAF]

Y

3

The ISO-3 code of the currency

expiryDate

Date

N,
default: 7 days


The date when the transaction will expire if the customer does not complete the payment. Date should be formatted based on ISO-8106 like "1970-01-01T00:00:00.000+0000"

orderDate

Date

N


The date of the order. Smobilpay for e-commerce will generate one automatically using current date and time if not provided.

merchantReference

string

Y

36

This is the merchants transaction reference which has to be unique for each transaction that is requested. This can be used to query the status of the transaction.

Items

List

N


Container for order items

itemId

string

N

36

The unique id of the purchased item.

particulars

string

N

50

Description of the item.

unitCost

Float

N


Cost per unit of the purchased item.

Quantity

Integer

N


Quantity purchased.

Subtotal

Float

N


The subtotal of the line of items.

receiptUrl

string

N


The URL where the customer can download or print the receipt after a successful payment.

optRefOne

string

N


Optional order reference

optRefTwo

string

N


Optional order reference

Output Data Types

Name

Type

Description

orderTransactionId

string

The tracking id of the transaction. This should be used for any query related API. For example, query the status of the payment.

merchantReferenceId

string

The unique reference id created by your system and provided in the request.

redirectUrl

string

The URL where to redirect the customer browser.


JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.