Skip to content

One-Stage Payment

A one-stage payment is configured using the prepare_payment method by setting the parameter auto_capture = true, which is the default value in the request body. In this payment process, funds are debited immediately without requiring additional confirmation of the amount by the Partner.

User Flows

Payment via OCTO Form - Humo/Uzcard (Processing Center - PC)

  1. The client selects a product or service;
  2. In the shopping cart, the client clicks "Pay";
  3. The Partner initiates the transaction using the prepare_payment method;
  4. Our Back-end (BE) sends a link to our Front-end (FE) for payment;
  5. The Partner provides the link for the client to access our FE;
  6. The client selects a payment method;
  7. Our FE displays the form to enter bank card details;
  8. The client fills out and submits their bank card details;
  9. Our FE redirects the client to the OTP code entry form;
  10. The Processing Center (PC) sends the OTP code;
  11. The client submits the OTP code*;
  12. After verification, our BE sends a debit request to the PC;
  13. The PC confirms the debit or sends a rejection;
  14. We notify the Partner of the success or failure of the debit;
  15. The client is redirected back to the Partner's website.

Important!

There is a limit for incorrect OTP code entries for Uzcard. If the client enters an incorrect OTP code three times, the transaction is canceled, and a new payment must be registered.


Diagram

Payment via OCTO Form

Payment via OCTO Form - Visa/MC (Processing Center - PC)

  1. The client selected a product/service;
  2. Clicked "Pay" in the shopping cart;
  3. The partner initiates the transaction using the prepare_payment method;
  4. Our Back-end (BE) sends a link to our Front-end (FE) for payment;
  5. The partner redirects the client to our FE for payment;
  6. The client selects the payment method;
  7. Our FE sends an on-screen form for entering bank card details;
  8. The client fills in and sends bank card details;
  9. Our FE displays an on-screen form for entering the OTP code to the client;
  10. Visa/MC PC sent the OTP code to the client;
  11. The client enters the OTP code received from Visa/MC PC;
  12. Visa/MC PC sends a confirmation of the write-off to our BE;
  13. Our BE notifies the Partner about successful/unsuccessful write-off;
  14. Our BE redirects the client to the Partner's website.

Diagram

Payment via OCTO Form

Methods

prepare_payment

  • URL: https://secure.octo.uz/prepare_payment
  • Method: POST
  • Content-type: application/json

Test transactions

To conduct a test transaction, when initiating the prepare_payment method, you must specify the test parameter with the value true in the request body. This parameter is optional. If it is not specified, a real transaction will be created.

To conduct a test transaction, specify - test: true

json
{
  "auto_capture": true,
  "test": true, 
  "init_time": "2024-05-02 09:17:00"
}

Example request

Important!

One-stage payment - auto_capture: true

Two-stage payment - auto_capture: false

json
{
    "octo_shop_id": 123,
    "octo_secret": "537da54b-835a-4968-9864-c2ae02c5902e",
    "shop_transaction_id": "0000_0000_0000_0000_0010",
    "auto_capture": true,  
    "test": false,
    "init_time": "2024-05-02 09:17:00",
    "user_data": {
        "user_id": "Johnny Depp",
        "phone": "998901234567",
        "email": "octo@mail.com"
    },
    "total_sum": 1000.0,
    "currency": "UZS",
    "description": "TEST_PAYMENT",
    "basket": [
        {
            "position_desc": "Йогурт MANON клубничный",
            "count": 2,
            "price": 10.0,
            "spic": "special_information_for_position"
        },
        {
            "position_desc": "Йогурт MANON банановый",
            "count": 1,
            "price": 20.0,
            "spic": "special_information_for_position"
        }
    ],
    "payment_methods": [
        {
            "method": "bank_card"
        },
        {
            "method": "uzcard"
        },
        {
            "method": "humo"
        }
    ],
    "tsp_id": 18,
    "return_url": "https://octo.uz" // (URL must always be complete),
    "notify_url": "https://notify-url.uz",
    "language": "uz",
    "ttl": 15
}

Request parameters

ParameterTypeRequiredDescription
octo_shop_idIntegerYesThe shop's unique ID (available in the Personal Account).
octo_secretStringYesThe shop's personal secret key, generated in the Personal Account. Must be kept securely.
shop_transaction_idStringYesThe unique transaction ID on the shop's side. Used to prevent duplication.
auto_captureBooleanYesIf true, funds are automatically written off. If false, additional confirmation is required.
testBooleanYesIndicates if it is a test payment.
init_timeDatetimeYesTime of payment creation (format: yyyy-MM-dd HH:mm:ss).
user_dataObjectNoInformation about the customer, displayed on the payment page.
user_data.user_idStringYes (if present)User's ID in the shop's database.
user_data.phoneStringYes (if present)User's phone number.
user_data.emailStringYes (if present)User's email address.
total_sumDoubleYesTotal payment amount.
currencyStringYesPayment currency (e.g., USD, UZS, RUB).
descriptionStringYesDescription of the product.
basketArrayYesDetailed information about the basket.
basket.position_descStringYes (if present)Item name in the receipt.
basket.countIntegerYes (if present)Quantity of the item.
basket.priceDoubleYes (if present)Price per item.
basket.spicStringNoAdditional field for item details.
payment_methodsArrayNoAvailable payment methods (e.g., bank_card, uzcard, humo).
tsp_idIntegerNoID of the sales and service provider.
return_urlStringYesURL to redirect the customer after payment. Must identify the specific payment.
notify_urlStringNoURL for payment status notifications.
languageStringYesLanguage of the payment form (e.g., en, uz, ru).
ttlIntegerNoPayment lifetime in minutes.

Successful response example

json
{
    "error": 0,
    "data": {
        "shop_transaction_id": "c9211e0f-c6ba-4d97-b8be-fb230ef3985b",
        "octo_payment_UUID": "e3f40dc3-4955-412a-853a-2ddd28d3201f",
        "status": "created",
        "octo_pay_url": "https://pay2.octo.uz/pay/e3f40dc3-4955-412a-853a-2ddd28d3201f?language=uz",
        "refunded_sum": 0,
        "total_sum": 1000.0
    },
    "apiMessageForDevelopers": "",
    "shop_transaction_id": "c9211e0f-c6ba-4d97-b8be-fb230ef3985b",
    "octo_payment_UUID": "e3f40dc3-4955-412a-853a-2ddd28d3201f",
    "status": "created",
    "octo_pay_url": "https://pay2.octo.uz/pay/e3f40dc3-4955-412a-853a-2ddd28d3201f?language=uz",
    "refunded_sum": 0,
    "total_sum": 1000.0
}

Successful response parameters

ParameterTypeRequiredDescription
errorIntegerYesError code (0 indicates success).
dataObjectYesMain object with payment details.
data.shop_transaction_idStringYesShop's transaction ID.
data.octo_payment_UUIDStringYesOcto's payment ID.
data.statusStringYesPayment status.
data.octo_pay_urlStringYesURL to access the payment in Octo.
data.refunded_sumDoubleNoAmount refunded, if any.
data.total_sumDoubleYesTotal payment amount.
apiMessageForDevelopersStringNoMessage for developers (empty if successful).

Unsuccessful response example

json
{
    "error": 2,
    "errMessage": "Wrong secret",
    "data": null,
    "errorMessage": "Wrong secret",
    "apiMessageForDevelopers": "The ErrorMessage field is outdated. Please switch to errMessage for unification of the responses. Also, please know that in the future, all fields except error and errMessage will be passed to data. For more information, please contact the technical support of the service."
}

Unsuccessful response parameters

ParameterTypeRequiredDescription
errorIntegerYesError code.
errMessageStringYesError message.
dataObjectNoMain transaction data.
errorMessageStringYesError message (deprecated, use errMessage).
apiMessageForDevelopersStringNoTechnical message for developers.

Important

In the future, all fields except error and errMessage will be passed to the data object. If you have any questions about the response structure, please contact Octo's technical support.