Billing
Get available plans
Retrieves the plans a store can subscribe to.
Authorization: APIKey TOKEN.Show fieldsHide fields
Failed requests return a PayNowError body. See the error response guide.
curl -X GET "https://api.paynow.gg/v1/stores/{storeId}/billing/plans" \
-H "Authorization: APIKey TOKEN"import { createManagementClient } from "@paynow-gg/typescript-sdk";
const paynow = createManagementClient({
apiKey: "API_KEY",
storeId: "STORE_ID",
});
const result = await paynow.billing.getPublicPlans();import requests
headers = {"Authorization": "APIKey TOKEN"}
response = requests.get("https://api.paynow.gg/v1/stores/{storeId}/billing/plans", headers=headers)[
{
"id": "string",
"is_custom": true,
"name": "string",
"platform_fee_rate": 0,
"subscription_price_monthly": 0,
"description": "string",
"inherits_from_plan_id": "string",
"subscription_price_annually": 0
}
]Change subscription plan
Moves the store onto a different plan. When the change needs paying for, the response carries a 'session_url' the store owner must complete.
Authorization: APIKey TOKEN.monthlyThe subscription renews every month.
annuallyThe subscription renews every year.
Show fieldsHide fields
Failed requests return a PayNowError body. See the error response guide.
curl -X POST "https://api.paynow.gg/v1/stores/{storeId}/billing/plans/change" \
-H "Authorization: APIKey TOKEN" \
-H "Content-Type: application/json" \
-d '{
"plan_id": "string",
"renewal_period": "monthly"
}'import { createManagementClient } from "@paynow-gg/typescript-sdk";
const paynow = createManagementClient({
apiKey: "API_KEY",
storeId: "STORE_ID",
});
const result = await paynow.billing.changeSubscriptionPlan({
plan_id: "string",
renewal_period: "monthly",
});import requests
headers = {"Authorization": "APIKey TOKEN"}
payload = {
"plan_id": "string",
"renewal_period": "monthly",
}
response = requests.post("https://api.paynow.gg/v1/stores/{storeId}/billing/plans/change", headers=headers, json=payload){
"requires_payment": true,
"session_url": "string"
}Continue current subscription
Cancels a pending downgrade or cancellation, keeping the store on its current plan.
Authorization: APIKey TOKEN.curl -X POST "https://api.paynow.gg/v1/stores/{storeId}/billing/plans/continue" \
-H "Authorization: APIKey TOKEN"import { createManagementClient } from "@paynow-gg/typescript-sdk";
const paynow = createManagementClient({
apiKey: "API_KEY",
storeId: "STORE_ID",
});
await paynow.billing.continueCurrentSubscription();import requests
headers = {"Authorization": "APIKey TOKEN"}
response = requests.post("https://api.paynow.gg/v1/stores/{storeId}/billing/plans/continue", headers=headers)Change subscription payment method
Starts a session for the store owner to replace the card the subscription is billed to.
Authorization: APIKey TOKEN.Show fieldsHide fields
Failed requests return a PayNowError body. See the error response guide.
curl -X POST "https://api.paynow.gg/v1/stores/{storeId}/billing/payment-method/change" \
-H "Authorization: APIKey TOKEN"import { createManagementClient } from "@paynow-gg/typescript-sdk";
const paynow = createManagementClient({
apiKey: "API_KEY",
storeId: "STORE_ID",
});
const result = await paynow.billing.changeSubscriptionPaymentMethod();import requests
headers = {"Authorization": "APIKey TOKEN"}
response = requests.post("https://api.paynow.gg/v1/stores/{storeId}/billing/payment-method/change", headers=headers){
"requires_payment": true,
"session_url": "string"
}Get billing details
Retrieves the billing address and tax details the store is invoiced under.
Authorization: APIKey TOKEN.Show fieldsHide fields
Failed requests return a PayNowError body. See the error response guide.
curl -X GET "https://api.paynow.gg/v1/stores/{storeId}/billing/details" \
-H "Authorization: APIKey TOKEN"import { createManagementClient } from "@paynow-gg/typescript-sdk";
const paynow = createManagementClient({
apiKey: "API_KEY",
storeId: "STORE_ID",
});
const result = await paynow.billing.getStoreBillingDetails();import requests
headers = {"Authorization": "APIKey TOKEN"}
response = requests.get("https://api.paynow.gg/v1/stores/{storeId}/billing/details", headers=headers){
"city": "string",
"country": "string",
"line_1": "string",
"line_2": "string",
"postal_code": "string",
"state": "string",
"tax_id": "string"
}Update billing details
Replaces the billing address and tax details the store is invoiced under.
Authorization: APIKey TOKEN.curl -X PUT "https://api.paynow.gg/v1/stores/{storeId}/billing/details" \
-H "Authorization: APIKey TOKEN" \
-H "Content-Type: application/json" \
-d '{
"city": "string",
"country": "string",
"line_1": "string",
"line_2": "string",
"postal_code": "string",
"state": "string",
"tax_id": "string"
}'import { createManagementClient } from "@paynow-gg/typescript-sdk";
const paynow = createManagementClient({
apiKey: "API_KEY",
storeId: "STORE_ID",
});
await paynow.billing.updateStoreBillingDetails({
city: "string",
country: "string",
line_1: "string",
line_2: "string",
postal_code: "string",
state: "string",
tax_id: "string",
});import requests
headers = {"Authorization": "APIKey TOKEN"}
payload = {
"city": "string",
"country": "string",
"line_1": "string",
"line_2": "string",
"postal_code": "string",
"state": "string",
"tax_id": "string",
}
response = requests.put("https://api.paynow.gg/v1/stores/{storeId}/billing/details", headers=headers, json=payload)Get subscription invoices
Retrieves the invoices raised against the store's own subscription.
Authorization: APIKey TOKEN.Show fieldsHide fields
Failed requests return a PayNowError body. See the error response guide.
curl -X GET "https://api.paynow.gg/v1/stores/{storeId}/billing/invoices" \
-H "Authorization: APIKey TOKEN"import { createManagementClient } from "@paynow-gg/typescript-sdk";
const paynow = createManagementClient({
apiKey: "API_KEY",
storeId: "STORE_ID",
});
const result = await paynow.billing.getStoreInvoices();import requests
headers = {"Authorization": "APIKey TOKEN"}
response = requests.get("https://api.paynow.gg/v1/stores/{storeId}/billing/invoices", headers=headers)[
{
"id": "411486491630370816",
"created_at": "2024-01-01T00:00:00Z",
"currency": "string",
"description": "string",
"gateway": "string",
"gateway_invoice_id": "string",
"invoice_url": "string",
"is_paid": true,
"plan_pricing_id": "411486491630370816",
"subscription_id": "411486491630370816",
"total": 0,
"updated_at": "2024-01-01T00:00:00Z"
}
]Get invoice URL
Issues a fresh link to the hosted invoice. Prefer this over the 'invoice_url' carried by the invoice list, which is recorded once and may have expired.
Authorization: APIKey TOKEN.Show fieldsHide fields
Failed requests return a PayNowError body. See the error response guide.
curl -X GET "https://api.paynow.gg/v1/stores/{storeId}/billing/invoices/{invoiceId}/url" \
-H "Authorization: APIKey TOKEN"import { createManagementClient } from "@paynow-gg/typescript-sdk";
const paynow = createManagementClient({
apiKey: "API_KEY",
storeId: "STORE_ID",
});
const result = await paynow.billing.getStoreInvoiceUrl("411486491630370816");import requests
headers = {"Authorization": "APIKey TOKEN"}
response = requests.get("https://api.paynow.gg/v1/stores/{storeId}/billing/invoices/{invoiceId}/url", headers=headers){
"url": "string"
}Get billing status
Retrieves the store's plan, limits, feature flags and subscription state.
Authorization: APIKey TOKEN.Show fieldsHide fields
alertsStoreAlertDto[]Required
infowarningaction_requiredresolved
otherexcessive_chargeback_ratekyc_requiredbusiness_details_requiredincreased_fraud_rateunsupported_productproduct_compliance_checkintegration_issuestorefront_compliancesupport_inquiryfeature_eligibilityfeature_enrolled
planPlanDtoRequired
plan_pricingPlanPricingDtoRequired
payment_methodSubscriptionPaymentMethodDtoOptionalRepresents the payment method a store's subscription is billed to.
subscriptionStoreSubscriptionDtoOptional
incompletetrialingactiverequires_actioncanceled
Failed requests return a PayNowError body. See the error response guide.
curl -X GET "https://api.paynow.gg/v1/stores/{storeId}/billing/status" \
-H "Authorization: APIKey TOKEN"import { createManagementClient } from "@paynow-gg/typescript-sdk";
const paynow = createManagementClient({
apiKey: "API_KEY",
storeId: "STORE_ID",
});
const result = await paynow.billing.getStoreBillingStatus();import requests
headers = {"Authorization": "APIKey TOKEN"}
response = requests.get("https://api.paynow.gg/v1/stores/{storeId}/billing/status", headers=headers){
"alerts": [
{
"id": "411486491630370816",
"admin_visible": true,
"created_at": "2024-01-01T00:00:00Z",
"metadata": {},
"status": "info",
"store_id": "411486491630370816",
"store_visible": true,
"type": "other",
"action_link": "string",
"action_required_at": "2024-01-01T00:00:00Z",
"custom_message": "string",
"custom_title": "string",
"entity_id": "411486491630370816",
"expires_at": "2024-01-01T00:00:00Z",
"resolved_at": "2024-01-01T00:00:00Z",
"resolved_by": "411486491630370816",
"updated_at": "2024-01-01T00:00:00Z"
}
],
"feature_flags": [
"string"
],
"is_locked": true,
"no_billing_details": true,
"plan": {
"id": "string",
"is_custom": true,
"name": "string",
"description": "string"
},
"plan_limits": {},
"plan_pricing": {
"id": "411486491630370816",
"begins_at": "2024-01-01T00:00:00Z",
"plan_id": "string",
"platform_fee_rate": 0,
"subscription_price_monthly": 0,
"ends_at": "2024-01-01T00:00:00Z",
"subscription_price_annually": 0
},
"revenue_usage": 0,
"store_id": "411486491630370816",
"lock_reason": "string",
"payment_method": {
"id": "string",
"type": "string",
"card_brand": "string",
"card_exp_month": 0,
"card_exp_year": 0,
"card_last4": "string"
},
"subscription": {
"id": "411486491630370816",
"cancel_at_period_end": true,
"created_at": "2024-01-01T00:00:00Z",
"currency": "string",
"current_period_end": "2024-01-01T00:00:00Z",
"current_period_start": "2024-01-01T00:00:00Z",
"gateway": "string",
"gateway_checkout_id": "string",
"gateway_payment_method_id": "string",
"gateway_subscription_id": "string",
"plan_id": "string",
"status": "incomplete",
"store_id": "411486491630370816",
"cancel_at": "2024-01-01T00:00:00Z",
"downgrade_period_end_plan_id": "string",
"ended_at": "2024-01-01T00:00:00Z",
"updated_at": "2024-01-01T00:00:00Z"
}
}