Credit Entitlements
Kundenbilanz abrufen
Abrufen des spezifischen Kontostands eines Kunden für eine Gutschriftberechtigung.
GET
/
credit-entitlements
/
{credit_entitlement_id}
/
balances
/
{customer_id}
JavaScript
import DodoPayments from 'dodopayments';
const client = new DodoPayments({
bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted
});
const customerCreditBalance = await client.creditEntitlements.balances.retrieve(
'cus_TV52uJWWXt2yIoBBxpjaa',
{ credit_entitlement_id: 'cde_ztxm5XJsKxWucRWA3rjdM' },
);
console.log(customerCreditBalance.id);import os
from dodopayments import DodoPayments
client = DodoPayments(
bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted
)
customer_credit_balance = client.credit_entitlements.balances.retrieve(
customer_id="cus_TV52uJWWXt2yIoBBxpjaa",
credit_entitlement_id="cde_ztxm5XJsKxWucRWA3rjdM",
)
print(customer_credit_balance.id)package main
import (
"context"
"fmt"
"github.com/dodopayments/dodopayments-go"
"github.com/dodopayments/dodopayments-go/option"
)
func main() {
client := dodopayments.NewClient(
option.WithBearerToken("My Bearer Token"),
)
customerCreditBalance, err := client.CreditEntitlements.Balances.Get(
context.TODO(),
"cde_ztxm5XJsKxWucRWA3rjdM",
"cus_TV52uJWWXt2yIoBBxpjaa",
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", customerCreditBalance.ID)
}
package com.dodopayments.api.example;
import com.dodopayments.api.client.DodoPaymentsClient;
import com.dodopayments.api.client.okhttp.DodoPaymentsOkHttpClient;
import com.dodopayments.api.models.creditentitlements.balances.BalanceRetrieveParams;
import com.dodopayments.api.models.creditentitlements.balances.CustomerCreditBalance;
public final class Main {
private Main() {}
public static void main(String[] args) {
DodoPaymentsClient client = DodoPaymentsOkHttpClient.fromEnv();
BalanceRetrieveParams params = BalanceRetrieveParams.builder()
.creditEntitlementId("cde_ztxm5XJsKxWucRWA3rjdM")
.customerId("cus_TV52uJWWXt2yIoBBxpjaa")
.build();
CustomerCreditBalance customerCreditBalance = client.creditEntitlements().balances().retrieve(params);
}
}package com.dodopayments.api.example
import com.dodopayments.api.client.DodoPaymentsClient
import com.dodopayments.api.client.okhttp.DodoPaymentsOkHttpClient
import com.dodopayments.api.models.creditentitlements.balances.BalanceRetrieveParams
import com.dodopayments.api.models.creditentitlements.balances.CustomerCreditBalance
fun main() {
val client: DodoPaymentsClient = DodoPaymentsOkHttpClient.fromEnv()
val params: BalanceRetrieveParams = BalanceRetrieveParams.builder()
.creditEntitlementId("cde_ztxm5XJsKxWucRWA3rjdM")
.customerId("cus_TV52uJWWXt2yIoBBxpjaa")
.build()
val customerCreditBalance: CustomerCreditBalance = client.creditEntitlements().balances().retrieve(params)
}require "dodopayments"
dodo_payments = Dodopayments::Client.new(
bearer_token: "My Bearer Token",
environment: "test_mode" # defaults to "live_mode"
)
customer_credit_balance = dodo_payments.credit_entitlements.balances.retrieve(
"cus_TV52uJWWXt2yIoBBxpjaa",
credit_entitlement_id: "cde_ztxm5XJsKxWucRWA3rjdM"
)
puts(customer_credit_balance)<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
use Dodopayments\Client;
use Dodopayments\Core\Exceptions\APIException;
$client = new Client(
bearerToken: getenv('DODO_PAYMENTS_API_KEY') ?: 'My Bearer Token',
environment: 'test_mode',
);
try {
$customerCreditBalance = $client->creditEntitlements->balances->retrieve(
'cus_TV52uJWWXt2yIoBBxpjaa',
creditEntitlementID: 'cde_ztxm5XJsKxWucRWA3rjdM',
);
var_dump($customerCreditBalance);
} catch (APIException $e) {
echo $e->getMessage();
}using System;
using DodoPayments.Client;
using DodoPayments.Client.Models.CreditEntitlements.Balances;
DodoPaymentsClient client = new();
BalanceRetrieveParams parameters = new()
{
CreditEntitlementID = "cde_ztxm5XJsKxWucRWA3rjdM",
CustomerID = "cus_TV52uJWWXt2yIoBBxpjaa",
};
var customerCreditBalance = await client.CreditEntitlements.Balances.Retrieve(parameters);
Console.WriteLine(customerCreditBalance);use dodopayments::Client;
#[tokio::main]
async fn main() -> dodopayments::Result<()> {
let client = Client::from_env()?;
let credit_entitlement_id = "credit_entitlement_id";
let customer_id = "customer_id";
let result = client
.credit_entitlements()
.balances()
.retrieve()
.credit_entitlement_id(credit_entitlement_id)
.customer_id(customer_id)
.await?;
println!("{result:?}");
Ok(())
}curl --request GET \
--url https://test.dodopayments.com/credit-entitlements/{credit_entitlement_id}/balances/{customer_id} \
--header 'Authorization: Bearer <token>'{
"balance": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"credit_entitlement_id": "<string>",
"customer_id": "<string>",
"id": "<string>",
"overage": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"last_transaction_at": "2023-11-07T05:31:56Z"
}Autorisierungen
Send your API key as a bearer token: Authorization: Bearer <api_key>. A test mode key starts with dodo_test_, for example dodo_test_AbCd1234EfGh5678.<secret>. A live mode key starts with dodo_live_. Use a test mode key on test.dodopayments.com and a live mode key on live.dodopayments.com. Keys from before these tags have no tag and operate as before.
Pfadparameter
Antwort
Customer balance details
Zuletzt geändert am 1. April 2026
War diese Seite hilfreich?
⌘I
JavaScript
import DodoPayments from 'dodopayments';
const client = new DodoPayments({
bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted
});
const customerCreditBalance = await client.creditEntitlements.balances.retrieve(
'cus_TV52uJWWXt2yIoBBxpjaa',
{ credit_entitlement_id: 'cde_ztxm5XJsKxWucRWA3rjdM' },
);
console.log(customerCreditBalance.id);import os
from dodopayments import DodoPayments
client = DodoPayments(
bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"), # This is the default and can be omitted
)
customer_credit_balance = client.credit_entitlements.balances.retrieve(
customer_id="cus_TV52uJWWXt2yIoBBxpjaa",
credit_entitlement_id="cde_ztxm5XJsKxWucRWA3rjdM",
)
print(customer_credit_balance.id)package main
import (
"context"
"fmt"
"github.com/dodopayments/dodopayments-go"
"github.com/dodopayments/dodopayments-go/option"
)
func main() {
client := dodopayments.NewClient(
option.WithBearerToken("My Bearer Token"),
)
customerCreditBalance, err := client.CreditEntitlements.Balances.Get(
context.TODO(),
"cde_ztxm5XJsKxWucRWA3rjdM",
"cus_TV52uJWWXt2yIoBBxpjaa",
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", customerCreditBalance.ID)
}
package com.dodopayments.api.example;
import com.dodopayments.api.client.DodoPaymentsClient;
import com.dodopayments.api.client.okhttp.DodoPaymentsOkHttpClient;
import com.dodopayments.api.models.creditentitlements.balances.BalanceRetrieveParams;
import com.dodopayments.api.models.creditentitlements.balances.CustomerCreditBalance;
public final class Main {
private Main() {}
public static void main(String[] args) {
DodoPaymentsClient client = DodoPaymentsOkHttpClient.fromEnv();
BalanceRetrieveParams params = BalanceRetrieveParams.builder()
.creditEntitlementId("cde_ztxm5XJsKxWucRWA3rjdM")
.customerId("cus_TV52uJWWXt2yIoBBxpjaa")
.build();
CustomerCreditBalance customerCreditBalance = client.creditEntitlements().balances().retrieve(params);
}
}package com.dodopayments.api.example
import com.dodopayments.api.client.DodoPaymentsClient
import com.dodopayments.api.client.okhttp.DodoPaymentsOkHttpClient
import com.dodopayments.api.models.creditentitlements.balances.BalanceRetrieveParams
import com.dodopayments.api.models.creditentitlements.balances.CustomerCreditBalance
fun main() {
val client: DodoPaymentsClient = DodoPaymentsOkHttpClient.fromEnv()
val params: BalanceRetrieveParams = BalanceRetrieveParams.builder()
.creditEntitlementId("cde_ztxm5XJsKxWucRWA3rjdM")
.customerId("cus_TV52uJWWXt2yIoBBxpjaa")
.build()
val customerCreditBalance: CustomerCreditBalance = client.creditEntitlements().balances().retrieve(params)
}require "dodopayments"
dodo_payments = Dodopayments::Client.new(
bearer_token: "My Bearer Token",
environment: "test_mode" # defaults to "live_mode"
)
customer_credit_balance = dodo_payments.credit_entitlements.balances.retrieve(
"cus_TV52uJWWXt2yIoBBxpjaa",
credit_entitlement_id: "cde_ztxm5XJsKxWucRWA3rjdM"
)
puts(customer_credit_balance)<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
use Dodopayments\Client;
use Dodopayments\Core\Exceptions\APIException;
$client = new Client(
bearerToken: getenv('DODO_PAYMENTS_API_KEY') ?: 'My Bearer Token',
environment: 'test_mode',
);
try {
$customerCreditBalance = $client->creditEntitlements->balances->retrieve(
'cus_TV52uJWWXt2yIoBBxpjaa',
creditEntitlementID: 'cde_ztxm5XJsKxWucRWA3rjdM',
);
var_dump($customerCreditBalance);
} catch (APIException $e) {
echo $e->getMessage();
}using System;
using DodoPayments.Client;
using DodoPayments.Client.Models.CreditEntitlements.Balances;
DodoPaymentsClient client = new();
BalanceRetrieveParams parameters = new()
{
CreditEntitlementID = "cde_ztxm5XJsKxWucRWA3rjdM",
CustomerID = "cus_TV52uJWWXt2yIoBBxpjaa",
};
var customerCreditBalance = await client.CreditEntitlements.Balances.Retrieve(parameters);
Console.WriteLine(customerCreditBalance);use dodopayments::Client;
#[tokio::main]
async fn main() -> dodopayments::Result<()> {
let client = Client::from_env()?;
let credit_entitlement_id = "credit_entitlement_id";
let customer_id = "customer_id";
let result = client
.credit_entitlements()
.balances()
.retrieve()
.credit_entitlement_id(credit_entitlement_id)
.customer_id(customer_id)
.await?;
println!("{result:?}");
Ok(())
}curl --request GET \
--url https://test.dodopayments.com/credit-entitlements/{credit_entitlement_id}/balances/{customer_id} \
--header 'Authorization: Bearer <token>'{
"balance": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"credit_entitlement_id": "<string>",
"customer_id": "<string>",
"id": "<string>",
"overage": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"last_transaction_at": "2023-11-07T05:31:56Z"
}