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 response = await client.billing.createTopupInvoice({ amountSubunits: 500000 });
console.log(response.id);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
)
response = client.billing.create_topup_invoice(
amount_subunits=500000,
)
print(response.id)package com.rye.example;
import com.rye.client.CheckoutIntentsClient;
import com.rye.client.okhttp.CheckoutIntentsOkHttpClient;
import com.rye.models.billing.BillingCreateTopupInvoiceParams;
import com.rye.models.billing.BillingCreateTopupInvoiceResponse;
public final class Main {
private Main() {}
public static void main(String[] args) {
CheckoutIntentsClient client = CheckoutIntentsOkHttpClient.fromEnv();
BillingCreateTopupInvoiceParams params = BillingCreateTopupInvoiceParams.builder()
.amountSubunits(500000)
.build();
BillingCreateTopupInvoiceResponse response = client.billing().createTopupInvoice(params);
}
}curl https://staging.api.rye.com/api/v1/billing/drawdown/topup \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer $CHECKOUT_INTENTS_API_KEY" \
-d '{
"amountSubunits": 500000,
"chargeAutomatically": false
}'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://staging.api.rye.com/api/v1/billing/drawdown/topup",
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([
'amountSubunits' => 500000,
'chargeAutomatically' => false
]),
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/billing/drawdown/topup"
payload := strings.NewReader("{\n \"amountSubunits\": 500000,\n \"chargeAutomatically\": false\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/billing/drawdown/topup")
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 \"amountSubunits\": 500000,\n \"chargeAutomatically\": false\n}"
response = http.request(request)
puts response.read_body{
"bankTransferDetails": {
"routingNumber": "<string>",
"accountNumber": "<string>",
"bankName": "<string>",
"accountHolderName": "<string>"
},
"url": "https://invoice.stripe.com/i/acct_xxx/test_xxx",
"amount": {
"currencyCode": "USD",
"amountSubunits": 1500
},
"id": "in_abc123"
}{
"message": "<string>"
}{
"name": "<string>",
"message": "<string>",
"stack": "<string>"
}{
"invoice": {
"bankTransferDetails": {
"routingNumber": "<string>",
"accountNumber": "<string>",
"bankName": "<string>",
"accountHolderName": "<string>"
},
"url": "https://invoice.stripe.com/i/acct_xxx/test_xxx",
"amount": {
"currencyCode": "USD",
"amountSubunits": 1500
},
"id": "in_abc123"
},
"message": "<string>"
}{
"name": "<string>",
"message": "<string>",
"status": 123,
"fields": {},
"stack": "<string>"
}{
"message": "<string>"
}Billing
Create on-demand top-up invoice
Request an on-demand top-up invoice.. Requires drawdown billing to be enabled. Only one unpaid top-up invoice is allowed at a time.
POST
/
api
/
v1
/
billing
/
drawdown
/
topup
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 response = await client.billing.createTopupInvoice({ amountSubunits: 500000 });
console.log(response.id);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
)
response = client.billing.create_topup_invoice(
amount_subunits=500000,
)
print(response.id)package com.rye.example;
import com.rye.client.CheckoutIntentsClient;
import com.rye.client.okhttp.CheckoutIntentsOkHttpClient;
import com.rye.models.billing.BillingCreateTopupInvoiceParams;
import com.rye.models.billing.BillingCreateTopupInvoiceResponse;
public final class Main {
private Main() {}
public static void main(String[] args) {
CheckoutIntentsClient client = CheckoutIntentsOkHttpClient.fromEnv();
BillingCreateTopupInvoiceParams params = BillingCreateTopupInvoiceParams.builder()
.amountSubunits(500000)
.build();
BillingCreateTopupInvoiceResponse response = client.billing().createTopupInvoice(params);
}
}curl https://staging.api.rye.com/api/v1/billing/drawdown/topup \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer $CHECKOUT_INTENTS_API_KEY" \
-d '{
"amountSubunits": 500000,
"chargeAutomatically": false
}'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://staging.api.rye.com/api/v1/billing/drawdown/topup",
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([
'amountSubunits' => 500000,
'chargeAutomatically' => false
]),
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/billing/drawdown/topup"
payload := strings.NewReader("{\n \"amountSubunits\": 500000,\n \"chargeAutomatically\": false\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/billing/drawdown/topup")
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 \"amountSubunits\": 500000,\n \"chargeAutomatically\": false\n}"
response = http.request(request)
puts response.read_body{
"bankTransferDetails": {
"routingNumber": "<string>",
"accountNumber": "<string>",
"bankName": "<string>",
"accountHolderName": "<string>"
},
"url": "https://invoice.stripe.com/i/acct_xxx/test_xxx",
"amount": {
"currencyCode": "USD",
"amountSubunits": 1500
},
"id": "in_abc123"
}{
"message": "<string>"
}{
"name": "<string>",
"message": "<string>",
"stack": "<string>"
}{
"invoice": {
"bankTransferDetails": {
"routingNumber": "<string>",
"accountNumber": "<string>",
"bankName": "<string>",
"accountHolderName": "<string>"
},
"url": "https://invoice.stripe.com/i/acct_xxx/test_xxx",
"amount": {
"currencyCode": "USD",
"amountSubunits": 1500
},
"id": "in_abc123"
},
"message": "<string>"
}{
"name": "<string>",
"message": "<string>",
"status": 123,
"fields": {},
"stack": "<string>"
}{
"message": "<string>"
}Authorizations
Rye API key
Body
application/json
Top-up parameters
Response
Created
Vendor-agnostic bank transfer details for push-based payment
Show child attributes
Show child attributes
Example:
"https://invoice.stripe.com/i/acct_xxx/test_xxx"
Show child attributes
Show child attributes
Available options:
draft, open, paid, uncollectible, void, unknown Example:
"in_abc123"
Was this page helpful?
⌘I

