### Successful Prepare Response Source: https://docs.click.uz/en/additional/shop-split Example of a successful response containing payment parameters and split details. ```json { "click_paydoc_id": 123, "attempt_trans_id": 345, "merchant_prepare_id": 12345, "error": 0, "error_note": "Success", "params": { "branch_id": 123, "payment_account": "***", "payment_mfo": "***", "transit_account": "***", "transit_mfo": "***" }, "split": [ { "cntrg_id": 123, "amount": 450 }, { "cntrg_id": 321, "amount": 550 } ] } ``` -------------------------------- ### Prepare Response JSON Examples Source: https://docs.click.uz/en/additional/get-info JSON structures for successful and unsuccessful responses from the merchant to the CLICK system. ```json { "click_paydoc_id": 123, "attempt_trans_id": 345, "merchant_prepare_id": 12345, "error": 0, "error_note": "Success", "params": { "branch_id": 123, "payment_account": "***", "payment_mfo": "***", "transit_account": "***", "transit_mfo": "***" } } ``` ```json { "click_paydoc_id": 123, "attempt_trans_id": 345, "error": -250, "error_note": "Error description" } ``` -------------------------------- ### Prepare Request Body Source: https://docs.click.uz/en/additional/shop-split Example JSON body for a Prepare request sent from CLICK to the Provider. ```json { "action": 1, "click_paydoc_id": 123, "attempt_trans_id": 345, "service_id": 123, "sign_time": "2020-03-04 17:00:00", "sign_string": "***", "params": { "contract": "***", "full_name": "***", "service_type": "***", "amount": 1000 } } ``` -------------------------------- ### Successful Response Example Source: https://docs.click.uz/en/additional/get-info A sample JSON response indicating a successful check request processing. ```json { "click_paydoc_id": 123, "attempt_trans_id": 345, "merchant_confirm_id": 12345, "error": 0, "error_note": "Success", "status": 2, "params": { "***": "***" } } ``` -------------------------------- ### Failed Prepare Response Source: https://docs.click.uz/en/additional/shop-split Example of a response indicating a failure with an error code. ```json { "click_paydoc_id": 123, "attempt_trans_id": 345, "error": -250, "error_note": "Error description" } ``` -------------------------------- ### Prepare Request JSON Example Source: https://docs.click.uz/en/additional/get-info Structure of the JSON payload sent from CLICK to the merchant for transaction preparation. ```json { "action": 1, "click_paydoc_id": 123, "attempt_trans_id": 345, "service_id": 123, "sign_time": "2020-03-04 17:00:00", "sign_string": "***", "params": { "contract": "***", "full_name": "***", "service_type": "***", "amount": 1000 } } ``` -------------------------------- ### Generate Auth Header in Node.js Source: https://docs.click.uz/en/merchant-api/requests Example implementation for generating the required Auth header using the crypto module. ```javascript import crypto from 'crypto' // Specify your keys const merchantUserId = 'YOUR_MERCHANT_USER_ID' const secretKey = 'YOUR_SECRET_KEY' // Get the current time (Unix timestamp) const timestamp = Math.floor(Date.now() / 1000) // Generate the string for the signature const digestString = timestamp + secretKey // Generate the SHA1 hash const digest = crypto.createHash('sha1').update(digestString).digest('hex') // Form the Authorization header const authorization = `${merchantUserId}:${digest}:${timestamp}` console.log('Authorization:', authorization) ``` -------------------------------- ### Check Request Example Source: https://docs.click.uz/en/additional/get-info A sample JSON payload sent from the CLICK system to the merchant for a check request. ```json { "action": 3, "click_paydoc_id": 123, "attempt_trans_id": 345, "merchant_prepare_id": 12345, "service_id": 123, "sign_time": "2020-03-04 17:00:00", "sign_string": "***", "params": { "contract": "***", "full_name": "***", "service_type": "***", "amount": 1000 } } ``` -------------------------------- ### Payment Completion Response JSON Source: https://docs.click.uz/en/additional/get-info Example JSON responses for successful and unsuccessful payment completion requests. ```json { "click_paydoc_id": 123, "attempt_trans_id": 345, "merchant_confirm_id": 12345, "error": 0, "error_note": "Success", "params": { "***": "***" } } ``` ```json { "click_paydoc_id": 123, "attempt_trans_id": 345, "error": -250, "error_note": "Error description" } ``` -------------------------------- ### GET https://api.click.uz/v2/merchant/invoice/status/:service_id/:invoice_id Source: https://docs.click.uz/en/merchant-api/requests Retrieves the current status of an existing invoice. ```APIDOC ## GET https://api.click.uz/v2/merchant/invoice/status/:service_id/:invoice_id ### Description Checks the status of an invoice using the service ID and invoice ID. ### Method GET ### Endpoint https://api.click.uz/v2/merchant/invoice/status/:service_id/:invoice_id ### Parameters #### Path Parameters - **service_id** (integer) - Required - Service ID - **invoice_id** (bigint) - Required - Invoice ID ### Response #### Success Response (200) - **error_code** (integer) - Error code - **error_note** (string) - Error description - **invoice_status** (bigint) - Invoice status code - **invoice_status_note** (string) - Status description #### Response Example { "error_code": 0, "error_note": "Success", "invoice_status": -99, "invoice_status_note": "Deleted" } ``` -------------------------------- ### Check Invoice Status Request Source: https://docs.click.uz/en/merchant-api/requests HTTP GET request to retrieve the status of a specific invoice using service and invoice IDs. ```http GET https://api.click.uz/v2/merchant/invoice/status/:service_id/:invoice_id HTTP/1.1 Accept: application/json Content-Type: application/json Auth: merchant_user_id:digest:timestamp ``` -------------------------------- ### GET /v2/merchant/payment/status_by_mti/:service_id/:merchant_trans_id/:date Source: https://docs.click.uz/en/merchant-api/requests Check the status of a payment using the merchant transaction ID. ```APIDOC ## GET https://api.click.uz/v2/merchant/payment/status_by_mti/:service_id/:merchant_trans_id/YYYY-MM-DD ### Description Check the status of a payment using the merchant transaction ID and date. ### Method GET ### Endpoint https://api.click.uz/v2/merchant/payment/status_by_mti/:service_id/:merchant_trans_id/YYYY-MM-DD ### Parameters #### Path Parameters - **service_id** (string) - Required - The service identifier. - **merchant_trans_id** (string) - Required - The merchant transaction ID. - **YYYY-MM-DD** (string) - Required - The date of the transaction. ### Response #### Success Response (200) - **error_code** (integer) - Status code. - **error_note** (string) - Status message. - **payment_id** (integer) - The payment ID. - **merchant_trans_id** (string) - The merchant transaction ID. ``` -------------------------------- ### Prepare Request Source: https://docs.click.uz/en/additional/get-info The Prepare request is used by the CLICK system to initiate a payment transaction with the merchant. It requires a specific MD5 signature for security verification. ```APIDOC ## Prepare Request ### Description Initiates a payment transaction from the CLICK system to the merchant. ### Request Body - **click_paydoc_id** (int) - Payment ID in CLICK system - **attempt_trans_id** (int) - Request attempt ID - **service_id** (int) - Service ID - **action** (int) - For Prepare = 1 - **params** (object) - Payment parameters - **sign_time** (varchar) - Payment time (YYYY-MM-DD HH:mm:ss) - **sign_string** (varchar) - MD5 signature (MD5(click_paydoc_id + attempt_trans_id + service_id + SECRET_KEY + params + action + sign_time)) ### Request Example { "action": 1, "click_paydoc_id": 123, "attempt_trans_id": 345, "service_id": 123, "sign_time": "2020-03-04 17:00:00", "sign_string": "***", "params": { "contract": "***", "full_name": "***", "service_type": "***", "amount": 1000 } } ### Response #### Success Response (200) - **click_paydoc_id** (int) - Payment ID in CLICK system - **attempt_trans_id** (int) - Request attempt ID - **merchant_prepare_id** (varchar) - Transaction ID in Merchant's billing system - **params** (object) - Payment processing info - **error** (int) - Request status code (0 for success) - **error_note** (varchar) - Request code description #### Response Example { "click_paydoc_id": 123, "attempt_trans_id": 345, "merchant_prepare_id": 12345, "error": 0, "error_note": "Success", "params": { "branch_id": 123, "payment_account": "***", "payment_mfo": "***", "transit_account": "***", "transit_mfo": "***" } } ``` -------------------------------- ### Calculate sign_string for Prepare Request Source: https://docs.click.uz/en/additional/shop-split The verification string is generated using an MD5 hash of the concatenated request parameters and the secret key. ```text md5(click_paydoc_id + attempt_trans_id + service_id + SECRET_KEY + params + action + sign_time) ``` -------------------------------- ### Compare Request Source: https://docs.click.uz/en/additional/get-info Retrieves a payment registry for a specific service within a defined date range. ```APIDOC ## Compare Request ### Description Retrieves a payment registry for a specific service within a defined date range. ### Request Body - **service_id** (int) - Required - Service ID - **action** (int) - Required - For Compare = 4 - **from_date** (varchar) - Required - Start date - **till_date** (varchar) - Required - End date ### Request Example { "action": 4, "service_id": 123, "from_date": "2020-03-03 00:00:00", "till_date": "2020-03-04 00:00:00" } ### Response #### Success Response (200) - **requests** (object) - Payment registry - **params** (object) - Parameters of each payment in the payment registry in "Key": "Value" format - **error** (int) - Request status code. 0 — success. - **error_note** (varchar) - Payment completion code description #### Response Example { "error": 0, "error_note": "Success", "requests": { "123": { "click_paydoc_id": 123, "params": { "contract": "***", "full_name": "***", "service_type": "***", "amount": 1000 } } } } ``` -------------------------------- ### Answer Pre-Checkout Query Source: https://docs.click.uz/en/additional/telegram-payments Respond to a `pre_checkout_query` within 10 seconds to confirm or deny a transaction. Provide a user-friendly error message if the order cannot be processed. ```javascript // If the order is valid await bot.api.answerPreCheckoutQuery(preCheckoutQuery.id, true); // If the order is invalid await bot.api.answerPreCheckoutQuery(preCheckoutQuery.id, false, { error_message: "Sorry, this item is out of stock. Would you be interested in other products we offer?" }); ``` -------------------------------- ### Prepare Request Header Source: https://docs.click.uz/en/additional/shop-split Standard HTTP header for the Prepare request. ```http Content-Type: application/json; charset=utf-8 ``` -------------------------------- ### Enable Confirmation Mode Source: https://docs.click.uz/en/merchant-api/click-pass Use this endpoint to enable confirmation mode for a specific Click Pass service. Ensure the correct service ID is provided in the URL. ```HTTP PUT https://api.click.uz/v2/merchant/click_pass/confirmation/:service_id HTTP/1.1 Accept: application/json Content-Type: application/json Auth: merchant_user_id:digest:timestamp ``` ```JSON { "error_code": 0, "error_note": "Confirmation mode enabled" } ``` -------------------------------- ### POST https://api.click.uz/v2/merchant/card_token/request Source: https://docs.click.uz/en/merchant-api/requests Initiates a request to create a card token for future payments. ```APIDOC ## POST https://api.click.uz/v2/merchant/card_token/request ### Description Creates a new card token for a specified card. If temporary is set to 1, the token is for one-time use and deleted after payment. ### Method POST ### Endpoint https://api.click.uz/v2/merchant/card_token/request ### Request Body - **service_id** (integer) - Required - The merchant service ID. - **card_number** (string) - Required - The card number. - **expire_date** (string) - Required - The card expiration date (MMYY). - **temporary** (integer) - Optional - Set to 1 for a one-time use token. ### Request Example { "service_id": 12345, "card_number": "8600123412341234", "expire_date": "0526", "temporary": 1 } ### Response #### Success Response (200) - **error_code** (integer) - Error status code. - **error_note** (string) - Error description. - **card_token** (string) - The generated card token. - **phone_number** (string) - Associated phone number. - **temporary** (boolean) - Indicates if the token is temporary. #### Response Example { "error_code": 0, "error_note": "", "card_token": "3B1DF3F1-7358-407C-B57F-0F6351310803", "phone_number": "+998*******97", "temporary": true } ``` -------------------------------- ### Enable Confirmation Mode Source: https://docs.click.uz/en/merchant-api/click-pass Enables confirmation mode for a specific Click Pass service. This requires the service ID as a path parameter. ```APIDOC ## Enable Confirmation Mode ### Description Enables confirmation mode for a specific Click Pass service. ### Method PUT ### Endpoint https://api.click.uz/v2/merchant/click_pass/confirmation/:service_id ### Parameters #### Path Parameters - **service_id** (string) - Required - The ID of the service for which to enable confirmation mode. ### Request Example ```json { "example": "No request body specified in source" } ``` ### Response #### Success Response (200) - **error_code** (integer) - Indicates the result of the operation (0 for success). - **error_note** (string) - A message describing the result of the operation. ``` -------------------------------- ### Prepare Request Source: https://docs.click.uz/en/additional/shop-split This request retrieves additional information from the Provider required to process a payment, including payment details and split information. ```APIDOC ## Prepare Request ### Description Retrieves additional information from the Provider required to process the payment, such as branches, payment details, and split information. ### Parameters #### Request Body - **click_paydoc_id** (bigint) - Required - Payment ID in the CLICK system - **attempt_trans_id** (bigint) - Required - Request attempt ID - **service_id** (int) - Required - Service ID - **action** (int) - Required - For Prepare = 1 - **params** (object) - Required - Payment parameters in "Key": "Value" format - **sign_time** (varchar) - Required - Payment time in YYYY-MM-DD HH:mm:ss format - **sign_string** (varchar) - Required - Verification string (MD5 hash of parameters) ### Request Example { "action": 1, "click_paydoc_id": 123, "attempt_trans_id": 345, "service_id": 123, "sign_time": "2020-03-04 17:00:00", "sign_string": "***", "params": { "contract": "***", "full_name": "***", "service_type": "***", "amount": 1000 } } ### Response #### Success Response (200) - **click_paydoc_id** (bigint) - Payment ID in the CLICK system - **attempt_trans_id** (bigint) - Request attempt ID - **merchant_prepare_id** (bigint) - Optional - Transaction ID in the Provider's billing system - **params** (object) - Parameters required to process the payment - **split** (item[]) - List of counterparties participating in the split - **error** (int) - Request status code (0 for success) - **error_note** (varchar) - Request status description #### Response Example { "click_paydoc_id": 123, "attempt_trans_id": 345, "merchant_prepare_id": 12345, "error": 0, "error_note": "Success", "params": { "branch_id": 123, "payment_account": "***", "payment_mfo": "***", "transit_account": "***", "transit_mfo": "***" }, "split": [ { "cntrg_id": 123, "amount": 450 }, { "cntrg_id": 321, "amount": 550 } ] } ``` -------------------------------- ### POST https://api.click.uz/v2/merchant/invoice/create Source: https://docs.click.uz/en/merchant-api/requests Creates a new invoice for a merchant service. ```APIDOC ## POST https://api.click.uz/v2/merchant/invoice/create ### Description Creates a new invoice for a specified service, amount, and recipient. ### Method POST ### Endpoint https://api.click.uz/v2/merchant/invoice/create ### Parameters #### Request Body - **service_id** (integer) - Required - Service ID - **amount** (float) - Required - Payment amount - **phone_number** (string) - Required - Invoice recipient - **merchant_trans_id** (string) - Required - Order ID / personal account ### Request Example { "service_id": 12345, "amount": 10000, "phone_number": "998901234567", "merchant_trans_id": "order_123" } ### Response #### Success Response (200) - **error_code** (integer) - Error code - **error_note** (string) - Error description - **invoice_id** (bigint) - Invoice ID #### Response Example { "error_code": 0, "error_note": "Success", "invoice_id": 1234567 } ``` -------------------------------- ### POST https://api.click.uz/v2/merchant/card_token/payment Source: https://docs.click.uz/en/merchant-api/requests Executes a payment using a previously verified card token. ```APIDOC ## POST https://api.click.uz/v2/merchant/card_token/payment ### Description Processes a payment transaction using a valid card token. ### Method POST ### Endpoint https://api.click.uz/v2/merchant/card_token/payment ### Request Body - **service_id** (integer) - Required - The merchant service ID. - **card_token** (string) - Required - The token to use for payment. - **amount** (number) - Required - The payment amount. - **transaction_parameter** (string) - Required - Custom transaction identifier. ### Request Example { "service_id": 12345, "card_token": "token", "amount": 10000, "transaction_parameter": "order_123" } ### Response #### Success Response (200) - **error_code** (integer) - Error status code. - **error_note** (string) - Error description. - **payment_id** (integer) - The unique payment ID. - **payment_status** (integer) - The status of the payment. #### Response Example { "error_code": 0, "error_note": "Success", "payment_id": 598761234, "payment_status": 1 } ``` -------------------------------- ### Create Invoice Request Source: https://docs.click.uz/en/merchant-api/requests HTTP POST request to create an invoice, requiring authentication headers and a JSON body. ```http POST https://api.click.uz/v2/merchant/invoice/create HTTP/1.1 Accept: application/json Content-Type: application/json Auth: merchant_user_id:digest:timestamp ``` ```json { "service_id": 12345, "amount": 10000, "phone_number": "998901234567", "merchant_trans_id": "order_123" } ``` -------------------------------- ### Compare Request JSON Source: https://docs.click.uz/en/additional/get-info JSON structure for initiating a Compare request with service ID and date range. ```json { "action": 4, "service_id": 123, "from_date": "2020-03-03 00:00:00", "till_date": "2020-03-04 00:00:00" } ``` -------------------------------- ### Complete Request Source: https://docs.click.uz/en/additional/get-info Finalizes a payment transaction in the CLICK system. Requires a valid MD5 signature formed from request parameters and a secret key. ```APIDOC ## Complete Request ### Description Finalizes a payment transaction in the CLICK system. Requires a valid MD5 signature formed from request parameters and a secret key. ### Parameters #### Request Body - **click_paydoc_id** (int) - Required - Payment ID in CLICK - **attempt_trans_id** (int) - Required - Attempt ID - **service_id** (int) - Required - Service ID - **action** (int) - Required - For Confirm = 2 - **merchant_prepare_id** (varchar) - Required - ID from Prepare - **params** (object) - Required - Payment parameters - **sign_time** (varchar) - Required - Time - **sign_string** (varchar) - Required - MD5 signature (MD5(click_paydoc_id + attempt_trans_id + service_id + SECRET_KEY + params + action + sign_time)) ### Request Example { "action": 2, "click_paydoc_id": 123, "attempt_trans_id": 345, "merchant_prepare_id": 12345, "service_id": 123, "sign_time": "2020-03-04 17:00:00", "sign_string": "***", "params": { "contract": "***", "full_name": "***", "service_type": "***", "amount": 1000 } } ### Response #### Success Response (200) - **click_paydoc_id** (int) - Payment ID in CLICK system - **attempt_trans_id** (int) - Request attempt ID - **merchant_confirm_id** (varchar) - Optional - Transaction ID of payment completion in Merchant's billing system - **params** (object) - Payment completion info parameters - **error** (int) - Request status code (0 for success) - **error_note** (varchar) - Processing result description #### Response Example { "click_paydoc_id": 123, "attempt_trans_id": 345, "merchant_confirm_id": 12345, "error": 0, "error_note": "Success", "params": { "***": "***" } } ``` -------------------------------- ### Create Card Token Request Source: https://docs.click.uz/en/merchant-api/requests Initiates a request to generate a card token. Setting temporary to 1 creates a one-time use token. ```http POST https://api.click.uz/v2/merchant/card_token/request HTTP/1.1 Accept: application/json Content-Type: application/json ``` ```json { "service_id": 12345, "card_number": "8600123412341234", "expire_date": "0526", "temporary": 1 } ``` -------------------------------- ### Payment Reversal Request Source: https://docs.click.uz/en/merchant-api/click-pass Initiate a payment reversal using this DELETE request. Note the conditions under which a reversal is possible. ```HTTP DELETE https://api.click.uz/v2/merchant/payment/reversal/:service_id/:payment_id HTTP/1.1 Accept: application/json Content-Type: application/json Auth: merchant_user_id:digest:timestamp ``` -------------------------------- ### Create Invoice Response Source: https://docs.click.uz/en/merchant-api/requests Successful response structure for an invoice creation request. ```json { "error_code": 0, "error_note": "Success", "invoice_id": 1234567 } ``` -------------------------------- ### Create Card Token Response Source: https://docs.click.uz/en/merchant-api/requests The response returned after a successful card token creation request. ```json { "error_code": 0, "error_note": "", "card_token": "3B1DF3F1-7358-407C-B57F-0F6351310803", "phone_number": "+998*******97", "temporary": true } ``` -------------------------------- ### Authentication Header Format Source: https://docs.click.uz/en/merchant-api/requests The required format for the Auth HTTP header using a digest and timestamp. ```text Auth: merchant_user_id:digest:timestamp ``` -------------------------------- ### Successful Response Body Source: https://docs.click.uz/en/additional/shop-split JSON structure for a successful payment confirmation response. ```json { "click_paydoc_id": 123, "attempt_trans_id": 345, "merchant_confirm_id": 12345, "error": 0, "error_note": "Success", "params": {} } ``` -------------------------------- ### Authentication Source: https://docs.click.uz/en/merchant-api/requests All API requests must include an 'Auth' header constructed using the merchant_user_id, a SHA1 digest of the timestamp and secret_key, and the current UNIX timestamp. ```APIDOC ## Authentication ### Description All API requests must contain the 'Auth' HTTP header to authenticate the request. ### Header Format `Auth: merchant_user_id:digest:timestamp` ### Components - **merchant_user_id**: Provided upon registration. - **digest**: `sha1(timestamp + secret_key)` - **timestamp**: UNIX timestamp (10-digit number of seconds since epoch) ### Required HTTP Headers - **Accept**: Response format - **Content-Type**: Request body format - **Auth**: Authentication data ``` -------------------------------- ### Payment with Card Token Request Source: https://docs.click.uz/en/merchant-api/requests Processes a payment using a previously verified card token. ```http POST https://api.click.uz/v2/merchant/card_token/payment HTTP/1.1 Accept: application/json Content-Type: application/json Auth: merchant_user_id:digest:timestamp ``` ```json { "service_id": 12345, "card_token": "token", "amount": 10000, "transaction_parameter": "order_123" } ``` -------------------------------- ### Send Invoice with Telegram Bot API Source: https://docs.click.uz/en/additional/telegram-payments Use the `sendInvoice` method to generate a payment invoice. Ensure the `provider_token` is correctly passed. ```javascript await bot.api.sendInvoice({ chat_id: chatId, provider_token: "YOUR_PROVIDER_TOKEN", start_parameter: "any-unique-parameter", title: "Goods title", description: "Goods description", payload: "Payload for the payment", currency: "UZS", prices: [ { label: "15% VAT", amount: 1500 }, { label: "Service fee", amount: 1000 } ], // Optional parameters photo_url: "https://example.com/image.jpg", photo_width: 512, photo_height: 512, need_name: true, need_phone_number: true, need_email: true, need_shipping_address: true, reply_markup: { inline_keyboard: [ [ { text: "Pay", pay: true } ] ] } }); ``` -------------------------------- ### Payment with Card Token Response Source: https://docs.click.uz/en/merchant-api/requests The response returned after a successful payment transaction. ```json { "error_code": 0, "error_note": "Success", "payment_id": 598761234, "payment_status": 1 } ``` -------------------------------- ### POST https://api.click.uz/v2/merchant/card_token/verify Source: https://docs.click.uz/en/merchant-api/requests Verifies a card token using an SMS code. ```APIDOC ## POST https://api.click.uz/v2/merchant/card_token/verify ### Description Verifies the card token request using the SMS code sent to the user. ### Method POST ### Endpoint https://api.click.uz/v2/merchant/card_token/verify ### Request Body - **service_id** (integer) - Required - The merchant service ID. - **card_token** (string) - Required - The token to verify. - **sms_code** (integer) - Required - The SMS verification code. ### Request Example { "service_id": 12345, "card_token": "token", "sms_code": 123456 } ### Response #### Success Response (200) - **error_code** (integer) - Error status code. - **error_note** (string) - Error description. - **card_number** (string) - Masked card number. #### Response Example { "error_code": 0, "error_note": "Success", "card_number": "8600 55** **** 3244" } ``` -------------------------------- ### Compare Response JSON Source: https://docs.click.uz/en/additional/get-info JSON structures for successful and unsuccessful Compare request responses. ```json { "error": 0, "error_note": "Success", "requests": { "123": { "click_paydoc_id": 123, "params": { "contract": "***", "full_name": "***", "service_type": "***", "amount": 1000 } } } } ``` ```json { "error": -250, "error_note": "Error description" } ``` -------------------------------- ### Payment Reversal (Cancel) Source: https://docs.click.uz/en/merchant-api/click-pass Initiates a reversal for a completed payment. Subject to specific conditions. ```APIDOC ## DELETE /v2/merchant/payment/reversal/:service_id/:payment_id ### Description Initiates a reversal for a completed payment. This operation is subject to several conditions, including the payment status, age, and method of payment. ### Method DELETE ### Endpoint /v2/merchant/payment/reversal/:service_id/:payment_id ### Parameters #### Path Parameters - **service_id** (string) - Required - The ID of the service. - **payment_id** (string) - Required - The ID of the payment. ### Response #### Success Response (200) - **error_code** (integer) - The status code of the operation. - **error_note** (string) - A message describing the operation status. - **payment_id** (integer) - The ID of the payment. #### Response Example ```json { "error_code": 0, "error_note": "Success", "payment_id": 1234567 } ``` ### Reversal Conditions * Payment must be successfully completed * Reversal is only possible for payments of the current month * Payments from the previous month — only on the first day of the current month * Payment must be made with an online card * Reversal may be rejected by UZCARD payment system ``` -------------------------------- ### Confirm Payment Request Source: https://docs.click.uz/en/merchant-api/click-pass Send a POST request to confirm a payment. This is used when confirmation mode is enabled for the service. ```HTTP POST https://api.click.uz/v2/merchant/click_pass/confirm HTTP/1.1 Accept: application/json Content-Type: application/json Auth: merchant_user_id:digest:timestamp ``` -------------------------------- ### Formulate MD5 Signature Source: https://docs.click.uz/en/additional/get-info The signature is generated by concatenating specific request fields with the merchant's secret key and hashing the result. ```text MD5(click_paydoc_id + attempt_trans_id + service_id + SECRET_KEY + params + action + sign_time) ``` -------------------------------- ### Verify Card Token Response Source: https://docs.click.uz/en/merchant-api/requests The response returned after a successful card token verification. ```json { "error_code": 0, "error_note": "Success", "card_number": "8600 55** **** 3244" } ``` -------------------------------- ### Failed Response Body Source: https://docs.click.uz/en/additional/shop-split JSON structure for a failed payment confirmation response. ```json { "click_paydoc_id": 123, "attempt_trans_id": 345, "error": -250, "error_note": "Error description" } ``` -------------------------------- ### Confirm Payment Response Source: https://docs.click.uz/en/merchant-api/click-pass A successful confirmation response indicates that the payment has been confirmed. ```JSON { "error_code": 0, "error_note": "Payment confirmed" } ``` -------------------------------- ### Confirm Request Body Source: https://docs.click.uz/en/additional/shop-split JSON structure for the Confirm request sent from CLICK to the Provider. ```json { "action": 2, "click_paydoc_id": 123, "attempt_trans_id": 345, "merchant_prepare_id": 12345, "service_id": 123, "sign_time": "2020-03-04 17:00:00", "sign_string": "***", "params": { "contract": "***", "full_name": "***", "service_type": "***", "amount": 1000 } } ``` -------------------------------- ### Check Payment Status Request Source: https://docs.click.uz/en/merchant-api/click-pass Use this endpoint to retrieve the current status of a payment. Ensure you have the correct service ID and payment ID. ```HTTP GET https://api.click.uz/v2/merchant/payment/status/:service_id/:payment_id HTTP/1.1 Accept: application/json Content-Type: application/json Auth: merchant_user_id:digest:timestamp ``` -------------------------------- ### Confirm Request Source: https://docs.click.uz/en/additional/shop-split The Confirm Request is sent by the CLICK system to the provider to finalize a payment. It requires a valid signature and specific transaction identifiers. ```APIDOC ## POST /confirm ### Description Finalizes a payment transaction in the provider's billing system. ### Parameters #### Request Body - **click_paydoc_id** (bigint) - Required - Payment ID in the CLICK system - **attempt_trans_id** (bigint) - Required - Request attempt ID - **service_id** (int) - Required - Service ID - **action** (int) - Required - For Confirm = 2 - **merchant_prepare_id** (bigint) - Required - Payment ID in the Provider's billing system for confirmation - **params** (object) - Required - Payment parameters in Key: Value format - **sign_time** (varchar) - Required - Payment time in YYYY-MM-DD HH:mm:ss format - **sign_string** (varchar) - Required - MD5 hash verification string ### Request Example { "action": 2, "click_paydoc_id": 123, "attempt_trans_id": 345, "merchant_prepare_id": 12345, "service_id": 123, "sign_time": "2020-03-04 17:00:00", "sign_string": "***", "params": { "contract": "***", "full_name": "***", "service_type": "***", "amount": 1000 } } ### Response #### Success Response (200) - **click_paydoc_id** (bigint) - Payment ID in the CLICK system - **attempt_trans_id** (bigint) - Request attempt ID - **merchant_confirm_id** (bigint) - Optional - Transaction ID for payment completion - **params** (object) - Payment completion information - **error** (int) - Request status code (0 for success) - **error_note** (varchar) - Status description #### Response Example { "click_paydoc_id": 123, "attempt_trans_id": 345, "merchant_confirm_id": 12345, "error": 0, "error_note": "Success", "params": {} } ``` -------------------------------- ### Check Request Source: https://docs.click.uz/en/additional/get-info The Check Request is sent by the CLICK system to the merchant to verify the status of a payment transaction. ```APIDOC ## Check Request ### Description This endpoint is used by the CLICK system to verify the status of a payment transaction in the merchant's billing system. ### Request Body - **click_paydoc_id** (int) - Payment ID in CLICK system - **attempt_trans_id** (int) - Request attempt ID - **service_id** (int) - Service ID - **action** (int) - For Check always 3 - **merchant_prepare_id** (varchar) - Payment ID in Merchants's billing system from Prepare request - **params** (object) - Payment parameters in "Key": "Value" format - **sign_time** (varchar) - Payment time. Format YYYY-MM-DD HH:mm:ss - **sign_string** (varchar) - Verification string (MD5 signature) ### Request Example { "action": 3, "click_paydoc_id": 123, "attempt_trans_id": 345, "merchant_prepare_id": 12345, "service_id": 123, "sign_time": "2020-03-04 17:00:00", "sign_string": "***", "params": { "contract": "***", "full_name": "***", "service_type": "***", "amount": 1000 } } ### Response #### Success Response (200) - **click_paydoc_id** (int) - Payment ID in CLICK system - **attempt_trans_id** (int) - Request attempt ID - **params** (object) - Payment verification info parameters - **error** (int) - Request status code. 0 — success - **error_note** (varchar) - Processing result description - **status** (int) - Payment processing status (0: Not processed, 1: Unsuccessful, 2: Successfully processed) #### Response Example { "click_paydoc_id": 123, "attempt_trans_id": 345, "merchant_confirm_id": 12345, "error": 0, "error_note": "Success", "status": 2, "params": { "***": "***" } } ``` -------------------------------- ### Verify Card Token Request Source: https://docs.click.uz/en/merchant-api/requests Verifies a card token using an SMS code. Requires authentication headers. ```http POST https://api.click.uz/v2/merchant/card_token/verify HTTP/1.1 Accept: application/json Content-Type: application/json Auth: merchant_user_id:digest:timestamp ``` ```json { "service_id": 12345, "card_token": "token", "sms_code": 123456 } ``` -------------------------------- ### Confirm Payment Source: https://docs.click.uz/en/merchant-api/click-pass Manually confirms a payment for a service where confirmation mode is enabled. Unconfirmed payments are automatically cancelled after 30 seconds. ```APIDOC ## POST /v2/merchant/click_pass/confirm ### Description Manually confirms a payment. This is used when the 'Confirmation mode' is enabled at the service level. Unconfirmed payments are automatically cancelled after 30 seconds. ### Method POST ### Endpoint /v2/merchant/click_pass/confirm ### Parameters #### Request Body - **service_id** (integer) - Required - The ID of the service. - **payment_id** (integer) - Required - The ID of the payment. ### Request Example ```json { "service_id": 12345, "payment_id": 1234567 } ``` ### Response #### Success Response (200) - **error_code** (integer) - The status code of the operation. - **error_note** (string) - A message describing the operation status. #### Response Example ```json { "error_code": 0, "error_note": "Payment confirmed" } ``` ``` -------------------------------- ### Payment Reversal Response Source: https://docs.click.uz/en/merchant-api/click-pass The response confirms if the reversal request was processed. The payment ID is returned upon success. ```JSON { "error_code": 0, "error_note": "Success", "payment_id": 1234567 } ``` -------------------------------- ### Confirm Payment Request Body Source: https://docs.click.uz/en/merchant-api/click-pass The request body for payment confirmation requires the service ID and payment ID. ```JSON { "service_id": 12345, "payment_id": 1234567 } ``` -------------------------------- ### Disable Confirmation Mode Source: https://docs.click.uz/en/merchant-api/click-pass Disables confirmation mode for a specific Click Pass service. This requires the service ID as a path parameter. ```APIDOC ## Disable Confirmation Mode ### Description Disables confirmation mode for a specific Click Pass service. ### Method DELETE ### Endpoint https://api.click.uz/v2/merchant/click_pass/confirmation/:service_id ### Parameters #### Path Parameters - **service_id** (string) - Required - The ID of the service for which to disable confirmation mode. ### Request Example ```json { "example": "No request body specified in source" } ``` ### Response #### Success Response (200) - **error_code** (integer) - Indicates the result of the operation (0 for success). - **error_note** (string) - A message describing the result of the operation. ``` -------------------------------- ### Check Invoice Status Response Source: https://docs.click.uz/en/merchant-api/requests Response structure containing the current status code and description for an invoice. ```json { "error_code": 0, "error_note": "Success", "invoice_status": -99, "invoice_status_note": "Deleted" } ``` -------------------------------- ### Check Payment Status Response Source: https://docs.click.uz/en/merchant-api/click-pass The response indicates the success or failure of the payment status check and provides the payment status code. ```JSON { "error_code": 0, "error_note": "Success", "payment_id": 1234567, "payment_status": 1 } ``` -------------------------------- ### Check Payment Status Source: https://docs.click.uz/en/merchant-api/click-pass Retrieves the current status of a specific payment using the service ID and payment ID. ```APIDOC ## GET /v2/merchant/payment/status/:service_id/:payment_id ### Description Retrieves the current status of a specific payment. ### Method GET ### Endpoint /v2/merchant/payment/status/:service_id/:payment_id ### Parameters #### Path Parameters - **service_id** (string) - Required - The ID of the service. - **payment_id** (string) - Required - The ID of the payment. ### Response #### Success Response (200) - **error_code** (integer) - The status code of the operation. - **error_note** (string) - A message describing the operation status. - **payment_id** (integer) - The ID of the payment. - **payment_status** (integer) - The status of the payment. #### Response Example ```json { "error_code": 0, "error_note": "Success", "payment_id": 1234567, "payment_status": 1 } ``` ``` -------------------------------- ### Check Payment Status by Merchant Transaction ID Source: https://docs.click.uz/en/merchant-api/requests Retrieves payment status using the merchant transaction ID and date. ```http GET https://api.click.uz/v2/merchant/payment/status_by_mti/:service_id/:merchant_trans_id/YYYY-MM-DD HTTP/1.1 Accept: application/json Content-Type: application/json Auth: merchant_user_id:digest:timestamp ``` ```json { "error_code": 0, "error_note": "Success", "payment_id": 1234567, "merchant_trans_id": "user123" } ``` -------------------------------- ### Disable Confirmation Mode Source: https://docs.click.uz/en/merchant-api/click-pass Use this endpoint to disable confirmation mode for a specific Click Pass service. The service ID must be included in the request URL. ```HTTP DELETE https://api.click.uz/v2/merchant/click_pass/confirmation/:service_id HTTP/1.1 Accept: application/json Content-Type: application/json Auth: merchant_user_id:digest:timestamp ``` ```JSON { "error_code": 0, "error_note": "Confirmation mode disabled" } ``` -------------------------------- ### DELETE /v2/merchant/payment/reversal/:service_id/:payment_id Source: https://docs.click.uz/en/merchant-api/requests Perform a payment reversal (cancel) for a specific payment. ```APIDOC ## DELETE https://api.click.uz/v2/merchant/payment/reversal/:service_id/:payment_id ### Description Perform a payment reversal (cancel) for a specific payment. Note: Payment must be successfully completed, made with an online card, and within the current reporting month (or first day of the current month for previous month payments). ### Method DELETE ### Endpoint https://api.click.uz/v2/merchant/payment/reversal/:service_id/:payment_id ### Parameters #### Path Parameters - **service_id** (string) - Required - The service identifier. - **payment_id** (string) - Required - The payment identifier. ### Response #### Success Response (200) - **error_code** (integer) - Status code. - **error_note** (string) - Status message. - **payment_id** (integer) - The payment ID. ``` -------------------------------- ### Payment Reversal Source: https://docs.click.uz/en/merchant-api/requests Cancels a completed payment. Reversals are subject to specific monthly reporting constraints. ```http DELETE https://api.click.uz/v2/merchant/payment/reversal/:service_id/:payment_id HTTP/1.1 Accept: application/json Content-Type: application/json Auth: merchant_user_id:digest:timestamp ``` ```json { "error_code": 0, "error_note": "Success", "payment_id": 1234567 } ``` -------------------------------- ### Delete Card Token Response Source: https://docs.click.uz/en/merchant-api/requests The response body returned upon a successful deletion request. ```JSON { "error_code": 0, "error_note": "Success" } ```