Tier Groups
Get customer tier groups
Retrieves tier group state for a logged in customer. Returns an empty array if not logged in.
Authorization: Customer TOKEN.Show fieldsHide fields
Failed requests return a PayNowError body. See the error response guide.
curl -X GET "https://api.paynow.gg/v1/store/tier-groups" \
-H "Authorization: Customer TOKEN"import { createStorefrontClient } from "@paynow-gg/typescript-sdk";
const paynow = createStorefrontClient({
storeId: "STORE_ID",
customerToken: "CUSTOMER_TOKEN",
});
const result = await paynow.tierGroups.getCustomerTierGroups();import requests
headers = {"Authorization": "Customer TOKEN"}
response = requests.get("https://api.paynow.gg/v1/store/tier-groups", headers=headers)[
{
"active_product_id": "411486491630370816",
"currency": "string",
"next_billing_amount": 0,
"next_billing_presentment_amount": 0,
"next_renewal_at": "2024-01-01T00:00:00Z",
"presentment_currency": "string",
"tier_group_id": "411486491630370816",
"pending_change_product_id": "411486491630370816"
}
]Update subscription tier group
Upgrades or downgrades an existing subscription tier group. The customer must have an active subscription within this tier group.
Authorization: Customer TOKEN.Show fieldsHide fields
subscription_changeSubscriptionChangeDtoRequiredA pending or applied change to a subscription.
linesSubscriptionChangeLineDto[]RequiredA single line item within a subscription change.
next_billing_amountSubscriptionChangeAmountDtoRequiredPricing breakdown for a subscription change, in the smallest units of the given currency (e.g. cents).
next_billing_presentment_amountSubscriptionChangeAmountDtoRequiredPricing breakdown for a subscription change, in the smallest units of the given currency (e.g. cents).
prorated_amountSubscriptionChangeProratedAmountDtoRequiredThe total prorated charge for a subscription change, expressed in both settlement and presentment currencies.
invalidimmediateSubscription will be updated instantly, and a proration charge will be applied.
next_billing_periodSubscription will be updated at the end of the billing period, no proration will be applied.
noneNo proration is applied, subscription is updated instantly.
invalidpending_paymentThe change is pending payment before it can be applied.
pending_renewalThe change will be applied at the next renewal.
appliedThe change has been applied to the subscription.
canceledThe change was canceled and will not be applied.
pending_verificationThe change requires a verification code sent to the customer's e-mail.
pending_paymentCheckoutPaymentInfoDtoOptionalPayment outcome information returned after a subscription change triggers an immediate charge.
Failed requests return a PayNowError body. See the error response guide.
curl -X POST "https://api.paynow.gg/v1/store/tier-groups/{id}/change" \
-H "Authorization: Customer TOKEN" \
-H "Content-Type: application/json" \
-d '{
"target_product_id": "411486491630370816",
"verification_code": "string"
}'import { createStorefrontClient } from "@paynow-gg/typescript-sdk";
const paynow = createStorefrontClient({
storeId: "STORE_ID",
customerToken: "CUSTOMER_TOKEN",
});
const result = await paynow.tierGroups.updateSubscriptionTierGroup("411486491630370816", {
target_product_id: "411486491630370816",
verification_code: "string",
});import requests
headers = {"Authorization": "Customer TOKEN"}
payload = {
"target_product_id": "411486491630370816",
"verification_code": "string",
}
response = requests.post("https://api.paynow.gg/v1/store/tier-groups/{id}/change", headers=headers, json=payload){
"subscription_change": {
"created_at": "2024-01-01T00:00:00Z",
"id": "411486491630370816",
"lines": [
{
"amount": {
"currency": "string",
"discount": 0,
"subtotal": 0,
"tax": 0,
"total": 0
},
"id": "411486491630370816",
"is_deleted": true,
"presentment_amount": {
"currency": "string",
"discount": 0,
"subtotal": 0,
"tax": 0,
"total": 0
},
"price": 0,
"product": {
"custom_variables": {},
"id": "411486491630370816",
"name": "string",
"version_id": "411486491630370816",
"image_url": "string",
"selected_gameserver_id": "411486491630370816",
"pricing_region_id": "string"
},
"prorated_amount": 0,
"prorated_presentment_amount": 0,
"remaining_minutes": 0,
"tax_inclusive": true,
"total_minutes": 0,
"subscription_line_id": "411486491630370816"
}
],
"next_billing_amount": {
"currency": "string",
"discount": 0,
"subtotal": 0,
"tax": 0,
"total": 0
},
"next_billing_presentment_amount": {
"currency": "string",
"discount": 0,
"subtotal": 0,
"tax": 0,
"total": 0
},
"off_session": true,
"prorated_amount": {
"currency": "string",
"presentment_currency": "string",
"presentment_prorated_amount": 0,
"prorated_amount": 0
},
"proration_behavior": "invalid",
"status": "invalid",
"subscription_id": "411486491630370816",
"prorated_order_id": "411486491630370816",
"applied_at": "2024-01-01T00:00:00Z"
},
"pending_payment": {
"declined": true,
"status": "string",
"decline_message": "string",
"checkout_url": "string"
}
}Preview update subscription tier group
Previews an upgrade or a downgrade an existing subscription tier group. The customer must have an active subscription within this tier group.
Authorization: Customer TOKEN.Show fieldsHide fields
subscription_changeSubscriptionChangeDtoRequiredA pending or applied change to a subscription.
linesSubscriptionChangeLineDto[]RequiredA single line item within a subscription change.
next_billing_amountSubscriptionChangeAmountDtoRequiredPricing breakdown for a subscription change, in the smallest units of the given currency (e.g. cents).
next_billing_presentment_amountSubscriptionChangeAmountDtoRequiredPricing breakdown for a subscription change, in the smallest units of the given currency (e.g. cents).
prorated_amountSubscriptionChangeProratedAmountDtoRequiredThe total prorated charge for a subscription change, expressed in both settlement and presentment currencies.
invalidimmediateSubscription will be updated instantly, and a proration charge will be applied.
next_billing_periodSubscription will be updated at the end of the billing period, no proration will be applied.
noneNo proration is applied, subscription is updated instantly.
invalidpending_paymentThe change is pending payment before it can be applied.
pending_renewalThe change will be applied at the next renewal.
appliedThe change has been applied to the subscription.
canceledThe change was canceled and will not be applied.
pending_verificationThe change requires a verification code sent to the customer's e-mail.
pending_paymentCheckoutPaymentInfoDtoOptionalPayment outcome information returned after a subscription change triggers an immediate charge.
Failed requests return a PayNowError body. See the error response guide.
curl -X POST "https://api.paynow.gg/v1/store/tier-groups/{id}/change/preview" \
-H "Authorization: Customer TOKEN" \
-H "Content-Type: application/json" \
-d '{
"target_product_id": "411486491630370816",
"verification_code": "string"
}'import { createStorefrontClient } from "@paynow-gg/typescript-sdk";
const paynow = createStorefrontClient({
storeId: "STORE_ID",
customerToken: "CUSTOMER_TOKEN",
});
const result = await paynow.tierGroups.updateSubscriptionTierGroupPreview("411486491630370816", {
target_product_id: "411486491630370816",
verification_code: "string",
});import requests
headers = {"Authorization": "Customer TOKEN"}
payload = {
"target_product_id": "411486491630370816",
"verification_code": "string",
}
response = requests.post("https://api.paynow.gg/v1/store/tier-groups/{id}/change/preview", headers=headers, json=payload){
"subscription_change": {
"created_at": "2024-01-01T00:00:00Z",
"id": "411486491630370816",
"lines": [
{
"amount": {
"currency": "string",
"discount": 0,
"subtotal": 0,
"tax": 0,
"total": 0
},
"id": "411486491630370816",
"is_deleted": true,
"presentment_amount": {
"currency": "string",
"discount": 0,
"subtotal": 0,
"tax": 0,
"total": 0
},
"price": 0,
"product": {
"custom_variables": {},
"id": "411486491630370816",
"name": "string",
"version_id": "411486491630370816",
"image_url": "string",
"selected_gameserver_id": "411486491630370816",
"pricing_region_id": "string"
},
"prorated_amount": 0,
"prorated_presentment_amount": 0,
"remaining_minutes": 0,
"tax_inclusive": true,
"total_minutes": 0,
"subscription_line_id": "411486491630370816"
}
],
"next_billing_amount": {
"currency": "string",
"discount": 0,
"subtotal": 0,
"tax": 0,
"total": 0
},
"next_billing_presentment_amount": {
"currency": "string",
"discount": 0,
"subtotal": 0,
"tax": 0,
"total": 0
},
"off_session": true,
"prorated_amount": {
"currency": "string",
"presentment_currency": "string",
"presentment_prorated_amount": 0,
"prorated_amount": 0
},
"proration_behavior": "invalid",
"status": "invalid",
"subscription_id": "411486491630370816",
"prorated_order_id": "411486491630370816",
"applied_at": "2024-01-01T00:00:00Z"
},
"pending_payment": {
"declined": true,
"status": "string",
"decline_message": "string",
"checkout_url": "string"
}
}