Confirm or Cancel Payment

If the payment was created with the parameter auto_capture = false, then after the transition of the payment to the waiting_for_capture state, the Octo service awaits the store to confirm or cancel the payment.

If the payment confirmation or cancellation was not performed by the store as part of the response to the notification of the store by the Octo service (request for notify_url by the Octo service), the store must confirm or cancel the payment with its own request to the Octo system.

Request format:

URL: https://secure.octo.uz/set_accept

Method: POST

Content-type: application/json

Request body:

{
  "octo_shop_id": 10000,
  "octo_secret": "2d45df74-bb95-47cf-a616-8d6dcee2e10d",
  "octo_payment_UUID": "1145df74-bb95-47cf-a616-8d6dcee2e222",
  "accept_status": "capture"
}

Description of response fields:

Field Required Description
octo_shop_id Yes Unique ID of the store (available in the personal cabinet of the store)
octo_secret Yes The personal secret key of the store, which is generated in the personal cabinet of the store. The key must be kept in a safe, inaccessible area of the store website.
octo_payment_UUID Yes Unique transaction identifier in Octo PS.
accept_status Yes May take values:
capture - confirm the payment
cancel - cancel the payment

In response to the store request, Octo PS responds with the following JSON in the response body:

{
  "error": 0,
  "status": "succeeded",
  "shop_transaction_id": "uniq shop transaction_id",
  "octo_payment_UUID": "1145df74-bb95-47cf-a616-8d6dcee2e222",
  "octo_pay_url": "https://pay.octo.uz/1145df74-bb95-47cf-a616-8d6dcee2e222"
}

Description of Octo response fields:

Field Required Description
status Yes (if error=0) Payment status in the Octo system, one of the following:

created - payment created
canceled - payment canceled
wait_user_action - awaiting user action
waiting_for_capture - payment authorized and awaiting store confirmation
succeeded - payment completed successfully
shop_transaction_id Yes (if error=0) Unique transaction identifier on the store side.
octo_payment_UUID Yes (if error=0) Unique transaction identifier in Octo PS.
octo_pay_url Yes (if error=0) URL of making the payment in Octo PS.
error Yes Error code. Options:

0 - no errors
1 - data format error
2 - authorisation error
4 - internal service error
10 - it is not possible to confirm or cancel the payment as the current status is not equal to waiting_for_capture
11 - payment with specified octo_payment_UUID not found
errorMessage No Detailed error description
transfer_sum No Bill amount minus Octo fees available for a refund to the buyer
refunded_sum No Amount refunded to the buyer

If the store does not confirm the payment within 2 hours from the moment of payment transition to the waiting_for_capture status, then the payment is automatically canceled and the money is returned to the buyer's account.