Skip to main content

Create Payment via Tokenisation

POST 

https://api.cleverhub.co/api/v2/cards/create_payment

This endpoint allows you to create a card payment intent using a previously tokenised or newly provided card.

  • token object is required and should contain a id and type card method reference.
  • webhook_notification object is optional. If not provided, we will use your default webhook configuration that you've previously set up. If provided, we will send webhook notifications to the specified endpoint for this specific payment.
  • When the card requires 3DS authentication, we will return a pay_code object containing {3ds_url: ''}. You must direct your customer to this URL to authorise the payment. After successful authorisation, customer back to return_url and you can use the capture API normally to collect the payment from the user.

Request

Bodyrequired

    amountnumberrequired

    Amount in smallest currency unit (e.g., cents)

    Example: 1000
    currencystringrequired

    ISO 4217 currency code (e.g., AUD, USD)

    Example: USD
    token objectrequired

    The card token object

    idstringrequired

    The token id

    Example: tok_dfe1988a1ffc0d6562d3
    typestring

    The token type (default 'card')

    Example: card
    external_idstringrequired

    External ID

    Example: order_test_xxx
    return_urlstringrequired

    Return URL

    Example: https://example.com
    webhook_notification object
    endpoint_urluri

    Your webhook endpoint to receive status updates

    Example: https://merchant.com/webhook
    authorization_headerstring

    Optional token for webhook authorization

    Example: Bearer xxxxxx

Responses

Payment created

Schema
    uuidstring
    Example: 7PPPMXIGH
    namestring
    Example: Testing
    emailstring
    Example: test@example.com
    external_idstring
    Example: wc_order_6C1hcvg4T7Pom
    statusstring

    Possible values: [pending, authorised, waiting, received, expired, return_pending, return_expired, partially_refunded, return_received, return_rejected, failed, in_dispute, dispute_lost]

    Example: waiting
    pay_code objectnullable
    3ds_urlstring
    Example: https://3ds-auth.example.com/verify
    currencystring
    Example: USD
    amountnumber
    Example: 10000
    totalnumber
    Example: 10000
    paid_amountnumber
    Example: 0
    is_refundableboolean
    Example: true
    payment_methodstring
    Example: card
    expired_atstring
    Example:
    webhook_notification object
    endpoint_urlstring
    Example: https://webhook.site/456adb8f-4407-4bce-90fe-2c431db19696
    authorization_headerstring
    Example: ****
    refund_information object
    total_amountnumber
    Example: 200
    refund_amountnumber
    Example: 50
    descriptionstring
    Example: Testing refund
    sender_details object
    card object
    card_typestring
    Example: card
    card_brandstring
    Example: visa
    card_last_4string
    Example: 4242
    created_atdate-time
    Example: 2025-05-28T04:22:21.567+0000

Authorization: app-id

name: app-idtype: apiKeydescription: The app-id is registered and secured inside Hello Clever system and only required when client has initiated or in the middle of the transaction.in: header
name: secret-keytype: apiKeydescription: The secret-key is our client's secret of the source. Required if a publishable key is used to retrieve the source.in: header
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://api.cleverhub.co/api/v2/cards/create_payment");
request.Headers.Add("Accept", "application/json");
request.Headers.Add("app-id", "<app-id>");
request.Headers.Add("secret-key", "<app-id>");
var content = new StringContent("{\n \"amount\": 1000,\n \"currency\": \"USD\",\n \"token\": {\n \"id\": \"tok_dfe1988a1ffc0d6562d3\",\n \"type\": \"card\"\n },\n \"external_id\": \"order_test_xxx\",\n \"return_url\": \"https://example.com\",\n \"webhook_notification\": {\n \"endpoint_url\": \"https://merchant.com/webhook\",\n \"authorization_header\": \"Bearer xxxxxx\"\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
Auth
Body required
{
  "amount": 1000,
  "currency": "USD",
  "token": {
    "id": "tok_dfe1988a1ffc0d6562d3",
    "type": "card"
  },
  "external_id": "order_test_xxx",
  "return_url": "https://example.com",
  "webhook_notification": {
    "endpoint_url": "https://merchant.com/webhook",
    "authorization_header": "Bearer xxxxxx"
  }
}
ResponseClear

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