Bind a store transaction to a purchase intent
curl --request POST \
--url https://api.runaether.dev/orgs/{orgID}/billing/checkout-sessions/{checkoutSessionID}/transaction \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"transaction_id": "<string>"
}
'import requests
url = "https://api.runaether.dev/orgs/{orgID}/billing/checkout-sessions/{checkoutSessionID}/transaction"
payload = { "transaction_id": "<string>" }
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({transaction_id: '<string>'})
};
fetch('https://api.runaether.dev/orgs/{orgID}/billing/checkout-sessions/{checkoutSessionID}/transaction', 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.runaether.dev/orgs/{orgID}/billing/checkout-sessions/{checkoutSessionID}/transaction",
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([
'transaction_id' => '<string>'
]),
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://api.runaether.dev/orgs/{orgID}/billing/checkout-sessions/{checkoutSessionID}/transaction"
payload := strings.NewReader("{\n \"transaction_id\": \"<string>\"\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://api.runaether.dev/orgs/{orgID}/billing/checkout-sessions/{checkoutSessionID}/transaction")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"transaction_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.runaether.dev/orgs/{orgID}/billing/checkout-sessions/{checkoutSessionID}/transaction")
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 \"transaction_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"checkout_session_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"checkout_session_token": "<string>",
"checkout_type": "subscription",
"status": "created",
"subscription_status": "active",
"target_tier": "starter",
"claimed_store_purchase": true,
"store_app_user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"store_product_id": "<string>",
"url": "<string>"
}{
"code": "bad_gateway",
"error": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
]
}{
"code": "bad_gateway",
"error": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
]
}{
"code": "bad_gateway",
"error": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
]
}{
"code": "bad_gateway",
"error": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
]
}{
"code": "bad_gateway",
"error": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
]
}{
"code": "bad_gateway",
"error": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
]
}{
"code": "bad_gateway",
"error": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
]
}{
"code": "bad_gateway",
"error": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
]
}Billing
Bind a store transaction to a purchase intent
Records the store transaction a device's purchase produced on one of the org's store purchase intents, so the store's report of that purchase is granted through the intent.
Use this tool when you need to:
- Attach the App Store or Play Store transaction to the purchase intent createBillingCheckoutSession returned on ios or android
- Retry a bind after the purchase settled
Examples:
- POST /orgs/{orgID}/billing/checkout-sessions/{checkoutSessionID}/transaction {"transaction_id": "2000000123456789"}
Hints:
- orgID is the org's uuid and checkoutSessionID the intent's checkout_session_id, a uuid; transaction_id is required, 1 to 128 letters, digits or . _ : - characters (an App Store transaction id or a Play Store order id). The schema answers 422 for either out of shape.
- For attribution only: nothing is granted on the device's word. The store's report grants the purchase; when the store already reported it, the bind claims it, completes the intent and grants it once, and the returned BillingCheckoutSession has claimed_store_purchase true.
- Binding the same transaction again succeeds without change, whatever the intent's status; that answer carries no claimed_store_purchase.
- Refused with 404 for an intent the org does not have, and 409 for a Stripe checkout, an intent already bound to another transaction or no longer open, a transaction bound to another intent, or an already reported purchase the intent cannot be granted: bought in another store or for another product, a sandbox purchase outside the allowlist, a subscription for an org that holds another, or a subscription whose paid period ended with no renewal or expiration reported yet.
- Use getBillingCheckoutSession instead to follow the intent's status after the bind, and claimBillingUnassignedStorePurchase to recover a purchase no intent holds.
- Owners, admins and billing members of the org: a member or viewer is refused with 403 org_role_insufficient before the path or body is validated, a non-member with 403 org_membership_required, an orgID that is not a uuid with 400, and an agent host's grant with 403 agent_host_route_not_allowed.
POST
/
orgs
/
{orgID}
/
billing
/
checkout-sessions
/
{checkoutSessionID}
/
transaction
Bind a store transaction to a purchase intent
curl --request POST \
--url https://api.runaether.dev/orgs/{orgID}/billing/checkout-sessions/{checkoutSessionID}/transaction \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"transaction_id": "<string>"
}
'import requests
url = "https://api.runaether.dev/orgs/{orgID}/billing/checkout-sessions/{checkoutSessionID}/transaction"
payload = { "transaction_id": "<string>" }
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({transaction_id: '<string>'})
};
fetch('https://api.runaether.dev/orgs/{orgID}/billing/checkout-sessions/{checkoutSessionID}/transaction', 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.runaether.dev/orgs/{orgID}/billing/checkout-sessions/{checkoutSessionID}/transaction",
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([
'transaction_id' => '<string>'
]),
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://api.runaether.dev/orgs/{orgID}/billing/checkout-sessions/{checkoutSessionID}/transaction"
payload := strings.NewReader("{\n \"transaction_id\": \"<string>\"\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://api.runaether.dev/orgs/{orgID}/billing/checkout-sessions/{checkoutSessionID}/transaction")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"transaction_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.runaether.dev/orgs/{orgID}/billing/checkout-sessions/{checkoutSessionID}/transaction")
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 \"transaction_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"checkout_session_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"checkout_session_token": "<string>",
"checkout_type": "subscription",
"status": "created",
"subscription_status": "active",
"target_tier": "starter",
"claimed_store_purchase": true,
"store_app_user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"store_product_id": "<string>",
"url": "<string>"
}{
"code": "bad_gateway",
"error": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
]
}{
"code": "bad_gateway",
"error": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
]
}{
"code": "bad_gateway",
"error": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
]
}{
"code": "bad_gateway",
"error": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
]
}{
"code": "bad_gateway",
"error": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
]
}{
"code": "bad_gateway",
"error": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
]
}{
"code": "bad_gateway",
"error": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
]
}{
"code": "bad_gateway",
"error": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
]
}Authorizations
Body
application/json
Response
OK
- Option 1
- Option 2
- Option 3