Billing & Payments
Get URL for 3DS / SCA security challenge
Returns the URL where the customer completes the 3D Secure (SCA) challenge that Shopify requested for a billing attempt. The response body is the URL itself, not JSON. Redirect the customer to it.
Before you call it:
idis the billing attempt’sid, as returned by Get past orders.- The billing attempt must belong to the signed-in customer and be in the
SECURITY_CHALLENGEstatus. Otherwise the call returns 400. - Call it from a page on the shop’s storefront with the customer signed in, like every Storefront API call.
- If Shopify has no challenge URL for the attempt, the response is 200 with an empty body.
Finding challenged attempts: Appstle sends no webhook when an attempt moves to SECURITY_CHALLENGE. On the storefront, read the attempt’s status from Get past orders. From your server, call the Admin API’s Get past orders report with status=SECURITY_CHALLENGE.
GET
/
subscriptions
/
cp
/
api
/
subscription-billing-attempts
/
security-challenge-action-url
/
{id}
Get URL for 3DS / SCA security challenge
curl --request GET \
--url https://www.myshop.com/apps/subscriptions/cp/api/subscription-billing-attempts/security-challenge-action-url/{id}import requests
url = "https://www.myshop.com/apps/subscriptions/cp/api/subscription-billing-attempts/security-challenge-action-url/{id}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://www.myshop.com/apps/subscriptions/cp/api/subscription-billing-attempts/security-challenge-action-url/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const url = 'https://www.myshop.com/apps/subscriptions/cp/api/subscription-billing-attempts/security-challenge-action-url/{id}';
const options = {method: 'GET'};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://www.myshop.com/apps/subscriptions/cp/api/subscription-billing-attempts/security-challenge-action-url/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://www.myshop.com/apps/subscriptions/cp/api/subscription-billing-attempts/security-challenge-action-url/{id}"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}require 'uri'
require 'net/http'
url = URI("https://www.myshop.com/apps/subscriptions/cp/api/subscription-billing-attempts/security-challenge-action-url/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body"<string>""<string>"Path Parameters
Billing attempt ID: the id of an entry returned by Get past orders
Response
The security challenge URL, as plain text
The response is of type string.
⌘I
Get URL for 3DS / SCA security challenge
curl --request GET \
--url https://www.myshop.com/apps/subscriptions/cp/api/subscription-billing-attempts/security-challenge-action-url/{id}import requests
url = "https://www.myshop.com/apps/subscriptions/cp/api/subscription-billing-attempts/security-challenge-action-url/{id}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://www.myshop.com/apps/subscriptions/cp/api/subscription-billing-attempts/security-challenge-action-url/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const url = 'https://www.myshop.com/apps/subscriptions/cp/api/subscription-billing-attempts/security-challenge-action-url/{id}';
const options = {method: 'GET'};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://www.myshop.com/apps/subscriptions/cp/api/subscription-billing-attempts/security-challenge-action-url/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://www.myshop.com/apps/subscriptions/cp/api/subscription-billing-attempts/security-challenge-action-url/{id}"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}require 'uri'
require 'net/http'
url = URI("https://www.myshop.com/apps/subscriptions/cp/api/subscription-billing-attempts/security-challenge-action-url/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body"<string>""<string>"