Skip to content
Docs

Hosted page · Server-side

POST/api/payments/hosted-page

Create a hosted page

Generate a hosted page.

Server-side request · headers mid + terminal-idTry it in Sandbox
Pairs with the Pay button. Pass the request_id from this response to payment.pay() on your page. Read the Pay button guide.

Request body

FieldTypeDescription
amountRequirednumber

The payment amount. For payment of 100 AED it must be 100 for 100.50 it must be written as 100.50

Min 1e.g. 100
currencyRequiredstring

The three-letter ISO currency code.

Min length 3Max length 3e.g. AED
order_idRequiredstring

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.

Max length 50e.g. ORD-10482
referenceOptionalstring

A reference to this payment.

Max length 50e.g. ORD-10482
customer_emailOptionalstring

customer email id.

e.g. aisha.rahman@example.com
customer_mobileOptionalstring

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).

e.g. 971501234567
customer_first_nameOptionalstring

customer First Name.

e.g. Aisha
customer_last_nameOptionalstring

customer Last Name.

e.g. Rahman
success_urlOptionalstring

For redirect success payment methods.

Max length 1024e.g. https://example.com/checkout/success
failure_urlOptionalstring

For redirect failure payment methods.

Max length 1024e.g. https://example.com/checkout/failed
page_titleOptionalstring

show page heading or title on hosted page.

Max length 100e.g. Example Store checkout
page_descriptionOptionalstring

show description on hosted page.

e.g. Review your order and pay securely by card or with split payment.
support_emailOptionalstring

Support email id.

e.g. support@example.com
support_phone_numberOptionalstring

Support contact number.

e.g. 971561234567
term_and_conditionsOptionalstring

Your term and conditions.

e.g. By completing payment you agree to Example Store's terms of sale and returns policy.
logoOptionalstring

Organization or product logo url.

Max length 1024e.g. https://example.com/images/logo.svg
return_typeOptionalstring

This will return response or redirect to link base on return type.

One of REDIRECTURLDefault "URL"
expire_atOptionalnumber

The link will never expire if expire_at is null or not given. The value is in minutes.

Default nulle.g. 120
captureOptionalboolean

Whether to capture the payment.

Default true
limitOptionalnumberstring

There is a limit for using a link for payment; if NO_LIMIT is sent, the link will remain active until it is canceled.

One of NO_LIMITDefault 1
payment_button_labelOptionalstring

Payment button label.

Default "Pay"e.g. Pay
itemsOptionalarray 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[].imageOptionalstring

Product image.

e.g. https://example.com/images/wool-blazer-charcoal.jpg
items[].nameOptionalstring

Product name.

e.g. Wool Blazer – Charcoal
items[].descriptionOptionalstring

Product description.

e.g. Tailored wool blazer, charcoal grey
items[].sizeOptionalstring

Product size.

e.g. XL
items[].quantityOptionalstring

Product quantity.

e.g. 1
items[].priceOptionalstring

Product total price.

e.g. 1349
instalment_bank_listOptionalarray 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_bank_list[].bank_codeRequiredstring

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

e.g. EMIRATES_NBD
instalment_bank_list[].instalmentOptionalarray 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.

metadataOptionalobject

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

FieldTypeDescription
midRequiredstring

Your MID, starts with ul-mid.

e.g. ul-mid-696f12de-46d0-48c4-a7c8-bb*********5
terminal-idRequiredstring

Your terminal id, starts with ul-tid.

e.g. ul-tid-6208df4ad7329e*********e

Responses

StatusDescription
200 OKSuccess
400 Bad requestBad Request
401 UnauthorizedUnauthorized

Response fields 200

FieldTypeDescription
request_idOptionalstring

Payment request id.

e.g. 631725c9a5bcfd0d3*******
linkOptionalstring

Payment URL for the link.

e.g. https://api.geturbanledger.com/api/payments/hosted-page/631725c9a5bcfd0d3*******/view
POSThttps://sandbox.geturbanledger.com/api/payments/hosted-page
curl -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"
  }
}'
Response
200 OK · Success
{
  "request_id": "631725c9a5bcfd0d3*******",
  "link": "https://api.geturbanledger.com/api/payments/hosted-page/631725c9a5bcfd0d3*******/view"
}
Talk to ustalk-to-us