curl --request PATCH \
--url https://{defaultHost}/v1/checkouts/{id}/finalize \
--header 'Authorization: Bearer <token>'import requests
url = "https://{defaultHost}/v1/checkouts/{id}/finalize"
headers = {"Authorization": "Bearer <token>"}
response = requests.patch(url, headers=headers)
print(response.text)const options = {method: 'PATCH', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{defaultHost}/v1/checkouts/{id}/finalize', 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://{defaultHost}/v1/checkouts/{id}/finalize",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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://{defaultHost}/v1/checkouts/{id}/finalize"
req, _ := http.NewRequest("PATCH", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://{defaultHost}/v1/checkouts/{id}/finalize")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{defaultHost}/v1/checkouts/{id}/finalize")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "9770f9be-9619-446a-9f5c-d041de7c1075",
"object": "checkout",
"abandoned_checkout_enabled": true,
"amount_due": 2900,
"applied_balance_amount": 0,
"available_countries": [],
"billing_matches_shipping": true,
"checkout_fees_amount": 0,
"credited_balance_amount": 0,
"currency": "usd",
"discount_amount": 0,
"email": "customer@example.com",
"external_url": null,
"first_name": null,
"free_shipping_choice_shortage_amount": null,
"full_amount": 2900,
"group_key": null,
"inherited_email": "customer@example.com",
"inherited_name": null,
"inherited_phone": null,
"ip_address": null,
"last_name": null,
"live_mode": true,
"manual_payment": false,
"metadata": {},
"name": null,
"net_paid_amount": 0,
"paid_amount": 0,
"g_weight": 0,
"latitude": null,
"longitude": null,
"paid_at": null,
"payment_method_required": true,
"phone_required": false,
"portal_url": "http://app.example.com/portal_redirect/checkouts/9770f9be-9619-446a-9f5c-d041de7c1075",
"phone": null,
"proration_amount": 0,
"refunded_amount": 0,
"remaining_amount_due": 2900,
"reusable_payment_method_required": false,
"selected_shipping_choice_required": false,
"shipping_address_accuracy_requirement": "none",
"shipping_amount": 0,
"shipping_enabled": false,
"shipping_fees_amount": 0,
"shipping_tax_amount": 0,
"shipping_tax_rate": 0,
"status": "finalized",
"subtotal_amount": 2900,
"tax_amount": 0,
"tax_behavior": "exclusive",
"tax_breakdown": [],
"tax_enabled": false,
"tax_status": "disabled",
"total_amount": 2900,
"total_savings_amount": 0,
"trial_amount": 0,
"upsells_expire_at": null,
"billing_address": null,
"current_payment_intent": "c8645dc9-0e65-4288-bf1c-b4f11aafa773",
"current_upsell": null,
"invoice": null,
"last_click": null,
"customer": "870d7d55-80ed-41f7-8169-6dad3bb92a57",
"discount": null,
"geo_address": null,
"ip_geo_address": null,
"manual_payment_method": null,
"order": null,
"payment_method": null,
"inherited_billing_address": null,
"inherited_shipping_address": null,
"inherited_tax_identifier": null,
"referral": null,
"shipping_address": null,
"tax_identifier": null,
"selected_shipping_choice": null,
"upsell_funnel": null,
"created_at": 1793796862,
"updated_at": 1793796863
}Finalize
Finalizes a specific checkout before it can be paid. If succesfull, this will return an associated PaymentIntent with the necessary information to capture the payment via the specific processor.
curl --request PATCH \
--url https://{defaultHost}/v1/checkouts/{id}/finalize \
--header 'Authorization: Bearer <token>'import requests
url = "https://{defaultHost}/v1/checkouts/{id}/finalize"
headers = {"Authorization": "Bearer <token>"}
response = requests.patch(url, headers=headers)
print(response.text)const options = {method: 'PATCH', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{defaultHost}/v1/checkouts/{id}/finalize', 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://{defaultHost}/v1/checkouts/{id}/finalize",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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://{defaultHost}/v1/checkouts/{id}/finalize"
req, _ := http.NewRequest("PATCH", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://{defaultHost}/v1/checkouts/{id}/finalize")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{defaultHost}/v1/checkouts/{id}/finalize")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "9770f9be-9619-446a-9f5c-d041de7c1075",
"object": "checkout",
"abandoned_checkout_enabled": true,
"amount_due": 2900,
"applied_balance_amount": 0,
"available_countries": [],
"billing_matches_shipping": true,
"checkout_fees_amount": 0,
"credited_balance_amount": 0,
"currency": "usd",
"discount_amount": 0,
"email": "customer@example.com",
"external_url": null,
"first_name": null,
"free_shipping_choice_shortage_amount": null,
"full_amount": 2900,
"group_key": null,
"inherited_email": "customer@example.com",
"inherited_name": null,
"inherited_phone": null,
"ip_address": null,
"last_name": null,
"live_mode": true,
"manual_payment": false,
"metadata": {},
"name": null,
"net_paid_amount": 0,
"paid_amount": 0,
"g_weight": 0,
"latitude": null,
"longitude": null,
"paid_at": null,
"payment_method_required": true,
"phone_required": false,
"portal_url": "http://app.example.com/portal_redirect/checkouts/9770f9be-9619-446a-9f5c-d041de7c1075",
"phone": null,
"proration_amount": 0,
"refunded_amount": 0,
"remaining_amount_due": 2900,
"reusable_payment_method_required": false,
"selected_shipping_choice_required": false,
"shipping_address_accuracy_requirement": "none",
"shipping_amount": 0,
"shipping_enabled": false,
"shipping_fees_amount": 0,
"shipping_tax_amount": 0,
"shipping_tax_rate": 0,
"status": "finalized",
"subtotal_amount": 2900,
"tax_amount": 0,
"tax_behavior": "exclusive",
"tax_breakdown": [],
"tax_enabled": false,
"tax_status": "disabled",
"total_amount": 2900,
"total_savings_amount": 0,
"trial_amount": 0,
"upsells_expire_at": null,
"billing_address": null,
"current_payment_intent": "c8645dc9-0e65-4288-bf1c-b4f11aafa773",
"current_upsell": null,
"invoice": null,
"last_click": null,
"customer": "870d7d55-80ed-41f7-8169-6dad3bb92a57",
"discount": null,
"geo_address": null,
"ip_geo_address": null,
"manual_payment_method": null,
"order": null,
"payment_method": null,
"inherited_billing_address": null,
"inherited_shipping_address": null,
"inherited_tax_identifier": null,
"referral": null,
"shipping_address": null,
"tax_identifier": null,
"selected_shipping_choice": null,
"upsell_funnel": null,
"created_at": 1793796862,
"updated_at": 1793796863
}Authorizations
Query Parameters
Response
Success
The email of the customer. If customers exists with this email, the most recently active/updated customer will be associated. If no customers exist with this email, a new customer will be created. If a customer_id is also passed then this will take precedence and the customer will not be looked up by email.
Expandable – The associated address ID.
Expandable – Property not returned unless expanded.
Expandable – Property not returned unless expanded.
The current payment intent to be used to pay the checkout. (This will only be set once the checkout has been finalized.)
Expandable – The associated payment intent ID.
The upsell to be shown to the customer. (This will only be set once the checkout has been paid and an upsell funnel is set on the checkout.)
Expandable – The associated upsell ID.
The customer will only be set once the checkout has been finalized.
Expandable – The associated customer ID.
Expandable – The associated discount ID.
Expandable – The associated address ID.
Expandable – The associated address ID.
The inherited billing address of the checkout or customer. This is controlled by the inherit_customer_enabled attribute on the account's order protocol.
Expandable – The associated address ID.
The inherited shipping address of the checkout or customer. This is controlled by the inherit_customer_enabled attribute on the account's order protocol.
Expandable – The associated address ID.
The inherited tax identifier of the checkout or customer. This is controlled by the inherit_customer_enabled attribute on the account's order protocol.
Expandable – The associated tax identifier ID.
Expandable – The associated invoice ID.
Expandable – The associated click ID.
Expandable – Property not returned unless expanded.
Expandable – Property not returned unless expanded.
Expandable – The associated manual payment method ID.
Expandable – The associated order ID.
Expandable – Property not returned unless expanded.
Expandable – Property not returned unless expanded.
Expandable – Property not returned unless expanded.
Expandable – The associated referral ID.
Expandable – The associated shipping choice ID.
Expandable – The associated address ID.
Expandable – Property not returned unless expanded.
Expandable – Property not returned unless expanded.
Expandable – The associated tax identifier ID.
Expandable – The associated upsell funnel ID.
Was this page helpful?