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.confirm('id', {
paymentMethod: { stripeToken: 'tok_1RkrWWHGDlstla3f1Fc7ZrhH', type: 'stripe_token' },
});
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.confirm(
id="id",
payment_method={
"stripe_token": "tok_1RkrWWHGDlstla3f1Fc7ZrhH",
"type": "stripe_token",
},
)
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.CheckoutIntentConfirmParams;
import com.rye.models.checkoutintents.PaymentMethod;
public final class Main {
private Main() {}
public static void main(String[] args) {
CheckoutIntentsClient client = CheckoutIntentsOkHttpClient.fromEnv();
CheckoutIntentConfirmParams params = CheckoutIntentConfirmParams.builder()
.id("id")
.paymentMethod(PaymentMethod.StripeTokenPaymentMethod.builder()
.stripeToken("tok_1RkrWWHGDlstla3f1Fc7ZrhH")
.type(PaymentMethod.StripeTokenPaymentMethod.Type.STRIPE_TOKEN)
.build())
.build();
CheckoutIntent checkoutIntent = client.checkoutIntents().confirm(params);
}
}curl https://staging.api.rye.com/api/v1/checkout-intents/$ID/confirm \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer $CHECKOUT_INTENTS_API_KEY" \
-d '{
"paymentMethod": {
"stripeToken": "tok_1RkrWWHGDlstla3f1Fc7ZrhH",
"type": "stripe_token"
}
}'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://staging.api.rye.com/api/v1/checkout-intents/{id}/confirm",
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([
'paymentMethod' => [
'stripeToken' => 'tok_1RkrWWHGDlstla3f1Fc7ZrhH',
'type' => 'stripe_token'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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://staging.api.rye.com/api/v1/checkout-intents/{id}/confirm"
payload := strings.NewReader("{\n \"paymentMethod\": {\n \"stripeToken\": \"tok_1RkrWWHGDlstla3f1Fc7ZrhH\",\n \"type\": \"stripe_token\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
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))
}require 'uri'
require 'net/http'
url = URI("https://staging.api.rye.com/api/v1/checkout-intents/{id}/confirm")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"paymentMethod\": {\n \"stripeToken\": \"tok_1RkrWWHGDlstla3f1Fc7ZrhH\",\n \"type\": \"stripe_token\"\n }\n}"
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>"
}{
"name": "<string>",
"message": "<string>",
"stack": "<string>",
"state": "<string>"
}{
"name": "<string>",
"message": "<string>",
"stack": "<string>"
}Checkout Intents
Confirm checkout intent
Confirm a checkout intent with provided payment information
Confirm means we have buyer’s name, address and payment info, so we can move forward to place the order.
POST
/
api
/
v1
/
checkout-intents
/
{id}
/
confirm
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.confirm('id', {
paymentMethod: { stripeToken: 'tok_1RkrWWHGDlstla3f1Fc7ZrhH', type: 'stripe_token' },
});
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.confirm(
id="id",
payment_method={
"stripe_token": "tok_1RkrWWHGDlstla3f1Fc7ZrhH",
"type": "stripe_token",
},
)
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.CheckoutIntentConfirmParams;
import com.rye.models.checkoutintents.PaymentMethod;
public final class Main {
private Main() {}
public static void main(String[] args) {
CheckoutIntentsClient client = CheckoutIntentsOkHttpClient.fromEnv();
CheckoutIntentConfirmParams params = CheckoutIntentConfirmParams.builder()
.id("id")
.paymentMethod(PaymentMethod.StripeTokenPaymentMethod.builder()
.stripeToken("tok_1RkrWWHGDlstla3f1Fc7ZrhH")
.type(PaymentMethod.StripeTokenPaymentMethod.Type.STRIPE_TOKEN)
.build())
.build();
CheckoutIntent checkoutIntent = client.checkoutIntents().confirm(params);
}
}curl https://staging.api.rye.com/api/v1/checkout-intents/$ID/confirm \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer $CHECKOUT_INTENTS_API_KEY" \
-d '{
"paymentMethod": {
"stripeToken": "tok_1RkrWWHGDlstla3f1Fc7ZrhH",
"type": "stripe_token"
}
}'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://staging.api.rye.com/api/v1/checkout-intents/{id}/confirm",
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([
'paymentMethod' => [
'stripeToken' => 'tok_1RkrWWHGDlstla3f1Fc7ZrhH',
'type' => 'stripe_token'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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://staging.api.rye.com/api/v1/checkout-intents/{id}/confirm"
payload := strings.NewReader("{\n \"paymentMethod\": {\n \"stripeToken\": \"tok_1RkrWWHGDlstla3f1Fc7ZrhH\",\n \"type\": \"stripe_token\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
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))
}require 'uri'
require 'net/http'
url = URI("https://staging.api.rye.com/api/v1/checkout-intents/{id}/confirm")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"paymentMethod\": {\n \"stripeToken\": \"tok_1RkrWWHGDlstla3f1Fc7ZrhH\",\n \"type\": \"stripe_token\"\n }\n}"
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>"
}{
"name": "<string>",
"message": "<string>",
"stack": "<string>",
"state": "<string>"
}{
"name": "<string>",
"message": "<string>",
"stack": "<string>"
}Authorizations
Rye API key
Path Parameters
The id of the checkout intent to confirm
Body
application/json
The request body containing the payment information
- Stripe
- Basis Theory
- Drawdown
- X402
Show child attributes
Show child attributes
Response
The confirmed checkout intent
- 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

