---
title: "Create an Apple Pay onramp order (v2 Headless API)"
method: POST
path: "/v1/onramp/apple-pay/order"
tags: ["onramp"]
---

# Create an Apple Pay onramp order (v2 Headless API)

`POST /v1/onramp/apple-pay/order`

Create a Coinbase v2 headless onramp order for Apple Pay.

Returns a `payment_link_url` to load in an iframe/webview for Apple Pay checkout.
The user never leaves the app — they tap the Apple Pay button rendered by the iframe.

**Requirements:**
- Account must have a verified email address
- Account must have a verified phone number (re-verified within the last 60 days)
- Account must have a Smart Account (earning wallet) on the target network

**Flow:**
1. Frontend calls this endpoint with amount and agreement timestamp
2. Backend validates identity, creates CDP v2 order, returns payment link
3. Frontend loads payment_link_url in iframe
4. Frontend listens for postMessage events from iframe
5. On success, frontend calls POST /v1/onramp/settled with settled amount
6. Existing SA→tipping transfer flow completes the deposit

See: https://docs.cdp.coinbase.com/onramp/headless-onramp/overview

## Headers

- `authorization` string, nullable — Bearer JWT issued by Grove.

## Request body

- ApplePayOrderRequest — Request model for POST /v1/onramp/apple-pay/order. Creates a v2 headless onramp order for Apple Pay. Requires the user to have a verified email and phone number (phone verified within the last 60 days).
  - `amount` string, required — Fiat amount in USD (e.g., '10.00')
  - `agreement_accepted_at` string, required — ISO 8601 timestamp when user accepted Coinbase Guest Checkout ToS
  - `network` string — Target blockchain network (e.g., base, base-sepolia)
  - `token` string — Token to purchase (e.g., USDC)
  - `domain` string, nullable — Web app domain for iframe Apple Pay button rendering (required for web)

## Response `200`

Successful Response

- ApplePayOrderResponse — Response model for POST /v1/onramp/apple-pay/order.
  - `event_id` string, required — Onramp event ID for lifecycle tracking
  - `payment_link_url` string, required — URL for Apple Pay iframe/webview
  - `order_id` string, required — CDP v2 order ID
  - `order_status` string, required — CDP order status
  - `payment_total` string, nullable — Total fiat amount including fees
  - `purchase_amount` string, nullable — Crypto amount to receive

## Other responses

- `400` — Missing verified email/phone, stale phone verification, or invalid amount
- `401` — Missing or invalid JWT
- `422` — Validation Error

---

[API](https://skmtc.net/grove/apis/grove-api.md) · [All operations](https://skmtc.net/grove/apis/grove-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/grove/grove-api/versions/f286b48a8105/schema)
