Onramp (App2App)

Create an onramp mobile challenge

Changed on

Issues a challenge for initiating an onramp flow from a partner mobile app. Authenticate this request from the partner backend with a CDP API key; do not embed the API key in the mobile client. The project is identified by the API key JWT.

Pass the challenge to the mobile app. The app signs it using platform attestation (iOS App Attest or Android Play Integrity) and submits it to the Create Onramp Mobile Session endpoint without CDP API key authentication to obtain a ready-to-use onramp URL. The redirectUrl is required so the Coinbase app knows where to return the user after completing or dismissing the transaction.

post/v2/onramp/mobile/sessions/challenges

Request

  • Base URL
    https://api.cdp.coinbase.com/platform
  • Auth
    HTTP bearer

Request body

intersection required
required: redirectUrl

Example request

{
  "purchaseCurrency": "USDC",
  "destinationNetwork": "base",
  "destinationAddress": "0x1234567890abcdef1234567890abcdef12345678",
  "paymentAmount": "100.00",
  "purchaseAmount": "10.000000",
  "paymentCurrency": "USD",
  "paymentMethod": "CARD",
  "country": "US",
  "subdivision": "NY",
  "redirectUrl": "https://example.com/success",
  "clientIp": "127.0.0.1",
  "partnerUserRef": "user-1234"
}

Response

Onramp mobile challenge created successfully.

OnrampMobileChallenge required

A server-issued challenge for platform attestation in an App2App onramp handoff.

challenge, string required

An opaque server-issued token to be used with platform attestation (iOS App Attest or Android Play Integrity Standard). Treat it as an opaque string — do not attempt to parse its contents. Pass this value along with the attestation payload to the Create Onramp Mobile Session endpoint to complete the App2App handoff.

iOS: pass this value directly to DCAppAttestService.generateAssertion(keyId, clientDataHash: SHA256(challenge)).

Android: pass this value unchanged as requestHash to StandardIntegrityManager.requestToken(requestHash). Do not hash it.

expiresAt, string date-time required

The time at which the challenge expires. Challenges are short-lived; submit the attestation to Create Onramp Mobile Session before this time or request a new challenge.

Example response

{
  "challenge": "MWYwNWQwODktZTZlYy02OTdlLTgzZTYtMTI3NzcyOWJhNjM3",
  "expiresAt": "2025-04-24T00:05:00Z"
}

Changes

    • warning

      added the new policy_not_applicable enum value to the errorType response property for the response status

    • warning

      added the new policy_not_applicable enum value to the errorType response property for the response status

    • warning

      added the new policy_not_applicable enum value to the errorType response property for the response status

    4 more changes in this revision