Create top-up
This endpoint allows you to create a new top-up for a specified customer's balance. While this top-up is active, the customer's balance will added in increments of the specified amount whenever the balance reaches the specified threshold.
If a top-up already exists for this customer in the same currency, the existing top-up will be replaced.
Path Parameters
Request Body required
The currency or custom pricing unit to use for this top-up. If this is a real-world currency, it must match the customer's invoicing currency.
The threshold at which to trigger the top-up. If the balance is at or below this threshold, the top-up will be triggered.
The amount to increment when the threshold is reached.
How much, in the customer's currency, to charge for each unit.
invoice_settings object
Whether the credits purchase invoice should auto collect with the customer's saved payment method.
The net terms determines the difference between the invoice date and the issue date for the invoice. If you intend the invoice to be due on issue, set this to 0.
An optional memo to display on the invoice.
Default value: false
If true, new credit blocks created by this top-up will require that the corresponding invoice is paid before they can be drawn down from.
The number of days or months after which the top-up expires. If unspecified, it does not expire.
Possible values: [day
, month
]
The unit of expires_after.
- 201
- 400
- 401
- 404
- 409
- 413
- 429
- 500
Created
Response Headers
Schema
The currency or custom pricing unit to use for this top-up. If this is a real-world currency, it must match the customer's invoicing currency.
The threshold at which to trigger the top-up. If the balance is at or below this threshold, the top-up will be triggered.
The amount to increment when the threshold is reached.
How much, in the customer's currency, to charge for each unit.
invoice_settings object
Whether the credits purchase invoice should auto collect with the customer's saved payment method.
The net terms determines the difference between the invoice date and the issue date for the invoice. If you intend the invoice to be due on issue, set this to 0.
An optional memo to display on the invoice.
Default value: false
If true, new credit blocks created by this top-up will require that the corresponding invoice is paid before they can be drawn down from.
The number of days or months after which the top-up expires. If unspecified, it does not expire.
Possible values: [day
, month
]
The unit of expires_after.
{
"id": "string",
"currency": "string",
"threshold": "string",
"amount": "string",
"per_unit_cost_basis": "string",
"invoice_settings": {
"auto_collection": true,
"net_terms": 0,
"memo": "string",
"require_successful_payment": false
},
"expires_after": 0,
"expires_after_unit": "day"
}
Bad Request
Response Headers
Schema
Possible values: [https://docs.withorb.com/reference/error-responses#400-constraint-violation
]
Possible values: [400
]
Possible values: [https://docs.withorb.com/reference/error-responses#400-duplicate-resource-creation
]
Possible values: [400
]
Possible values: [https://docs.withorb.com/reference/error-responses#400-request-validation-errors
]
Possible values: [400
]
{}
Unauthorized
Response Headers
Schema
Possible values: [https://docs.withorb.com/reference/error-responses#401-authentication-error
]
Possible values: [401
]
{
"type": "https://docs.withorb.com/reference/error-responses#401-authentication-error",
"status": 401,
"detail": "string",
"title": "string"
}
Not Found
Response Headers
Schema
Possible values: [https://docs.withorb.com/reference/error-responses#404-feature-not-available
]
Possible values: [400
]
Possible values: [https://docs.withorb.com/reference/error-responses#404-resource-not-found
]
Possible values: [404
]
Possible values: [https://docs.withorb.com/reference/error-responses#404-url-not-found
]
Possible values: [404
]
{}
Conflict
Response Headers
Schema
Possible values: [https://docs.withorb.com/reference/error-responses#409-resource-conflict
]
Possible values: [409
]
{
"type": "https://docs.withorb.com/reference/error-responses#409-resource-conflict",
"status": 409,
"detail": "string",
"title": "string"
}
Request Entity Too Large
Response Headers
Schema
Possible values: [https://docs.withorb.com/reference/error-responses#413-request-too-large
]
Possible values: [413
]
Possible values: [https://docs.withorb.com/reference/error-responses#413-resource-too-large
]
Possible values: [413
]
Possible values: [https://docs.withorb.com/reference/error-responses#413-too-many-results
]
Possible values: [413
]
{}
Too Many Requests
Response Headers
Schema
Possible values: [https://docs.withorb.com/reference/error-responses#429-too-many-requests
]
Possible values: [429
]
{
"type": "https://docs.withorb.com/reference/error-responses#429-too-many-requests",
"status": 429,
"detail": "string",
"title": "string"
}
Internal Server Error
Response Headers
Schema
Possible values: [https://docs.withorb.com/reference/error-responses#500-internal-server-error
]
{
"type": "https://docs.withorb.com/reference/error-responses#500-internal-server-error",
"status": 0,
"detail": "string",
"title": "string"
}