Skip to content

Create Payment Order

Function Description

  • The merchant creates a payment order for approved customers.

DANGER

Only approved customers can successfully create payment orders.

Create Payment Order API

Request URL

  • /payee/payCustomTicket/create

Request Method

  • POST

Request Parameters

The request parameters are as follows:

TIP

  1. If one of the merchant customer ID and system customer ID is not transmitted, the interface will respond to parameter missing errors.
  2. The sandbox environment creates a payment ticket for a customer who has filled in a test account, which will automatically complete the payment process and trigger a callback notification.
  3. STCPay payment only supports SAR currency.
ParameterRequiredTypeDefault ValueDescription
customidNstring-System customer ID, length limit 64 characters
mercustomidNstring-Merchant customer ID, length limit 128 characters
payeeuidYstring-Merchant order ID, which must be globally unique and has a length limit of 64 characters
amountYfloat-Payment amount, accurate to two decimal places
currencyYstring-Currency code
paymentmethodYstring-Payment method

Request Parameter Example

json
{
    "mercustomid":"u004",
    "payeeuid":"TEST1234567aa12sd2",
    "amount":2002,
    "currency":"SAR",
    "paymentmethod":"bankTransfer"
}

Response Parameters

The response parameters are as follows:

  • Response Body
ParameterTypeDescription
ticketidstringPayment order ID
keystringPayment order key, unique for each payment order
customidstringSystem customer ID
mercustomidstringMerchant customer ID
payeeuidstringMerchant order ID
trantypestringTransaction type
currencystringReturns the currency code when applying for payout
paymentmethodstringpayment method
amountfloatTotal amount paid by the payer
realamountfloatThe actual amount received by the payee
feefloatHandling fee
statusnumberPayment order status
statusdescstringStatus description
confirmtimenumberPayment completion time
custominfoobjectCustomer data snapshot when creating a payment order, with the same data structure as customer data
created_atnumberCreation time
updated_atnumberUpdate time

Response parameter Example

json
{
    "code": 200,
    "message": "Request succeeded.",
    "data": {
        "ticketid": "17d59",
        "key": "M4TBTQU20240626141958",
        "customid": "13033",
        "mercustomid": "u006",
        "payeeuid": "PAY12345678",
        "trantype": "standard",
        "currency": "SAR",
        "paymentmethod": "STCPay",
        "amount": 18.75,
        "realamount": 17.81,
        "fee": 0.94,
        "feeconfigid": 1,
        "status": 0,
        "statusdesc": "2024-06-26 14:19:58",
        "confirmtime": 0,
        "custominfo": {
            "customid": "13033",
            "mercustomid": "u006",
            "name_e": "updTest32",
            "name_a": "dbnuo",
            "identity": "p/aFchx1MfO1BqrKTkiOs5FsAcynsiNUWjB3UABZYW2DssEt6EL2zU+r1g9tAwydbSAbMunA3zDcMut9vZ/dT8Nha1f+do35KivBBp1pTuI+kfaY8vja1pYmw6oEMUtpZyIWSu7kCg1bGjLX5IWCXZYdB0t3rCyzoAlomokwuZdHBKy/uEQzLsln6QU33MfayNxdGcGIYgpv4VCCiS7MejW9MP3Jh/y0Re/M5lW271xsES38J5RKEKhRUr1wAnp6vCkXZrn7Hd5tnxwUdHGHSGNK9/IV2cKICb3/GlsAq+sxHPDTOfkIhCvrOANKpuFqHUysJoGiFMc87Nc8J4raUQ==",
            "identitypic": "fvL4hLLMcXtVA0NHDmZidAIY5yiwlZZcd26EfHEdZgX8CdbXPO8eWB4cDAyQ8Bz3xBzDqUL4u02Q/kRxVPLIh8dPZ2ooMX6SPdxH5FW2HHlJ7vm2mqz0XgRy+DLC731xRbuUuxms9SuDfxCGDwiCddPFpuvkqRiUdOdmW9kcP064Y5V+KA7M1PgQLSn2h2hfyREN2yos7njZDDwveIfNpGi+hR4AjjQXYmKLlsbjDz/5kNPRbWOrvmL7karJKsja2GRauj5GbHUBnqX05NJhQvSzen4UDDnY9BfBtcDuC9pEyUOyIIRMIB3VkLbUvlWMzuFeYD+u7iE35f2vBkPXqA==",
            "signpic": "",
            "bankname": "Riyad Bank",
            "bankcode": "1174c",
            "cardno": "q7gmtfi1gieWi/d6XHqtTKzAHi6Wxoxm4C9FGDYvmgYK8l7kK2H3IwcWnpO8liyhDAwBG42gebVYcOURTxhnGIhRXptEdegtQk5k0CqrPUghfMbTtUMSlj+ztxaa+HsRDlNfau35LOBoGcpn1tNV0OMar6XnR40KN06fkngItbKQvj8MC605cr/EI7Jit2qzNsUTUvlbQG53XuXV6pq/JIhMSUrO8JNcVzPc5G4VdruO4d7C3BzFqkpg4C5zf2bL+PuiE8WLyCOJFsOoxDtubkSviBYKS8SI2qYTkyZvVeZTICbNJw71OouycTj/FE+/HqaLjN7ue4NjzFwodK6bHw==",
            "ibanaccount": "1234567892",
            "stcaccount": "QYLZ+8VpsZc2E5jljmaBSFySy4dvOWI5Q6nne+egdk0CYOc0g3t9guwAXTSKZWjij5Luy4EHrTju9f6VPsh7P33AJf4rHu/E86lr7vHxgwrriLHgdz3tbrCWolP9kW/i0d2uVuUTq2HgGddYNJgOvd5sBcyLDMMnDERJXRNfGKoIR5igUCQWZIzqTZXUGOWdm8tysHT3vnJb+DnWb2GNA0vLvwW36pUi8qxhb4Gbttt3J+Rzz+K/KsiziUmNWU1F1cr7e6qSvOze6TicfIogDt21FRGB/y5qYYOUE+fMd7HKxnY3i3LUu0q6T+ldQ9jlp2am78wS7T0yi0TMeNf3wQ==",
            "status": 1,
            "statusdesc": "Approved",
            "demand_perfection": [],
            "created_at": 1707394806,
            "updated_at": 1719400743
        },
        "created_at": 1719400798,
        "updated_at": 1719400798
    },
    "sensitiveFields": {
        "custominfo": [
            "identity",
            "identitypic",
            "signpic",
            "stcaccount",
            "cardno"
        ]
    },
    "requestId": "8A1D33FFBC9F379C1C6F423FFF7B8A46"
}