Create Payment Gateway Link
POSThttps://api.cleverhub.co/api/v1/payment_gateways/create_payment
Creates a payment gateway link for redirecting the customer to complete a payment. Once the payment is made successfully, Hello Clever will notify the status of the payment via the specified payment_gateway_notification
endpoint. The payment request has various statuses throughout its lifecycle.
Request
Header Parameters
The access token used for authentication, obtained from the /v1/payment_gateways/access_token
endpoint.
- application/json
Bodyrequired
Unique identifier for the order created by the merchant.
34097959-a153-48d4-bdab-14332bf7a92d
The amount to be charged.
100
A brief description of the transaction.
Order payment
URL to redirect the user upon successful payment.
https://yourserver.co/order/success
payment_gateway_notification objectrequired
order_details objectrequired
Responses
- 200
- 400
- 401
- 404
- 422
Payment link created successfully.
- application/json
- Schema
- Example (auto)
Schema
The URL to redirect the customer to the Hello Clever payment gateway for completing the payment.
https://v2.paymentgateway.cleverhub.co/oneclick-checkout?payment=eyJ0eXAiOiJKV1QiLCJh...
The unique identifier for the payment created in the Hello Clever system.
46345
The unique identifier for the order associated with this payment, as provided in the request.
34097959-a153-48d4-bdab-14332bf7a92d
{
"redirect_url": "https://v2.paymentgateway.cleverhub.co/oneclick-checkout?payment=eyJ0eXAiOiJKV1QiLCJh...",
"payment_id": 46345,
"order_id": "34097959-a153-48d4-bdab-14332bf7a92d"
}
Bad Request.
Unauthorized.
Not Found.
Unprocessable Entity.
- csharp
- curl
- dart
- go
- http
- java
- javascript
- kotlin
- c
- nodejs
- objective-c
- ocaml
- php
- powershell
- python
- r
- ruby
- rust
- shell
- swift
- HTTPCLIENT
- RESTSHARP
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://api.cleverhub.co/api/v1/payment_gateways/create_payment");
request.Headers.Add("Accept", "application/json");
var content = new StringContent("{\n \"order_id\": \"34097959-a153-48d4-bdab-14332bf7a92d\",\n \"amount\": 100,\n \"description\": \"Order payment\",\n \"order_success_url\": \"https://yourserver.co/order/success\",\n \"payment_gateway_notification\": {\n \"authorization_header\": \"ANYTHING_ONLY_YOU_KNOW\",\n \"endpoint_url\": \"https://yourserver.co/endpoint\"\n },\n \"order_details\": {\n \"billing_details\": {\n \"first_name\": \"Clever\",\n \"last_name\": \"Hello\",\n \"phone\": \"+61412345678\",\n \"email\": \"test@helloclever.co\",\n \"company\": \"Hello Clever\",\n \"country_code\": \"AU\",\n \"state\": \"NSW\",\n \"postal_code\": \"2000\",\n \"city\": \"Sydney\",\n \"address\": \"388 George Street\"\n },\n \"shipping_details\": {\n \"first_name\": \"Clever\",\n \"last_name\": \"Hello\",\n \"phone\": \"+61412345678\",\n \"email\": \"test@helloclever.co\",\n \"company\": \"Hello Clever\",\n \"country_code\": \"AU\",\n \"state\": \"NSW\",\n \"postal_code\": \"2000\",\n \"city\": \"Sydney\",\n \"address\": \"388 George Street\"\n },\n \"items\": [\n {\n \"id\": \"item-123\",\n \"name\": \"Product Name\",\n \"variant_id\": \"variant-456\",\n \"image_url\": \"https://example.com/image.jpg\",\n \"quantity\": \"2\",\n \"price\": \"25.00\",\n \"enable_cashback\": true\n }\n ]\n }\n}", null, "application/json");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());