Set automatic top-up
Charges a saved card when balance falls below amount / 10. Amount is micro-USD, at least 10000000 and whole cents; null turns auto top-up off. Omit cardId to use the default card.
PUT
/
billing
/
auto-top-up
Set automatic top-up
curl --request PUT \
--url https://api.streamloop.app/v1/billing/auto-top-up \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"amount": 123,
"cardId": "<string>"
}
'import requests
url = "https://api.streamloop.app/v1/billing/auto-top-up"
payload = {
"amount": 123,
"cardId": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({amount: 123, cardId: '<string>'})
};
fetch('https://api.streamloop.app/v1/billing/auto-top-up', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"userErrors": [
{
"code": "<string>",
"message": "<string>",
"field": "<string>"
}
],
"account": {
"balance": 123,
"catalog": {
"isDefault": true,
"version": "<string>"
},
"creditLimit": 123,
"headroom": 123,
"id": "<string>",
"standing": "OK",
"subscriptionEngine": "INTERNAL",
"uncoveredPerHour": 123,
"autoTopUp": {
"amount": 123,
"cardId": "<string>",
"threshold": 123
},
"catalogVersionUntil": "2023-11-07T05:31:56Z",
"defaultCard": {
"brand": "<string>",
"expMonth": 123,
"expYear": 123,
"id": "<string>",
"isDefault": true,
"last4": "<string>",
"rail": "STRIPE",
"status": "ACTIVE"
},
"plan": {
"cancelAtPeriodEnd": true,
"lines": [
{
"product": {
"key": "<string>",
"price": 123,
"term": "MONTHLY"
},
"quantity": 123,
"quantityAtRenewal": 123,
"total": 123,
"unitPrice": 123
}
],
"monthlyTotal": 123,
"renewalTotal": 123,
"status": "TRIALING",
"term": "MONTHLY",
"renewsAt": "2023-11-07T05:31:56Z",
"trialEndsAt": "2023-11-07T05:31:56Z"
},
"spendCap": 123
},
"card": {
"brand": "<string>",
"expMonth": 123,
"expYear": 123,
"id": "<string>",
"isDefault": true,
"last4": "<string>",
"rail": "STRIPE",
"status": "ACTIVE"
}
}{
"code": "<string>",
"detail": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>"
}{
"code": "<string>",
"detail": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>"
}{
"code": "<string>",
"detail": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>"
}{
"code": "<string>",
"detail": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>"
}{
"code": "<string>",
"detail": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>"
}{
"code": "<string>",
"detail": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>"
}{
"code": "<string>",
"detail": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>"
}{
"code": "<string>",
"detail": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>"
}Authorizations
oauth2bearerAuthapiKey
Headers
Workspace this request operates in — the workspace id (wksp_…) or the organization id, from GET /workspaces. Required with an API key, which carries no workspace (400 WORKSPACE_REQUIRED without it). With an OAuth token it defaults to the workspace the token was issued for. Responds 403 WORKSPACE_FORBIDDEN when the caller is not a current member, rather than falling back to another workspace.
⌘I
Set automatic top-up
curl --request PUT \
--url https://api.streamloop.app/v1/billing/auto-top-up \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"amount": 123,
"cardId": "<string>"
}
'import requests
url = "https://api.streamloop.app/v1/billing/auto-top-up"
payload = {
"amount": 123,
"cardId": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({amount: 123, cardId: '<string>'})
};
fetch('https://api.streamloop.app/v1/billing/auto-top-up', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"userErrors": [
{
"code": "<string>",
"message": "<string>",
"field": "<string>"
}
],
"account": {
"balance": 123,
"catalog": {
"isDefault": true,
"version": "<string>"
},
"creditLimit": 123,
"headroom": 123,
"id": "<string>",
"standing": "OK",
"subscriptionEngine": "INTERNAL",
"uncoveredPerHour": 123,
"autoTopUp": {
"amount": 123,
"cardId": "<string>",
"threshold": 123
},
"catalogVersionUntil": "2023-11-07T05:31:56Z",
"defaultCard": {
"brand": "<string>",
"expMonth": 123,
"expYear": 123,
"id": "<string>",
"isDefault": true,
"last4": "<string>",
"rail": "STRIPE",
"status": "ACTIVE"
},
"plan": {
"cancelAtPeriodEnd": true,
"lines": [
{
"product": {
"key": "<string>",
"price": 123,
"term": "MONTHLY"
},
"quantity": 123,
"quantityAtRenewal": 123,
"total": 123,
"unitPrice": 123
}
],
"monthlyTotal": 123,
"renewalTotal": 123,
"status": "TRIALING",
"term": "MONTHLY",
"renewsAt": "2023-11-07T05:31:56Z",
"trialEndsAt": "2023-11-07T05:31:56Z"
},
"spendCap": 123
},
"card": {
"brand": "<string>",
"expMonth": 123,
"expYear": 123,
"id": "<string>",
"isDefault": true,
"last4": "<string>",
"rail": "STRIPE",
"status": "ACTIVE"
}
}{
"code": "<string>",
"detail": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>"
}{
"code": "<string>",
"detail": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>"
}{
"code": "<string>",
"detail": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>"
}{
"code": "<string>",
"detail": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>"
}{
"code": "<string>",
"detail": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>"
}{
"code": "<string>",
"detail": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>"
}{
"code": "<string>",
"detail": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>"
}{
"code": "<string>",
"detail": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>"
}