Skip to content

Create a TopUp

POST
/apis/nodus.dev/v1/topups
curl --request POST \
--url https://example.com/apis/nodus.dev/v1/topups \
--header 'Content-Type: application/json' \
--data '{ "apiVersion": "example", "kind": "example", "metadata": { "annotations": { "additionalProperty": "example" }, "creationTimestamp": "example", "deletionGracePeriodSeconds": 1, "deletionTimestamp": "example", "finalizers": [ "example" ], "generateName": "example", "generation": 1, "labels": { "additionalProperty": "example" }, "managedFields": [ { "apiVersion": "example", "fieldsType": "example", "fieldsV1": { "additionalProperty": "example" }, "manager": "example", "operation": "example", "subresource": "example", "time": "example" } ], "name": "example", "namespace": "example", "ownerReferences": [ { "apiVersion": "example", "blockOwnerDeletion": true, "controller": true, "kind": "example", "name": "example", "uid": "example" } ], "resourceVersion": "example", "selfLink": "example", "uid": "example" }, "spec": { "amountUSD": "example", "cancelURL": "example", "origin": "example", "savePaymentMethod": true, "successURL": "example" }, "status": { "checkoutURL": "example", "conditions": [ { "lastTransitionTime": "example", "message": "example", "observedGeneration": 1, "reason": "example", "status": "example", "type": "example" } ], "creditedUSD": "example", "expirationTime": "example", "invoicePDFURL": "example", "paidTime": "example", "paymentIntent": "example", "paymentMethod": { "brand": "example", "last4": "example" }, "phase": "example", "reason": "example", "receiptURL": "example", "refundedUSD": "example", "transaction": "example" } }'
dryRun
string
fieldValidation
string
fieldManager
string
Idempotency-Key
string
If-Match
string
Media type application/json

TopUp is a prepaid credit purchase. Creating one opens a Stripe Checkout page (status.checkoutURL); the wallet is credited once Stripe confirms the payment, whatever the browser does. Auto-recharge and imported legacy purchases are TopUps too, created by Nodus. A TopUp is never updated or deleted: an unpaid checkout expires.

object
apiVersion
string
kind
string
metadata
object
annotations
object
key
additional properties
string
creationTimestamp
string
deletionGracePeriodSeconds
integer format: int64
deletionTimestamp
string
finalizers
Array<string>
nullable
generateName
string
generation
integer format: int64
labels
object
key
additional properties
string
managedFields
Array<object>
nullable
object
apiVersion
string
fieldsType
string
fieldsV1
object
key
additional properties
manager
string
operation
string
subresource
string
time
string
name
string
namespace
string
ownerReferences
Array<object>
nullable
object
apiVersion
required
string
blockOwnerDeletion
boolean
controller
boolean
kind
required
string
name
required
string
uid
required
string
resourceVersion
string
selfLink
string
uid
string
spec
required

TopUpSpec is the purchase.

object
amountUSD
required

AmountUSD is the credit to buy, from “5.00” to “1000.00” in whole cents.

string
cancelURL

CancelURL is where Checkout returns the browser when the customer leaves without paying.

string
origin

Origin is how the TopUp is paid; customers create Checkout TopUps only.

string
savePaymentMethod

SavePaymentMethod keeps the card for auto-recharge.

boolean
successURL

SuccessURL is where Checkout returns the browser after paying: the console or an http://127.0.0.1 page. It is used once, when the checkout opens, and reads back empty.

string
status

TopUpStatus is the payment’s progress.

object
checkoutURL

CheckoutURL is the Stripe Checkout page to pay on.

string
conditions

Conditions carry Paid and Credited.

Array<object>
nullable
object
lastTransitionTime
required
string
message
required
string
observedGeneration
integer format: int64
reason
required
string
status
required
string
type
required
string
creditedUSD

CreditedUSD is the credit the payment added to the wallet.

string
expirationTime

ExpirationTime is when the checkout page stops taking payment.

string
invoicePDFURL

InvoicePDFURL is the invoice as a PDF.

string
paidTime

PaidTime is when Stripe captured the payment.

string
paymentIntent

PaymentIntent is the Stripe payment, quoted when contacting support.

string
paymentMethod

TopUpPaymentMethod is the card that paid.

object
brand
required

Brand is the card network, such as visa.

string
last4
required

Last4 is the card number’s last four digits.

string
phase

Phase is Queued while the checkout is created, Running while it is open, Succeeded once paid and credited, and Failed when it expired or the payment failed.

string
reason

Reason qualifies the phase: PaymentPending while a bank payment settles, Expired or PaymentFailed once Failed.

string
receiptURL

ReceiptURL is the Stripe-hosted invoice page.

string
refundedUSD

RefundedUSD is the part of the credit refunded to the card.

string
transaction

Transaction is the ledger Transaction that credited the payment.

string
Example generated
{
"apiVersion": "example",
"kind": "example",
"metadata": {
"annotations": {
"additionalProperty": "example"
},
"creationTimestamp": "example",
"deletionGracePeriodSeconds": 1,
"deletionTimestamp": "example",
"finalizers": [
"example"
],
"generateName": "example",
"generation": 1,
"labels": {
"additionalProperty": "example"
},
"managedFields": [
{
"apiVersion": "example",
"fieldsType": "example",
"fieldsV1": {
"additionalProperty": "example"
},
"manager": "example",
"operation": "example",
"subresource": "example",
"time": "example"
}
],
"name": "example",
"namespace": "example",
"ownerReferences": [
{
"apiVersion": "example",
"blockOwnerDeletion": true,
"controller": true,
"kind": "example",
"name": "example",
"uid": "example"
}
],
"resourceVersion": "example",
"selfLink": "example",
"uid": "example"
},
"spec": {
"amountUSD": "example",
"cancelURL": "example",
"origin": "example",
"savePaymentMethod": true,
"successURL": "example"
},
"status": {
"checkoutURL": "example",
"conditions": [
{
"lastTransitionTime": "example",
"message": "example",
"observedGeneration": 1,
"reason": "example",
"status": "example",
"type": "example"
}
],
"creditedUSD": "example",
"expirationTime": "example",
"invoicePDFURL": "example",
"paidTime": "example",
"paymentIntent": "example",
"paymentMethod": {
"brand": "example",
"last4": "example"
},
"phase": "example",
"reason": "example",
"receiptURL": "example",
"refundedUSD": "example",
"transaction": "example"
}
}

OK

Media type application/json

TopUp is a prepaid credit purchase. Creating one opens a Stripe Checkout page (status.checkoutURL); the wallet is credited once Stripe confirms the payment, whatever the browser does. Auto-recharge and imported legacy purchases are TopUps too, created by Nodus. A TopUp is never updated or deleted: an unpaid checkout expires.

object
apiVersion
string
kind
string
metadata
object
annotations
object
key
additional properties
string
creationTimestamp
string
deletionGracePeriodSeconds
integer format: int64
deletionTimestamp
string
finalizers
Array<string>
nullable
generateName
string
generation
integer format: int64
labels
object
key
additional properties
string
managedFields
Array<object>
nullable
object
apiVersion
string
fieldsType
string
fieldsV1
object
key
additional properties
manager
string
operation
string
subresource
string
time
string
name
string
namespace
string
ownerReferences
Array<object>
nullable
object
apiVersion
required
string
blockOwnerDeletion
boolean
controller
boolean
kind
required
string
name
required
string
uid
required
string
resourceVersion
string
selfLink
string
uid
string
spec
required

TopUpSpec is the purchase.

object
amountUSD
required

AmountUSD is the credit to buy, from “5.00” to “1000.00” in whole cents.

string
cancelURL

CancelURL is where Checkout returns the browser when the customer leaves without paying.

string
origin

Origin is how the TopUp is paid; customers create Checkout TopUps only.

string
savePaymentMethod

SavePaymentMethod keeps the card for auto-recharge.

boolean
successURL

SuccessURL is where Checkout returns the browser after paying: the console or an http://127.0.0.1 page. It is used once, when the checkout opens, and reads back empty.

string
status

TopUpStatus is the payment’s progress.

object
checkoutURL

CheckoutURL is the Stripe Checkout page to pay on.

string
conditions

Conditions carry Paid and Credited.

Array<object>
nullable
object
lastTransitionTime
required
string
message
required
string
observedGeneration
integer format: int64
reason
required
string
status
required
string
type
required
string
creditedUSD

CreditedUSD is the credit the payment added to the wallet.

string
expirationTime

ExpirationTime is when the checkout page stops taking payment.

string
invoicePDFURL

InvoicePDFURL is the invoice as a PDF.

string
paidTime

PaidTime is when Stripe captured the payment.

string
paymentIntent

PaymentIntent is the Stripe payment, quoted when contacting support.

string
paymentMethod

TopUpPaymentMethod is the card that paid.

object
brand
required

Brand is the card network, such as visa.

string
last4
required

Last4 is the card number’s last four digits.

string
phase

Phase is Queued while the checkout is created, Running while it is open, Succeeded once paid and credited, and Failed when it expired or the payment failed.

string
reason

Reason qualifies the phase: PaymentPending while a bank payment settles, Expired or PaymentFailed once Failed.

string
receiptURL

ReceiptURL is the Stripe-hosted invoice page.

string
refundedUSD

RefundedUSD is the part of the credit refunded to the card.

string
transaction

Transaction is the ledger Transaction that credited the payment.

string
Example generated
{
"apiVersion": "example",
"kind": "example",
"metadata": {
"annotations": {
"additionalProperty": "example"
},
"creationTimestamp": "example",
"deletionGracePeriodSeconds": 1,
"deletionTimestamp": "example",
"finalizers": [
"example"
],
"generateName": "example",
"generation": 1,
"labels": {
"additionalProperty": "example"
},
"managedFields": [
{
"apiVersion": "example",
"fieldsType": "example",
"fieldsV1": {
"additionalProperty": "example"
},
"manager": "example",
"operation": "example",
"subresource": "example",
"time": "example"
}
],
"name": "example",
"namespace": "example",
"ownerReferences": [
{
"apiVersion": "example",
"blockOwnerDeletion": true,
"controller": true,
"kind": "example",
"name": "example",
"uid": "example"
}
],
"resourceVersion": "example",
"selfLink": "example",
"uid": "example"
},
"spec": {
"amountUSD": "example",
"cancelURL": "example",
"origin": "example",
"savePaymentMethod": true,
"successURL": "example"
},
"status": {
"checkoutURL": "example",
"conditions": [
{
"lastTransitionTime": "example",
"message": "example",
"observedGeneration": 1,
"reason": "example",
"status": "example",
"type": "example"
}
],
"creditedUSD": "example",
"expirationTime": "example",
"invoicePDFURL": "example",
"paidTime": "example",
"paymentIntent": "example",
"paymentMethod": {
"brand": "example",
"last4": "example"
},
"phase": "example",
"reason": "example",
"receiptURL": "example",
"refundedUSD": "example",
"transaction": "example"
}
}

An error: a metav1.Status whose reason is a registered code.

Media type application/json

Status is the error body of every API response: a Kubernetes metav1.Status (so kubectl and client-go understand it) plus three top-level extensions that those clients ignore (ADR-028).

object
apiVersion
string
code
integer format: int32
details
object
causes
Array<object>
nullable
object
field
string
message
string
reason
string
group
string
kind
string
name
string
retryAfterSeconds
integer format: int32
uid
string
docs

Docs is the URL of the code’s docs page.

string
fix

Fix says what to do next, for example a CLI command or the field to change.

string
kind
string
message
string
metadata
object
continue
string
remainingItemCount
integer format: int64
resourceVersion
string
selfLink
string
shardInfo
object
selector
required
string
reason
string
requestId

RequestID identifies the request in logs and support tickets.

string
status
string
Example generated
{
"apiVersion": "example",
"code": 1,
"details": {
"causes": [
{
"field": "example",
"message": "example",
"reason": "example"
}
],
"group": "example",
"kind": "example",
"name": "example",
"retryAfterSeconds": 1,
"uid": "example"
},
"docs": "example",
"fix": "example",
"kind": "example",
"message": "example",
"metadata": {
"continue": "example",
"remainingItemCount": 1,
"resourceVersion": "example",
"selfLink": "example",
"shardInfo": {
"selector": "example"
}
},
"reason": "example",
"requestId": "example",
"status": "example"
}