curl --request POST \
--url https://api.cdp.coinbase.com/platform/v2/onramp/limits \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"paymentMethodType": "GUEST_CHECKOUT_APPLE_PAY",
"userId": "+12055555555",
"userIdType": "phone_number"
}
'import requests
url = "https://api.cdp.coinbase.com/platform/v2/onramp/limits"
payload = {
"paymentMethodType": "GUEST_CHECKOUT_APPLE_PAY",
"userId": "+12055555555",
"userIdType": "phone_number"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
paymentMethodType: 'GUEST_CHECKOUT_APPLE_PAY',
userId: '+12055555555',
userIdType: 'phone_number'
})
};
fetch('https://api.cdp.coinbase.com/platform/v2/onramp/limits', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.cdp.coinbase.com/platform/v2/onramp/limits",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'paymentMethodType' => 'GUEST_CHECKOUT_APPLE_PAY',
'userId' => '+12055555555',
'userIdType' => 'phone_number'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.cdp.coinbase.com/platform/v2/onramp/limits"
payload := strings.NewReader("{\n \"paymentMethodType\": \"GUEST_CHECKOUT_APPLE_PAY\",\n \"userId\": \"+12055555555\",\n \"userIdType\": \"phone_number\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.cdp.coinbase.com/platform/v2/onramp/limits")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"paymentMethodType\": \"GUEST_CHECKOUT_APPLE_PAY\",\n \"userId\": \"+12055555555\",\n \"userIdType\": \"phone_number\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cdp.coinbase.com/platform/v2/onramp/limits")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"paymentMethodType\": \"GUEST_CHECKOUT_APPLE_PAY\",\n \"userId\": \"+12055555555\",\n \"userIdType\": \"phone_number\"\n}"
response = http.request(request)
puts response.read_body{
"limits": [
{
"limitType": "weekly_spending",
"currency": "USD",
"limit": "500",
"remaining": "400"
},
{
"limitType": "lifetime_transactions",
"limit": "15",
"remaining": "12"
}
]
}{
"errorType": "invalid_request",
"errorMessage": "Must provide a valid payment method type and user identifier."
}{
"errorType": "unauthorized",
"errorMessage": "The request is not properly authenticated."
}{
"errorType": "rate_limit_exceeded",
"errorMessage": "Rate limit exceeded."
}{
"errorType": "internal_server_error",
"errorMessage": "An internal server error occurred. Please try again later."
}Get onramp user limits
Returns the transaction limits for an onramp user based on their payment method and user identifier. Use this API to show users their remaining purchase capacity before initiating an onramp transaction.
Currently supports GUEST_CHECKOUT_APPLE_PAY payment method with phone number identification. The phone number must have been previously verified via OTP.
curl --request POST \
--url https://api.cdp.coinbase.com/platform/v2/onramp/limits \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"paymentMethodType": "GUEST_CHECKOUT_APPLE_PAY",
"userId": "+12055555555",
"userIdType": "phone_number"
}
'import requests
url = "https://api.cdp.coinbase.com/platform/v2/onramp/limits"
payload = {
"paymentMethodType": "GUEST_CHECKOUT_APPLE_PAY",
"userId": "+12055555555",
"userIdType": "phone_number"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
paymentMethodType: 'GUEST_CHECKOUT_APPLE_PAY',
userId: '+12055555555',
userIdType: 'phone_number'
})
};
fetch('https://api.cdp.coinbase.com/platform/v2/onramp/limits', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.cdp.coinbase.com/platform/v2/onramp/limits",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'paymentMethodType' => 'GUEST_CHECKOUT_APPLE_PAY',
'userId' => '+12055555555',
'userIdType' => 'phone_number'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.cdp.coinbase.com/platform/v2/onramp/limits"
payload := strings.NewReader("{\n \"paymentMethodType\": \"GUEST_CHECKOUT_APPLE_PAY\",\n \"userId\": \"+12055555555\",\n \"userIdType\": \"phone_number\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.cdp.coinbase.com/platform/v2/onramp/limits")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"paymentMethodType\": \"GUEST_CHECKOUT_APPLE_PAY\",\n \"userId\": \"+12055555555\",\n \"userIdType\": \"phone_number\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cdp.coinbase.com/platform/v2/onramp/limits")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"paymentMethodType\": \"GUEST_CHECKOUT_APPLE_PAY\",\n \"userId\": \"+12055555555\",\n \"userIdType\": \"phone_number\"\n}"
response = http.request(request)
puts response.read_body{
"limits": [
{
"limitType": "weekly_spending",
"currency": "USD",
"limit": "500",
"remaining": "400"
},
{
"limitType": "lifetime_transactions",
"limit": "15",
"remaining": "12"
}
]
}{
"errorType": "invalid_request",
"errorMessage": "Must provide a valid payment method type and user identifier."
}{
"errorType": "unauthorized",
"errorMessage": "The request is not properly authenticated."
}{
"errorType": "rate_limit_exceeded",
"errorMessage": "Rate limit exceeded."
}{
"errorType": "internal_server_error",
"errorMessage": "An internal server error occurred. Please try again later."
}Authorizations
A JWT signed using your CDP API Key Secret, encoded in base64. Refer to the Generate Bearer Token section of our Authentication docs for information on how to generate your Bearer Token.
Body
The type of payment method to be used to complete an onramp order.
GUEST_CHECKOUT_APPLE_PAY, GUEST_CHECKOUT_GOOGLE_PAY "GUEST_CHECKOUT_APPLE_PAY"
The user identifier value. For phone_number type, this must be in E.164 format.
"+12055555555"
The type of user identifier:
phone_number: A phone number in E.164 format associated with an onramp user.
phone_number "phone_number"
Response
Successfully retrieved user limits.
The list of limits applicable to the user.
Show child attributes
Show child attributes
Was this page helpful?