S2S Payment
Server-to-Server (S2S) payment processing using the standard Payment method with card details.
S2S Payment
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.
The S2S Payment endpoint allows merchants to process card payments directly from their server to PayOrc's API. This is the standard card payment integration for server-to-server scenarios (type: "CARD").
For wallet payments, use type: "APPLE_PAY" or type: "GOOGLE_PAY" with the wallet token in data.token instead of card_details — see Apple Pay and Google Pay. Wallet flows do not require raw card data on your server.
S2S (Server-to-Server) integration requires PCI DSS compliance. You must be certified to handle raw card data directly. If you are not PCI DSS certified, consider using the PayOrc SDKs or hosted payment pages instead.
Endpoint
| Method | URL |
|---|---|
| POST | https://api.payorc.com/s2s/v1/payment |
Please use the test credentials for sandbox testing.
Headers
| Header | Type | Required | Description |
|---|---|---|---|
merchant-key | String | Yes | Your merchant API key |
merchant-secret | String | Yes | Your merchant API secret |
Content-Type | String | Yes | Must be application/json |
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
data.action | String | Yes | Transaction action: AUTH (auth only), SALE (auth + capture) |
data.class | String | Yes | Payment class: ECOM for e-commerce |
data.capture_method | String | Yes | AUTOMATIC or MANUAL |
data.payment_token | String | No | Payment token (leave empty for new card) |
data.type | String | Yes | Payment type: CARD, APPLE_PAY, GOOGLE_PAY, etc. |
data.customer_details.m_customer_id | String | No | Your internal customer ID |
data.customer_details.name | String | Yes | Customer full name |
data.customer_details.email | String | Yes | Customer email address |
data.customer_details.mobile | String | Yes | Customer mobile number |
data.customer_details.code | String | Yes | Country dial code (e.g., 91 for India) |
data.order_details.m_order_id | String | Yes | Your unique order ID |
data.order_details.amount | String | Yes | Transaction amount |
data.order_details.currency | String | Yes | ISO 4217 currency code |
data.order_details.convenience_fee | String | No | Convenience fee amount |
data.order_details.description | String | No | Order description |
data.order_details.return_url | String | Yes | URL to redirect after 3DS (HTTPS) |
data.urls | Object | No | Redirect and webhook URLs — see URLs |
data.items | Array | Yes | Array of order items |
data.billing_details | Object | Yes | Billing address details |
data.card_details.card_holder_name | String | Yes | Name on card |
data.card_details.card_number | String | Yes | Card number |
data.card_details.cvv | String | Yes | Card CVV |
data.card_details.expiry | String | Yes | Card expiry (MM/YYYY) |
data.card_details.tokenize | String | No | 1 to save token, 0 not to |
data.shipping_details | Object | No | Shipping address details |
data.parameters | Array | No | Custom parameters |
data.custom_data | Array | No | Custom data key-value pairs |
URLs
Optional per-order redirect and webhook overrides. Empty strings fall back to MID defaults where applicable.
| Field | Type | Required | Description |
|---|---|---|---|
data.urls.success | String | No | Success redirect URL |
data.urls.cancel | String | No | Cancel redirect URL |
data.urls.failure | String | No | Failure redirect URL |
data.urls.webhook_url | String | No | Per-order webhook URL (HTTPS). Overrides dashboard webhook when set |
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": "AUTH",
"class": "ECOM",
"capture_method": "AUTOMATIC",
"payment_token": "",
"type": "CARD",
"customer_details": {
"m_customer_id": "1234",
"name": "John Doe",
"email": "[email protected]",
"mobile": "9876543210",
"code": "91"
},
"order_details": {
"m_order_id": "123456",
"amount": "100",
"currency": "AED",
"convenience_fee": "0",
"description": "Order description",
"return_url": "http://localhost/status"
},
"items": [
{
"title": "Product Name",
"description": "Product description",
"quantity": 1,
"unit_price": "100.00",
"discount_amount": "0.00",
"reference_id": "REF001",
"is_refundable": true
}
],
"billing_details": {
"address_line1": "Po Box 12322",
"address_line2": "Jebel Ali Free Zone",
"city": "Dubai",
"province": "Dubai",
"country": "AE",
"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": "" }
],
"card_details": {
"card_holder_name": "John Doe",
"card_number": "4111111111111111",
"cvv": "123",
"expiry": "04/2026",
"tokenize": "0"
},
"urls": {
"success": "",
"cancel": "",
"failure": "",
"webhook_url": "https://merchant.example.com/webhook"
}
}
}'Success Response
Card and MOTO initiate responses use the S2S envelope { status, code, message, data }. On 3DS, data is webhook-shaped (same fields as Webhook notifications) plus redirect_url for the PayOrc checkout page.
{
"status": "success",
"code": "00",
"message": "Redirection URL generated successfully",
"data": {
"action": "AWAIT_3DS",
"status": "SUCCESS",
"status_code": "",
"order_status": "AWAIT_3DS",
"m_order_id": "123456",
"p_order_id": "1000011841",
"p_request_id": "1000012174",
"psp_ref_id": "",
"transaction_id": "1000012174",
"is_live": false,
"terminal_label": "",
"remark": "",
"reason": "",
"currency": "AED",
"amount": "100.00",
"channel": "S2S",
"channel_id": "",
"shipping_fee": "0.00",
"convenience_fee": "0.00",
"customer_details": {
"name": "John Doe",
"email": "[email protected]",
"code": "91",
"mobile": "9876543210",
"m_customer_id": "1234"
},
"billing_address": {
"address_line_1": "Po Box 12322",
"address_line_2": "Jebel Ali Free Zone",
"city": "Dubai",
"state": "Dubai",
"country": "AE",
"pincode": "54044"
},
"shipping_address": {
"address_line_1": "Po Box 12322",
"address_line_2": "Jebel Ali Free Zone",
"city": "Dubai",
"state": "Dubai",
"country": "AE",
"pincode": "54044"
},
"ip_country": "",
"psp": "PAYMOB",
"payment_method": "CARD",
"m_payment_token": "",
"transaction_time": "03-08-2026 09:44:40",
"payment_method_data": {
"scheme": "",
"card_country": "",
"card_type": "",
"mask_card_number": ""
},
"apm_name": "",
"apm_identifier": "",
"sub_merchant_identifier": "0000001181",
"parameters": [
{ "alpha": "" },
{ "beta": "" },
{ "gamma": "" },
{ "delta": "" },
{ "epsilon": "" }
],
"custom_data": [
{ "alpha": "" },
{ "beta": "" },
{ "gamma": "" },
{ "delta": "" },
{ "epsilon": "" }
],
"return_url": "https://merchant.example.com/status",
"redirect_url": "https://checkout.payorc.com/s2s/payment/{checkout_token}"
}
}Redirect the customer to data.redirect_url to complete 3DS. Final payment status is delivered via webhook. After completion, data matches the full webhook payload (action, order_status, m_payment_token, payment_method_data, etc.).
Error Response
Validation errors (HTTP 4xx) use:
{
"message": "Type not valid/not supplied",
"status": "fail",
"code": "E0021"
}Payment initiation failures return the webhook envelope with status: "failed":
{
"status": "failed",
"code": "PAYMENT_FAILED",
"message": "Redirection URL generation failed",
"data": {
"action": "FAILED",
"status": "FAILED",
"order_status": "FAILED",
"m_order_id": "123456",
"p_order_id": "1000011841",
"currency": "AED",
"amount": "100.00",
"redirect_url": ""
}
}Response Fields
| Field | Type | Description |
|---|---|---|
status | String | API envelope: success or failed (validation errors use fail) |
code | String | 00 on success; E0021 validation; PAYMENT_FAILED on payment failure |
message | String | Human-readable message |
data | Object | Webhook-shaped payload — see Webhook notifications |
data.action | String | e.g. AWAIT_3DS, AUTH, CAPTURE, FAILED |
data.status | String | SUCCESS or FAILED (inside data) |
data.order_status | String | e.g. AWAIT_3DS, AUTHORISED, CAPTURED, FAILED |
data.m_order_id | String | Your merchant order ID |
data.p_order_id | String | PayOrc order ID |
data.p_request_id | String | PayOrc request ID |
data.transaction_id | String | PayOrc transaction ID |
data.amount | String | Amount (e.g. "100.00") |
data.currency | String | ISO currency code |
data.return_url | String | Return URL from the request |
data.redirect_url | String | PayOrc checkout URL for 3DS (present on initiate success) |
data.m_payment_token | String | Present after successful auth/capture when tokenized |
data.payment_method_data | Object | Card metadata (scheme, card_country, card_type, mask_card_number) |
data.parameters / data.custom_data | Array | Echoed from request (array of alpha…epsilon objects) |