Error: Paddle API error: Authentication header included, but incorrectly formatted.
Status code: 403

test_that("paddle_create_customer() returns error when email is already used", {
custom_data = list(source = "unit_test"),
), "Paddle API error: customer email conflicts with customer of id ctm_01jwp3yens988zjex66a8hh7rz")
test_that("paddle_create_customer() returns error when email is not filled", {
), "`email` is required and must be a non-empty string.")
res <- paddle_list_customers(per_page = 1,
test_that("paddle_update_customer() returns error with wrong status", {
id = "cus_invalid",  # replace with a real ID for live test
test_that("paddle_update_customer() returns error with wrond customer id", {
id = "ctm_01jwk0s510nxxv3gv8ky41e46a",  # replace with a real ID for live test
test_that("paddle_generate_auth_token() fails with invalid ID", {
test_that("paddle_list_customer() returns error with wrong inputs1", {
expect_error(paddle_list_customers(status = "wrong input"), "`status` must be one of: active, archived")
test_that("paddle_list_customer() returns error with wrong inputs3", {
expect_error(paddle_list_customers(search = "wrong input"), "`search` must be one of: id, name, email")
test_that("paddle_list_customer() returns error with wrong inputs4", {
test_that("paddle_list_credit_balances() validates input correctly", {
expect_silent(paddle_list_credit_balances("ctm_01jwk0s510nxxv3gv8ky41e46a", currency_code = c("USD", "EUR")))
test_that("paddle_list_customer_addresses() validates inputs correctly", {
expect_error(paddle_list_customer_addresses("ctm_01jwk0s510nxxv3gv8ky41e46a", status = c("archived", "bad")),
expect_silent(paddle_list_customer_addresses("ctm_01jwk0s510nxxv3gv8ky41e46a", per_page = 50, status = "active"))
test_that("paddle_create_customer_address() validates inputs correctly", {
"`country_code` must be a valid 2-letter")
test_that("paddle_update_customer_address() validates inputs correctly", {
"`address_id` must be a non-empty string")
expect_error(paddle_update_customer_address("ctm_01jwk0s510nxxv3gv8ky41e46a", "add_1", country_code = "US1"),
expect_error(paddle_update_customer_address("ctm_01jwk0s510nxxv3gv8ky41e46a", "add_1", status = "disabled"),
test_that("paddle_list_customer_businesses() validates input correctly", {
expect_error(paddle_list_customer_businesses("ctm_01jwk0s510nxxv3gv8ky41e46a", status = c("active", "deleted")),
expect_silent(paddle_list_customer_businesses("ctm_01jwk0s510nxxv3gv8ky41e46a", order_by = "id[DESC]", status = "archived", search = "LLC"))
test_that("paddle_create_customer_business() validates inputs correctly", {
expect_error(paddle_create_customer_business("ctm_01jwk0s510nxxv3gv8ky41e46a", name = "Business", contacts = list(list(name = "X"))),
"Each contact must be a list containing at least an `email` field")
contacts = list(list(name = "X", email = "invalidemail"))),
"Each contact must contain a valid email address")
tax_identifier = "VAT123456",  # invalid: contains letters
contacts = list(list(email = "alice@example.com"))
"`tax_identifier` must contain only digits"
test_that("paddle_update_customer_business() validates inputs correctly", {
"`business_id` must be a non-empty string")
expect_error(paddle_update_customer_business("ctm_01jwk0s510nxxv3gv8ky41e46a", "biz_01jx23b3fhk07ngxddazz0e9a1", tax_identifier = "VAT1234"),
"`tax_identifier` must contain only digits")
expect_error(paddle_update_customer_business("ctm_01jwk0s510nxxv3gv8ky41e46a", "biz_01jx23b3fhk07ngxddazz0e9a1", status = "deleted"),
"`status` must be one of: active, archived")
expect_error(paddle_update_customer_business("ctm_01jwk0s510nxxv3gv8ky41e46a", "biz_01jx23b3fhk07ngxddazz0e9a1", contacts = list(list(name = "Jane"))),
"Each contact must include a valid `email` field")
#     contacts = list(list(name = "Jane Doe", email = "jane@example.com"))