Create a Hosted Payment
POST/hosted-payments
Request
Header Parameters
A unique value, eg. a UUID.
- application/json
Body
A positive integer value in specified currency's smallest unit. e.g. $10 would be represented as 1000 (cents).
Three-letter ISO 4217 currency code in full uppercase. Must be a supported currency.
Possible values: [PAYLAH
, PAYNOW
]
Possible values: [APP_IOS
, APP_ANDROID
, WEB_BROWSER_DESKTOP
, WEB_BROWSER_MOBILE
]
For a web browser based channel, use a HTTPS URL. For a native mobile based channel, use an App Deep Link URL. This should not be set if hostedPaymentMethodId is provided in the request.
A string to reference (e.g. your order ID, a payment ID, etc.) which can be used to reconcile the hosted payment with your own systems. This cannot exceed 255 characters.
Only applicable to PAYLAH. Set to true if you wish to create a token for future payments.
ID of the registered payment method to be used for creating the payment.
Responses
- 200
OK
Response Headers
Acme-Mode
string
Has the value LIVE if the data exists in live production mode or the value TEST if the data exists in test sandbox mode.
- application/json
- Schema
- Example (from schema)
Schema
- PAYLAH_WALLET_DELINKED: The payer has delinked their PayLah! Wallet and the specified
hostedPaymentMethodId
can no longer be used for creating payments. - PAYLAH_WALLET_ALREADY_LINKED: The specified PayLah! Wallet number has already been linked before. You should set the hostedPaymentMethodId in the request body.
- INSUFFICIENT_FUNDS_PENDING_TOP_UP: The payer has insufficient funds in their PayLah! Wallet and the payer needs to top up their wallet in 5 minutes. You should keep polling the hosted payment status.
- OTHERS
Possible values: [REQUIRES_ACTION
, PENDING
, SUCCEEDED
, FAILED
]
Status of the payment
Possible values: [PAYLAH_WALLET_DELINKED
, PAYLAH_WALLET_ALREADY_LINKED
, INSUFFICIENT_FUNDS_PENDING_TOP_UP
, OTHERS
]
Result code of the payment, if available. Possible values are:
Possible values: [SGD
]
Possible values: [PAYLAH
, PAYNOW
]
Possible values: [APP_IOS
, APP_ANDROID
, WEB_BROWSER_DESKTOP
, WEB_BROWSER_MOBILE
]
For web browser based channel, use a HTTPS URL. For native mobile based channel, use an App Deep Link URL.
Redirect the payer to this URL for payment.
A string to reference (e.g. your order ID, a payment ID, etc.) which can be used to reconcile the hosted payment with your own systems. This cannot exceed 255 characters.
This has to be saved in your system and, in the future, sent to Acme when creating payments using this registered payment method. Note that for the first payment using the payment method, this ID may not be returned from the POST /v1/hosted-payments/ call and you will have to poll the GET /v1/hosted-payments/{id} endpoint to retrieve this ID.
{
"id": "hpymt_dummy12342",
"status": "REQUIRES_ACTION",
"resultCode": null,
"amount": 4242,
"currency": "SGD",
"method": "PAYNOW",
"channel": "WEB_BROWSER_DESKTOP",
"returnUrl": "https://example.com/return",
"redirectUrl": "https://api.tryacme.com/redirection/hosted-payments/hpymt_12345/submit",
"referenceId": "REF-1234567",
"hostedPaymentMethodId": "hpm_example12345",
"createdAt": "2023-04-24T00:00:00.000000Z",
"updatedAt": "2023-04-24T00:00:00.000000Z"
}