---
title: "Creating a Payment with Apple Pay (decrypted)"
source_url: https://docs.rapyd.net/en/creating-a-payment-with-apple-pay--decrypted-.html
lang: en
---

# Creating a Payment with Apple Pay (decrypted)

This procedure describes how to create a payment using a decrypted Apple Pay payload.

Use this process when you want to decrypt the payload with your own keys.

Prerequisites

- Completion of the Rapyd onboarding process. See [Activating Your Account (KYB)](https://docs.rapyd.net/en/activating-your-account--kyb-.md "Activating Your Account (KYB)").
- Check the relevant country's payment methods that support Apple Pay as a digital wallet provider via the [List Payment Methods by Country](https://docs.rapyd.net/en/list-payment-methods-by-country.md "List Payment Methods by Country") request. For information about Apple Pay support for a specific payment method, contact [Rapyd Client Support](https://support.rapyd.net/).
- Activation of Apple Pay in the Client Portal. See [Activating Apple Pay](https://docs.rapyd.net/en/activating-apple-pay.md "Activating Apple Pay").
- A digital wallet. Generate the transaction details using Apple Pay's process.
- An encrypted payload from Apple. You must do the following:

  - Decrypt the payload using your own keys.
  - Copy the decrypted contents of `token.paymentData` to `details.decrypted_data` in your 'Create Payment' request.
  - Copy the contents of `token.paymentMethod` to `details.brand_data` in your 'Create Payment' request.

URL

post {{base_url}}/v1/payments

Request Body

```json
{
    "amount": 1000,
    "currency": "ISK",
    "payment_method": {
        "type": "gb_visa_card",
        "digital_wallet": {
            "type": "apple_pay",
            "details": {
                "decrypted_data": {
                    "applicationPrimaryAccountNumber": "4818528810085112",
                    "applicationExpirationDate": "281231",
                    "currencyCode": "978",
                    "transactionAmount": 1000,
                    "deviceManufacturerIdentifier": "040010030273",
                    "paymentDataType": "3DSecure",
                    "paymentData": {
                        "onlinePaymentCryptogram": "AnZPt6sADBgtrkkC1XlvMAACAAA=",
                        "eciIndicator": "7"
                    }
                },
                "brand_data": {
                    "displayName": "Visa 0189",
                    "network": "Visa",
                    "type": "credit"
                }
            }
        }
    }
}
```

Response

```json
{
    "status": {
        "error_code": "",
        "status": "SUCCESS",
        "message": "",
        "response_code": "",
        "operation_id": "c7d3a7a4-64f4-44c4-9318-7cfe1aa43838"
    },
    "data": {
        "id": "payment_a8172f9a1321839470a694343b00f105",
        "amount": 1000,
        "original_amount": 1000,
        "is_partial": false,
        "currency_code": "ISK",
        "country_code": "GB",
        "status": "CLO",
        "description": "",
        "merchant_reference_id": "",
        "customer_token": "cus_c2f48676a46d2c8db9c18515d3dea067",
        "payment_method": "card_7b29a88b15851a485f906c4df94d10d6",
        "payment_method_data": {
            "id": "card_7b29a88b15851a485f906c4df94d10d6",
            "type": "gb_visa_card",
            "category": "card",
            "metadata": null,
            "image": "",
            "webhook_url": "",
            "supporting_documentation": "",
            "next_action": "not_applicable",
            "digital_wallet": {
                "type": "apple_pay",
                "pan_type": ""
            }
        },
        "auth_code": "614731",
        "expiration": 1708521825,
        "captured": true,
        "refunded": false,
        "refunded_amount": 0,
        "receipt_email": "",
        "redirect_url": "",
        "complete_payment_url": "",
        "error_payment_url": "",
        "receipt_number": "",
        "flow_type": "",
        "address": null,
        "statement_descriptor": "from db",
        "transaction_id": "",
        "created_at": 1707917025,
        "metadata": {},
        "failure_code": "",
        "failure_message": "",
        "paid": true,
        "paid_at": 1707917027,
        "dispute": null,
        "refunds": null,
        "order": null,
        "outcome": null,
        "visual_codes": {},
        "textual_codes": {},
        "instructions": [],
        "ewallet_id": "ewallet_c3016bb4e958f489046b5a7e82826063",
        "ewallets": [
			{
                "ewallet_id": "ewallet_c3016bb4e958f489046b5a7e82826063",
                "amount": 1000,
                "percent": 100,
                "refunded_amount": 0
            }
        ],
        "payment_method_options": {},
        "payment_method_type": "gb_visa_card",
        "payment_method_type_category": "card",
        "fx_rate": 1,
        "merchant_requested_currency": null,
        "merchant_requested_amount": null,
        "fixed_side": "",
        "payment_fees": null,
        "invoice": "",
        "escrow": null,
        "group_payment": "",
        "cancel_reason": null,
        "initiation_type": "customer_present",
        "mid": "mid_26302_00000001_valitor",
        "next_action": "not_applicable",
        "error_code": "",
        "remitter_information": {},
        "save_payment_method": true
    }
}
```
