Create Static PayID
POSThttps://api.cleverhub.co/api/v1/customers/create_static_open_payid
Creates a Static Open PayID that serves as a unique, reusable identifier linked to a customer’s information. This Static PayID can be used for multiple transactions, offering a persistent payment identifier that simplifies future payments and customer recognition.
When a Static PayID is created, it securely associates essential customer details like name, email, and optional address or phone number, ensuring a streamlined payment process for returning customers. Additionally, the customer_notification
configuration allows for real-time updates on transaction status, providing merchants with immediate feedback on payment events through a secure callback mechanism.
Request
- application/json
Bodyrequired
The full name of the customer for whom the Static PayID is created.
Possible values: Value must match regular expression ^(?)[a-zA-Z0-9 ]*(?![ ])$
John Doe
The email address associated with the Static PayID.
johndoe@example.com
Prefix used to generate a unique PayID for the customer.
Possible values: Value must match regular expression ^(?=.{3,35}$)[a-z0-9.]*
customer.prefix123
The full address associated with the Static PayID.
123 Example Street
Phone number associated with the Static PayID, including country code.
+61412345678
City where the customer resides.
Sydney
Postal code of the customer's location.
2000
State where the customer resides.
NSW
Custom identifier set by the merchant to reference the Static PayID.
custom-id-67890
customer_notification objectrequired
Responses
- 200
- 400
- 401
- 422
Static Open PayID created successfully.
- application/json
- Schema
- Example (auto)
Schema
Name of the Static Open PayID.
Email associated with the Static Open PayID.
Address linked with the Static Open PayID.
Phone number associated with the Static Open PayID.
Postal code of the customer’s location.
City associated with the Static Open PayID.
State associated with the Static Open PayID.
Custom identifier that can be used for future reference.
customer_notification object
Current status of the Static PayID.
Possible values: [active
, expired
]
{
"name": "string",
"email": "string",
"address": "string",
"phone": "string",
"zip_code": "string",
"city": "string",
"state": "string",
"external_id": "string",
"customer_notification": {
"endpoint_url": "string",
"authorization_header": "string"
},
"status": "active"
}
Bad Request.
Unauthorized.
Unprocessable Entity.
Callbacks
- POST statusChange
POST{$request.body#/customer_notification.endpoint_url}
- application/json
Bodyrequired
pending
: The payment request is still open and awaiting payment.received
: The payment has been received.expired
: The payment request has expired.return_pending
: A return of funds is in process.return_received
: Returned funds have been received.return_expired
: The return process has expired.return_rejected
: The return request was rejected.
A unique identifier assigned to the payment request, used for tracking and referencing purposes within the system.
123456
The identifier of the balance associated with this payment request, allowing for account management and tracking of specific transactions.
HDCHJSS
The name of the individual or entity associated with the payment request. This helps identify the payer or payee involved.
John Doe
The PayID generated for the payment request, used to uniquely identify and route the payment to the correct recipient.
payid123@example.com
The name of the merchant managing or handling the payment. This field is useful for recognising the party to whom the payment is being made.
Merchant Co.
Indicates whether Goods and Services Tax (GST) applies to the transaction. A value of true
means GST is included.
true
The amount requested for the payment, excluding any applicable taxes. This field represents the base value of the transaction.
100.0
The total amount due, including all applicable taxes such as GST. This is the final amount the payer needs to pay.
110.0
The portion of the total amount that is attributable to GST. This helps in breaking down the tax components of the payment.
10.0
The expiration date and time of the PayID, indicating until when the PayID is valid for making the payment.
2024-12-31T23:59:59Z
A custom identifier provided for tracking purposes, such as an internal reference or an invoice number.
custom-id-12345
The cashback amount, if applicable, that the payer is eligible to receive as part of the transaction.
5.0
The last date by which the payment must be made. This provides a clear deadline for the payer.
2024-12-30T23:59:59Z
The date and time when the payment was successfully completed. This is used for record-keeping and verification.
2024-12-25T12:34:56Z
The current status of the payment request. Possible values include:
Possible values: [pending
, received
, expired
, return_pending
, return_received
, return_expired
, return_rejected
]
pending
A description accompanying the payment request, providing additional information such as the purpose of the payment or related invoice details.
Payment for invoice #1234
A unique value used to validate the transaction, preventing replay attacks and ensuring the integrity of the payment request.
unique_nonce_string
Represents the specific stage within the pending
status. This value is null
unless the transaction is flagged for being overpaid, underpaid, or having an unmatched nonce.
Possible values: [overpaid
, underpaid
, unmatched_nonce
, null
]
overpaid
refund_information object
sender_details object
A shortened version of the invoice URL for convenience. This can be used to quickly share or access the invoice details. Note: this field is deprecated.
https://short.example.com/invoice/123456
The full URL of the invoice related to the payment request. This provides access to the detailed invoice online. Note: this field is deprecated.
https://example.com/invoice/123456
Callbacks Responses
- 200
- 400
- 401
Callback received successfully.
Bad request.
Unauthorized access.
Authorization: app-id
name: app-idtype: apiKeyin: headerdescription: A unique identifier assigned to each application.
name: secret-keytype: apiKeyin: headerdescription: A secure token associated with the `app-id`.
- 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/customers/create_static_open_payid");
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 \"name\": \"John Doe\",\n \"email\": \"johndoe@example.com\",\n \"prefix_static_payid\": \"customer.prefix123\",\n \"address\": \"123 Example Street\",\n \"phone\": \"+61412345678\",\n \"city\": \"Sydney\",\n \"zip_code\": \"2000\",\n \"state\": \"NSW\",\n \"external_id\": \"custom-id-67890\",\n \"customer_notification\": {\n \"endpoint_url\": \"https://example.com/notification_callback\",\n \"authorization_header\": \"Bearer your_custom_token\"\n }\n}", null, "application/json");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());