Skip to main content

Create Payment Gateway Link

POST 

https://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

    access-token stringrequired

    The access token used for authentication, obtained from the /v1/payment_gateways/access_token endpoint.

Bodyrequired

    order_idstringrequired

    Unique identifier for the order created by the merchant.

    Example: 34097959-a153-48d4-bdab-14332bf7a92d
    amountnumberrequired

    The amount to be charged.

    Example: 100
    descriptionstringrequired

    A brief description of the transaction.

    Example: Order payment
    order_success_urlstringrequired

    URL to redirect the user upon successful payment.

    Example: https://yourserver.co/order/success
    payment_gateway_notification objectrequired

    Specifies the endpoint and authorization header for receiving notifications about payment status updates.

    authorization_headerstringrequired

    Authorization header for security in notifications.

    Example: ANYTHING_ONLY_YOU_KNOW
    endpoint_urlstringrequired

    Endpoint URL to receive payment status notifications.

    Example: https://yourserver.co/endpoint
    order_details objectrequired
    billing_details objectrequired
    first_namestringrequired

    First name of the customer.

    Example: Clever
    last_namestringrequired

    Last name of the customer.

    Example: Hello
    phonestringrequired

    Customer's phone number.

    Example: +61412345678
    emailstringrequired

    Customer's email address.

    Example: test@helloclever.co
    companystring

    Name of the customer's company, if applicable.

    Example: Hello Clever
    country_codestringrequired

    Country code of the customer's location.

    Example: AU
    statestring

    State or region of the customer's location.

    Example: NSW
    postal_codestringrequired

    Postal code of the customer's location.

    Example: 2000
    citystringrequired

    City of the customer's location.

    Example: Sydney
    addressstringrequired

    Full address of the customer.

    Example: 388 George Street
    shipping_details objectrequired
    first_namestringrequired

    First name of the recipient.

    Example: Clever
    last_namestringrequired

    Last name of the recipient.

    Example: Hello
    phonestringrequired

    Recipient's phone number.

    Example: +61412345678
    emailstringrequired

    Recipient's email address.

    Example: test@helloclever.co
    companystring

    Name of the recipient's company, if applicable.

    Example: Hello Clever
    country_codestringrequired

    Country code of the recipient's location.

    Example: AU
    statestring

    State or region of the recipient's location.

    Example: NSW
    postal_codestringrequired

    Postal code of the recipient's location.

    Example: 2000
    citystringrequired

    City of the recipient's location.

    Example: Sydney
    addressstringrequired

    Full address of the recipient.

    Example: 388 George Street
    items object[]required
  • Array [
  • idstringrequired

    Unique identifier for the item.

    Example: item-123
    namestringrequired

    Name of the item.

    Example: Product Name
    variant_idstring

    Identifier for the item's variant, if applicable.

    Example: variant-456
    image_urluri

    URL of the item's image.

    Example: https://example.com/image.jpg
    quantitystringrequired

    Quantity of the item ordered.

    Example: 2
    pricestringrequired

    Price of the item.

    Example: 25.00
    enable_cashbackboolean

    Indicates if cashback is enabled for the item.

    Example: true
  • ]

Responses

Payment link created successfully.

Schema
    redirect_urluri

    The URL to redirect the customer to the Hello Clever payment gateway for completing the payment.

    Example: https://v2.paymentgateway.cleverhub.co/oneclick-checkout?payment=eyJ0eXAiOiJKV1QiLCJh...
    payment_idinteger

    The unique identifier for the payment created in the Hello Clever system.

    Example: 46345
    order_idstring

    The unique identifier for the order associated with this payment, as provided in the request.

    Example: 34097959-a153-48d4-bdab-14332bf7a92d
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());
Request Collapse all
Base URL
https://api.cleverhub.co/api
Parameters
— headerrequired
Body required
{
  "order_id": "34097959-a153-48d4-bdab-14332bf7a92d",
  "amount": 100,
  "description": "Order payment",
  "order_success_url": "https://yourserver.co/order/success",
  "payment_gateway_notification": {
    "authorization_header": "ANYTHING_ONLY_YOU_KNOW",
    "endpoint_url": "https://yourserver.co/endpoint"
  },
  "order_details": {
    "billing_details": {
      "first_name": "Clever",
      "last_name": "Hello",
      "phone": "+61412345678",
      "email": "test@helloclever.co",
      "company": "Hello Clever",
      "country_code": "AU",
      "state": "NSW",
      "postal_code": "2000",
      "city": "Sydney",
      "address": "388 George Street"
    },
    "shipping_details": {
      "first_name": "Clever",
      "last_name": "Hello",
      "phone": "+61412345678",
      "email": "test@helloclever.co",
      "company": "Hello Clever",
      "country_code": "AU",
      "state": "NSW",
      "postal_code": "2000",
      "city": "Sydney",
      "address": "388 George Street"
    },
    "items": [
      {
        "id": "item-123",
        "name": "Product Name",
        "variant_id": "variant-456",
        "image_url": "https://example.com/image.jpg",
        "quantity": "2",
        "price": "25.00",
        "enable_cashback": true
      }
    ]
  }
}
ResponseClear

Click the Send API Request button above and see the response here!