Billing
Billing Portal
Get a Stripe billing portal URL for managing payment methods
curl -X POST https://api.ugc.inc/billing/portal \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"return_url": "https://myapp.com/settings"}'
import { UGCClient } from 'ugcinc';
const client = new UGCClient({ apiKey: 'YOUR_API_KEY' });
const response = await client.billing.getPortalUrl({
return_url: 'https://myapp.com/settings'
});
if (response.ok) {
window.location.href = response.data.url;
}
{
"ok": true,
"code": 200,
"message": "Success",
"data": {
"url": "https://billing.stripe.com/p/session/..."
}
}
⌘I
curl -X POST https://api.ugc.inc/billing/portal \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"return_url": "https://myapp.com/settings"}'
import { UGCClient } from 'ugcinc';
const client = new UGCClient({ apiKey: 'YOUR_API_KEY' });
const response = await client.billing.getPortalUrl({
return_url: 'https://myapp.com/settings'
});
if (response.ok) {
window.location.href = response.data.url;
}
{
"ok": true,
"code": 200,
"message": "Success",
"data": {
"url": "https://billing.stripe.com/p/session/..."
}
}
