Skip to main content
POST
Manage Payment Method
Base URL: https://api.nozle.app/engine/api/v1. Return the Stripe Billing Portal page where a customer adds or changes their payment method. Only Stripe customers have this page. Auth: secret key (sk_) with payment:write, or trusted internal auth. Publishable keys are always refused with 403. A customer-scoped credential reaches only its own customer.
Nozle stores no card data and never shows card details. The payment method lives at the payment provider, so this endpoint sends the customer there. Call it from your backend for the logged-in user or team, then redirect the browser to the returned url.

Request

string
required
External customer ID. The customer must already exist and be linked to a payment provider.
string
Where Stripe sends the customer when they leave the Billing Portal. It must be an absolute HTTPS URL on an allowlisted origin, the same list as checkout. If omitted, Nozle uses the organization’s default return URL. The body can be empty.

Response

Core’s body is returned unchanged:
string
required
Always stripe.
string
required
A Stripe Billing Portal URL. Redirect the customer to it.
string | null
When the page stops working, as an RFC 3339 UTC timestamp. null for Stripe Billing Portal sessions.

Razorpay customers

Razorpay customers have no payment method to manage here. They pay each invoice through a Razorpay payment link: when an invoice is finalized and no mandate charges it, Nozle emails the customer a payment request for that invoice with a Pay invoice button (the billing entity and the customer need an email address). The button always opens a current Razorpay payment link, also after an earlier link expired, and paying it marks the invoice paid. Dunning campaigns do not send a second request for such an invoice. For a Razorpay customer this endpoint answers 422 razorpay_pays_by_link and creates nothing at Razorpay.

Errors

The request is checked in this order: valid JSON body, return_url, then Core. For 422 errors the code is in error_details, for example {"code": "validation_errors", "error_details": {"base": ["razorpay_pays_by_link"]}}. Match on the code, never on the message text.

SDKs

The SDK methods return the inner manage_payment_method object. The idempotency option (idempotencyKey, idempotency_key, or key in Go) is optional. Send the same value when retrying the same request. See the Billing pages: Node, Python and Go.