PayOrc
S2S (Seamless API)

STC Pay

Process payments via STC Pay wallet integration.

STC Pay

Version: 3.0.0

Generate API Key for S2S channel. Navigate to Developers → API Keys → Add new API key → Select S2S in the Channel Dropdown.

STC Pay is a mobile wallet payment method. The customer is redirected to complete payment via the STC Pay app. The API returns a redirection URL that the customer follows to authorize the payment.

Endpoint

MethodURL
POSThttps://api.payorc.com/s2s/v1/payment

Please use the test credentials for sandbox testing.

Headers

HeaderTypeRequiredDescription
merchant-keyStringYesYour merchant API key
merchant-secretStringYesYour merchant API secret
Content-TypeStringYesMust be application/json

Request Body

FieldTypeRequiredDescription
data.actionStringYesTransaction action: SALE
data.classStringYesMust be ECOM
data.capture_methodStringYesAUTOMATIC
data.payment_tokenStringNoLeave empty for STC Pay
data.typeStringYesMust be STCPAY
data.customer_details.m_customer_idStringNoYour internal customer ID
data.customer_details.nameStringYesCustomer full name
data.customer_details.emailStringYesCustomer email address
data.customer_details.mobileStringYesCustomer mobile number
data.customer_details.codeStringYesCountry dial code (e.g., 966 for Saudi Arabia)
data.order_details.m_order_idStringYesYour unique order ID
data.order_details.amountStringYesTransaction amount
data.order_details.currencyStringYesMust be SAR
data.order_details.return_urlStringYesURL to redirect after payment
data.itemsArrayYesArray of order items
data.billing_detailsObjectYesBilling address details
data.stcpay_details.idStringYesSTC Pay registered phone number (e.g., +966594393608)
data.shipping_detailsObjectNoShipping address details
data.urlsObjectNoRedirect and webhook URLs — see S2S Payment URLs

Code Examples

curl --location --globoff 'https://api.payorc.com/s2s/v1/payment' \
--header 'merchant-key: YOUR_MERCHANT_KEY' \
--header 'merchant-secret: YOUR_MERCHANT_SECRET' \
--header 'Content-Type: application/json' \
--data-raw '{
  "data": {
    "action": "SALE",
    "class": "ECOM",
    "capture_method": "AUTOMATIC",
    "payment_token": "",
    "type": "STCPAY",
    "customer_details": {
      "m_customer_id": "1234",
      "name": "John Doe",
      "email": "[email protected]",
      "mobile": "594393608",
      "code": "966"
    },
    "order_details": {
      "m_order_id": "123456",
      "amount": "50",
      "currency": "SAR",
      "convenience_fee": "0",
      "description": "STC Pay payment",
      "return_url": "http://localhost/status"
    },
    "items": [
      {
        "title": "Product Name",
        "description": "Product description",
        "quantity": 1,
        "unit_price": "50.00",
        "discount_amount": "0.00",
        "is_refundable": true
      }
    ],
    "billing_details": {
      "address_line1": "Po Box 12322",
      "city": "Riyadh",
      "province": "Riyadh",
      "country": "SA",
      "pin": "54044"
    },
    "shipping_details": {
      "shipping_name": "John Doe",
      "shipping_email": "[email protected]",
      "shipping_code": "",
      "shipping_mobile": "",
      "address_line1": "Po Box 12322",
      "address_line2": "Jebel Ali Free Zone",
      "city": "Dubai",
      "province": "Dubai",
      "country": "AE",
      "pin": "54044",
      "location_pin": "",
      "shipping_currency": "AED",
      "shipping_amount": "0"
    },
    "parameters": [
      { "alpha": "" },
      { "beta": "" },
      { "gamma": "" },
      { "delta": "" },
      { "epsilon": "" }
    ],
    "custom_data": [
      { "alpha": "" },
      { "beta": "" },
      { "gamma": "" },
      { "delta": "" },
      { "epsilon": "" }
    ],
    "urls": {
      "success": "",
      "cancel": "",
      "failure": "",
      "webhook_url": "https://merchant.example.com/webhook"
    },

    "stcpay_details": {
      "id": "+966594393608"
    }
  }
}'

Success Response

{
  "data": {
    "order_status": "SUCCESS",
    "order_id": 1000010379,
    "amount": 50,
    "currency": "SAR",
    "psp_name": "telr",
    "redirection_url": "https://nodeserver.payorc.com/api/v1/stcpay/redirection/CC023F6305533251886C18E8AEA1B365E1A3725D8C4D60C8452984C1766616BF/1000010379/test",
    "stcpay_id": "+966594393608"
  },
  "message": "STCPay redirection url.",
  "status": "success",
  "code": "00"
}

Error Response

{
  "status": "fail",
  "code": "E0021",
  "message": "Service not available",
  "data": {
    "order_status": "FAILED",
    "order_id": 1000010379,
    "amount": 50,
    "currency": "SAR",
    "psp_name": "telr",
    "redirection_url": "",
    "stcpay_id": "+966594393608"
  }
}

Response Fields

FieldTypeDescription
data.order_statusStringOrder status: SUCCESS or FAILED
data.order_idNumberPayOrc order ID
data.amountNumberTransaction amount
data.currencyStringCurrency code
data.psp_nameStringPSP name
data.redirection_urlStringURL to redirect customer for payment
data.stcpay_idStringSTC Pay registered phone number
statusStringAPI envelope: success or fail
codeString00 on success; E0021 on failure
messageStringResponse message

On this page