Billing
A software platform for a robot labor force.
Plans
The API provides endpoints to list all available subscription and one-time purchase plans.
Plan Types
Plans are categorized by their billing model:
| Type | Description |
|---|---|
one_time | A one-time purchase plan |
recurring | A subscription plan with recurring billing |
When the plan type is recurring, it indicates a subscription plan that bills on a recurring basis.
Endpoints
GET /v1/plans- List all available plans
Payment Methods
Users can manage their saved payment methods (cards) through the API. Payment methods are stored and managed via Stripe.
Endpoints
| Method | Endpoint | Description |
|---|---|---|
GET | /v1/me/payment-methods | List all saved payment methods for the authenticated user |
POST | /v1/me/payment-methods | Add a new payment method via Stripe Checkout |
Listing Payment Methods
Returns a paginated list of saved cards. Supports pagination with limit (default 10, max 100) and cursor parameters.
Adding a Payment Method
Creates a Stripe Setup Session and returns a hosted URL where the user can securely enter their card details. Redirect the user to the returned URL to complete the payment method registration.
Orders
Users can purchase plans and manage their order history through the wallet API.
Endpoints
| Method | Endpoint | Description |
|---|---|---|
GET | /v1/me/wallet/orders | List order history for the authenticated user |
POST | /v1/me/wallet/orders | Create a new order to purchase a plan |
POST | /v1/me/wallet/orders/{order_id}/refund | Refund a specific order |
Creating an Order
Create a new order to purchase a plan. The request requires:
| Field | Type | Required | Description |
|---|---|---|---|
payment_method_id | string | Yes | The ID of the saved payment method |
plan_id | string | Yes | The ID of the plan to purchase |
amount | int64 | No | Custom amount (if applicable) |
idempotency_key | string | Yes | Unique key to prevent duplicate orders |
Listing Orders
Returns a paginated list of orders with the following fields:
| Field | Type | Description |
|---|---|---|
id | string | Order ID |
plan_id | string | The plan purchased |
status | string | Order status |
currency | string | Currency code |
amount | int64 | Order amount |
is_refundable | bool | Whether the order can be refunded |
Supports pagination with limit (default 20) and after_public_id cursor, plus sorting with order_by_asc or order_by_desc.
Refunding an Order
An order can only be refunded if is_refundable is true. Send a POST request to /v1/me/wallet/orders/{order_id}/refund to process the refund.
Subscriptions
Users can view and manage their active subscriptions for recurring (subscription) plans.
Endpoints
| Method | Endpoint | Description |
|---|---|---|
GET | /v1/me/wallet/subscriptions | List all subscriptions for the authenticated user |
DELETE | /v1/me/wallet/subscriptions/{subscription_id} | Cancel a specific subscription |
Listing Subscriptions
Returns a list of all subscriptions associated with the authenticated user.
Canceling a Subscription
Cancels an active subscription. Requires the subscription ID path parameter.
How is this guide?