curl --request GET \
--url https://api.xpaycheckout.com/setup-method/{setupMethodId} \
--header 'Authorization: Basic <encoded-value>'import requests
url = "https://api.xpaycheckout.com/setup-method/{setupMethodId}"
headers = {"Authorization": "Basic <encoded-value>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Basic <encoded-value>'}};
fetch('https://api.xpaycheckout.com/setup-method/{setupMethodId}', 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.xpaycheckout.com/setup-method/{setupMethodId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>"
],
]);
$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://api.xpaycheckout.com/setup-method/{setupMethodId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Basic <encoded-value>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.xpaycheckout.com/setup-method/{setupMethodId}")
.header("Authorization", "Basic <encoded-value>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.xpaycheckout.com/setup-method/{setupMethodId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Basic <encoded-value>'
response = http.request(request)
puts response.read_body{
"setupMethodId": "sm_sK8d3Jq1tZxPjYVhRQW2rf",
"customerId": "cus_Tfd3Jq1tZxPjYVhRQW2r3",
"currency": "USD",
"paymentMethods": [
"CARD",
"GOOGLE_PAY",
"APPLE_PAY"
],
"storeFrontId": "sf_sK8d3Jq1tZxPjYVhRQW2rf",
"callbackUrl": "https://example.com/callback",
"metadata": {
"orderId": "12345",
"customerNote": "Setup for recurring payments"
},
"status": "CREATED",
"pmId": "pmt_ftoeKIYGC3f43frT",
"intentId": "in_ftoeKIYGC3f43frX",
"receiptId": "recp_123311"
}{
"errorCode": "bad_request",
"errorDescription": "Failed to read request"
}Get Setup Method
Get details of a setup method
curl --request GET \
--url https://api.xpaycheckout.com/setup-method/{setupMethodId} \
--header 'Authorization: Basic <encoded-value>'import requests
url = "https://api.xpaycheckout.com/setup-method/{setupMethodId}"
headers = {"Authorization": "Basic <encoded-value>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Basic <encoded-value>'}};
fetch('https://api.xpaycheckout.com/setup-method/{setupMethodId}', 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.xpaycheckout.com/setup-method/{setupMethodId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>"
],
]);
$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://api.xpaycheckout.com/setup-method/{setupMethodId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Basic <encoded-value>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.xpaycheckout.com/setup-method/{setupMethodId}")
.header("Authorization", "Basic <encoded-value>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.xpaycheckout.com/setup-method/{setupMethodId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Basic <encoded-value>'
response = http.request(request)
puts response.read_body{
"setupMethodId": "sm_sK8d3Jq1tZxPjYVhRQW2rf",
"customerId": "cus_Tfd3Jq1tZxPjYVhRQW2r3",
"currency": "USD",
"paymentMethods": [
"CARD",
"GOOGLE_PAY",
"APPLE_PAY"
],
"storeFrontId": "sf_sK8d3Jq1tZxPjYVhRQW2rf",
"callbackUrl": "https://example.com/callback",
"metadata": {
"orderId": "12345",
"customerNote": "Setup for recurring payments"
},
"status": "CREATED",
"pmId": "pmt_ftoeKIYGC3f43frT",
"intentId": "in_ftoeKIYGC3f43frX",
"receiptId": "recp_123311"
}{
"errorCode": "bad_request",
"errorDescription": "Failed to read request"
}Authorizations
Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.
Path Parameters
Unique identifier of the setup method
Response
Setup Method details retrieved successfully
Unique identifier of the setup method
"sm_sK8d3Jq1tZxPjYVhRQW2rf"
The unique identifier for the customer, generated via the create-customer API
"cus_Tfd3Jq1tZxPjYVhRQW2r3"
Three letter abbreviation of the currency
"USD"
List of payment methods enabled for setup.
💡 If a selected payment method is unavailable, the system will automatically fallback to card payments to ensure a smooth checkout experience.
["CARD", "GOOGLE_PAY", "APPLE_PAY"]
The unique identifier for your storefront
"sf_sK8d3Jq1tZxPjYVhRQW2rf"
The URL we will callback to once the setup is complete
"https://example.com/callback"
A collection of key-value pairs that were provided when the object was created
Show child attributes
Show child attributes
{ "orderId": "12345", "customerNote": "Setup for recurring payments" }
The status of the setup method
CREATED, SUCCESS, FAILED "CREATED"
Unique identifier of the payment method if setup is completed
"pmt_ftoeKIYGC3f43frT"
Unique identifier of the successful payment intent created while setting up the payment method token. Present only when amount is passed during setup creation.
"in_ftoeKIYGC3f43frX"
Your identifier for the order. Present only when provided during setup method creation.
"recp_123311"
Was this page helpful?