Localized Pricing
سرد الأسعار المحلية
سرد قواعد الأسعار المحلية النشطة لمنتج.
GET
/
products
/
{product_id}
/
localized-prices
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 listLocalizedPricesResponse = await client.products.localizedPrices.list(
'pdt_R8AWMPiV8RyJElcCKvAID',
);
console.log(listLocalizedPricesResponse.items);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
)
list_localized_prices_response = client.products.localized_prices.list(
"pdt_R8AWMPiV8RyJElcCKvAID",
)
print(list_localized_prices_response.items)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"),
)
listLocalizedPricesResponse, err := client.Products.LocalizedPrices.List(context.TODO(), "pdt_R8AWMPiV8RyJElcCKvAID")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", listLocalizedPricesResponse.Items)
}
package com.dodopayments.api.example;
import com.dodopayments.api.client.DodoPaymentsClient;
import com.dodopayments.api.client.okhttp.DodoPaymentsOkHttpClient;
import com.dodopayments.api.models.products.localizedprices.ListLocalizedPricesResponse;
import com.dodopayments.api.models.products.localizedprices.LocalizedPriceListParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
DodoPaymentsClient client = DodoPaymentsOkHttpClient.fromEnv();
ListLocalizedPricesResponse listLocalizedPricesResponse = client.products().localizedPrices().list("pdt_R8AWMPiV8RyJElcCKvAID");
}
}package com.dodopayments.api.example
import com.dodopayments.api.client.DodoPaymentsClient
import com.dodopayments.api.client.okhttp.DodoPaymentsOkHttpClient
import com.dodopayments.api.models.products.localizedprices.ListLocalizedPricesResponse
import com.dodopayments.api.models.products.localizedprices.LocalizedPriceListParams
fun main() {
val client: DodoPaymentsClient = DodoPaymentsOkHttpClient.fromEnv()
val listLocalizedPricesResponse: ListLocalizedPricesResponse = client.products().localizedPrices().list("pdt_R8AWMPiV8RyJElcCKvAID")
}require "dodopayments"
dodo_payments = Dodopayments::Client.new(
bearer_token: "My Bearer Token",
environment: "test_mode" # defaults to "live_mode"
)
list_localized_prices_response = dodo_payments.products.localized_prices.list("pdt_R8AWMPiV8RyJElcCKvAID")
puts(list_localized_prices_response)<?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 {
$listLocalizedPricesResponse = $client->products->localizedPrices->list(
'pdt_R8AWMPiV8RyJElcCKvAID'
);
var_dump($listLocalizedPricesResponse);
} catch (APIException $e) {
echo $e->getMessage();
}using System;
using DodoPayments.Client;
using DodoPayments.Client.Models.Products.LocalizedPrices;
DodoPaymentsClient client = new();
LocalizedPriceListParams parameters = new()
{
ProductID = "pdt_R8AWMPiV8RyJElcCKvAID"
};
var listLocalizedPricesResponse = await client.Products.LocalizedPrices.List(parameters);
Console.WriteLine(listLocalizedPricesResponse);use dodopayments::Client;
#[tokio::main]
async fn main() -> dodopayments::Result<()> {
let client = Client::from_env()?;
let product_id = "product_id";
let result = client
.products()
.localized_prices()
.list()
.product_id(product_id)
.await?;
println!("{result:?}");
Ok(())
}curl --request GET \
--url https://test.dodopayments.com/products/{product_id}/localized-prices \
--header 'Authorization: Bearer <token>'{
"items": [
{
"amount": 123,
"created_at": "2023-11-07T05:31:56Z",
"currency": "AED",
"id": "<string>",
"mode": "by_currency",
"product_id": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"country_code": "AF"
}
]
}التفويضات
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.
معلمات المسار
Product Id
الاستجابة
Active localized rules
Show child attributes
Show child attributes
آخر تعديل في ٣١ يوليو ٢٠٢٦
هل كانت هذه الصفحة مفيدة؟
⌘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 listLocalizedPricesResponse = await client.products.localizedPrices.list(
'pdt_R8AWMPiV8RyJElcCKvAID',
);
console.log(listLocalizedPricesResponse.items);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
)
list_localized_prices_response = client.products.localized_prices.list(
"pdt_R8AWMPiV8RyJElcCKvAID",
)
print(list_localized_prices_response.items)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"),
)
listLocalizedPricesResponse, err := client.Products.LocalizedPrices.List(context.TODO(), "pdt_R8AWMPiV8RyJElcCKvAID")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", listLocalizedPricesResponse.Items)
}
package com.dodopayments.api.example;
import com.dodopayments.api.client.DodoPaymentsClient;
import com.dodopayments.api.client.okhttp.DodoPaymentsOkHttpClient;
import com.dodopayments.api.models.products.localizedprices.ListLocalizedPricesResponse;
import com.dodopayments.api.models.products.localizedprices.LocalizedPriceListParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
DodoPaymentsClient client = DodoPaymentsOkHttpClient.fromEnv();
ListLocalizedPricesResponse listLocalizedPricesResponse = client.products().localizedPrices().list("pdt_R8AWMPiV8RyJElcCKvAID");
}
}package com.dodopayments.api.example
import com.dodopayments.api.client.DodoPaymentsClient
import com.dodopayments.api.client.okhttp.DodoPaymentsOkHttpClient
import com.dodopayments.api.models.products.localizedprices.ListLocalizedPricesResponse
import com.dodopayments.api.models.products.localizedprices.LocalizedPriceListParams
fun main() {
val client: DodoPaymentsClient = DodoPaymentsOkHttpClient.fromEnv()
val listLocalizedPricesResponse: ListLocalizedPricesResponse = client.products().localizedPrices().list("pdt_R8AWMPiV8RyJElcCKvAID")
}require "dodopayments"
dodo_payments = Dodopayments::Client.new(
bearer_token: "My Bearer Token",
environment: "test_mode" # defaults to "live_mode"
)
list_localized_prices_response = dodo_payments.products.localized_prices.list("pdt_R8AWMPiV8RyJElcCKvAID")
puts(list_localized_prices_response)<?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 {
$listLocalizedPricesResponse = $client->products->localizedPrices->list(
'pdt_R8AWMPiV8RyJElcCKvAID'
);
var_dump($listLocalizedPricesResponse);
} catch (APIException $e) {
echo $e->getMessage();
}using System;
using DodoPayments.Client;
using DodoPayments.Client.Models.Products.LocalizedPrices;
DodoPaymentsClient client = new();
LocalizedPriceListParams parameters = new()
{
ProductID = "pdt_R8AWMPiV8RyJElcCKvAID"
};
var listLocalizedPricesResponse = await client.Products.LocalizedPrices.List(parameters);
Console.WriteLine(listLocalizedPricesResponse);use dodopayments::Client;
#[tokio::main]
async fn main() -> dodopayments::Result<()> {
let client = Client::from_env()?;
let product_id = "product_id";
let result = client
.products()
.localized_prices()
.list()
.product_id(product_id)
.await?;
println!("{result:?}");
Ok(())
}curl --request GET \
--url https://test.dodopayments.com/products/{product_id}/localized-prices \
--header 'Authorization: Bearer <token>'{
"items": [
{
"amount": 123,
"created_at": "2023-11-07T05:31:56Z",
"currency": "AED",
"id": "<string>",
"mode": "by_currency",
"product_id": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"country_code": "AF"
}
]
}