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
- The client selects a product or service on the Partner's website or app.
- The client clicks "Pay".
- The Partner's website or app creates an Apple Pay payment session and performs merchant validation.
- The client confirms the payment using Face ID, Touch ID or another supported device authentication method.
- Apple Pay passes the encrypted payment data to the Partner.
- 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).
- The Partner sends a
/prepare_paymentrequest to OCTO, specifying thedigital_walletpayment method. - OCTO creates a payment transaction and returns its identifier
octo_payment_UUID. - The Partner sends a
/pay/{octo_payment_UUID}request with the prepared Apple Pay data. - OCTO sends the data to the processing center for payment authorization.
- If authorization succeeds, OCTO initiates the debit confirmation (capture).
- OCTO returns the result of the
/paymethod. - 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.
{
"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
| Parameter | Type | Required | Description |
|---|---|---|---|
| octo_shop_id | Long | Yes | Unique shop identifier in OCTO. Available in the shop's personal account. |
| octo_shop_sub_id | Long | Yes (if the shop has sub-merchants) | Sub-merchant identifier in OCTO. Optional if the shop has no sub-merchants. |
| octo_secret | String | Yes | The shop's personal secret key generated in the personal account. |
| shop_transaction_id | String | Yes | Unique transaction identifier on the Partner's side. Used to prevent accidental duplicate transactions. |
| auto_capture | Boolean | Yes | Confirms one-stage payment, i.e. the debit after successful authorization. The value true must be passed. |
| test | Boolean | No | Test transaction flag. The value false must be passed. |
| init_time | String | Yes | Payment creation time in the yyyy-MM-dd HH:mm:ss format. |
| user_data | Object | No | User information. |
| user_data.user_id | String | Yes (if the user_data block is passed) | User identifier in the Partner's system. |
| user_data.phone | String | Yes (if the user_data block is passed) | User's phone number. |
| user_data.email | String | Yes (if the user_data block is passed) | User's email. |
| total_sum | BigDecimal | Yes | Total payment amount. |
| currency | String | Yes | Payment currency. Available currencies: UZS, USD. Availability depends on the Partner's settings. |
| description | String | Yes | Description of the product or service. |
| basket | Array | No | Array with information about goods and services. |
| basket.position_desc | String | Yes (if the basket block is passed) | Item name on the receipt. Latin letters, digits, spaces and the basic characters - . _ ( ) are allowed. |
| basket.count | BigDecimal | Yes (if the basket block is passed) | Quantity of the product or service. |
| basket.price | Double | Yes (if the basket block is passed) | Price per unit of the product or service. |
| basket.spic | String | No | Additional identifier of the product or service. |
| basket.inn | String | Yes (if the basket block is passed) | Shop TIN. For an individual entrepreneur, the PINFL is used. |
| basket.package_code | String | Yes (if the basket block is passed) | Package code of the product or service. |
| basket.nds | Int | Yes (if the basket block is passed) | VAT flag: 0 - without VAT, 1 - with VAT. |
| payment_methods | Array | Yes | Array of payment methods. For Apple Pay it must contain digital_wallet. |
| payment_methods.method | String | Yes | Payment method. For Apple Pay - digital_wallet. |
| return_url | String | No | URL to return the user to the Partner's website after payment. |
| notify_url | String | Yes | URL to which OCTO sends payment status change notifications. |
| language | String | No | Payment form language. Allowed values: oz - Uzbek (Latin), uz - Uzbek (Cyrillic), en - English, ru - Russian. |
| ttl | Int | No | Lifetime of the payment transaction from its creation (in minutes). After it expires, the payment cannot be made. |
Successful response example
{
"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
| Parameter | Type | Required | Description |
|---|---|---|---|
| error | Int | Yes | Error code (0 — no errors). |
| data | Object | Yes (if error = 0) | Main object with payment data. |
| data.shop_transaction_id | String | Yes (if error = 0) | Unique transaction identifier on the shop's side. |
| data.octo_payment_UUID | String | Yes (if error = 0) | Unique OCTO payment identifier. Used when calling the /pay method. |
| data.status | String | Yes (if error = 0) | Current payment status. After creation — created. |
| data.octo_pay_url | String | Yes (if error = 0) | OCTO payment page URL. Not needed in the Back-to-Back scenario described here. |
| data.refunded_sum | Double | No | Refunded amount (if there were refunds). |
| data.total_sum | Double | Yes (if error = 0) | Total payment amount. |
| shop_transaction_id | String | Yes (if error = 0) | Duplicates shop_transaction_id from the data object. |
| octo_payment_UUID | String | Yes (if error = 0) | Duplicates octo_payment_UUID from the data object. |
| status | String | Yes (if error = 0) | Duplicates status from the data object. |
| octo_pay_url | String | Yes (if error = 0) | Duplicates octo_pay_url from the data object. |
| refunded_sum | Double | Yes (if error = 0) | Duplicates refunded_sum from the data object. |
| total_sum | Double | Yes (if error = 0) | Duplicates total_sum from the data object. |
| apiMessageForDevelopers | String | No | Message 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
{
"error": 2,
"errMessage": "Wrong secret",
"data": null,
"errorMessage": "Wrong secret",
"apiMessageForDevelopers": ""
}Unsuccessful response parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| error | Int | Yes | Error code (0 means no errors). |
| errMessage | String | Yes | Error message (if an error occurred). |
| data | Object | No | Main transaction data (may be null on error). |
| errorMessage | String | Yes | Error message (if an error occurred). |
| apiMessageForDevelopers | String | No | Technical message (field for additional information). |
Possible error codes
| Code | Description |
|---|---|
1 | An error occurred. Please try again later. |
1 | Sub-merchant not found. |
1 | unsupported_pay_method |
1 | octo_shop_sub_id is required — for scenarios where a sub-merchant must be specified. |
1 | Sub-merchant is not active for digital_wallet |
1 | Cybersource settings not found |
2 | Shop with the specified identifier not found. |
2 | Invalid secret key. |
3 | Payment amount must be greater than zero. |
3 / HTTP 403 | Basket amount does not match the total payment amount. |
5 | Shop status does not allow real payments. |
6 | Unknown currency or currency not available to the shop. |
6 | Unsupported currency for payment method: digital_wallet |
7 | Unsupported payment method: digital_wallet |
9 | Notification URL is not specified. |
10 | Invalid user_data fields. |
11 | Too many requests. Minimum delay is 1 second. |
12 | Shop is blocked. |
13 | TSP identifier is not specified or TSP is not found in the shop's list. |
403 / HTTP 403 | Invalid 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
| Parameter | Type | Required | Description |
|---|---|---|---|
| octo_payment_UUID | String | Yes | Unique identifier of the OCTO payment transaction received after a successful /prepare_payment call. |
Request example
{
"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
| Parameter | Type | Required | Description |
|---|---|---|---|
| pan | String | Yes | Full tokenized card number (DPAN) received from Apple Pay. |
| exp | String | Yes | DPAN expiry date in the YYMM format. For example, 3112 - December 2031. |
| method | String | Yes | Payment method. Fixed value - digital_wallet. |
| String | No | Buyer's email. | |
| digitalWalletData | Object | Yes | Object with digital wallet data. Required when method = digital_wallet. |
| digitalWalletData.cryptogram | String | Yes | Apple Pay payment cryptogram. Passed unchanged in Base64 format. |
| digitalWalletData.eciIndicator | String | No | Electronic 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.cardType | String | Yes | Payment system of the tokenized card: VISA or MASTERCARD. |
| billingDetails | Object | No | Buyer's billing data from Apple Pay. Passed if billingAddress is present. |
| billingDetails.billingFirstName | String | No | Buyer's first name. |
| billingDetails.billingLastName | String | No | Buyer's last name. |
| billingDetails.billingStreet | String | No | Street, building and other address details of the Buyer. |
| billingDetails.billingLocality | String | No | Buyer's city or locality. For example: Tashkent. |
| billingDetails.billingAdministrativeArea | String | No | Region or administrative area. For example: TAS. |
| billingDetails.billingPostalCode | String | No | Buyer's postal code. |
| billingDetails.billingCountry | String | No | Buyer'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
{
"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
| Parameter | Type | Required | Description |
|---|---|---|---|
| error | Int | Yes | Request processing code. 0 - no API error. |
| errMessage | String | No | Error message. Empty on success. |
| data | Object | Yes | Object with payment transaction data. |
| data.id | Int | Yes | Internal OCTO transaction identifier. |
| data.uuid | String | Yes | OCTO payment transaction UUID. |
| data.processorKey | String | No | Processing transaction identifier, if available. |
| data.merchantId | Int | Yes | OCTO shop identifier. |
| data.merchantTransId | String | Yes | Transaction identifier on the Partner's side. |
| data.initialSum | Decimal | Yes | Initial payment amount. |
| data.totalSum | Decimal | Yes | Total payment amount. |
| data.currency | String | Yes | Payment currency. |
| data.selectedMethod | String | Yes | Selected payment method. For Apple Pay - digital_wallet. |
| data.peyedTime | Int | No | Time of successful payment in UNIX timestamp format. |
| data.autoCapture | Boolean | Yes | Automatic debit confirmation flag. |
| data.redirectUrl | String | No | Additional confirmation URL. For the Apple Pay scenario described - null. |
| data.details | Object | No | Additional payment transaction data. |
| data.details.cardInfo | Object | No | Tokenized card data. |
| data.details.cardInfo.first6 | String | No | First six digits of the DPAN. |
| data.details.cardInfo.last4 | String | No | Last four digits of the DPAN. |
| data.details.cardInfo.issuerCountryCode | String | No | Issuer country code, if determined. |
| data.details.cardInfo.cardHolder | String | No | Cardholder name. May be null in the described scenario. |
| data.details.transType | String | No | Transaction type. For Apple Pay - DIGITAL_WALLET. |
| data.status | String | Yes | Current transaction status. |
| data.processingReference | String | No | Transaction identifier in processing, if received. |
| data.bankCode | String | No | Bank or processing code. |
| data.cardInputType | String | Yes | Card data input method. For this scenario - merchant_site. |
| data.refundedSum | Decimal | No | Amount of completed refunds. |
Unsuccessful response example
{
"error": 1,
"errMessage": "Verification error",
"data": null
}Unsuccessful response parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| error | Int | Yes | Error code. |
| errMessage | String | Yes | Error description. |
| data | Object / null | No | Payment transaction information, if available. |
Possible error codes
| Code | Description |
|---|---|
0 | No error. The payment is already being processed, and a repeated call does not initiate a new one. |
1 | payment_not_found |
1 | Payment method is unavailable. |
1 | Payments with cards of the selected payment system are temporarily unavailable. |
1 | Wrong ccy |
1 | Cybersource settings not found |
1 | Authorization declined |
1 | Capture failed |
1 | Processing error |
2 | fraud |
3 | The payment has expired. |
4 | wrong_payment_status |
5 | Payment method is not allowed. |
6 | Invalid request parameters. |
7 | Unsupported currency for selected pay provider |
12 | Invalid card number or unrecognized card prefix. |
13 | Payment or BIN is blocked. |
14 | Provider for the selected method not found. |
15 | Wrong expire date or card expired |
16 | Invalid card number. |
403 | The card's country is in the Partner's country blacklist. |
444 | Duplicate payment in processing |
500 | Tariff calculation, anti-fraud check or processing error. |
700 | Minimum 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.