POST /api/v1/internal/projects/:projectUuid/apps/:projectAppUuid/tenants/:tenantUuid/one-time-payments
Creates a new one time payments resource.
This endpoint documentation is generated from the current Fastify route implementation and should be treated as the implementation-level contract for this version of the API.
Source route file:
src/api/routes/internal/private/bearer/projects/apps/tenants/one-time-payments/post.ts
Request Method
POST
Base URL
https://api.userdocks.local:5000
Endpoint
/api/v1/internal/projects/:projectUuid/apps/:projectAppUuid/tenants/:tenantUuid/one-time-payments
Path Variables
| Variable | Type | Required | Description |
|---|---|---|---|
projectUuid | string | true | Path variable from route pattern. |
projectAppUuid | string | true | Path variable from route pattern. |
tenantUuid | string | true | Path variable from route pattern. |
Query Parameters
No query parameters.
HTTP Headers
| Variable | Type | Required | Description |
|---|---|---|---|
Authorization | string | true | Bearer token in the form Bearer <jwt>. |
Content-Type | string | true | Use application/json for JSON request bodies. |
Request Body
Schema reference: createOneTimePaymentSchema
{
"productUuid": "11111111-1111-1111-1111-111111111111",
"productPriceUuid": "11111111-1111-1111-1111-111111111111",
"units": 1
}
Successful Response
Success status code(s): 201.
{
"kind": "oneTimePayments",
"totalItems": 1,
"itemsLength": 1,
"items": [
{
"uuid": "otp_11111111-1111-1111-1111-111111111111",
"tenantUuid": "tenant_11111111-1111-1111-1111-111111111111",
"createdByUuid": "user_11111111-1111-1111-1111-111111111111",
"paymentProviderUuid": "pp_11111111-1111-1111-1111-111111111111",
"productUuid": "product_11111111-1111-1111-1111-111111111111",
"productPriceUuid": "price_11111111-1111-1111-1111-111111111111",
"invoiceId": "in_12345",
"units": 1,
"invoiceUrl": "https://dashboard.stripe.com/invoices/in_12345",
"isPromotion": true,
"createdAt": "2026-01-01T00:00:00.000Z",
"updatedAt": "2026-01-01T00:00:00.000Z",
"product": {
"uuid": "product_11111111-1111-1111-1111-111111111111",
"appUuid": "app_11111111-1111-1111-1111-111111111111",
"productId": "prod_ext_12345",
"name": "Pro Plan",
"description": "Primary subscription product",
"shippable": false,
"packageDimensionHeight": null,
"packageDimensionWidth": null,
"packageDimensionLength": null,
"packageDimensionWeight": null,
"url": "https://example.com/products/pro-plan",
"createdAt": "2026-01-01T00:00:00.000Z",
"updatedAt": "2026-01-01T00:00:00.000Z",
"productImages": [
{
"uuid": "pimg_11111111-1111-1111-1111-111111111111",
"appUuid": "app_11111111-1111-1111-1111-111111111111",
"productUuid": "product_11111111-1111-1111-1111-111111111111",
"url": "https://cdn.example.com/product.png",
"createdAt": "2026-01-01T00:00:00.000Z",
"updatedAt": "2026-01-01T00:00:00.000Z"
}
],
"productPrices": [
{
"uuid": "price_11111111-1111-1111-1111-111111111111",
"appUuid": "app_11111111-1111-1111-1111-111111111111",
"productPriceId": "price_ext_12345",
"productUuid": "product_11111111-1111-1111-1111-111111111111",
"paymentProviderUuid": "pp_11111111-1111-1111-1111-111111111111",
"currency": "usd",
"unitAmount": 999,
"recurring": true,
"recurringInterval": "month",
"recurringIntervalCount": 1,
"createdAt": "2026-01-01T00:00:00.000Z",
"updatedAt": "2026-01-01T00:00:00.000Z",
"paymentProvider": {
"uuid": "pp_11111111-1111-1111-1111-111111111111",
"appUuid": "app_11111111-1111-1111-1111-111111111111",
"name": "stripe",
"account": "acct_12345",
"connected": true,
"createdAt": "2026-01-01T00:00:00.000Z",
"updatedAt": "2026-01-01T00:00:00.000Z"
}
}
]
}
}
]
}
Error Responses
| HTTP Status | Example Error |
|---|---|
401 | {"errors":[{"validation":"error","code":"[E4010]","message":"Unauthorized Token"}]} |
403 | {"errors":[{"validation":"error","code":"[E4030]","message":"App Is Disabled"}]} |
400 | {"errors":[{"validation":"error","code":"[E4000]","message":"Bad Request / validation error"}]} |
500 | {"errors":[{"validation":"error","code":"[E0000]","message":"Internal Server Error"}]} |
Example
const url = `https://api.userdocks.local:5000/api/v1/internal/projects/projectUuid-value/apps/projectAppUuid-value/tenants/tenantUuid-value/one-time-payments`;
const response = await fetch(url, {
method: 'POST',
headers: {
Authorization: 'Bearer <jwt>',
'Content-Type': 'application/json',
},
body: '{"productUuid":"11111111-1111-1111-1111-111111111111","productPriceUuid":"11111111-1111-1111-1111-111111111111","units":1}',
});
const data = await response.json();
console.log(response.status, data);