curl -X POST 'https://verification.didit.me/v3/billing/top-up/' \
-H 'x-api-key: YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"amount_in_dollars": 500,
"success_url": "https://yourapp.com/billing/success",
"cancel_url": "https://yourapp.com/billing/cancel"
}'from didit import Didit
# Reads DIDIT_API_KEY.
client = Didit()
result = client.billing.top_up(
amount_in_dollars=50.0,
)
print(result)import Didit from "@didit-protocol/sdk-node";
// Reads DIDIT_API_KEY.
const didit = new Didit();
const result = await didit.billing.topUp({
amount_in_dollars: 50.0,
});
console.log(result);ctx := context.Background()
// Reads DIDIT_API_KEY.
client := didit.NewClient()
result, err := client.Billing.TopUp(ctx, didit.BillingTopUpParams{
AmountInDollars: 50.0,
})
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", result)import me.didit.Didit;
import me.didit.types.BillingTopUpParams;
// Reads DIDIT_API_KEY.
Didit client = new Didit();
var result = client.billing().topUp(BillingTopUpParams.builder()
.amountInDollars(50.0)
.build());
System.out.println(result);<?php
require 'vendor/autoload.php';
use Didit\DiditClient;
// Reads DIDIT_API_KEY.
$didit = new DiditClient();
$result = $didit->billing->topUp([
'amount_in_dollars' => 50.0,
]);
print_r($result->toArray());require "didit"
# Reads DIDIT_API_KEY.
didit = Didit::Client.new
result = didit.billing.top_up(amount_in_dollars: 50.0)
puts result.to_husing System;
using System.Text.Json;
using Didit;
// Reads DIDIT_API_KEY.
using var client = new DiditClient();
var result = await client.Billing.TopUpAsync(new BillingTopUpParams
{
AmountInDollars = 50.0,
});
Console.WriteLine(JsonSerializer.Serialize(result));{
"checkout_session_id": "cs_test_a1B2c3D4e5F6g7H8i9J0",
"checkout_session_url": "https://checkout.example.com/c/pay/cs_test_a1B2c3D4e5F6g7H8i9J0"
}Top Up Credits API
Create a Stripe checkout to add a top-up to your Didit balance: 50to20,000 at face value, on the Free, Growth and Scale plans. Top-ups last 12 months.
curl -X POST 'https://verification.didit.me/v3/billing/top-up/' \
-H 'x-api-key: YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"amount_in_dollars": 500,
"success_url": "https://yourapp.com/billing/success",
"cancel_url": "https://yourapp.com/billing/cancel"
}'from didit import Didit
# Reads DIDIT_API_KEY.
client = Didit()
result = client.billing.top_up(
amount_in_dollars=50.0,
)
print(result)import Didit from "@didit-protocol/sdk-node";
// Reads DIDIT_API_KEY.
const didit = new Didit();
const result = await didit.billing.topUp({
amount_in_dollars: 50.0,
});
console.log(result);ctx := context.Background()
// Reads DIDIT_API_KEY.
client := didit.NewClient()
result, err := client.Billing.TopUp(ctx, didit.BillingTopUpParams{
AmountInDollars: 50.0,
})
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", result)import me.didit.Didit;
import me.didit.types.BillingTopUpParams;
// Reads DIDIT_API_KEY.
Didit client = new Didit();
var result = client.billing().topUp(BillingTopUpParams.builder()
.amountInDollars(50.0)
.build());
System.out.println(result);<?php
require 'vendor/autoload.php';
use Didit\DiditClient;
// Reads DIDIT_API_KEY.
$didit = new DiditClient();
$result = $didit->billing->topUp([
'amount_in_dollars' => 50.0,
]);
print_r($result->toArray());require "didit"
# Reads DIDIT_API_KEY.
didit = Didit::Client.new
result = didit.billing.top_up(amount_in_dollars: 50.0)
puts result.to_husing System;
using System.Text.Json;
using Didit;
// Reads DIDIT_API_KEY.
using var client = new DiditClient();
var result = await client.Billing.TopUpAsync(new BillingTopUpParams
{
AmountInDollars = 50.0,
});
Console.WriteLine(JsonSerializer.Serialize(result));{
"checkout_session_id": "cs_test_a1B2c3D4e5F6g7H8i9J0",
"checkout_session_url": "https://checkout.example.com/c/pay/cs_test_a1B2c3D4e5F6g7H8i9J0"
}Authorizations
Your application's API key, from Developers -> API keys in the Business Console. The primary key has full access. A named key can be scoped: none, read or write per resource, limited to some workflows or to approved sessions, to a list of IP addresses, and to an expiry date. 401 means the key is wrong, revoked or expired; 403 means no key was sent, the key has no access to this resource or action, or the request came from an address outside its IP list; 404 on a session route means the session is outside the key's workflows or statuses. A key without media access receives image, video and PDF URLs as null, and a key without sessions write receives session links and tokens as null. See https://docs.didit.me/console/api-keys.
Body
Amount to charge, in USD. Must be from 50 to 20,000. The balance receives the same amount, with no discount or bonus. Tax is added automatically at checkout based on the customer's billing address.
50 <= x <= 20000URL the hosted checkout redirects the customer to after a successful payment. Currently defaults to https://console.didit.me. Pass a working URL explicitly; the default host is unavailable. Append the literal placeholder {CHECKOUT_SESSION_ID} if you want the hosted checkout to substitute the session ID.
URL the hosted checkout redirects the customer to when they abort or close the Checkout window. Currently defaults to https://console.didit.me. Pass a working URL explicitly; the default host is unavailable.
Response
Hosted checkout session created. Redirect the user to checkout_session_url to complete payment.