@riseworks/riseworks-sdk 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/README.md +240 -0
  2. package/ai-skills/README.md +28 -0
  3. package/ai-skills/STANDARDS.md +66 -0
  4. package/ai-skills/references/API_WORKFLOWS.md +200 -0
  5. package/ai-skills/references/TYPES.md +190 -0
  6. package/ai-skills/rise-auth-and-setup/README.md +14 -0
  7. package/ai-skills/rise-auth-and-setup/SKILL.md +57 -0
  8. package/ai-skills/rise-auth-and-setup/metadata.json +12 -0
  9. package/ai-skills/rise-auth-and-setup/references/SETUP_PATTERNS.md +26 -0
  10. package/ai-skills/rise-debugging-and-errors/SKILL.md +51 -0
  11. package/ai-skills/rise-payments-workflows/README.md +19 -0
  12. package/ai-skills/rise-payments-workflows/SKILL.md +109 -0
  13. package/ai-skills/rise-payments-workflows/metadata.json +12 -0
  14. package/ai-skills/rise-payments-workflows/references/PAYMENT_PATTERNS.md +36 -0
  15. package/ai-skills/rise-sdk-integration/README.md +25 -0
  16. package/ai-skills/rise-sdk-integration/SKILL.md +130 -0
  17. package/ai-skills/rise-sdk-integration/metadata.json +12 -0
  18. package/ai-skills/rise-sdk-integration/references/PATTERNS.md +28 -0
  19. package/ai-skills/rise-security-and-approvals/SKILL.md +33 -0
  20. package/ai-skills/rise-teams-and-invites/README.md +13 -0
  21. package/ai-skills/rise-teams-and-invites/SKILL.md +66 -0
  22. package/ai-skills/rise-teams-and-invites/metadata.json +12 -0
  23. package/ai-skills/rise-teams-and-invites/references/TEAM_PATTERNS.md +25 -0
  24. package/ai-skills/rise-v1-migration/README.md +22 -0
  25. package/ai-skills/rise-v1-migration/SKILL.md +184 -0
  26. package/ai-skills/rise-v1-migration/metadata.json +13 -0
  27. package/ai-skills/rise-v1-migration/references/ENDPOINT_MAPPINGS.md +72 -0
  28. package/ai-skills/rise-v1-migration/references/MIGRATION_PATTERNS.md +66 -0
  29. package/ai-skills/rise-webhooks/README.md +41 -0
  30. package/ai-skills/rise-webhooks/SKILL.md +143 -0
  31. package/ai-skills/rise-webhooks/metadata.json +13 -0
  32. package/ai-skills/rise-webhooks/references/HANDLER.md +60 -0
  33. package/ai-skills/rise-webhooks/references/REGISTRATION.md +113 -0
  34. package/dist/index.cjs +1406 -0
  35. package/dist/index.d.cts +6865 -0
  36. package/dist/index.d.cts.map +1 -0
  37. package/dist/index.d.mts +6865 -0
  38. package/dist/index.d.mts.map +1 -0
  39. package/dist/index.mjs +1383 -0
  40. package/package.json +87 -0
  41. package/scripts/add-skills.mjs +158 -0
@@ -0,0 +1,190 @@
1
+ # Rise SDK — TypeScript types reference
2
+
3
+ Use this when implementing typed integrations. All types are exported from `riseworks-sdk`.
4
+
5
+ ## Webhook event types
6
+
7
+ Import for **validated webhook payloads** and **event-type narrowing**:
8
+
9
+ ```ts
10
+ import type {
11
+ RiseWebhookEvent,
12
+ PaymentSentV2,
13
+ PaymentGroupCreatedV2,
14
+ DepositReceivedV2,
15
+ InviteAcceptedV2,
16
+ WithdrawAccountDuplicatedDetectedV2,
17
+ } from 'riseworks-sdk'
18
+ ```
19
+
20
+ - **`RiseWebhookEvent`** — Union of all supported webhook events. Use as the type for `validator.validateEvent()` / `validateEventSafe().event`.
21
+ - **Event-specific types** — Each event payload has a type (e.g. `PaymentSentV2`). Every event includes the base envelope: `object`, `created`, `request_id`, `event_type`, `event_version`, `idempotency_key`.
22
+
23
+ **Narrow by `event_type` in handlers:**
24
+
25
+ ```ts
26
+ if (event.event_type === 'payment.sent') {
27
+ // event is PaymentSentV2; event.payment is available
28
+ const payment = event.payment
29
+ }
30
+ if (event.event_type === 'deposit.received') {
31
+ // event is DepositReceivedV2; event.deposit is available
32
+ }
33
+ ```
34
+
35
+ **Common event_type values**: `payment.sent`, `payment.group.created`, `deposit.received`, `invite.accepted`, `withdraw_account.duplicated_detected`. Use these same strings in `events` when registering webhooks. Full list: B2B docs Webhooks → Event Types.
36
+
37
+ ## Webhook management types
38
+
39
+ For **register, list, update, test, delivery history** (from codegen):
40
+
41
+ ```ts
42
+ import type {
43
+ RegisterWebhookRequest,
44
+ UpdateWebhookRequest,
45
+ ListWebhooksRequest,
46
+ ListWebhooksResponse,
47
+ GetWebhookResponse,
48
+ TestWebhookRequest,
49
+ TestWebhookResponse,
50
+ DeliveryHistoryResponse,
51
+ WebhookListItem,
52
+ DeliveryHistoryItem,
53
+ WebhookEndpointNanoid,
54
+ WebhookDeliveryNanoid,
55
+ } from 'riseworks-sdk'
56
+ ```
57
+
58
+ - **`RegisterWebhookRequest`** — `company_nanoid`, `url`, `events` (array of event type strings), `secret` (min 16 chars), optional `team_nanoid`, `name`, `description`, `is_active`.
59
+ - **`ListWebhooksResponse`** — `data.webhooks`, `data.next_cursor`.
60
+ - **`DeliveryHistoryItem`** — `delivery_nanoid`, `event_nanoid`, `status` ('queued' | 'success' | 'failed' | 'retrying'), `response_code`, `created_at`.
61
+
62
+ ## API call types
63
+
64
+ The SDK also exports request and response types for API calls. Use them for typed params, payloads, and responses instead of hand-written object shapes.
65
+
66
+ ```ts
67
+ import type {
68
+ RiseApiClientOptions,
69
+ RiseEnvironment,
70
+ RiseIdAuthConfig,
71
+ TeamParams,
72
+ TeamUserParams,
73
+ CreateTeamRequest,
74
+ UpdateTeamRequest,
75
+ PostTeamResponse,
76
+ GetTeamResponse,
77
+ GetTeamUsersResponse,
78
+ GetTeamSettingsResponse,
79
+ UpdateTeamSettingsRequest,
80
+ GetBalanceRequest,
81
+ GetBalanceResponse,
82
+ CreatePaymentsRequest,
83
+ ExecutePaymentsRequest,
84
+ ExecutePaymentsResponse,
85
+ CreateExternalRecipientRequest,
86
+ CreateInstantExternalPaymentRequest,
87
+ CreateInstantExternalPaymentResponse,
88
+ PostManagerInvitesRequest,
89
+ PostManagerInvitesResponse,
90
+ } from 'riseworks-sdk'
91
+ ```
92
+
93
+ - **Auth/config**: `RiseApiClientOptions`, `RiseEnvironment`, `RiseIdAuthConfig`.
94
+ - **Teams**: `TeamParams`, `TeamUserParams`, `CreateTeamRequest`, `UpdateTeamRequest`, `PostTeamResponse`, `GetTeamResponse`, `GetTeamUsersResponse`.
95
+ - **Balances**: `GetBalanceRequest`, `GetBalanceResponse`.
96
+ - **Payments**: `CreatePaymentsRequest`, `ExecutePaymentsRequest`, `ExecutePaymentsResponse`.
97
+ - **Bill pay**: `CreateExternalRecipientRequest`, `CreateInstantExternalPaymentRequest`, `CreateInstantExternalPaymentResponse`.
98
+ - **Invites**: `PostManagerInvitesRequest`, `PostManagerInvitesResponse`.
99
+
100
+ ## Method-to-type mapping
101
+
102
+ Use these pairings when generating typed SDK code:
103
+
104
+ - `new RiseApiClient(config)` → `RiseApiClientOptions`
105
+ - `client.teams.create(data)` → `CreateTeamRequest` / `PostTeamResponse`
106
+ - `client.teams.get(params)` → `TeamParams` / `GetTeamResponse`
107
+ - `client.teams.getUsers(params)` → `TeamParams` / `GetTeamUsersResponse`
108
+ - `client.teams.getSettings(params)` → `TeamParams` / `GetTeamSettingsResponse`
109
+ - `client.teams.updateSettings(params, data)` → `TeamParams` / `UpdateTeamSettingsRequest`
110
+ - `client.entityBalance.get(params)` → `GetBalanceRequest` / `GetBalanceResponse`
111
+ - `client.payments.get(params)` → `GetPaymentsRequest` / `GetPaymentsResponse`
112
+ - `client.payments.getPaymentTypedData(data)` → `CreatePaymentsRequest` / `CreatePaymentsResponse`
113
+ - `client.payments.executePaymentWithSignedData(data)` → `ExecutePaymentsRequest` / `ExecutePaymentsResponse`
114
+ - `client.billPay.createRecipient(params, data)` → `ExternalRecipientsParams` / `CreateExternalRecipientRequest`
115
+ - `client.billPay.prepareInstantPayment(data)` → `CreateInstantExternalPaymentRequest` / `CreateInstantExternalPaymentResponse`
116
+ - `client.billPay.executeInstantPayment(data)` → `ExecuteInstantExternalPaymentRequest` / `ExecuteInstantExternalPaymentResponse`
117
+ - `client.invites.get(params)` → `GetInvitesRequest` / `GetInvitesResponse`
118
+ - `client.invites.sendManagerInvite(data)` or manual typed-data flow → `PostManagerInvitesRequest` / `PostManagerInvitesResponse`
119
+ - `client.webhooks.register(data)` → `RegisterWebhookRequest` / `RegisterWebhookResponse`
120
+ - `client.webhooks.list(params)` → `ListWebhooksRequest` / `ListWebhooksResponse`
121
+ - `client.webhooks.test(webhookNanoid, data)` → `TestWebhookRequest` / `TestWebhookResponse`
122
+
123
+ Example:
124
+
125
+ ```ts
126
+ import { RiseApiClient } from 'riseworks-sdk'
127
+ import type {
128
+ CreatePaymentsRequest,
129
+ ExecutePaymentsResponse,
130
+ GetBalanceRequest,
131
+ } from 'riseworks-sdk'
132
+
133
+ const payment: CreatePaymentsRequest = {
134
+ from: teamNanoid,
135
+ to: [{ to: userNanoid, amount_cents: 10000, currency_symbol: 'USD' }],
136
+ pay_now: true,
137
+ network: 'arbitrum',
138
+ }
139
+
140
+ const balanceParams: GetBalanceRequest = { nanoid: teamNanoid }
141
+ const balance = await client.entityBalance.get(balanceParams)
142
+ const sent: ExecutePaymentsResponse = await client.payments.sendPayment(payment)
143
+ ```
144
+
145
+ ## Webhook validator types
146
+
147
+ ```ts
148
+ import {
149
+ WebhookValidator,
150
+ WebhookValidationError,
151
+ } from 'riseworks-sdk'
152
+ import type { WebhookValidationResult, WebhookValidationOptions } from 'riseworks-sdk'
153
+ ```
154
+
155
+ - **`WebhookValidator`** — `new WebhookValidator(secret, options?)`. Methods: `validateEvent(body, signature)` returns `RiseWebhookEvent` (throws); `validateEventSafe(body, signature)` returns `WebhookValidationResult`.
156
+ - **`WebhookValidationResult`** — `{ isValid, event?, error?, timestampValid? }`.
157
+
158
+ ## Branded ID types (nanoids)
159
+
160
+ Use for params and response fields to get correct typing:
161
+
162
+ ```ts
163
+ import type {
164
+ CompanyNanoid,
165
+ TeamNanoid,
166
+ UserNanoid,
167
+ WithdrawAccountNanoid,
168
+ WebhookEndpointNanoid,
169
+ WebhookDeliveryNanoid,
170
+ InviteNanoid,
171
+ TransactionNanoid,
172
+ } from 'riseworks-sdk'
173
+ ```
174
+
175
+ - Nanoids are 15-char strings with prefixes: `co-`, `te-`, `us-`, `wa-`, `wh-`, `wl-`, `in-`, `tx-`, etc. Use these types in function args and when reading API responses.
176
+
177
+ ## API response shape
178
+
179
+ All SDK client methods that return data follow:
180
+
181
+ - `{ data, success }` — use `response.data` for the payload. Type the `data` field from the method’s return type when possible.
182
+
183
+ ## Amounts and formats
184
+
185
+ - **Payment amounts**: `amount_cents` (number) for fiat; blockchain amounts often as **strings** (smallest units) to avoid precision loss.
186
+ - **Dates**: ISO-8601 strings or `Date` where the SDK accepts them (e.g. `payments.get()`).
187
+
188
+ ## Documentation
189
+
190
+ - **Rise B2B API**: [https://v2-docs.riseworks.io/](https://v2-docs.riseworks.io/) — Event payloads, field specs, and full event list are in the Webhooks section.
@@ -0,0 +1,14 @@
1
+ # Rise Auth And Setup Skill
2
+
3
+ Human-facing notes for the `rise-auth-and-setup` skill.
4
+
5
+ ## Purpose
6
+
7
+ This skill helps agents initialize `RiseApiClient` correctly and choose between
8
+ JWT auth and `riseIdAuth`.
9
+
10
+ ## Extra references
11
+
12
+ - `../references/TYPES.md` — config and request/response typing
13
+ - `../references/API_WORKFLOWS.md` — what to do after initialization
14
+ - `references/SETUP_PATTERNS.md` — defaults for environment and auth selection
@@ -0,0 +1,57 @@
1
+ ---
2
+ name: rise-auth-and-setup
3
+ description: Configures riseworks-sdk authentication, environments, and secure server-side setup. Use when the user mentions setup, configuration, jwtToken, riseIdAuth, SIWE, private keys, environments, or initializing RiseApiClient.
4
+ compatibility: Node.js, TypeScript or JavaScript. Works with Claude Code, Cursor, Windsurf, Codex.
5
+ metadata:
6
+ author: Rise Works
7
+ version: "1.0"
8
+ ---
9
+
10
+ # Rise Auth And Setup
11
+
12
+ **Note:** Always read the installed `riseworks-sdk` source when implementing—the SDK may have new functions or types not yet reflected in this skill.
13
+
14
+ ## Default setup choices
15
+
16
+ - Use `jwtToken` when the application already has a valid JWT.
17
+ - Use `riseIdAuth` when the application needs SDK-managed SIWE-based authentication and refresh.
18
+ - Keep private keys and Rise IDs server-side.
19
+ - Prefer environment variables for secrets.
20
+ - Default to `riseIdAuth` for flows that include automatic signing (`sendPayment`, `sendManagerInvite`, `sendInstantPayment`).
21
+ - Default to `jwtToken` for read-heavy or manual typed-data flows.
22
+
23
+ ## Required setup surface
24
+
25
+ - `new RiseApiClient({ environment, jwtToken })`
26
+ - `new RiseApiClient({ environment, riseIdAuth: { riseId, privateKey } })`
27
+
28
+ ## Types
29
+
30
+ - Use `RiseApiClientOptions` for client configuration objects.
31
+ - Use `RiseEnvironment` for environment values and `RiseIdAuthConfig` for `riseIdAuth`.
32
+ - Prefer typed config examples over inline anonymous object shapes.
33
+
34
+ ## API support guidance
35
+
36
+ - After initialization, prefer a quick verification call such as `client.me.get()`.
37
+ - If the next workflow needs entity context, follow with `client.user.getTeams()` or `client.user.getOrganizations()`.
38
+ - Mention that most other B2B API calls are performed through `RiseApiClient` methods, not raw HTTP calls.
39
+
40
+ For common SDK API flows after auth, see [references/API_WORKFLOWS.md](../references/API_WORKFLOWS.md).
41
+ For setup defaults and auth-mode selection, see [references/SETUP_PATTERNS.md](references/SETUP_PATTERNS.md).
42
+
43
+ ## Environments
44
+
45
+ - Use the requested environment explicitly.
46
+ - If the user does not specify one, ask whether they want `dev`, `stg`, or `prod`.
47
+ - Only use a custom `baseUrl` when the user clearly needs it.
48
+
49
+ ## Documentation
50
+
51
+ - **Rise B2B API**: [https://v2-docs.riseworks.io/](https://v2-docs.riseworks.io/) — Authentication, Understanding Private Keys, Secondary Wallets, SDK Configuration. Suggest when the user needs SIWE details or secure setup guides.
52
+
53
+ ## Output quality bar
54
+
55
+ - Show complete initialization examples.
56
+ - Keep secret handling server-side.
57
+ - When examples include money movement or webhook validation, mention the relevant server-only secrets.
@@ -0,0 +1,12 @@
1
+ {
2
+ "version": "1.1.0",
3
+ "domain": "auth-setup",
4
+ "package": "riseworks-sdk",
5
+ "preferredLanguage": "TypeScript",
6
+ "references": [
7
+ "../references/TYPES.md",
8
+ "../references/API_WORKFLOWS.md",
9
+ "references/SETUP_PATTERNS.md",
10
+ "https://v2-docs.riseworks.io/"
11
+ ]
12
+ }
@@ -0,0 +1,26 @@
1
+ # Auth and setup patterns
2
+
3
+ Use this reference when the user needs to initialize `RiseApiClient` correctly.
4
+
5
+ ## Choose the auth mode
6
+
7
+ - **Use `jwtToken`** when the app already has a valid JWT or only needs read-heavy/manual flows.
8
+ - **Use `riseIdAuth`** when the SDK should manage SIWE/JWT and automatic signing.
9
+
10
+ ## Recommended setup sequence
11
+
12
+ 1. Create typed config with `RiseApiClientOptions`
13
+ 2. Initialize `new RiseApiClient(config)`
14
+ 3. Verify with `client.me.get()`
15
+ 4. Fetch teams or organizations if later steps need nanoids
16
+
17
+ ## Environment defaults
18
+
19
+ - Ask for `dev`, `stg`, or `prod` when missing.
20
+ - Use `baseUrl` only when the user explicitly needs a custom backend target.
21
+ - Mention `timeout` only when the user is dealing with long-running or unreliable network calls.
22
+
23
+ ## Security defaults
24
+
25
+ - Keep `privateKey`, `riseIdAuth`, JWTs, and webhook secrets server-side.
26
+ - Recommend secondary wallets for API operations that use signing.
@@ -0,0 +1,51 @@
1
+ ---
2
+ name: rise-debugging-and-errors
3
+ description: Troubleshoots Rise SDK integrations, auth issues, webhook validation failures, and payment or withdrawal errors. Use when the user mentions debugging, failed requests, signatures, invalid auth, unexpected responses, or retries.
4
+ compatibility: Any environment. Works with Claude Code, Cursor, Windsurf, Codex.
5
+ metadata:
6
+ author: Rise Works
7
+ version: "1.0"
8
+ ---
9
+
10
+ # Rise Debugging And Errors
11
+
12
+ **Note:** Always read the installed `riseworks-sdk` source when implementing—the SDK may have new functions or types not yet reflected in this skill.
13
+
14
+ ## Triage order
15
+
16
+ 1. Confirm environment and auth method.
17
+ 2. Confirm the nanoids and request payload shape.
18
+ 3. Check whether the request is server-side when secrets or signing are involved.
19
+ 4. For webhooks, verify raw body handling and signature validation.
20
+ 5. For payments and withdrawals, verify private key availability and approval flow.
21
+ 6. Confirm the generated code is using the correct SDK method and exported request/response types.
22
+
23
+ ## Common problem areas
24
+
25
+ - wrong environment or expired auth
26
+ - missing server-side secret or private key
27
+ - incorrect webhook raw body handling
28
+ - ambiguous payment flow selection
29
+ - missing or invalid nanoids
30
+ - using a write method with JWT auth when the automatic flow requires signing
31
+ - guessing response shapes instead of using SDK types like `{ data, success }`
32
+ - skipping discovery calls (`getTeams()`, `getOrganizations()`) before entity-scoped operations
33
+
34
+ ## API-specific troubleshooting
35
+
36
+ - **Auth failures**: check `RiseApiClientOptions`, environment, and whether the flow should use `jwtToken` or `riseIdAuth`.
37
+ - **Teams/invites**: verify whether the operation is company-scoped or team-scoped and that the right nanoid type is being used.
38
+ - **Payments/bill pay/withdrawals**: confirm whether the correct automatic or manual typed-data flow was chosen.
39
+ - **Webhooks**: by default, webhook registration is done in the Rise UI; only debug SDK registration code when the user explicitly built programmatic webhook management.
40
+
41
+ For common SDK method flows, see [references/API_WORKFLOWS.md](../references/API_WORKFLOWS.md).
42
+
43
+ ## Documentation
44
+
45
+ - **Rise B2B API**: [https://v2-docs.riseworks.io/](https://v2-docs.riseworks.io/) — Error Handling, Webhooks (Testing & Debugging), API Reference. Suggest when the user needs error formats or deeper troubleshooting guides.
46
+
47
+ ## Output quality bar
48
+
49
+ - Ask for the failing code path, request type, and error text when missing.
50
+ - Prefer actionable fixes over generic troubleshooting advice.
51
+ - For webhook bugs, include signature and raw-body checks first.
@@ -0,0 +1,19 @@
1
+ # Rise Payments Workflows Skill
2
+
3
+ Human-facing notes for the `rise-payments-workflows` skill.
4
+
5
+ ## Purpose
6
+
7
+ This skill focuses on money-moving and treasury-related SDK flows:
8
+
9
+ - payment history
10
+ - internal Rise payments
11
+ - external bill pay
12
+ - balance lookup
13
+ - payroll-related payment lookups
14
+
15
+ ## Extra references
16
+
17
+ - `../references/TYPES.md` — exported payment and bill pay types
18
+ - `../references/API_WORKFLOWS.md` — shared end-to-end SDK flows
19
+ - `references/PAYMENT_PATTERNS.md` — default payment/bill pay patterns
@@ -0,0 +1,109 @@
1
+ ---
2
+ name: rise-payments-workflows
3
+ description: Implements Rise payment, bill pay, and balance workflows with riseworks-sdk. Use when the user mentions payroll, contractor payments, vendor payments, invoices, bill pay, balances, treasury, or withdrawals.
4
+ compatibility: Node.js, TypeScript or JavaScript. Server-side only for signing. Works with Claude Code, Cursor, Windsurf, Codex.
5
+ metadata:
6
+ author: Rise Works
7
+ version: "1.0"
8
+ ---
9
+
10
+ # Rise Payments Workflows
11
+
12
+ **Note:** Always read the installed `riseworks-sdk` source when implementing—the SDK may have new functions or types not yet reflected in this skill.
13
+
14
+ ## Classify the request first
15
+
16
+ - Team payout to existing Rise recipients: use `client.payments.sendPayment()`.
17
+ - External bill pay by email: create the recipient, then send the instant payment.
18
+ - Balance lookup: use `client.entityBalance.get()`.
19
+ - Payroll info: use `client.payroll.getTeamPayroll()`.
20
+ - Payment history or status lookup: use `client.payments.get()`.
21
+
22
+ ## Inputs to collect
23
+
24
+ - Team, user, or account nanoids (use typed params: `TeamNanoid`, `UserNanoid` when typing)
25
+ - Amount in cents (number for fiat; blockchain amounts may be strings in smallest units)
26
+ - Currency and network when required (`currency_symbol`, `network` e.g. `'arbitrum'`)
27
+ - Recipient email for external bill pay
28
+ - Invoice or service details when present
29
+
30
+ ## Important constraints
31
+
32
+ - Signed payment flows need a private key on the server or supplied per call.
33
+ - Keep treasury and money-moving code server-side.
34
+ - If the request is ambiguous, ask whether it is an internal Rise payment or external bill pay.
35
+
36
+ ## Preferred SDK surface
37
+
38
+ ### Payments
39
+ - `client.payments.sendPayment({ from, to, pay_now, network })` — automatic; requires `riseIdAuth` or `privateKey`
40
+ - `client.payments.get({ team_nanoid, state, start_date, end_date, query_type })` — list payments
41
+ - Manual flow: `client.payments.getPaymentTypedData(data)` → sign → `client.payments.executePaymentWithSignedData(data)` — the SDK sends a fresh `x-idempotency-key` per call; the execute step takes the payment group id from the signed data, so the two calls must **not** share a key. `sendPayment()` handles this for you.
42
+
43
+ ### Bill pay (external)
44
+ - `client.billPay.createRecipient({ team_nanoid }, data)` — register external recipient by email
45
+ - `client.billPay.sendInstantPayment(data)` — send; requires `riseIdAuth` or `privateKey`
46
+ - Manual flow: `client.billPay.prepareInstantPayment(data)` → sign → `client.billPay.executeInstantPayment(data)`
47
+
48
+ ### Balances
49
+ - `client.entityBalance.get({ nanoid })` — get balance for a team, company, or user entity
50
+
51
+ ### Withdrawals
52
+ - Withdrawals are not available via the SDK: the withdraw endpoints require reCAPTCHA verification headers only a browser session can produce. Point users to the Rise dashboard for withdrawals.
53
+
54
+ ### Payroll
55
+ - `client.payroll.getTeamPayroll({ team_nanoid })` — payroll details for a team
56
+
57
+ ## Common edge cases
58
+
59
+ - **JWT only**: If the client is created with `jwtToken` and no `riseIdAuth`, automatic `sendPayment` / `sendInstantPayment` will fail; use the manual flow (get typed data, sign elsewhere, execute).
60
+ - **Amounts**: Amounts are in cents; document this in examples. Currency is typically `USD`; network often `arbitrum`.
61
+ - **Dates**: `client.payments.get()` expects `start_date` and `end_date` as `Date` objects (or values the SDK accepts).
62
+ - **Missing team context**: If the user wants payments or bill pay and does not have a `team_nanoid`, call `client.user.getTeams()` first.
63
+ - **Bill pay sequence**: External payments often need two steps: `createRecipient()` first, then `sendInstantPayment()`.
64
+ - **Idempotency**: The batch payment endpoints require an `x-idempotency-key` header. The SDK generates a fresh one per call (POST and PUT use different keys); the server takes the payment group id from the signed data, so the two calls must not share a key. `sendPayment()` handles this automatically.
65
+ - **Safe retries**: Keys are per call — never share one key between the prepare (POST) and the execute (PUT), but DO reuse the same key when retrying the same call. Pass an explicit `idempotencyKey`, keep it for the retry, and wait ~3 seconds between attempts: the server dedups on the key and returns the same transaction, and a 409 "Duplicate request" within the window means the first attempt is still processing. Set `external_id` on each payment — unique per payer team — as the durable idempotency guard.
66
+
67
+ ## When not to use this skill
68
+
69
+ - User is asking about payments or payroll for a different platform (e.g. Stripe, ADP). Do not assume Rise.
70
+ - User only needs conceptual explanation of "how Rise payments work" with no code. Prefer a short answer unless they ask for implementation.
71
+
72
+ ## Example (team payment)
73
+
74
+ ```ts
75
+ await client.payments.sendPayment({
76
+ from: teamNanoid,
77
+ to: [{ to: userNanoid, amount_cents: 10000, currency_symbol: 'USD', invoice_description: 'Contractor pay' }],
78
+ pay_now: true,
79
+ network: 'arbitrum',
80
+ })
81
+ ```
82
+
83
+ ## Types
84
+
85
+ - **Queries**: Use `GetPaymentsRequest` and `GetPaymentsResponse` for payment history/status queries.
86
+ - **Payments**: Type payloads with `CreatePaymentsRequest`, `ExecutePaymentsRequest`, `ExecutePaymentsResponse`.
87
+ - **Bill pay**: Type payloads with `CreateExternalRecipientRequest`, `CreateInstantExternalPaymentRequest`, `CreateInstantExternalPaymentResponse`.
88
+ - **Request/response**: Use SDK types for method params and responses where possible. Responses are `{ data, success }`; amounts are typically `amount_cents` (number) or token amounts as strings.
89
+ - **Full type reference**: [references/TYPES.md](../references/TYPES.md) — nanoids, webhook events, API shapes.
90
+
91
+ ## API workflow defaults
92
+
93
+ - Discover the team first with `client.user.getTeams()` when needed.
94
+ - Use automatic flows when the client has `riseIdAuth`.
95
+ - Use manual typed-data flows when the client only has JWT auth or when the user explicitly wants custom signing.
96
+
97
+ For full SDK flow patterns, see [references/API_WORKFLOWS.md](../references/API_WORKFLOWS.md).
98
+ For payment-specific generation defaults and sequencing, see [references/PAYMENT_PATTERNS.md](references/PAYMENT_PATTERNS.md).
99
+
100
+ ## Documentation
101
+
102
+ - **Rise B2B API**: [https://v2-docs.riseworks.io/](https://v2-docs.riseworks.io/) — Payment Processing, Balance Management, API Reference. Suggest when the user needs currency/network details or full request shapes.
103
+
104
+ ## Output quality bar
105
+
106
+ - Prefer complete working examples over pseudo-code.
107
+ - Mention approval or review gates for money movement.
108
+ - Reuse the exact SDK method names and argument shapes that exist today.
109
+ - For `billPay`, always pass recipient params as the first argument.
@@ -0,0 +1,12 @@
1
+ {
2
+ "version": "1.1.0",
3
+ "domain": "payments",
4
+ "package": "riseworks-sdk",
5
+ "preferredLanguage": "TypeScript",
6
+ "references": [
7
+ "../references/TYPES.md",
8
+ "../references/API_WORKFLOWS.md",
9
+ "references/PAYMENT_PATTERNS.md",
10
+ "https://v2-docs.riseworks.io/"
11
+ ]
12
+ }
@@ -0,0 +1,36 @@
1
+ # Payment and bill pay patterns
2
+
3
+ Use this reference when the user is building payment-related application code.
4
+
5
+ ## Default flow selection
6
+
7
+ - **Payment history**: `client.payments.get()`
8
+ - **Internal Rise payment**: `client.payments.sendPayment()`
9
+ - **External recipient setup**: `client.billPay.createRecipient({ team_nanoid }, data)`
10
+ - **External instant payment**: `client.billPay.sendInstantPayment()`
11
+ - **Balance lookup**: `client.entityBalance.get({ nanoid })`
12
+ - **Withdrawal**: Withdrawals are not available via the SDK: the withdraw endpoints require reCAPTCHA verification headers only a browser session can produce. Point users to the Rise dashboard for withdrawals.
13
+
14
+ ## Automatic vs manual signing
15
+
16
+ - Use automatic methods when the client has `riseIdAuth` or an available `privateKey`.
17
+ - Use typed-data flows when the client only has JWT auth or the user explicitly wants custom signing.
18
+
19
+ ## Recommended generation order
20
+
21
+ 1. Discover `team_nanoid` or `account_nanoid` if missing.
22
+ 2. Build a typed payload.
23
+ 3. Call the SDK method.
24
+ 4. Use `response.data`.
25
+ 5. Mention approval/review gates for side effects.
26
+
27
+ ## Bill pay specifics
28
+
29
+ - External recipient registration is often a separate setup step.
30
+ - Do not skip `createRecipient()` when the recipient is not already known to Rise.
31
+
32
+ ## Common values
33
+
34
+ - `currency_symbol`: usually `'USD'`
35
+ - `network`: often `'arbitrum'`
36
+ - amounts: `amount_cents` for fiat-facing payloads
@@ -0,0 +1,25 @@
1
+ # Rise SDK Integration Skill
2
+
3
+ Human-facing notes for the `rise-sdk-integration` skill.
4
+
5
+ ## Purpose
6
+
7
+ This is the broad "use the SDK correctly" skill. It helps agents choose the
8
+ right `riseworks-sdk` method, discover missing nanoids, and generate typed app
9
+ code instead of pseudo-code.
10
+
11
+ ## When this skill should be used
12
+
13
+ Use it for general SDK application code involving:
14
+
15
+ - auth bootstrap
16
+ - team/company discovery
17
+ - payments, bill pay, balances
18
+ - invites and team operations
19
+ - webhook receiver code
20
+
21
+ ## Extra references
22
+
23
+ - `../references/TYPES.md` — exported request/response and webhook types
24
+ - `../references/API_WORKFLOWS.md` — end-to-end SDK method flows
25
+ - `references/PATTERNS.md` — generation defaults and decision rules for broad SDK tasks