Hosted page · Server-side
/ api/ payments/ hosted-pageCreate a hosted page
Generate a hosted page.
mid + terminal-idTry it in Sandbox request_id from this response to payment.pay() on your page. Read the Pay button guide.Request body
| Field | Type | Description |
|---|---|---|
amountRequired | number | The payment amount. For payment of 100 AED it must be 100 for 100.50 it must be written as 100.50 |
currencyRequired | string | The three-letter ISO currency code. |
order_Required | string | A order id you can later use to identify this payment, such as an order number. Can only be alphanumeric and must be unique for Benefit. |
referenceOptional | string | A reference to this payment. |
customer_Optional | string | customer email id. |
customer_Optional | string | Customer mobile number including country code, without spaces, special characters, or + sign. For example, for a UAE number, it should start with 971 followed by the mobile number (e.g., 9715*******84). |
customer_Optional | string | customer First Name. |
customer_Optional | string | customer Last Name. |
success_Optional | string | For redirect success payment methods. |
failure_Optional | string | For redirect failure payment methods. |
page_Optional | string | show page heading or title on hosted page. |
page_Optional | string | show description on hosted page. |
support_Optional | string | Support email id. |
support_Optional | string | Support contact number. |
term_Optional | string | Your term and conditions. |
logoOptional | string | Organization or product logo url. |
return_Optional | string | This will return response or redirect to link base on return type. |
expire_Optional | number | The link will never expire if expire_at is null or not given. The value is in minutes. |
captureOptional | boolean | Whether to capture the payment. |
limitOptional | numberstring | There is a limit for using a link for payment; if NO_LIMIT is sent, the link will remain active until it is canceled. |
payment_Optional | string | Payment button label. |
itemsOptional | array of objects | Allows you to send carts information about a transaction. Note that this object only allows one level of depth, so cannot accept non-primitive data types such as objects or arrays. |
items[].Optional | string | Product image. |
items[].Optional | string | Product name. |
items[].Optional | string | Product description. |
items[].Optional | string | Product size. |
items[].Optional | string | Product quantity. |
items[].Optional | string | Product total price. |
instalment_Optional | array of objects | Restrict the split payment to specific banks and optionally limit which split payment tenures are shown. If provided, only the specified banks will be displayed on the hosted page. If the instalment array is omitted for a bank, all available tenures for that bank will be shown. Each bank_code must be a valid code from the supported list. For the full list of supported bank codes, visit https://geturbanledger.com/docs/instalment_bank_codes |
instalment_Required | string | The bank identifier code. Must be one of the supported split payment bank codes (e.g., EMIRATES_NBD, MASHREQ, ADCB, LIV, HSBC_ME, RAKBANK, FAB, DUBAI_FIRST). For the complete code list, visit https://geturbanledger.com/docs/instalment_bank_codes |
instalment_Optional | array of number | Optional. An array of split payment tenure months to allow for this bank (e.g., [3, 6, 9, 12]). If not provided or empty, all available split payment tenures for the bank will be shown. Each value must be a valid tenure offered by the specified bank. |
metadataOptional | object | Allows you to store additional information about a transaction with custom fields, which can be used for reporting purposes. Note that this object only allows one level of depth, so cannot accept non-primitive data types such as objects or arrays. |
Headers
| Field | Type | Description |
|---|---|---|
midRequired | string | Your MID, starts with ul-mid. |
terminal-idRequired | string | Your terminal id, starts with ul-tid. |
Responses
| Status | Description |
|---|---|
| 200 OK | Success |
| 400 Bad request | Bad Request |
| 401 Unauthorized | Unauthorized |
Response fields 200
| Field | Type | Description |
|---|---|---|
request_Optional | string | Payment request id. |
linkOptional | string | Payment URL for the link. |
https://sandbox.geturbanledger.com/api/payments/hosted-pagecurl -X POST "https://sandbox.geturbanledger.com/api/payments/hosted-page" \
-H "Content-Type: application/json" \
-H "mid: sb-ul-mid-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" \
-H "terminal-id: ul-tid-xxxxxxxxxxxxxxxxxxxxxxxx" \
-d '{
"amount": 100,
"currency": "AED",
"order_id": "ORD-10482",
"reference": "ORD-10482",
"customer_email": "aisha.rahman@example.com",
"customer_mobile": "971501234567",
"customer_first_name": "Aisha",
"customer_last_name": "Rahman",
"success_url": "https://example.com/checkout/success",
"failure_url": "https://example.com/checkout/failed",
"page_title": "Example Store checkout",
"page_description": "Review your order and pay securely by card or with split payment.",
"support_email": "support@example.com",
"support_phone_number": "971561234567",
"term_and_conditions": "By completing payment you agree to Example Store'\''s terms of sale and returns policy.",
"logo": "https://example.com/images/logo.svg",
"return_type": "REDIRECT",
"expire_at": 120,
"capture": true,
"limit": 1,
"payment_button_label": "Pay",
"items": [
{
"image": "https://example.com/images/wool-blazer-charcoal.jpg",
"name": "Wool Blazer – Charcoal",
"description": "Tailored wool blazer, charcoal grey",
"size": "XL",
"quantity": 1,
"price": 1349
},
{
"image": "https://example.com/images/wool-blazer-navy.jpg",
"name": "Wool Blazer – Navy",
"description": "Tailored wool blazer, navy blue",
"size": "L",
"quantity": 1,
"price": 1249
}
],
"instalment_bank_list": [
{
"bank_code": "EMIRATES_NBD",
"instalment": [
3,
6,
9
]
},
{
"bank_code": "MASHREQ"
},
{
"bank_code": "FAB",
"instalment": [
6,
12
]
}
],
"metadata": {
"channel": "web",
"customer_ref": "CUST-10482"
}
}'{
"request_id": "631725c9a5bcfd0d3*******",
"link": "https://api.geturbanledger.com/api/payments/hosted-page/631725c9a5bcfd0d3*******/view"
}