JavaScript
import CheckoutIntents from 'checkout-intents';
const client = new CheckoutIntents({
apiKey: process.env['CHECKOUT_INTENTS_API_KEY'], // This is the default and can be omitted
});
const checkoutIntent = await client.checkoutIntents.retrieve('id');
console.log(checkoutIntent);import os
from checkout_intents import CheckoutIntents
client = CheckoutIntents(
api_key=os.environ.get("CHECKOUT_INTENTS_API_KEY"), # This is the default and can be omitted
)
checkout_intent = client.checkout_intents.retrieve(
"id",
)
print(checkout_intent)package com.rye.example;
import com.rye.client.CheckoutIntentsClient;
import com.rye.client.okhttp.CheckoutIntentsOkHttpClient;
import com.rye.models.checkoutintents.CheckoutIntent;
import com.rye.models.checkoutintents.CheckoutIntentRetrieveParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
CheckoutIntentsClient client = CheckoutIntentsOkHttpClient.fromEnv();
CheckoutIntent checkoutIntent = client.checkoutIntents().retrieve("id");
}
}curl https://staging.api.rye.com/api/v1/checkout-intents/$ID \
-H "Authorization: Bearer $CHECKOUT_INTENTS_API_KEY"<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://staging.api.rye.com/api/v1/checkout-intents/{id}",
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: <api-key>"
],
]);
$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://staging.api.rye.com/api/v1/checkout-intents/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<api-key>")
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://staging.api.rye.com/api/v1/checkout-intents/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"buyer": {
"postalCode": "10001",
"country": "US",
"province": "NY",
"city": "New York",
"address1": "123 Main St",
"phone": "1234567890",
"email": "john.doe@example.com",
"lastName": "Doe",
"firstName": "John",
"address2": "Apt 1"
},
"quantity": 1,
"productUrl": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"id": "<string>",
"state": "retrieving_offer",
"referenceId": "order-1234",
"discoverPromoCodes": true,
"constraints": {
"offerRetrievalEffort": "max",
"maxShippingPrice": 500,
"maxTotalPrice": 100000
},
"promoCodes": [
"SAVE20"
],
"variantSelections": [
{
"value": "Small, Red, XS, L, etc.",
"label": "Size, Color, etc."
}
]
}{
"name": "<string>",
"message": "<string>",
"stack": "<string>"
}{
"name": "<string>",
"message": "<string>",
"stack": "<string>"
}Checkout Intents
Retrieve checkout intent
Retrieve a checkout intent by id
Returns checkout intent information if the lookup succeeds.
GET
/
api
/
v1
/
checkout-intents
/
{id}
JavaScript
import CheckoutIntents from 'checkout-intents';
const client = new CheckoutIntents({
apiKey: process.env['CHECKOUT_INTENTS_API_KEY'], // This is the default and can be omitted
});
const checkoutIntent = await client.checkoutIntents.retrieve('id');
console.log(checkoutIntent);import os
from checkout_intents import CheckoutIntents
client = CheckoutIntents(
api_key=os.environ.get("CHECKOUT_INTENTS_API_KEY"), # This is the default and can be omitted
)
checkout_intent = client.checkout_intents.retrieve(
"id",
)
print(checkout_intent)package com.rye.example;
import com.rye.client.CheckoutIntentsClient;
import com.rye.client.okhttp.CheckoutIntentsOkHttpClient;
import com.rye.models.checkoutintents.CheckoutIntent;
import com.rye.models.checkoutintents.CheckoutIntentRetrieveParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
CheckoutIntentsClient client = CheckoutIntentsOkHttpClient.fromEnv();
CheckoutIntent checkoutIntent = client.checkoutIntents().retrieve("id");
}
}curl https://staging.api.rye.com/api/v1/checkout-intents/$ID \
-H "Authorization: Bearer $CHECKOUT_INTENTS_API_KEY"<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://staging.api.rye.com/api/v1/checkout-intents/{id}",
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: <api-key>"
],
]);
$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://staging.api.rye.com/api/v1/checkout-intents/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<api-key>")
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://staging.api.rye.com/api/v1/checkout-intents/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"buyer": {
"postalCode": "10001",
"country": "US",
"province": "NY",
"city": "New York",
"address1": "123 Main St",
"phone": "1234567890",
"email": "john.doe@example.com",
"lastName": "Doe",
"firstName": "John",
"address2": "Apt 1"
},
"quantity": 1,
"productUrl": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"id": "<string>",
"state": "retrieving_offer",
"referenceId": "order-1234",
"discoverPromoCodes": true,
"constraints": {
"offerRetrievalEffort": "max",
"maxShippingPrice": 500,
"maxTotalPrice": 100000
},
"promoCodes": [
"SAVE20"
],
"variantSelections": [
{
"value": "Small, Red, XS, L, etc.",
"label": "Size, Color, etc."
}
]
}{
"name": "<string>",
"message": "<string>",
"stack": "<string>"
}{
"name": "<string>",
"message": "<string>",
"stack": "<string>"
}Authorizations
Rye API key
Path Parameters
The id of the checkout intent to look up
Response
Checkout intent information
- Retrieving Offer
- Awaiting Confirmation
- Requires Action
- Placing Order
- Completed
- Failed
Show child attributes
Show child attributes
Required range:
x >= 0Available options:
retrieving_offer Maximum string length:
255Example:
"order-1234"
Show child attributes
Show child attributes
Promo code string with validation constraints.
- Must contain only letters, digits, underscores, or hyphens
- Maximum length of 32 characters
Maximum string length:
32Pattern:
^[a-zA-Z0-9_\-]+$Show child attributes
Show child attributes
Was this page helpful?
⌘I

