@isnap/sdk 2.2.0-next.227 → 2.2.0-next.229

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.
@@ -2380,7 +2380,7 @@ export interface paths {
2380
2380
  put?: never;
2381
2381
  /**
2382
2382
  * Release a reserved line
2383
- * @description Gives back a line that you have reserved: it returns to `available` immediately and no longer belongs to your account. Accepts an API key. Any other line returns `404 not_found`, an `active` line included: to end a line you use, call `POST /v1/lines/{id}/terminate` or `POST /v1/lines/{id}/cancel`. A release cancels the unpaid subscription of a payment that was started for the line, unless that payment has been submitted. A payment that succeeds after the release activates no line: iSnap cancels its subscription and records the charge as a refund owed to the account. A release changes no other billing and leaves the `metadata` of the line as it is. This operation sends no event.
2383
+ * @description Gives back a line that you have reserved: it returns to `available` immediately and no longer belongs to your account. Accepts an API key. Any other line returns `404 not_found`, an `active` line included: to end a line you use, call `POST /v1/lines/{id}/terminate` or `POST /v1/lines/{id}/cancel`. When a payment was started for the line, the release first cancels its unpaid subscription, which can no longer be paid. While the first payment of a subscription of yours for the line has been submitted, or has succeeded within the last hour, and the line is not `active` yet, the call returns `409 purchase_payment_in_progress` and releases nothing: the line stays reserved for your account. Read it with `GET /v1/lines/{id}` until it is `active` or no longer `reserved`. One hour after a payment that succeeded and did not activate the line, the release goes through: the subscription of that payment is canceled, and the payment is recorded as a refund owed to the account. When the payments of the line cannot be checked, the call fails and releases nothing. A release changes no other billing and leaves the `metadata` of the line as it is. This operation sends no event.
2384
2384
  */
2385
2385
  post: {
2386
2386
  parameters: {
@@ -2450,6 +2450,15 @@ export interface paths {
2450
2450
  "application/json": components["schemas"]["ErrorEnvelope"];
2451
2451
  };
2452
2452
  };
2453
+ /** @description Conflict. `error.code` is `purchase_payment_in_progress` when the first payment of a subscription of yours for the line has been submitted, or has succeeded within the last hour, and the line is not `active` yet: the line is not released, and stays reserved for your account. Read the line with `GET /v1/lines/{id}` until it is `active` or no longer `reserved`. It is `purchase_in_progress` when the request has waited 10 seconds for another payment or release request of the same account: resend the request. */
2454
+ 409: {
2455
+ headers: {
2456
+ [name: string]: unknown;
2457
+ };
2458
+ content: {
2459
+ "application/json": components["schemas"]["ErrorEnvelope"];
2460
+ };
2461
+ };
2453
2462
  /** @description Too many requests. `error.code` is `rate_limit_exceeded` when more than 100 requests came from the same network address in 60 seconds, whatever their API key or account: wait `error.retry_after` seconds. */
2454
2463
  429: {
2455
2464
  headers: {
@@ -2972,7 +2981,7 @@ export interface paths {
2972
2981
  parameters: {
2973
2982
  query?: {
2974
2983
  /** @description Keep the pre-orders in this status. */
2975
- status?: "draft" | "provisioning" | "fulfilled" | "cancelled";
2984
+ status?: "draft" | "awaiting_payment" | "provisioning" | "fulfilled" | "cancelled";
2976
2985
  /** @description The `next_cursor` of the previous page. Omit it for the first page. An unreadable cursor restarts from the first page, without an error. */
2977
2986
  cursor?: string;
2978
2987
  /** @description Number of pre-orders per page, from 1 to 100. Default: 25. */
@@ -3036,7 +3045,7 @@ export interface paths {
3036
3045
  * Create a pre-order
3037
3046
  * @description Creates a draft pre-order for one rented iMessage line. Accepts an API key. A line-scoped key is not limited to its list on this operation. A draft has no effect: it creates no line, takes no payment, and never expires. Call `POST /v1/pre-orders/{id}/confirm` to commit it. There is no limit on the number of drafts. `Idempotency-Key` is ignored: a repeated call creates another draft. Creating a draft sends no event.
3038
3047
  *
3039
- * `preferred_area_codes` lists up to 5 area codes in order of preference, and `inbound_only` chooses between an inbound-only line and a two-way line. `billing_tier`, when sent, must be `rental_iphone`: `rental_android` returns `400 android_rental_not_purchasable`, and the four other values return `400 tier_not_pre_orderable`. `billing_anchor_at` is stored on the pre-order and carried onto the line at confirmation: a value more than 31 days after the call returns `400 billing_anchor_too_far`, and the confirmation does not check it again. A key that is not listed, `quantity` included, returns `400 validation_failed`: one pre-order is one line.
3048
+ * `preferred_area_codes` lists up to 5 area codes in order of preference, and `inbound_only` chooses between an inbound-only line and a two-way line. `billing_tier`, when sent, must be `rental_iphone`: `rental_android` returns `400 android_rental_not_purchasable`, and the four other values return `400 tier_not_pre_orderable`. `billing_anchor_at` is stored on the pre-order and carried onto the line when the line is created: a value more than 31 days after the call returns `400 billing_anchor_too_far`, and it is not checked again. A key that is not listed, `quantity` included, returns `400 validation_failed`: one pre-order is one line.
3040
3049
  */
3041
3050
  post: {
3042
3051
  parameters: {
@@ -3162,11 +3171,17 @@ export interface paths {
3162
3171
  put?: never;
3163
3172
  /**
3164
3173
  * Confirm a pre-order
3165
- * @description Commits a draft pre-order. Accepts an API key. A line-scoped key is not limited to its list on this operation: it can confirm any draft of the account. The call sets `status` to `provisioning` and `estimated_fulfillment` to the time of the call plus 72 hours, and creates on your account a rented iMessage line with `status: provisioning`, with the `inbound_only` and the `billing_anchor_at` of the pre-order. When a number in one of your area codes is in stock, it is assigned to the line immediately. The confirmation sends no event: iSnap sends `pre_order.fulfilled`, which carries the `line_id`, when the line is handed over.
3174
+ * @description Commits a draft pre-order. Accepts an API key. A line-scoped key is not limited to its list on this operation: it can confirm any draft of the account. The confirmation sends no event: iSnap sends `pre_order.fulfilled`, which carries the `line_id`, when the line is handed over.
3175
+ *
3176
+ * The build of a pre-order sets `status` to `provisioning` and `estimated_fulfillment` to the time the build starts plus 72 hours, and creates on your account a rented iMessage line with `status: provisioning`, with the `inbound_only` and the `billing_anchor_at` of the pre-order. When a number is in stock in one of your area codes, in their order of preference, it is assigned to the line when the build starts. A pre-order with no `preferred_area_codes` takes any number in stock.
3166
3177
  *
3167
- * A wholesale partner pays nothing at confirmation: `stripe_client_secret` is `null`, and the line is billed on the monthly invoice from the day it is handed over. For a direct account, confirm starts a monthly subscription and returns `stripe_client_secret`, a client secret that your payment page passes to the payment form of Stripe to collect the first month. The line is created whether or not that payment completes. The secret is returned in this response only and confirm cannot be repeated: store the secret before anything else.
3178
+ * For a wholesale partner the build starts with the confirmation. A wholesale partner pays nothing at confirmation: `stripe_client_secret` is `null`, and the line is billed on the monthly invoice from the day it is handed over.
3168
3179
  *
3169
- * Only a draft can be confirmed: any other pre-order returns `400 pre_order_not_draft`, and a confirmation that runs at the same time as another confirmation or as a cancellation returns `409 pre_order_not_draft`. A confirmed pre-order cannot be canceled through the API.
3180
+ * For a direct account the build starts when the first month is paid. Confirm starts a monthly subscription, sets `status` to `awaiting_payment` and returns `stripe_client_secret`, a client secret that your payment page passes to the payment form of Stripe to collect the first month. Only card payments are accepted. Until that payment succeeds, no line is created and `estimated_fulfillment` is `null`. After paying, read the pre-order with `GET /v1/pre-orders/{id}` until `status` is `provisioning`. When the first month is not paid within 23 hours of the confirmation, `status` becomes `cancelled` and iSnap sends `pre_order.cancelled`. When a credit balance of the account at Stripe covers the first month, there is nothing to pay: the build starts with the confirmation and `stripe_client_secret` is `null`. The first month starts at the confirmation, not when the line is handed over, and the next invoice is issued one month after the confirmation. The hand-over of the line takes no payment and does not change when the subscription is invoiced.
3181
+ *
3182
+ * Confirm can be repeated while `status` is `awaiting_payment`: it returns the same client secret and starts no second subscription. Repeated after the payment succeeded, it returns the pre-order in `provisioning`.
3183
+ *
3184
+ * Any other pre-order returns `400 pre_order_not_draft`, including one that was canceled because its first month was not paid in time. A confirmation that runs at the same time as a cancellation, or for a wholesale partner as another confirmation, returns `409 pre_order_not_draft`. When Stripe cannot be reached, the call returns `503 payment_provider_unavailable`: nothing changed, and the call can be repeated. When Stripe refuses the request for the account, the call returns `409 payment_setup_failed`: nothing changed, and repeating the call does not help. Once its build has started, a pre-order cannot be canceled through the API.
3170
3185
  */
3171
3186
  post: {
3172
3187
  parameters: {
@@ -3180,7 +3195,7 @@ export interface paths {
3180
3195
  };
3181
3196
  requestBody?: never;
3182
3197
  responses: {
3183
- /** @description The pre-order, in status `provisioning`. */
3198
+ /** @description The pre-order: in status `awaiting_payment` with its `stripe_client_secret` for a direct account whose first month is due, in status `provisioning` otherwise. */
3184
3199
  200: {
3185
3200
  headers: {
3186
3201
  [name: string]: unknown;
@@ -3200,7 +3215,7 @@ export interface paths {
3200
3215
  };
3201
3216
  };
3202
3217
  };
3203
- /** @description Invalid request. `error.code` is `validation_failed` when a parameter, a header or the body does not match its schema: `error.issues` then lists each problem. It is `pre_order_not_draft` when the pre-order is not a draft. */
3218
+ /** @description Invalid request. `error.code` is `validation_failed` when a parameter, a header or the body does not match its schema: `error.issues` then lists each problem. It is `pre_order_not_draft` when the pre-order is neither a draft nor in `awaiting_payment`, except a pre-order in `provisioning` whose first month was paid, which a repeated confirm returns. */
3204
3219
  400: {
3205
3220
  headers: {
3206
3221
  [name: string]: unknown;
@@ -3227,6 +3242,15 @@ export interface paths {
3227
3242
  "application/json": components["schemas"]["ErrorEnvelope"];
3228
3243
  };
3229
3244
  };
3245
+ /** @description Conflict. `error.code` is `pre_order_not_draft` when a cancellation, or for a wholesale partner another confirmation, ran at the same time and won. It is `payment_setup_failed` when Stripe refused the request for the account: repeating the call does not help. */
3246
+ 409: {
3247
+ headers: {
3248
+ [name: string]: unknown;
3249
+ };
3250
+ content: {
3251
+ "application/json": components["schemas"]["ErrorEnvelope"];
3252
+ };
3253
+ };
3230
3254
  /** @description Too many requests. `error.code` is `rate_limit_exceeded` when more than 100 requests came from the same network address in 60 seconds, whatever their API key or account: wait `error.retry_after` seconds. */
3231
3255
  429: {
3232
3256
  headers: {
@@ -3245,6 +3269,15 @@ export interface paths {
3245
3269
  "application/json": components["schemas"]["ErrorEnvelope"];
3246
3270
  };
3247
3271
  };
3272
+ /** @description Service unavailable. `error.code` is `payment_provider_unavailable`: Stripe could not be reached. Nothing changed, and the call can be repeated. */
3273
+ 503: {
3274
+ headers: {
3275
+ [name: string]: unknown;
3276
+ };
3277
+ content: {
3278
+ "application/json": components["schemas"]["ErrorEnvelope"];
3279
+ };
3280
+ };
3248
3281
  };
3249
3282
  };
3250
3283
  delete?: never;
@@ -3262,7 +3295,7 @@ export interface paths {
3262
3295
  };
3263
3296
  /**
3264
3297
  * Get a pre-order
3265
- * @description Returns one pre-order of the account. Accepts an API key. A line-scoped key is not limited to its list on this operation. A pre-order carries no line id: the line it produces is announced by `pre_order.fulfilled`, which carries the `line_id`. `stripe_client_secret` is `null` here. A pre-order of another account, or an unknown id, returns `404 not_found`.
3298
+ * @description Returns one pre-order of the account. Accepts an API key. A line-scoped key is not limited to its list on this operation. A pre-order carries no line id: the line it produces is announced by `pre_order.fulfilled`, which carries the `line_id`. `stripe_client_secret` is `null` here. Reading a pre-order in status `awaiting_payment` checks its first-month payment with Stripe: when that payment has succeeded, the build starts and the pre-order is returned in `provisioning`. When Stripe cannot be reached, the read still answers, with the pre-order in `awaiting_payment`. A pre-order of another account, or an unknown id, returns `404 not_found`.
3266
3299
  */
3267
3300
  get: {
3268
3301
  parameters: {
@@ -3448,7 +3481,7 @@ export interface paths {
3448
3481
  put?: never;
3449
3482
  /**
3450
3483
  * Cancel a pre-order
3451
- * @description Cancels a draft pre-order: nothing was created and nothing was charged. Accepts an API key. A line-scoped key is not limited to its list on this operation. Sets `status` to `cancelled` and sends `pre_order.cancelled`. Only a draft can be canceled: a pre-order that is confirmed, fulfilled or already canceled returns `400 pre_order_already_confirmed`, and a cancellation that runs at the same time as a confirmation or as another cancellation returns `409 pre_order_already_confirmed`. A confirmed pre-order cannot be canceled through the API.
3484
+ * @description Cancels a pre-order in status `draft` or `awaiting_payment`: nothing was created and nothing was charged. Accepts an API key. A line-scoped key is not limited to its list on this operation. Sets `status` to `cancelled` and sends `pre_order.cancelled`. For a pre-order in `awaiting_payment`, the first-month payment is canceled first: the client secret returned by confirm can no longer be used. When that first month is already paid, the call returns `409 pre_order_already_paid` and the build goes on. A pre-order that is `provisioning`, `fulfilled` or already `cancelled` returns `400 pre_order_already_confirmed`, and the cancellation of a draft that runs at the same time as another cancellation, or as the confirmation of a wholesale partner, returns `409 pre_order_already_confirmed`. When Stripe cannot be reached, the call returns `503 payment_provider_unavailable`: nothing changed, and the call can be repeated. When Stripe refuses the request for the account, the call returns `409 payment_setup_failed`: nothing changed, and repeating the call does not help. Once its build has started, a pre-order cannot be canceled through the API.
3452
3485
  */
3453
3486
  post: {
3454
3487
  parameters: {
@@ -3482,7 +3515,7 @@ export interface paths {
3482
3515
  };
3483
3516
  };
3484
3517
  };
3485
- /** @description Invalid request. `error.code` is `validation_failed` when a parameter, a header or the body does not match its schema: `error.issues` then lists each problem. It is `pre_order_already_confirmed` when the pre-order is not a draft: it is confirmed, fulfilled or already canceled. */
3518
+ /** @description Invalid request. `error.code` is `validation_failed` when a parameter, a header or the body does not match its schema: `error.issues` then lists each problem. It is `pre_order_already_confirmed` when the pre-order is `provisioning`, `fulfilled` or already `cancelled`. */
3486
3519
  400: {
3487
3520
  headers: {
3488
3521
  [name: string]: unknown;
@@ -3509,7 +3542,7 @@ export interface paths {
3509
3542
  "application/json": components["schemas"]["ErrorEnvelope"];
3510
3543
  };
3511
3544
  };
3512
- /** @description Conflict. `error.code` is `pre_order_already_confirmed`: a confirmation or another cancellation of the same pre-order ran at the same time and won. */
3545
+ /** @description Conflict. `error.code` is `pre_order_already_paid` when the first month is already paid. It is `pre_order_already_confirmed` when a confirmation or another cancellation of the same draft ran at the same time and won. It is `payment_setup_failed` when Stripe refused the request for the account: repeating the call does not help. */
3513
3546
  409: {
3514
3547
  headers: {
3515
3548
  [name: string]: unknown;
@@ -3536,6 +3569,15 @@ export interface paths {
3536
3569
  "application/json": components["schemas"]["ErrorEnvelope"];
3537
3570
  };
3538
3571
  };
3572
+ /** @description Service unavailable. `error.code` is `payment_provider_unavailable`: Stripe could not be reached. Nothing changed, and the call can be repeated. */
3573
+ 503: {
3574
+ headers: {
3575
+ [name: string]: unknown;
3576
+ };
3577
+ content: {
3578
+ "application/json": components["schemas"]["ErrorEnvelope"];
3579
+ };
3580
+ };
3539
3581
  };
3540
3582
  };
3541
3583
  delete?: never;
@@ -3630,7 +3672,7 @@ export interface paths {
3630
3672
  "application/json": components["schemas"]["ErrorEnvelope"];
3631
3673
  };
3632
3674
  };
3633
- /** @description Conflict. `error.code` is `line_not_reserved` when the reservation of the line has ended. It is `purchase_payment_in_progress` when the first payment of a subscription of the reservation has been submitted and the line is not `active` yet: nothing is canceled or created. It is `purchase_in_progress` when the request has waited 10 seconds for another request that starts a payment for the same account: resend the request. */
3675
+ /** @description Conflict. `error.code` is `line_not_reserved` when the reservation of the line has ended. It is `purchase_payment_in_progress` when the first payment of a subscription of the reservation has been submitted and the line is not `active` yet: nothing is canceled or created. It is `purchase_in_progress` when the request has waited 10 seconds for another payment or release request of the same account: resend the request. */
3634
3676
  409: {
3635
3677
  headers: {
3636
3678
  [name: string]: unknown;
@@ -3731,7 +3773,7 @@ export interface paths {
3731
3773
  "application/json": components["schemas"]["ErrorEnvelope"];
3732
3774
  };
3733
3775
  };
3734
- /** @description Conflict. `error.code` is `purchase_payment_in_progress` when the first payment of a subscription to the same product has been submitted and what it buys is not counted yet in `GET /v1/billing/coverage`, for one hour at most after that payment succeeded: nothing is canceled or created. It is `purchase_in_progress` when the request has waited 10 seconds for another request that starts a payment for the same account: resend the request. */
3776
+ /** @description Conflict. `error.code` is `purchase_payment_in_progress` when the first payment of a subscription to the same product has been submitted and what it buys is not counted yet in `GET /v1/billing/coverage`, for one hour at most after that payment succeeded: nothing is canceled or created. It is `purchase_in_progress` when the request has waited 10 seconds for another payment or release request of the same account: resend the request. */
3735
3777
  409: {
3736
3778
  headers: {
3737
3779
  [name: string]: unknown;
@@ -3843,7 +3885,7 @@ export interface paths {
3843
3885
  "application/json": components["schemas"]["ErrorEnvelope"];
3844
3886
  };
3845
3887
  };
3846
- /** @description Conflict. `error.code` is `purchase_payment_in_progress` when the first payment of a subscription to the same product has been submitted and what it buys is not counted yet in `GET /v1/billing/coverage`, for one hour at most after that payment succeeded: nothing is canceled or created. It is `purchase_in_progress` when the request has waited 10 seconds for another request that starts a payment for the same account: resend the request. */
3888
+ /** @description Conflict. `error.code` is `purchase_payment_in_progress` when the first payment of a subscription to the same product has been submitted and what it buys is not counted yet in `GET /v1/billing/coverage`, for one hour at most after that payment succeeded: nothing is canceled or created. It is `purchase_in_progress` when the request has waited 10 seconds for another payment or release request of the same account: resend the request. */
3847
3889
  409: {
3848
3890
  headers: {
3849
3891
  [name: string]: unknown;
@@ -4150,10 +4192,15 @@ export interface paths {
4150
4192
  * @description Dashboard session only: an API key is refused with `401`. The request must carry the header `X-Requested-With: XMLHttpRequest`, or it is refused with `403 forbidden`. Schedules a subscription of the account to end at the end of the billing period already paid: the subscription of a line, a subscription to BYOD slots or a subscription to hosted macOS sessions. The line, the slots or the sessions work until then, and `cancel_at_period_end` reads `true` in `GET /v1/billing/subscriptions`. A subscription to BYOD slots or to hosted macOS sessions whose first payment has not succeeded is canceled immediately instead, and can no longer be paid; when that payment has been submitted, the call returns `409 purchase_payment_in_progress` and cancels nothing.
4151
4193
  *
4152
4194
  * Canceling a subscription to BYOD slots returns `422 byop_reduction_strands_mac_sessions` when the account would hold fewer BYOD slots than hosted macOS sessions at the end of the billing period: cancel the subscription to hosted macOS sessions first. When the subscription to BYOD slots ends, the `active` BYOD lines of the account that its remaining BYOD slots no longer cover take the status `cancelled`, oldest first. A subscription to BYOD slots or to hosted macOS sessions that has already ended returns `409 subscription_already_ended`. Any other subscription, a subscription of another account included, returns `403 forbidden`. The response is not wrapped in the standard envelope.
4195
+ *
4196
+ * To abandon a purchase that the account has not paid, send `only_if_unpaid=true`: the call then cancels the subscription only while it waits for its first payment and that payment has not been submitted, as above. A subscription this operation cancels (the subscription of a line, or one to BYOD slots or to hosted macOS sessions) that is paid, or whose first payment has been submitted, for example from another browser tab, returns `409 purchase_payment_in_progress`, and nothing is canceled or scheduled. A purchase of a line that has not activated its line, paid or not, still returns `403 forbidden`: it is ended with `POST /v1/lines/{id}/release`.
4153
4197
  */
4154
4198
  delete: {
4155
4199
  parameters: {
4156
- query?: never;
4200
+ query?: {
4201
+ /** @description `true` abandons an unpaid purchase: the subscription is canceled only while its first payment has not been submitted. A subscription this operation cancels that is paid, or whose first payment has been submitted, returns `409 purchase_payment_in_progress` and nothing is canceled. Omitted or `false`, the call cancels as it does without the parameter. */
4202
+ only_if_unpaid?: "true" | "false";
4203
+ };
4157
4204
  header?: never;
4158
4205
  path: {
4159
4206
  /** @description Id of the subscription, as returned in `id` by `GET /v1/billing/subscriptions`. */
@@ -4208,7 +4255,7 @@ export interface paths {
4208
4255
  "application/json": components["schemas"]["ErrorEnvelope"];
4209
4256
  };
4210
4257
  };
4211
- /** @description Conflict. The resource is not in a state that allows this operation; `error.code` names the reason. It is `subscription_already_ended` when a subscription to BYOD slots or to hosted macOS sessions has already ended. It is `purchase_payment_in_progress` when the first payment of an unpaid subscription has been submitted. */
4258
+ /** @description Conflict. The resource is not in a state that allows this operation; `error.code` names the reason. It is `subscription_already_ended` when a subscription to BYOD slots or to hosted macOS sessions has already ended. It is `purchase_payment_in_progress` when the first payment of an unpaid subscription has been submitted, and, with `only_if_unpaid=true`, when a subscription this operation cancels is paid: nothing is canceled. */
4212
4259
  409: {
4213
4260
  headers: {
4214
4261
  [name: string]: unknown;
@@ -4573,7 +4620,7 @@ export interface paths {
4573
4620
  put?: never;
4574
4621
  /**
4575
4622
  * Start adding a payment method
4576
- * @description Dashboard session only: an API key is refused with `401`. The request must carry the header `X-Requested-With: XMLHttpRequest`, or it is refused with `403 forbidden`. Returns `client_secret`, a client secret for the payment form of Stripe: the form saves a new card on the account. Only a card can be saved. The call creates the billing account of an account that has none. The response is not wrapped in the standard envelope.
4623
+ * @description Dashboard session only: an API key is refused with `401`. The request must carry the header `X-Requested-With: XMLHttpRequest`, or it is refused with `403 forbidden`. Returns `client_secret`, a client secret for the payment form of Stripe: the form saves a new card on the account. Only a card can be saved. The call creates the billing account of an account that has none. A wholesale partner is billed on the monthly wholesale invoice and saves no card: it gets `403 wholesale_partner_no_checkout`, and nothing is created. The response is not wrapped in the standard envelope.
4577
4624
  */
4578
4625
  post: {
4579
4626
  parameters: {
@@ -4611,6 +4658,15 @@ export interface paths {
4611
4658
  "application/json": components["schemas"]["ErrorEnvelope"];
4612
4659
  };
4613
4660
  };
4661
+ /** @description Refused. `error.code` is `wholesale_partner_no_checkout` when the account is a wholesale partner. It is `forbidden` when the request carries no header `X-Requested-With: XMLHttpRequest`. */
4662
+ 403: {
4663
+ headers: {
4664
+ [name: string]: unknown;
4665
+ };
4666
+ content: {
4667
+ "application/json": components["schemas"]["ErrorEnvelope"];
4668
+ };
4669
+ };
4614
4670
  /** @description Too many requests. `error.code` is `rate_limit_exceeded` when more than 100 requests came from the same network address in 60 seconds, whatever their API key or account: wait `error.retry_after` seconds. */
4615
4671
  429: {
4616
4672
  headers: {
@@ -9147,12 +9203,12 @@ export interface components {
9147
9203
  preferred_area_codes: string[];
9148
9204
  /** @description `true` for an inbound-only line, `false` for a two-way line. */
9149
9205
  inbound_only: boolean;
9150
- /** @description The billing anchor you set when creating the pre-order, carried onto the line at confirmation. `null` when you set none. */
9206
+ /** @description The billing anchor you set when creating the pre-order, carried onto the line when the line is created. `null` when you set none. */
9151
9207
  billing_anchor_at: string | null;
9152
9208
  status: components["schemas"]["PreOrderStatus"];
9153
- /** @description Client secret for the payment form of Stripe, to collect the first month. Set only in the response of `POST /v1/pre-orders/{id}/confirm`, for an account that is not a wholesale partner. `null` in every other response. */
9209
+ /** @description Client secret for the payment form of Stripe, to collect the first month. Set only in the response of `POST /v1/pre-orders/{id}/confirm`, when that response carries the pre-order in status `awaiting_payment`: the first time and every time confirm is repeated. `null` in every other response. */
9154
9210
  stripe_client_secret: string | null;
9155
- /** @description Estimated time of the hand-over of the line: the time of the confirmation plus 72 hours. Set once at confirmation and never revised. `null` until the pre-order is confirmed. */
9211
+ /** @description Estimated time of the hand-over of the line: the time the build starts plus 72 hours. Set once, when the build starts, and never revised. `null` while the pre-order is `draft` or `awaiting_payment`, and on a pre-order canceled before its build started. */
9156
9212
  estimated_fulfillment: string | null;
9157
9213
  device_status?: components["schemas"]["DeviceFulfillmentStatus"];
9158
9214
  /** @description Timestamp of creation, ISO 8601 in UTC. */
@@ -9170,12 +9226,12 @@ export interface components {
9170
9226
  } | null;
9171
9227
  };
9172
9228
  /**
9173
- * @description `draft`: created, with no effect. `provisioning`: confirmed, and the line is being prepared. `fulfilled`: the line is handed over. `cancelled`: the draft was canceled. A confirmed pre-order never becomes `cancelled`.
9229
+ * @description `draft`: created, with no effect. `awaiting_payment`: confirmed by a direct account, and the first month is due; nothing is built until it is paid. `provisioning`: the build has started, and the line is being prepared. `fulfilled`: the line is handed over. `cancelled`: the pre-order ended with no line. You canceled it, its first month was not paid within 23 hours of the confirmation, or its subscription was canceled before the first payment. A pre-order whose build has started never becomes `cancelled`.
9174
9230
  * @enum {string}
9175
9231
  */
9176
- PreOrderStatus: "draft" | "provisioning" | "fulfilled" | "cancelled";
9232
+ PreOrderStatus: "draft" | "awaiting_payment" | "provisioning" | "fulfilled" | "cancelled";
9177
9233
  /**
9178
- * @description Progress of the line. `awaiting_hardware`: the line is not ready; also the value of a draft and of a canceled draft. `ready`: the line is prepared. `deployed`: the line is handed over. `received` and `setup_in_progress` are declared and never returned. Always present on a pre-order, and never `null`.
9234
+ * @description Progress of the line. `awaiting_hardware`: the line is not ready; also the value of a pre-order that has no line: a draft, a pre-order in `awaiting_payment`, a canceled pre-order. `ready`: the line is prepared. `deployed`: the line is handed over. `received` and `setup_in_progress` are declared and never returned. Always present on a pre-order, and never `null`.
9179
9235
  * @enum {string|null}
9180
9236
  */
9181
9237
  DeviceFulfillmentStatus: "awaiting_hardware" | "received" | "setup_in_progress" | "ready" | "deployed" | null;
@@ -9357,7 +9413,7 @@ export interface components {
9357
9413
  BillingConfig: {
9358
9414
  /** @description Stripe publishable key that the payment form of Stripe is loaded with. It starts with `pk_test_` in test mode and with `pk_live_` in live mode. `null` only for a wholesale partner, when iSnap has no publishable key to return. */
9359
9415
  publishable_key: string | null;
9360
- /** @description `true` for a wholesale partner. A wholesale partner is billed on the monthly wholesale invoice: it has no card payment to make, and the operations that start a payment return `403 wholesale_partner_no_checkout` to it. */
9416
+ /** @description `true` for a wholesale partner. A wholesale partner is billed on the monthly wholesale invoice: it has no card payment to make, and the operations that start a payment or save a card return `403 wholesale_partner_no_checkout` to it. */
9361
9417
  wholesale: boolean;
9362
9418
  };
9363
9419
  BillingCoverageEnvelope: {
@@ -80,7 +80,13 @@ export declare class LinesResource extends BaseResource {
80
80
  * line is billed on its activation instant.
81
81
  */
82
82
  activate(id: string, body?: ActivateLineBody, opts?: RequestOptions): Promise<Line>;
83
- /** `POST /v1/lines/{id}/release` — release an active or reserved line back to the pool. */
83
+ /**
84
+ * `POST /v1/lines/{id}/release` — give back a line you reserved; it returns
85
+ * to `available`. While the first payment of a subscription of yours for the
86
+ * line has been submitted, or has succeeded within the last hour, and the line
87
+ * is not `active` yet, the call fails with `409 purchase_payment_in_progress`
88
+ * and releases nothing.
89
+ */
84
90
  release(id: string, opts?: RequestOptions): Promise<Line>;
85
91
  /**
86
92
  * `POST /v1/lines/{id}/terminate` — permanently END a line you own. The
@@ -1 +1 @@
1
- {"version":3,"file":"lines.d.ts","sourceRoot":"","sources":["../../src/resources/lines.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAA;AAChE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAExC,MAAM,MAAM,IAAI,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,CAAA;AAChD,MAAM,MAAM,QAAQ,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,UAAU,CAAC,CAAA;AACxD,MAAM,MAAM,OAAO,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,SAAS,CAAC,CAAA;AACtD,MAAM,MAAM,cAAc,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,YAAY,CAAC,CAAA;AAChE,MAAM,MAAM,gBAAgB,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,cAAc,CAAC,CAAA;AACpE,MAAM,MAAM,qBAAqB,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,mB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AC,iBAAiB,CAAC;IAS7B;;;;;;;;OAQG;IACH,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,UAAU,CAAC;IAS9D,6FAA6F;IAC7F,SAAS,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,sBAAsB,CAAC;IAS7E;;;;OAIG;IACH,YAAY,CACV,EAAE,EAAE,MAAM,EACV,IAAI,EAAE,eAAe,EACrB,IAAI,CAAC,EAAE,cAAc,GACpB,OAAO,CAAC,sBAAsB,CAAC;CAQnC"}
@@ -77,7 +77,13 @@ export class LinesResource extends BaseResource {
77
77
  activate(id, body = {}, opts) {
78
78
  return this.client.request('POST', `/v1/lines/${encodeURIComponent(id)}/activate`, body, opts);
79
79
  }
80
- /** `POST /v1/lines/{id}/release` — release an active or reserved line back to the pool. */
80
+ /**
81
+ * `POST /v1/lines/{id}/release` — give back a line you reserved; it returns
82
+ * to `available`. While the first payment of a subscription of yours for the
83
+ * line has been submitted, or has succeeded within the last hour, and the line
84
+ * is not `active` yet, the call fails with `409 purchase_payment_in_progress`
85
+ * and releases nothing.
86
+ */
81
87
  release(id, opts) {
82
88
  return this.client.request('POST', `/v1/lines/${encodeURIComponent(id)}/release`, undefined, opts);
83
89
  }
@@ -1 +1 @@
1
- {"version":3,"file":"lines.js","sourceRoot":"","sources":["../../src/resources/lines.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAwBxC,MAAM,OAAO,aAAc,SAAQ,YAAY;IAC7C;;;;;OAKG;IACH,IAAI,CAAC,QAAwB,EAAE,EAAE,IAAqB;QACpD,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAW,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE;YAClE,GAAG,IAAI;YACP,KAAK,EAAE,EAAE,GAAG,IAAI,EAAE,KAAK,EAAE,GAAG,KAAK,EA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ource extends BaseResource {
28
28
  create(body: CreatePreOrderBody, opts?: RequestOptions): Promise<PreOrder>;
29
29
  /**
30
30
  * `POST /v1/pre-orders/{id}/confirm` — confirm a `draft` pre-order. The
31
- * binding step: engages the one-month commitment (full month, no proration)
32
- * and triggers procurement (mints the provisioning line + fulfillment task,
33
- * notifies ops). Returns the pre-order in `provisioning`; ops procures the
34
- * hardware and the partner is notified via the `pre_order.fulfilled` webhook
35
- * when a matching line is ready. Direct customers get a Stripe
36
- * `stripe_client_secret` to confirm the first-month charge; wholesale
37
- * partners are billed EOM (no per-line Stripe sub). Only a draft can be
38
- * confirmed.
31
+ * binding step: engages the one-month commitment (full month, no proration).
32
+ *
33
+ * A wholesale partner (billed at the end of the month) gets the pre-order
34
+ * back in `provisioning`: the line is being built, and the
35
+ * `pre_order.fulfilled` webhook fires when it is live.
36
+ *
37
+ * A direct account gets it back in `awaiting_payment` with
38
+ * `stripe_client_secret`, the client secret of the first-month payment, to
39
+ * confirm with the Stripe Payment Element (card only). Nothing is built until
40
+ * that payment succeeds; the pre-order then moves to `provisioning`: read it
41
+ * with `get()` until it leaves `awaiting_payment`. Calling `confirm()` again
42
+ * while it is `awaiting_payment` returns the same secret. When the first
43
+ * month is already paid (the account's credit balance covers it, or
44
+ * `confirm()` is repeated after the payment), the pre-order comes back in
45
+ * `provisioning` with `stripe_client_secret: null`.
46
+ *
47
+ * The first month starts at the confirmation, not when the line is handed
48
+ * over, and the next invoice is issued one month after the confirmation. The
49
+ * hand-over of the line takes no payment and does not change when the
50
+ * subscription is invoiced.
51
+ *
52
+ * An unpaid first month cancels the pre-order 23 hours after the
53
+ * confirmation; `confirm()` on it then throws a `BadRequestError` (400
54
+ * `pre_order_not_draft`), like any confirm of a pre-order that is not a
55
+ * draft. A 503 `payment_provider_unavailable` means nothing changed and the
56
+ * call can be repeated (the SDK retries it). A `ConflictError` with 409
57
+ * `payment_setup_failed` means the payment provider refused the request for
58
+ * the account: it is not retried, and repeating it does not help.
39
59
  */
40
60
  confirm(id: string, opts?: RequestOptions): Promise<PreOrder>;
41
61
  /**
@@ -51,7 +71,12 @@ export declare class PreOrdersResource extends BaseResource {
51
71
  * `has_more` is false.
52
72
  */
53
73
  list(query?: ListPreOrdersQuery, opts?: RequestOptions): Promise<PreOrderListData>;
54
- /** `GET /v1/pre-orders/{id}` — fetch a single pre-order by id. */
74
+ /**
75
+ * `GET /v1/pre-orders/{id}` — fetch a single pre-order by id. Reading a
76
+ * pre-order that is `awaiting_payment` checks its first-month payment: once
77
+ * it has succeeded, the pre-order comes back in `provisioning`.
78
+ * `stripe_client_secret` is always `null` here.
79
+ */
55
80
  get(id: string, opts?: RequestOptions): Promise<PreOrder>;
56
81
  /**
57
82
  * `PATCH /v1/pre-orders/{id}` — merge `metadata` into the pre-order's tags.
@@ -64,9 +89,13 @@ export declare class PreOrdersResource extends BaseResource {
64
89
  */
65
90
  update(id: string, body: PatchPreOrderBody, opts?: RequestOptions): Promise<PreOrder>;
66
91
  /**
67
- * `POST /v1/pre-orders/{id}/cancel` — cancel a pre-order before it is
68
- * fulfilled. Refunds the Stripe payment intent (if charged) and releases the
69
- * procurement task. No-op on an already-cancelled / fulfilled pre-order.
92
+ * `POST /v1/pre-orders/{id}/cancel` — cancel a `draft` or `awaiting_payment`
93
+ * pre-order. Free: nothing is charged or built in either status. For an
94
+ * `awaiting_payment` pre-order the first-month payment is voided first, so
95
+ * its client secret can no longer charge; a first month already paid throws
96
+ * a `ConflictError` (409 `pre_order_already_paid`). A pre-order that is
97
+ * `provisioning`, `fulfilled` or already `cancelled` is refused (400
98
+ * `pre_order_already_confirmed`).
70
99
  */
71
100
  cancel(id: string, opts?: RequestOptions): Promise<PreOrder>;
72
101
  }
@@ -1 +1 @@
1
- {"version":3,"file":"preorders.d.ts","sourceRoot":"","sources":["../../src/resources/preorders.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAA;AAChE,OAAO,KAAK,E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IACH,MAAM,CAAC,IAAI,EAAE,kBAAkB,EAAE,IAAI,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,QAAQ,CAAC;IAI1E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA8BG;IACH,OAAO,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,QAAQ,CAAC;IAS7D;;;;;;;;;;;OAWG;IACH,IAAI,CAAC,KAAK,GAAE,kBAAuB,EAAE,IAAI,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAOtF;;;;;OAKG;IACH,GAAG,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,QAAQ,CAAC;IASzD;;;;;;;;OAQG;IACH,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,iBAAiB,EAAE,IAAI,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,QAAQ,CAAC;IASrF;;;;;;;;OAQG;IACH,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,QAAQ,CAAC;CAQ7D"}
@@ -22,14 +22,34 @@ export class PreOrdersResource extends BaseResource {
22
22
  }
23
23
  /**
24
24
  * `POST /v1/pre-orders/{id}/confirm` — confirm a `draft` pre-order. The
25
- * binding step: engages the one-month commitment (full month, no proration)
26
- * and triggers procurement (mints the provisioning line + fulfillment task,
27
- * notifies ops). Returns the pre-order in `provisioning`; ops procures the
28
- * hardware and the partner is notified via the `pre_order.fulfilled` webhook
29
- * when a matching line is ready. Direct customers get a Stripe
30
- * `stripe_client_secret` to confirm the first-month charge; wholesale
31
- * partners are billed EOM (no per-line Stripe sub). Only a draft can be
32
- * confirmed.
25
+ * binding step: engages the one-month commitment (full month, no proration).
26
+ *
27
+ * A wholesale partner (billed at the end of the month) gets the pre-order
28
+ * back in `provisioning`: the line is being built, and the
29
+ * `pre_order.fulfilled` webhook fires when it is live.
30
+ *
31
+ * A direct account gets it back in `awaiting_payment` with
32
+ * `stripe_client_secret`, the client secret of the first-month payment, to
33
+ * confirm with the Stripe Payment Element (card only). Nothing is built until
34
+ * that payment succeeds; the pre-order then moves to `provisioning`: read it
35
+ * with `get()` until it leaves `awaiting_payment`. Calling `confirm()` again
36
+ * while it is `awaiting_payment` returns the same secret. When the first
37
+ * month is already paid (the account's credit balance covers it, or
38
+ * `confirm()` is repeated after the payment), the pre-order comes back in
39
+ * `provisioning` with `stripe_client_secret: null`.
40
+ *
41
+ * The first month starts at the confirmation, not when the line is handed
42
+ * over, and the next invoice is issued one month after the confirmation. The
43
+ * hand-over of the line takes no payment and does not change when the
44
+ * subscription is invoiced.
45
+ *
46
+ * An unpaid first month cancels the pre-order 23 hours after the
47
+ * confirmation; `confirm()` on it then throws a `BadRequestError` (400
48
+ * `pre_order_not_draft`), like any confirm of a pre-order that is not a
49
+ * draft. A 503 `payment_provider_unavailable` means nothing changed and the
50
+ * call can be repeated (the SDK retries it). A `ConflictError` with 409
51
+ * `payment_setup_failed` means the payment provider refused the request for
52
+ * the account: it is not retried, and repeating it does not help.
33
53
  */
34
54
  confirm(id, opts) {
35
55
  return this.client.request('POST', `/v1/pre-orders/${encodeURIComponent(id)}/confirm`, undefined, opts);
@@ -52,7 +72,12 @@ export class PreOrdersResource extends BaseResource {
52
72
  query: { ...opts?.query, ...query }
53
73
  });
54
74
  }
55
- /** `GET /v1/pre-orders/{id}` — fetch a single pre-order by id. */
75
+ /**
76
+ * `GET /v1/pre-orders/{id}` — fetch a single pre-order by id. Reading a
77
+ * pre-order that is `awaiting_payment` checks its first-month payment: once
78
+ * it has succeeded, the pre-order comes back in `provisioning`.
79
+ * `stripe_client_secret` is always `null` here.
80
+ */
56
81
  get(id, opts) {
57
82
  return this.client.request('GET', `/v1/pre-orders/${encodeURIComponent(id)}`, undefined, opts);
58
83
  }
@@ -69,9 +94,13 @@ export class PreOrdersResource extends BaseResource {
69
94
  return this.client.request('PATCH', `/v1/pre-orders/${encodeURIComponent(id)}`, body, opts);
70
95
  }
71
96
  /**
72
- * `POST /v1/pre-orders/{id}/cancel` — cancel a pre-order before it is
73
- * fulfilled. Refunds the Stripe payment intent (if charged) and releases the
74
- * procurement task. No-op on an already-cancelled / fulfilled pre-order.
97
+ * `POST /v1/pre-orders/{id}/cancel` — cancel a `draft` or `awaiting_payment`
98
+ * pre-order. Free: nothing is charged or built in either status. For an
99
+ * `awaiting_payment` pre-order the first-month payment is voided first, so
100
+ * its client secret can no longer charge; a first month already paid throws
101
+ * a `ConflictError` (409 `pre_order_already_paid`). A pre-order that is
102
+ * `provisioning`, `fulfilled` or already `cancelled` is refused (400
103
+ * `pre_order_already_confirmed`).
75
104
  */
76
105
  cancel(id, opts) {
77
106
  return this.client.request('POST', `/v1/pre-orders/${encodeURIComponent(id)}/cancel`, undefined, opts);
@@ -1 +1 @@
1
- {"version":3,"file":"preorders.js","sourceRoot":"","sources":["../../src/resources/preorders.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAexC,MAAM,OAAO,iBAAkB,SAAQ,YAAY;IACjD;;;;;;;;;;;;;;;;OAgBG;IACH,MAAM,CAAC,IAAwB,EAAE,IAAqB;QACpD,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAW,MAAM,EAAE,gBAAgB,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA;IAC5E,CAAC;IAED;;;;;;;;;;OAUG;IACH,OAAO,CAAC,EAAU,EAAE,IAAqB;QACvC,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CACxB,MAAM,EACN,kBAAkB,kBAAkB,CAAC,EAAE,CAAC,UAAU,EAClD,SAAS,EACT,IAAI,CACL,CAAA;IACH,CAAC;IAED;;;;;;;;;;;OAWG;IACH,IAAI,CAAC,QAA4B,EAAE,EAAE,IAAqB;QACxD,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO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C,MAAM,CAAC,OAAO,CACxB,MAAM,EACN,kBAAkB,kBAAkB,CAAC,EAAE,CAAC,UAAU,EAClD,SAAS,EACT,IAAI,CACL,CAAA;IACH,CAAC;IAED;;;;;;;;;;;OAWG;IACH,IAAI,CAAC,QAA4B,EAAE,EAAE,IAAqB;QACxD,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAmB,KAAK,EAAE,gBAAgB,EAAE,SAAS,EAAE;YAC/E,GAAG,IAAI;YACP,KAAK,EAAE,EAAE,GAAG,IAAI,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE;SACpC,CAAC,CAAA;IACJ,CAAC;IAED;;;;;OAKG;IACH,GAAG,CAAC,EAAU,EAAE,IAAqB;QACnC,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CACxB,KAAK,EACL,kBAAkB,kBAAkB,CAAC,EAAE,CAAC,EAAE,EAC1C,SAAS,EACT,IAAI,CACL,CAAA;IACH,CAAC;IAED;;;;;;;;OAQG;IACH,MAAM,CAAC,EAAU,EAAE,IAAuB,EAAE,IAAqB;QAC/D,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CACxB,OAAO,EACP,kBAAkB,kBAAkB,CAAC,EAAE,CAAC,EAAE,EAC1C,IAAI,EACJ,IAAI,CACL,CAAA;IACH,CAAC;IAED;;;;;;;;OAQG;IACH,MAAM,CAAC,EAAU,EAAE,IAAqB;QACtC,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CACxB,MAAM,EACN,kBAAkB,kBAAkB,CAAC,EAAE,CAAC,SAAS,EACjD,SAAS,EACT,IAAI,CACL,CAAA;IACH,CAAC;CACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@isnap/sdk",
3
- "version": "2.2.0-next.227",
3
+ "version": "2.2.0-next.229",
4
4
  "description": "Official TypeScript SDK for the iSnap P2P telephony API",
5
5
  "license": "MIT",
6
6
  "type": "module",