Merchant – Request

Connection and making requests

API Endpoint

https://api.click.uz/v2/merchant/

Private Data

Upon registration, service provider receives following data to connect and make requests to an API:

  • merchant_id
  • service_id
  • merchant_user_id
  • secret_key

secret_key parameter is private and service provider is fully responsible for its safety.
Exposing secret_key may end up in compromising your data.

Authentication

HTTP Header “Auth: merchant_user_id:digest:timestamp”
digest – sha1(timestamp + secret_key)
timestamp – UNIX timestamp (10 digit seconds from epoch start)

Required headers

Accept
Auth
Content-Type

Supported content types

application/json
application/xml

 

Create invoice

Request

POST https://api.click.uz/v2/merchant/invoice/create HTTP/1.1
Accept: application/json
Content-Type: application/json
Auth: 123:356a192b7913b04c54574d18c28d46e6395428ab:1519051543

{
“service_id”: :service_id,
“amount”: :amount,
“phone_number”: :phone_number,
“merchant_trans_id”: :merchant_trans_id
}

Request parameters

# Parameter Data type Description
1 service_id integer Service ID
2 amount float Requested amount
3 phone_number string Invoice receiver
4 merchant_trans_id string Order ID (for online shopping) / personal account / login in the billing of the supplier

Response

HTTP/1.1 200 OK
Content-Type: application/json

{
“error_code”: error_code,
“error_note”: “Error description”,
“invoice_id”: 1234567
}

Response parameters

# Parameter Data type Description
1 error_code integer Error code
2 error_note string Error description
3 invoice_id bigint Invoice Identifier

 

Invoice status check

Request

GET https://api.click.uz/v2/merchant/invoice/status/:service_id/:invoice_id HTTP/1.1
Accept: application/json
Content-Type: application/json
Auth: 123:356a192b7913b04c54574d18c28d46e6395428ab:1519051543

Response

HTTP/1.1 200 OK
Content-Type: application/json

{
“error_code”: error_code,
“error_note”: “Error description”,
“invoice_status”: -99,
“invoice_status_note”: “Deleted”,
}

Response parameters

# Parameter Data type Description
1 error_code integer Error code
2 error_note string Error description
3 invoice_status bigint Invoice status code
4 invoice_status_note int Status description

 

Payment status check

Request

GET https://api.click.uz/v2/merchant/payment/status/:service_id/:payment_id HTTP/1.1
Accept: application/json
Content-Type: application/json
Auth: 123:356a192b7913b04c54574d18c28d46e6395428ab:1519051543

Request parameters

# Parameter Data type Description
1 service_id integer Service ID
2 payment_id bigint Payment ID

Response

HTTP/1.1 200 OK
Content-Type: application/json

{
“error_code”: error_code,
“error_note”: “Error description”,
“payment_id”: 1234567,
“payment_status”: 1
}

Response parameters

# Parameter Data type Description
1 error_code integer Error code
2 error_note string Error description
3 payment_id bigint Payment Identifier
4 payment_status int Payment status code

 

Payment status check by merchant_trans_id

Request

GET https://api.click.uz/v2/merchant/payment/status_by_mti/:service_id/:merchant_trans_id HTTP/1.1
Accept: application/json
Content-Type: application/json
Auth: 123:356a192b7913b04c54574d18c28d46e6395428ab:15190515

Request parameters

# Parameter Data type Description
1 service_id integer Service ID
2 merchant_trans_id string Merchant transaction ID

Response

HTTP/1.1 200 OK
Content-Type: application/json

{
“error_code”: error_code,
“error_note”: “Error description”,
“payment_id”: 1234567,
“merchant_trans_id”: “user123”
}

Response parameters

# Parameter Data type Description
1 error_code integer Error code
2 error_note string Error description
3 payment_id bigint Payment Identifier
4 payment_status int Payment status code

 

Payment reversal (cancel)

Request

DELETE https://api.click.uz/v2/merchant/payment/reversal/:service_id/:payment:id HTTP/1.1
Accept: application/json
Content-Type: application/json
Auth: 123:356a192b7913b04c54574d18c28d46e6395428ab:1519051543

Request parameters

# Parameter Data type Description
1 service_id integer Service ID
2 payment_id bigint Payment ID

Response

HTTP/1.1 200 OK
Content-Type: application/json

{
“error_code”: error_code,
“error_note”: “Error description”,
“payment_id”: 1234567
}

Response parameters

# Parameter Data type Description
1 error_code integer Error code
2 error_note string Error description
3 payment_id bigint Payment Identifier

Reversal conditions

  • Payment should be successfully completed
  • Only payments created in current reporting month can be reverted
  • Payments from previous month can be canceled only on first day of current month.  Payment should be made with Online card.
  • Payment reversal can be denied due to refusal by UZCARD

 

Create card token

Request

POST https://api.click.uz/v2/merchant/card_token/request HTTP/1.1
Accept: application/json
Content-Type: application/json

{
“service_id”: :service_id,
“card_number”: :card_number,
“expire_date”: :expire_date, // (MMYY)
“temporary”: 1 // (0|1)
}

temporary – create token for one time use.
Temporary tokens are automatically removed after payment.

Request parameters

# Parameter Data type Description
1 service_id integer Service ID
2 card_number string Card number
3 expire_date string Card expire date
4 temporary bit Create temporary card

Response

HTTP/1.1 200 OK
Content-Type: application/json

{
“error_code”: error_code,
“error_note”: “Error description”,
“card_token”: “3B1DF3F1-7358-407C-B57F-0F6351310803”,
“phone_number”: “99890***1234”,
“temporary”: 1,
}

Response parameters

# Parameter Data type Description
1 error_code integer Error code
2 error_note string Error description
3 card_token string Card token
4 phone_number string User phone number
4 temporary bit Type of created token

 

Verify card token

Request

POST https://api.click.uz/v2/merchant/card_token/verify HTTP/1.1
Accept: application/json
Content-Type: application/json
Auth: 123:356a192b7913b04c54574d18c28d46e6395428ab:1519051543

{
“service_id”: :service_id,
“card_token”: :card_token,
“sms_code”: :sms_code
}

Request parameters

# Parameter Data type Description
1 service_id integer Service ID
2 card_token string Card token
3 sms_code int Recevied sms code

Response

HTTP/1.1 200 OK
Content-Type: application/json

{
“error_code”: error_code,
“error_note”: “Error description”,
“card_number”: “8600 55** **** 3244”,
}

Response parameters

# Parameter Data type Description
1 error_code integer Error code
2 error_note string Error description
3 card_number string Card number

 

Payment with token

Request

POST https://api.click.uz/v2/merchant/card_token/payment HTTP/1.1
Accept: application/json
Content-Type: application/json
Auth: 123:356a192b7913b04c54574d18c28d46e6395428ab:1519051543

{
“service_id”: :service_id,
“card_token”: :card_token,
“amount”: :amount,
“transaction_parameter”: :merchant_trans_id
}

transaction_parameter – user or contract identifier on merchant billing

Request parameters

# Parameter Data type Description
1 card_token string Card token
2 amount float Payment amount
3 merchant_trans_id string Merchant transaction ID

Response

HTTP/1.1 200 OK
Content-Type: application/json

{
“error_code”: error_code,
“error_note”: “Error description”,
“payment_id”: “598761234”,
“payment_status”: 1
}

Response parameters

# Parameter Data type Description
1 error_code integer Error code
2 error_note string Error description
3 payment_id bigint Payment Identifier
4 payment_status int Payment status code

 

Delete card token

Request

DELETE https://api.click.uz/v2/merchant/card_token/:service_id/:card_token HTTP/1.1
Accept: application/json
Content-Type: application/json
Auth: 123:356a192b7913b04c54574d18c28d46e6395428ab:1519051543

Request parameters

# Parameter Data type Description
1 service_id integer Service ID
2 card_token string Card token

Response

HTTP/1.1 200 OK
Content-Type: application/json

{
“error_code”: error_code,
“error_note”: “Error description”
}
© 2024 Click