Import
Compare a Stripe Import
Compare gate — prove the Stripe migration against live data before cut-over.
POST
/
v1
/
import
/
stripe
/
compare
Compare gate — prove the migration before cut-over
curl --request POST \
--url https://billing.example.com/v1/import/stripe/compare \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"customers": [
{}
],
"products": [
{}
],
"prices": [
{}
],
"subscriptions": [
{}
],
"payment_methods": [
{}
]
}
'import requests
url = "https://billing.example.com/v1/import/stripe/compare"
payload = {
"customers": [{}],
"products": [{}],
"prices": [{}],
"subscriptions": [{}],
"payment_methods": [{}]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
customers: [{}],
products: [{}],
prices: [{}],
subscriptions: [{}],
payment_methods: [{}]
})
};
fetch('https://billing.example.com/v1/import/stripe/compare', 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://billing.example.com/v1/import/stripe/compare",
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([
'customers' => [
[
]
],
'products' => [
[
]
],
'prices' => [
[
]
],
'subscriptions' => [
[
]
],
'payment_methods' => [
[
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://billing.example.com/v1/import/stripe/compare"
payload := strings.NewReader("{\n \"customers\": [\n {}\n ],\n \"products\": [\n {}\n ],\n \"prices\": [\n {}\n ],\n \"subscriptions\": [\n {}\n ],\n \"payment_methods\": [\n {}\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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))
}HttpResponse<String> response = Unirest.post("https://billing.example.com/v1/import/stripe/compare")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"customers\": [\n {}\n ],\n \"products\": [\n {}\n ],\n \"prices\": [\n {}\n ],\n \"subscriptions\": [\n {}\n ],\n \"payment_methods\": [\n {}\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://billing.example.com/v1/import/stripe/compare")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"customers\": [\n {}\n ],\n \"products\": [\n {}\n ],\n \"prices\": [\n {}\n ],\n \"subscriptions\": [\n {}\n ],\n \"payment_methods\": [\n {}\n ]\n}"
response = http.request(request)
puts response.read_body{
"source": "<string>",
"customers": {
"source": 123,
"matched": 123,
"missing": 123
},
"plans": {
"source": 123,
"matched": 123,
"missing": 123
},
"subscriptions": {
"source": 123,
"matched": 123,
"missing": 123
},
"issues": [
{
"kind": "<string>",
"external_id": "<string>",
"field": "<string>",
"source": "<string>",
"recurso": "<string>"
}
],
"ready": true,
"generated_at": "2023-11-07T05:31:56Z"
}{
"error": {
"code": "validation_failed",
"message": "<string>"
}
}{
"error": {
"code": "validation_failed",
"message": "<string>"
}
}Diffs the uploaded Stripe export (the same JSON the commit consumed) against
the tenant’s live Recurso data with zero writes. Three checks run per record:
Each entry in
- Coverage — every importable source record exists in Recurso.
- Fidelity — plan amount, currency, and interval; customer identity.
- Billing continuity — a subscription whose
current_period_enddrifted more than an hour is flagged: the double-billing / billing-gap risk.
ready: true means zero issues. Run it after a
commit, before pointing billing at
Recurso. Each run is persisted as a citable
compare report.
Example request
curl -X POST https://api.recurso.dev/v1/import/stripe/compare \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d @stripe-export.json
Example response
{
"source": "stripe",
"customers": { "source": 128, "matched": 128, "missing": 0 },
"plans": { "source": 6, "matched": 6, "missing": 0 },
"subscriptions": { "source": 117, "matched": 117, "missing": 0 },
"issues": [],
"ready": true,
"generated_at": "2026-08-12T10:30:00Z"
}
issues carries kind, external_id, field, source
(the export’s value), and recurso (the live value).Authorizations
Tenant API key obtained from POST /auth/register or POST /v1/developer/keys.
Body
application/json
The same Stripe export JSON the commit consumed.
Response
The compare report.
Migration-compare coverage for one record kind.
Show child attributes
Show child attributes
Migration-compare coverage for one record kind.
Show child attributes
Show child attributes
Migration-compare coverage for one record kind.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
⌘I
Compare gate — prove the migration before cut-over
curl --request POST \
--url https://billing.example.com/v1/import/stripe/compare \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"customers": [
{}
],
"products": [
{}
],
"prices": [
{}
],
"subscriptions": [
{}
],
"payment_methods": [
{}
]
}
'import requests
url = "https://billing.example.com/v1/import/stripe/compare"
payload = {
"customers": [{}],
"products": [{}],
"prices": [{}],
"subscriptions": [{}],
"payment_methods": [{}]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
customers: [{}],
products: [{}],
prices: [{}],
subscriptions: [{}],
payment_methods: [{}]
})
};
fetch('https://billing.example.com/v1/import/stripe/compare', 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://billing.example.com/v1/import/stripe/compare",
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([
'customers' => [
[
]
],
'products' => [
[
]
],
'prices' => [
[
]
],
'subscriptions' => [
[
]
],
'payment_methods' => [
[
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://billing.example.com/v1/import/stripe/compare"
payload := strings.NewReader("{\n \"customers\": [\n {}\n ],\n \"products\": [\n {}\n ],\n \"prices\": [\n {}\n ],\n \"subscriptions\": [\n {}\n ],\n \"payment_methods\": [\n {}\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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))
}HttpResponse<String> response = Unirest.post("https://billing.example.com/v1/import/stripe/compare")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"customers\": [\n {}\n ],\n \"products\": [\n {}\n ],\n \"prices\": [\n {}\n ],\n \"subscriptions\": [\n {}\n ],\n \"payment_methods\": [\n {}\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://billing.example.com/v1/import/stripe/compare")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"customers\": [\n {}\n ],\n \"products\": [\n {}\n ],\n \"prices\": [\n {}\n ],\n \"subscriptions\": [\n {}\n ],\n \"payment_methods\": [\n {}\n ]\n}"
response = http.request(request)
puts response.read_body{
"source": "<string>",
"customers": {
"source": 123,
"matched": 123,
"missing": 123
},
"plans": {
"source": 123,
"matched": 123,
"missing": 123
},
"subscriptions": {
"source": 123,
"matched": 123,
"missing": 123
},
"issues": [
{
"kind": "<string>",
"external_id": "<string>",
"field": "<string>",
"source": "<string>",
"recurso": "<string>"
}
],
"ready": true,
"generated_at": "2023-11-07T05:31:56Z"
}{
"error": {
"code": "validation_failed",
"message": "<string>"
}
}{
"error": {
"code": "validation_failed",
"message": "<string>"
}
}