---
# @generated by sylphx-gen. Do not edit.
title: "Create a test clock"
description: "`money.test_clocks.create` (POST /v1/{parent}/test_clocks): Creates a test-only Stripe simulation before the subject's first checkout."
type: reference
product: payments
summary: "Creates a test-only Stripe simulation before the subject's first checkout."
updated: 2026-09-28
nav: false
---

Creates a test-only Stripe simulation before the subject's first checkout. No catalogue, payment, subscription, or entitlement is changed.

- **Path** `POST https://api.sylphx.com/v1/orgs/acme/projects/shop/envs/production/test_clocks`
- **Scope** `billing:write`
- **Effect** `write` — a successful call changes state.
- **Collection** [test_clocks](/docs/api/test_clocks)
- **Query** `test_clock_id`

## Request

| Field | Type | What it is |
| --- | --- | --- |
| `parent` | `string` | The environment to create in. Required. |
| `test_clock` | `TestClock` | The subject and initial simulated time. Required. |
| `test_clock_id` | `string` | The final name segment; defaults to a stable id derived from the subject. |

### TestClock

| Field | Type | What it is |
| --- | --- | --- |
| `name` | `string` | The clock's resource name. |
| `subject` | `Subject` | The subject whose new Stripe customer will use this clock. A subject with an existing Money Stripe customer cannot acquire a clock. Required. |
| `frozen_time` | `timestamp` | Initial simulated time on create; current Stripe time on reads. Required on create. Only whole seconds are supported. Required. |

### Subject

| Field | Type | What it is |
| --- | --- | --- |
| `end_user` | `string` | An end user's id (Sylphx Auth, or the app's own OIDC issuer). One of the `kind` group. |
| `customer_organization` | `string` | A customer organization's id. One of the `kind` group. |

## Response

| Field | Type | What it is |
| --- | --- | --- |
| `name` | `string` | The clock's resource name. |
| `uid` | `string` | Stable identity, never reused. Output only. |
| `meta` | `ResourceMeta` | Resource metadata. Output only. |
| `subject` | `Subject` | The subject whose new Stripe customer will use this clock. A subject with an existing Money Stripe customer cannot acquire a clock. Required. |
| `frozen_time` | `timestamp` | Initial simulated time on create; current Stripe time on reads. Required on create. Only whole seconds are supported. Required. |
| `state` | `string` | Stripe's status: ready, advancing, or internal_failure. Poll GetTestClock until ready before the next simulation step. Ready does not mean Money has applied every webhook; observe the subscription and entitlement too. Output only. |
| `processor_clock_id` | `string` | Stripe clock id, for processor receipts. Output only. |
| `livemode` | `bool` | Always false; a live processor object is refused. Output only. |

### ResourceMeta

| Field | Type | What it is |
| --- | --- | --- |
| `generation` | `int64` | Increases by one on every change to `spec`. Output only. |
| `etag` | `string` | Strong ETag (AIP-154): changes on any change to spec, status, or metadata. Send it back as `If-Match` or `etag` to make Update and Delete conditional; a mismatch fails with ABORTED / 409 `ETAG_MISMATCH`. Output only. |
| `create_time` | `timestamp` | When the Resource was created. Output only. |
| `update_time` | `timestamp` | When the Resource last changed. Output only. |
| `delete_time` | `timestamp` | Set while the Resource is being deleted. Output only. |
| `labels` | `map<string, string>` | Caller-writable, indexed labels (AIP-122 label rules). |
| `annotations` | `map<string, string>` | Caller-writable, unindexed annotations. |
| `display_name` | `string` | Caller-writable human-readable name. |
| `creator` | `string` | The principal that created the Resource. Output only. |

### Subject

| Field | Type | What it is |
| --- | --- | --- |
| `end_user` | `string` | An end user's id (Sylphx Auth, or the app's own OIDC issuer). One of the `kind` group. |
| `customer_organization` | `string` | A customer organization's id. One of the `kind` group. |

## Errors

- [`UNAUTHENTICATED`](/docs/api/errors/UNAUTHENTICATED) — No valid key or token was presented.
- [`PERMISSION_DENIED`](/docs/api/errors/PERMISSION_DENIED) — The key lacks the method's permission.
- [`INVALID_FIELD`](/docs/api/errors/INVALID_FIELD) — A field failed validation.
- [`INVALID_STATE`](/docs/api/errors/INVALID_STATE) — The Resource is in a state that forbids the call.
- [`RESOURCE_ALREADY_EXISTS`](/docs/api/errors/RESOURCE_ALREADY_EXISTS) — A Resource with this name exists.
- [`UNAVAILABLE`](/docs/api/errors/UNAVAILABLE) — The Resource store, the owning service's backend, or the key verifier's snapshot is unavailable; retry after Retry-After.

Every error arrives in the body [Errors](/docs/platform/errors) describes.

## Examples

**cURL**

```curl
curl -X POST "https://api.sylphx.com/v1/orgs/acme/projects/shop/envs/production/test_clocks" \
  -H "Authorization: Bearer $SYLPHX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"frozen_time":{},"subject":{}}'
```

**TypeScript**

```ts
const response = await sylphx.money.testClocks.create({ parent: 'orgs/acme/projects/shop/envs/production', testClock: { frozenTime: {}, subject: {} } })
```

**Rust**

```rust
let mut req = sylphx::money::CreateTestClockRequest::default();
req.parent = "orgs/acme/projects/shop/envs/production".to_string();
req.test_clock = Some(sylphx::money::TestClock {
    frozen_time: Some(Default::default()),
    subject: Some(Default::default()),
    ..Default::default()
});
let response = sx.money().test_clocks().create(req).await?;
```

**CLI**

```bash
sylphx money test-clocks create --parent orgs/acme/projects/shop/envs/production
```

**MCP**

```json
{ "method_id": "money.test_clocks.create", "args": {"parent":"orgs/acme/projects/shop/envs/production","test_clock":{"frozen_time":{},"subject":{}}} }
```
