메인 콘텐츠로 건너뛰기
POST
/
customers
/
{customer_id}
/
wallets
/
ledger-entries
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 customerWallet = await client.customers.wallets.ledgerEntries.create(
  'cus_TV52uJWWXt2yIoBBxpjaa',
  {
    amount: 0,
    currency: 'AED',
    entry_type: 'credit',
  },
);

console.log(customerWallet.customer_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_wallet = client.customers.wallets.ledger_entries.create(
    customer_id="cus_TV52uJWWXt2yIoBBxpjaa",
    amount=0,
    currency="AED",
    entry_type="credit",
)
print(customer_wallet.customer_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"),
	)
	customerWallet, err := client.Customers.Wallets.LedgerEntries.New(
		context.TODO(),
		"cus_TV52uJWWXt2yIoBBxpjaa",
		dodopayments.CustomerWalletLedgerEntryNewParams{
			Amount:    dodopayments.F(int64(0)),
			Currency:  dodopayments.F(dodopayments.CurrencyAed),
			EntryType: dodopayments.F(dodopayments.CustomerWalletLedgerEntryNewParamsEntryTypeCredit),
		},
	)
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", customerWallet.CustomerID)
}
package com.dodopayments.api.example;

import com.dodopayments.api.client.DodoPaymentsClient;
import com.dodopayments.api.client.okhttp.DodoPaymentsOkHttpClient;
import com.dodopayments.api.models.customers.wallets.CustomerWallet;
import com.dodopayments.api.models.customers.wallets.ledgerentries.LedgerEntryCreateParams;
import com.dodopayments.api.models.misc.Currency;

public final class Main {
    private Main() {}

    public static void main(String[] args) {
        DodoPaymentsClient client = DodoPaymentsOkHttpClient.fromEnv();

        LedgerEntryCreateParams params = LedgerEntryCreateParams.builder()
            .customerId("cus_TV52uJWWXt2yIoBBxpjaa")
            .amount(0L)
            .currency(Currency.AED)
            .entryType(LedgerEntryCreateParams.EntryType.CREDIT)
            .build();
        CustomerWallet customerWallet = client.customers().wallets().ledgerEntries().create(params);
    }
}
package com.dodopayments.api.example

import com.dodopayments.api.client.DodoPaymentsClient
import com.dodopayments.api.client.okhttp.DodoPaymentsOkHttpClient
import com.dodopayments.api.models.customers.wallets.CustomerWallet
import com.dodopayments.api.models.customers.wallets.ledgerentries.LedgerEntryCreateParams
import com.dodopayments.api.models.misc.Currency

fun main() {
    val client: DodoPaymentsClient = DodoPaymentsOkHttpClient.fromEnv()

    val params: LedgerEntryCreateParams = LedgerEntryCreateParams.builder()
        .customerId("cus_TV52uJWWXt2yIoBBxpjaa")
        .amount(0L)
        .currency(Currency.AED)
        .entryType(LedgerEntryCreateParams.EntryType.CREDIT)
        .build()
    val customerWallet: CustomerWallet = client.customers().wallets().ledgerEntries().create(params)
}
require "dodopayments"

dodo_payments = Dodopayments::Client.new(
  bearer_token: "My Bearer Token",
  environment: "test_mode" # defaults to "live_mode"
)

customer_wallet = dodo_payments.customers.wallets.ledger_entries.create(
  "cus_TV52uJWWXt2yIoBBxpjaa",
  amount: 0,
  currency: :AED,
  entry_type: :credit
)

puts(customer_wallet)
<?php

require_once dirname(__DIR__) . '/vendor/autoload.php';

use Dodopayments\Client;
use Dodopayments\Core\Exceptions\APIException;
use Dodopayments\Misc\Currency;

$client = new Client(
  bearerToken: getenv('DODO_PAYMENTS_API_KEY') ?: 'My Bearer Token',
  environment: 'test_mode',
);

try {
  $customerWallet = $client->customers->wallets->ledgerEntries->create(
    'cus_TV52uJWWXt2yIoBBxpjaa',
    amount: 0,
    currency: Currency::AED,
    entryType: 'credit',
    idempotencyKey: 'idempotency_key',
    reason: 'reason',
  );

  var_dump($customerWallet);
} catch (APIException $e) {
  echo $e->getMessage();
}
using System;
using DodoPayments.Client;
using DodoPayments.Client.Models.Customers.Wallets.LedgerEntries;
using DodoPayments.Client.Models.Misc;

DodoPaymentsClient client = new();

LedgerEntryCreateParams parameters = new()
{
    CustomerID = "cus_TV52uJWWXt2yIoBBxpjaa",
    Amount = 0,
    Currency = Currency.Aed,
    EntryType = EntryType.Credit,
};

var customerWallet = await client.Customers.Wallets.LedgerEntries.Create(parameters);

Console.WriteLine(customerWallet);
use dodopayments::Client;

#[tokio::main]
async fn main() -> dodopayments::Result<()> {
    let client = Client::from_env()?;
    let customer_id = "customer_id";
    let result = client
        .customers()
        .wallets()
        .ledger_entries()
        .create()
        .customer_id(customer_id)
        .body(dodopayments::models::CustomersWalletsLedgerEntriesCreateParams {
                amount: Some(0),
                currency: Some(Box::new(dodopayments::models::Currency::Aed)),
                entry_type: Some("credit".to_string()),
                ..Default::default()
            })
        .await?;
    println!("{result:?}");
    Ok(())
}
curl --request POST \
  --url https://test.dodopayments.com/customers/{customer_id}/wallets/ledger-entries \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "amount": 123,
  "idempotency_key": "<string>",
  "reason": "<string>"
}
'
{
  "balance": 123,
  "created_at": "2023-11-07T05:31:56Z",
  "customer_id": "<string>",
  "updated_at": "2023-11-07T05:31:56Z"
}

인증

Authorization
string
header
필수

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

경로 매개변수

customer_id
string
필수

Customer ID

본문

application/json
amount
integer<int64>
필수
currency
enum<string>
필수

Currency of the wallet to adjust

사용 가능한 옵션:
AED,
ALL,
AMD,
ANG,
AOA,
ARS,
AUD,
AWG,
AZN,
BAM,
BBD,
BDT,
BGN,
BHD,
BIF,
BMD,
BND,
BOB,
BRL,
BSD,
BWP,
BYN,
BZD,
CAD,
CHF,
CLP,
CNY,
COP,
CRC,
CUP,
CVE,
CZK,
DJF,
DKK,
DOP,
DZD,
EGP,
ETB,
EUR,
FJD,
FKP,
GBP,
GEL,
GHS,
GIP,
GMD,
GNF,
GTQ,
GYD,
HKD,
HNL,
HRK,
HTG,
HUF,
IDR,
ILS,
INR,
IQD,
JMD,
JOD,
JPY,
KES,
KGS,
KHR,
KMF,
KRW,
KWD,
KYD,
KZT,
LAK,
LBP,
LKR,
LRD,
LSL,
LYD,
MAD,
MDL,
MGA,
MKD,
MMK,
MNT,
MOP,
MRU,
MUR,
MVR,
MWK,
MXN,
MYR,
MZN,
NAD,
NGN,
NIO,
NOK,
NPR,
NZD,
OMR,
PAB,
PEN,
PGK,
PHP,
PKR,
PLN,
PYG,
QAR,
RON,
RSD,
RUB,
RWF,
SAR,
SBD,
SCR,
SEK,
SGD,
SHP,
SLE,
SLL,
SOS,
SRD,
SSP,
STN,
SVC,
SZL,
THB,
TND,
TOP,
TRY,
TTD,
TWD,
TZS,
UAH,
UGX,
USD,
UYU,
UZS,
VES,
VND,
VUV,
WST,
XAF,
XCD,
XOF,
XPF,
YER,
ZAR,
ZMW
entry_type
enum<string>
필수

Type of ledger entry - credit or debit

사용 가능한 옵션:
credit,
debit
idempotency_key
string | null

Optional idempotency key to prevent duplicate entries

reason
string | null

응답

balance
integer<int64>
필수
created_at
string<date-time>
필수
currency
enum<string>
필수
사용 가능한 옵션:
AED,
ALL,
AMD,
ANG,
AOA,
ARS,
AUD,
AWG,
AZN,
BAM,
BBD,
BDT,
BGN,
BHD,
BIF,
BMD,
BND,
BOB,
BRL,
BSD,
BWP,
BYN,
BZD,
CAD,
CHF,
CLP,
CNY,
COP,
CRC,
CUP,
CVE,
CZK,
DJF,
DKK,
DOP,
DZD,
EGP,
ETB,
EUR,
FJD,
FKP,
GBP,
GEL,
GHS,
GIP,
GMD,
GNF,
GTQ,
GYD,
HKD,
HNL,
HRK,
HTG,
HUF,
IDR,
ILS,
INR,
IQD,
JMD,
JOD,
JPY,
KES,
KGS,
KHR,
KMF,
KRW,
KWD,
KYD,
KZT,
LAK,
LBP,
LKR,
LRD,
LSL,
LYD,
MAD,
MDL,
MGA,
MKD,
MMK,
MNT,
MOP,
MRU,
MUR,
MVR,
MWK,
MXN,
MYR,
MZN,
NAD,
NGN,
NIO,
NOK,
NPR,
NZD,
OMR,
PAB,
PEN,
PGK,
PHP,
PKR,
PLN,
PYG,
QAR,
RON,
RSD,
RUB,
RWF,
SAR,
SBD,
SCR,
SEK,
SGD,
SHP,
SLE,
SLL,
SOS,
SRD,
SSP,
STN,
SVC,
SZL,
THB,
TND,
TOP,
TRY,
TTD,
TWD,
TZS,
UAH,
UGX,
USD,
UYU,
UZS,
VES,
VND,
VUV,
WST,
XAF,
XCD,
XOF,
XPF,
YER,
ZAR,
ZMW
customer_id
string
필수
updated_at
string<date-time>
필수
마지막 수정일 2026년 4월 1일