Skip to content

Payment via Apple Pay ​

Payment via Apple Pay allows the client to pay for goods and services with a bank card added to Apple Wallet.

With this integration method, the Partner interacts with Apple Pay on its own, receives and decrypts the payment data, and then passes it to the OCTO payment system to process the transaction.

The /prepare_payment and /pay methods are used for payment.

Supported payment systems: Visa and Mastercard.

User Flows ​

Apple Pay payment via the Partner's website ​

  1. The client selects a product or service on the Partner's website or app.
  2. The client clicks "Pay".
  3. The Partner's website or app creates an Apple Pay payment session and performs merchant validation.
  4. The client confirms the payment using Face ID, Touch ID or another supported device authentication method.
  5. Apple Pay passes the encrypted payment data to the Partner.
  6. The Partner decrypts the received data and extracts the information required for the payment: the tokenized card number (DPAN), expiry date, cryptogram, card type and ECI (if present).
  7. The Partner sends a /prepare_payment request to OCTO, specifying the digital_wallet payment method.
  8. OCTO creates a payment transaction and returns its identifier octo_payment_UUID.
  9. The Partner sends a /pay/{octo_payment_UUID} request with the prepared Apple Pay data.
  10. OCTO sends the data to the processing center for payment authorization.
  11. If authorization succeeds, OCTO initiates the debit confirmation (capture).
  12. OCTO returns the result of the /pay method.
  13. The Partner processes the payment result.

Important!

The Partner is responsible for the Apple Pay integration, including merchant validation and decryption of the payment data.

Methods ​

prepare_payment ​

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

Test transactions

Test transactions are not available for Apple Pay payments. When calling the /prepare_payment method, pass test: false or omit the parameter.

Request example ​

Important!

This payment method uses the OCTO one-stage payment scenario, so the auto_capture: true parameter must be passed.

The payment_methods array must contain the digital_wallet payment method.

json
{
    "octo_shop_id": 242,
    "octo_shop_sub_id": 15001,
    "octo_secret": "YOUR_OCTO_SECRET",
    "shop_transaction_id": "67da5252-ece6-443a-8ad6-d2d225ed7dac",
    "auto_capture": true,
    "test": false,
    "init_time": "2026-10-29 19:30:00",
    "total_sum": 20000,
    "currency": "UZS",
    "description": "TEST_PAYMENT",
    "payment_methods": [
        {
            "method": "digital_wallet"
        }
    ],
    "return_url": "https://example.com/payment/result",
    "notify_url": "https://example.com/notify",
    "language": "en",
    "ttl": 15
}

The example includes octo_shop_sub_id for a shop that uses sub-merchants. If the shop has no sub-merchants, this parameter is optional and can be omitted from the request.

Request parameters ​

ParameterTypeRequiredDescription
octo_shop_idLongYesUnique shop identifier in OCTO. Available in the shop's personal account.
octo_shop_sub_idLongYes (if the shop has sub-merchants)Sub-merchant identifier in OCTO. Optional if the shop has no sub-merchants.
octo_secretStringYesThe shop's personal secret key generated in the personal account.
shop_transaction_idStringYesUnique transaction identifier on the Partner's side. Used to prevent accidental duplicate transactions.
auto_captureBooleanYesConfirms one-stage payment, i.e. the debit after successful authorization. The value true must be passed.
testBooleanNoTest transaction flag. The value false must be passed.
init_timeStringYesPayment creation time in the yyyy-MM-dd HH:mm:ss format.
user_dataObjectNoUser information.
user_data.user_idStringYes (if the user_data block is passed)User identifier in the Partner's system.
user_data.phoneStringYes (if the user_data block is passed)User's phone number.
user_data.emailStringYes (if the user_data block is passed)User's email.
total_sumBigDecimalYesTotal payment amount.
currencyStringYesPayment currency. Available currencies: UZS, USD. Availability depends on the Partner's settings.
descriptionStringYesDescription of the product or service.
basketArrayNoArray with information about goods and services.
basket.position_descStringYes (if the basket block is passed)Item name on the receipt. Latin letters, digits, spaces and the basic characters - . _ ( ) are allowed.
basket.countBigDecimalYes (if the basket block is passed)Quantity of the product or service.
basket.priceDoubleYes (if the basket block is passed)Price per unit of the product or service.
basket.spicStringNoAdditional identifier of the product or service.
basket.innStringYes (if the basket block is passed)Shop TIN. For an individual entrepreneur, the PINFL is used.
basket.package_codeStringYes (if the basket block is passed)Package code of the product or service.
basket.ndsIntYes (if the basket block is passed)VAT flag: 0 - without VAT, 1 - with VAT.
payment_methodsArrayYesArray of payment methods. For Apple Pay it must contain digital_wallet.
payment_methods.methodStringYesPayment method. For Apple Pay - digital_wallet.
return_urlStringNoURL to return the user to the Partner's website after payment.
notify_urlStringYesURL to which OCTO sends payment status change notifications.
languageStringNoPayment form language. Allowed values:
oz - Uzbek (Latin),
uz - Uzbek (Cyrillic),
en - English,
ru - Russian.
ttlIntNoLifetime of the payment transaction from its creation (in minutes). After it expires, the payment cannot be made.

Successful response example ​

json
{
    "error": 0,
    "data": {
        "shop_transaction_id": "67da5252-ece6-443a-8ad6-d2d225ed7dac",
        "octo_payment_UUID": "e3f40dc3-4955-412a-853a-2ddd28d3201f",
        "status": "created",
        "octo_pay_url": "https://pay2.octo.uz/pay/e3f40dc3-4955-412a-853a-2ddd28d3201f?language=en",
        "refunded_sum": 0,
        "total_sum": 20000
    },
    "shop_transaction_id": "67da5252-ece6-443a-8ad6-d2d225ed7dac",
    "octo_payment_UUID": "e3f40dc3-4955-412a-853a-2ddd28d3201f",
    "status": "created",
    "octo_pay_url": "https://pay2.octo.uz/pay/e3f40dc3-4955-412a-853a-2ddd28d3201f?language=en",
    "refunded_sum": 0,
    "total_sum": 20000,
    "apiMessageForDevelopers": ""
}

Successful response parameters ​

ParameterTypeRequiredDescription
errorIntYesError code (0 — no errors).
dataObjectYes (if error = 0)Main object with payment data.
data.shop_transaction_idStringYes (if error = 0)Unique transaction identifier on the shop's side.
data.octo_payment_UUIDStringYes (if error = 0)Unique OCTO payment identifier. Used when calling the /pay method.
data.statusStringYes (if error = 0)Current payment status. After creation — created.
data.octo_pay_urlStringYes (if error = 0)OCTO payment page URL. Not needed in the Back-to-Back scenario described here.
data.refunded_sumDoubleNoRefunded amount (if there were refunds).
data.total_sumDoubleYes (if error = 0)Total payment amount.
shop_transaction_idStringYes (if error = 0)Duplicates shop_transaction_id from the data object.
octo_payment_UUIDStringYes (if error = 0)Duplicates octo_payment_UUID from the data object.
statusStringYes (if error = 0)Duplicates status from the data object.
octo_pay_urlStringYes (if error = 0)Duplicates octo_pay_url from the data object.
refunded_sumDoubleYes (if error = 0)Duplicates refunded_sum from the data object.
total_sumDoubleYes (if error = 0)Duplicates total_sum from the data object.
apiMessageForDevelopersStringNoMessage for developers provided by the API (empty on success).

Important!

For the subsequent /pay call, the Partner must use the octo_payment_UUID value received when the payment was created.

In the Apple Pay Back-to-Back scenario, the Buyer does not need to be redirected to octo_pay_url.

Unsuccessful response example ​

json
{
    "error": 2,
    "errMessage": "Wrong secret",
    "data": null,
    "errorMessage": "Wrong secret",
    "apiMessageForDevelopers": ""
}

Unsuccessful response parameters ​

ParameterTypeRequiredDescription
errorIntYesError code (0 means no errors).
errMessageStringYesError message (if an error occurred).
dataObjectNoMain transaction data (may be null on error).
errorMessageStringYesError message (if an error occurred).
apiMessageForDevelopersStringNoTechnical message (field for additional information).

Possible error codes ​

CodeDescription
1An error occurred. Please try again later.
1Sub-merchant not found.
1unsupported_pay_method
1octo_shop_sub_id is required — for scenarios where a sub-merchant must be specified.
1Sub-merchant is not active for digital_wallet
1Cybersource settings not found
2Shop with the specified identifier not found.
2Invalid secret key.
3Payment amount must be greater than zero.
3 / HTTP 403Basket amount does not match the total payment amount.
5Shop status does not allow real payments.
6Unknown currency or currency not available to the shop.
6Unsupported currency for payment method: digital_wallet
7Unsupported payment method: digital_wallet
9Notification URL is not specified.
10Invalid user_data fields.
11Too many requests. Minimum delay is 1 second.
12Shop is blocked.
13TSP identifier is not specified or TSP is not found in the shop's list.
403 / HTTP 403Invalid basket item parameters or request format.

pay ​

  • URL: https://secure.octo.uz/pay/{octo_payment_UUID}
  • Method: POST
  • Content-type: application/json

The method is used to make an Apple Pay payment for a payment transaction previously created with the /prepare_payment method.

The Partner passes the tokenized card data obtained by decrypting the Apple Pay payload. OCTO performs authorization and debit confirmation through the processing center.

The result is returned synchronously in the method response.

Path parameter ​

ParameterTypeRequiredDescription
octo_payment_UUIDStringYesUnique identifier of the OCTO payment transaction received after a successful /prepare_payment call.

Request example ​

json
{
    "pan": "4761730000000010",
    "exp": "3112",
    "method": "digital_wallet",
    "email": "customer@example.com",
    "digitalWalletData": {
        "cryptogram": "AceY+igABPs3jdwNaDg3MAACAAA=",
        "eciIndicator": "05",
        "cardType": "VISA"
    },
    "billingDetails": {
        "billingFirstName": "Test",
        "billingLastName": "Testov",
        "billingStreet": "123 Street",
        "billingLocality": "Tashkent",
        "billingAdministrativeArea": "TAS",
        "billingPostalCode": "100000",
        "billingCountry": "UZ"
    }
}

Request parameters ​

ParameterTypeRequiredDescription
panStringYesFull tokenized card number (DPAN) received from Apple Pay.
expStringYesDPAN expiry date in the YYMM format. For example, 3112 - December 2031.
methodStringYesPayment method. Fixed value - digital_wallet.
emailStringNoBuyer's email.
digitalWalletDataObjectYesObject with digital wallet data. Required when method = digital_wallet.
digitalWalletData.cryptogramStringYesApple Pay payment cryptogram. Passed unchanged in Base64 format.
digitalWalletData.eciIndicatorStringNoElectronic Commerce Indicator (ECI). Passed if present.
Allowed values:
for VISA - 05, 06, 07;
for Mastercard - 00, 01, 02.
If absent, the value internet is sent to processing.
digitalWalletData.cardTypeStringYesPayment system of the tokenized card: VISA or MASTERCARD.
billingDetailsObjectNoBuyer's billing data from Apple Pay. Passed if billingAddress is present.
billingDetails.billingFirstNameStringNoBuyer's first name.
billingDetails.billingLastNameStringNoBuyer's last name.
billingDetails.billingStreetStringNoStreet, building and other address details of the Buyer.
billingDetails.billingLocalityStringNoBuyer's city or locality. For example: Tashkent.
billingDetails.billingAdministrativeAreaStringNoRegion or administrative area. For example: TAS.
billingDetails.billingPostalCodeStringNoBuyer's postal code.
billingDetails.billingCountryStringNoBuyer's country code. Recommended format: ISO 3166-1 alpha-2. For example: UZ.

Note

The billingDetails parameters are passed if such data was received from Apple Pay. The cardHolderName parameter, used in other bank card payment scenarios, is not required for this request.

Successful response example ​

json
{
    "error": 0,
    "errMessage": "",
    "data": {
        "id": 5520,
        "uuid": "e3f40dc3-4955-412a-853a-2ddd28d3201f",
        "processorKey": null,
        "merchantId": 242,
        "merchant": null,
        "merchantTransId": "67da5252-ece6-443a-8ad6-d2d225ed7dac",
        "initialSum": 20000.00,
        "totalSum": 20000.00,
        "splittedSum": 20000.00,
        "currency": "UZS",
        "convertSum": null,
        "convertRate": null,
        "convertCurrency": null,
        "selectedMethod": "digital_wallet",
        "description": "TEST_PAYMENT",
        "autoCapture": true,
        "withoutSite": false,
        "isTest": false,
        "refundLocked": false,
        "redirectUrl": null,
        "details": {
            "cardInfo": {
                "first6": "476173",
                "last4": "0010",
                "issuerCountryCode": "UZ",
                "cardHolder": null,
                "saveToken": null
            },
            "transType": "DIGITAL_WALLET"
        },
        "hold": null,
        "status": "succeeded",
        "basket": null,
        "user": {
            "email": "customer@example.com",
            "phone": null,
            "user_id": null
        },
        "refundedSum": 0.00,
        "processingReference": "ABC123DEF456",
        "bankCode": "RB",
        "cardInputType": "merchant_site",
        "test": false
    }
}

Successful response parameters ​

ParameterTypeRequiredDescription
errorIntYesRequest processing code. 0 - no API error.
errMessageStringNoError message. Empty on success.
dataObjectYesObject with payment transaction data.
data.idIntYesInternal OCTO transaction identifier.
data.uuidStringYesOCTO payment transaction UUID.
data.processorKeyStringNoProcessing transaction identifier, if available.
data.merchantIdIntYesOCTO shop identifier.
data.merchantTransIdStringYesTransaction identifier on the Partner's side.
data.initialSumDecimalYesInitial payment amount.
data.totalSumDecimalYesTotal payment amount.
data.currencyStringYesPayment currency.
data.selectedMethodStringYesSelected payment method. For Apple Pay - digital_wallet.
data.peyedTimeIntNoTime of successful payment in UNIX timestamp format.
data.autoCaptureBooleanYesAutomatic debit confirmation flag.
data.redirectUrlStringNoAdditional confirmation URL. For the Apple Pay scenario described - null.
data.detailsObjectNoAdditional payment transaction data.
data.details.cardInfoObjectNoTokenized card data.
data.details.cardInfo.first6StringNoFirst six digits of the DPAN.
data.details.cardInfo.last4StringNoLast four digits of the DPAN.
data.details.cardInfo.issuerCountryCodeStringNoIssuer country code, if determined.
data.details.cardInfo.cardHolderStringNoCardholder name. May be null in the described scenario.
data.details.transTypeStringNoTransaction type. For Apple Pay - DIGITAL_WALLET.
data.statusStringYesCurrent transaction status.
data.processingReferenceStringNoTransaction identifier in processing, if received.
data.bankCodeStringNoBank or processing code.
data.cardInputTypeStringYesCard data input method. For this scenario - merchant_site.
data.refundedSumDecimalNoAmount of completed refunds.

Unsuccessful response example ​

json
{
    "error": 1,
    "errMessage": "Verification error",
    "data": null
}

Unsuccessful response parameters ​

ParameterTypeRequiredDescription
errorIntYesError code.
errMessageStringYesError description.
dataObject / nullNoPayment transaction information, if available.

Possible error codes ​

CodeDescription
0No error. The payment is already being processed, and a repeated call does not initiate a new one.
1payment_not_found
1Payment method is unavailable.
1Payments with cards of the selected payment system are temporarily unavailable.
1Wrong ccy
1Cybersource settings not found
1Authorization declined
1Capture failed
1Processing error
2fraud
3The payment has expired.
4wrong_payment_status
5Payment method is not allowed.
6Invalid request parameters.
7Unsupported currency for selected pay provider
12Invalid card number or unrecognized card prefix.
13Payment or BIN is blocked.
14Provider for the selected method not found.
15Wrong expire date or card expired
16Invalid card number.
403The card's country is in the Partner's country blacklist.
444Duplicate payment in processing
500Tariff calculation, anti-fraud check or processing error.
700Minimum or maximum payment amount limits exceeded.

Payment result handling ​

On successful processing, OCTO returns the /pay method response with the payment transaction data.

Important!

error = 0 means that the API request was processed without an error. To determine the result of the payment itself, also check data.status.

If OCTO receives an indeterminate processing result from the processing center, the payment may temporarily be in the intermediate wait_user_action status.

In this case, OCTO continues checking the transaction result. The Partner should not automatically create a repeat payment, since the debit may have been accepted by the processing center even if its response was not received.

A repeated pay call while the current transaction is being processed does not initiate a new debit request. If the transaction is already completed, a repeated call may return the wrong_payment_status error.

To get the current payment state, use the "Verification of the status" method.

Status notifications ​

OCTO sends payment status change notifications to the notify_url passed when the transaction was created or configured for the shop.

The Partner must accept the notifications and verify their authenticity as described in the "Notifications" section.