@shoplygg/node 0.12.2 → 0.12.5
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.
- package/generated/api.d.ts +56 -10
- package/index.js +1 -1
- package/package.json +1 -1
package/generated/api.d.ts
CHANGED
|
@@ -4462,6 +4462,7 @@ export type OrdersShowResult = {
|
|
|
4462
4462
|
}[];
|
|
4463
4463
|
testPayment: boolean;
|
|
4464
4464
|
payments: unknown[] | Record<string, unknown>;
|
|
4465
|
+
held: unknown;
|
|
4465
4466
|
invoice: unknown;
|
|
4466
4467
|
disputes: unknown[] | Record<string, unknown>;
|
|
4467
4468
|
discord: unknown;
|
|
@@ -4635,6 +4636,7 @@ export type InvoicesListItem = {
|
|
|
4635
4636
|
status: string;
|
|
4636
4637
|
itemCount: number;
|
|
4637
4638
|
paidAt: unknown;
|
|
4639
|
+
closed: boolean;
|
|
4638
4640
|
};
|
|
4639
4641
|
|
|
4640
4642
|
/** What create an invoice takes: `invoices.create`. */
|
|
@@ -6644,6 +6646,11 @@ export type CustomersStatsResult = {
|
|
|
6644
6646
|
/** What get a customer answers: `customers.show`. */
|
|
6645
6647
|
export type CustomersShowResult = {
|
|
6646
6648
|
balance: number;
|
|
6649
|
+
balanceHolds: {
|
|
6650
|
+
orderId: string;
|
|
6651
|
+
amount: number;
|
|
6652
|
+
why: string;
|
|
6653
|
+
}[];
|
|
6647
6654
|
balanceAtCheckout: boolean;
|
|
6648
6655
|
tags: {
|
|
6649
6656
|
id: string;
|
|
@@ -6695,6 +6702,11 @@ export interface CustomersSetBalanceParams {
|
|
|
6695
6702
|
/** What change a customer's balance answers: `customers.setBalance`. */
|
|
6696
6703
|
export type CustomersSetBalanceResult = {
|
|
6697
6704
|
balance: number;
|
|
6705
|
+
balanceHolds: {
|
|
6706
|
+
orderId: string;
|
|
6707
|
+
amount: number;
|
|
6708
|
+
why: string;
|
|
6709
|
+
}[];
|
|
6698
6710
|
balanceAtCheckout: boolean;
|
|
6699
6711
|
tags: {
|
|
6700
6712
|
id: string;
|
|
@@ -6736,6 +6748,11 @@ export interface CustomersBlacklistParams {
|
|
|
6736
6748
|
/** What blacklist a customer answers: `customers.blacklist`. */
|
|
6737
6749
|
export type CustomersBlacklistResult = {
|
|
6738
6750
|
balance: number;
|
|
6751
|
+
balanceHolds: {
|
|
6752
|
+
orderId: string;
|
|
6753
|
+
amount: number;
|
|
6754
|
+
why: string;
|
|
6755
|
+
}[];
|
|
6739
6756
|
balanceAtCheckout: boolean;
|
|
6740
6757
|
tags: {
|
|
6741
6758
|
id: string;
|
|
@@ -6781,6 +6798,11 @@ export interface CustomersUnblacklistParams {
|
|
|
6781
6798
|
/** What clear a customer from the blacklist answers: `customers.unblacklist`. */
|
|
6782
6799
|
export type CustomersUnblacklistResult = {
|
|
6783
6800
|
balance: number;
|
|
6801
|
+
balanceHolds: {
|
|
6802
|
+
orderId: string;
|
|
6803
|
+
amount: number;
|
|
6804
|
+
why: string;
|
|
6805
|
+
}[];
|
|
6784
6806
|
balanceAtCheckout: boolean;
|
|
6785
6807
|
tags: {
|
|
6786
6808
|
id: string;
|
|
@@ -6817,6 +6839,11 @@ export interface CustomersTrustParams {
|
|
|
6817
6839
|
/** What trust a customer answers: `customers.trust`. */
|
|
6818
6840
|
export type CustomersTrustResult = {
|
|
6819
6841
|
balance: number;
|
|
6842
|
+
balanceHolds: {
|
|
6843
|
+
orderId: string;
|
|
6844
|
+
amount: number;
|
|
6845
|
+
why: string;
|
|
6846
|
+
}[];
|
|
6820
6847
|
balanceAtCheckout: boolean;
|
|
6821
6848
|
tags: {
|
|
6822
6849
|
id: string;
|
|
@@ -6847,6 +6874,11 @@ export type CustomersTrustResult = {
|
|
|
6847
6874
|
/** What stop trusting a customer answers: `customers.untrust`. */
|
|
6848
6875
|
export type CustomersUntrustResult = {
|
|
6849
6876
|
balance: number;
|
|
6877
|
+
balanceHolds: {
|
|
6878
|
+
orderId: string;
|
|
6879
|
+
amount: number;
|
|
6880
|
+
why: string;
|
|
6881
|
+
}[];
|
|
6850
6882
|
balanceAtCheckout: boolean;
|
|
6851
6883
|
tags: {
|
|
6852
6884
|
id: string;
|
|
@@ -7952,7 +7984,7 @@ export interface ResellerProductsBadgesParams {
|
|
|
7952
7984
|
|
|
7953
7985
|
/** What set a product's status and labels on the panel answers: `resellerProducts.badges`. */
|
|
7954
7986
|
export type ResellerProductsBadgesResult = {
|
|
7955
|
-
"
|
|
7987
|
+
"591cc244-1b62-483e-8002-ad61aa7829b2": {
|
|
7956
7988
|
label: string;
|
|
7957
7989
|
color: string;
|
|
7958
7990
|
kind: string;
|
|
@@ -8271,6 +8303,7 @@ export type ResellerTopUpsListItem = {
|
|
|
8271
8303
|
method: string;
|
|
8272
8304
|
createdAt: string;
|
|
8273
8305
|
paidAt: unknown;
|
|
8306
|
+
held: unknown;
|
|
8274
8307
|
};
|
|
8275
8308
|
|
|
8276
8309
|
/** What export top-ups takes: `resellerTopUps.export`. */
|
|
@@ -11774,7 +11807,16 @@ export type CustomerVerifyResult = {
|
|
|
11774
11807
|
export type CustomerShowResult = {
|
|
11775
11808
|
email: string;
|
|
11776
11809
|
customerSince: string;
|
|
11777
|
-
balance:
|
|
11810
|
+
balance: {
|
|
11811
|
+
amount: number;
|
|
11812
|
+
currencyCode: string;
|
|
11813
|
+
available: number;
|
|
11814
|
+
holds: {
|
|
11815
|
+
orderId: string;
|
|
11816
|
+
amount: number;
|
|
11817
|
+
why: string;
|
|
11818
|
+
}[];
|
|
11819
|
+
};
|
|
11778
11820
|
affiliate: {
|
|
11779
11821
|
member: boolean;
|
|
11780
11822
|
canJoin: boolean;
|
|
@@ -13711,7 +13753,7 @@ export interface ShoplyResourcesOrders {
|
|
|
13711
13753
|
/**
|
|
13712
13754
|
* **Get an order**
|
|
13713
13755
|
*
|
|
13714
|
-
* One order with everything its page shows: its lines and what each delivered, its payments, the buyer, its timeline, where it came from, `refund`, which says which ways it can be refunded, and `requests`: what Shoply sent your servers about it, each try of each webhook about the order and each line's dynamic delivery, newest first, with the first 300 characters of what came back. `customPayment` is for an order paid with one of your custom payment methods, and null for any other: the method's name, `status` (`open`, `review` while it waits for you to approve or reject it, `paid` or `rejected`), the amount, and `proof`, what the buyer sent when they said they paid (the reference, whether a proof of payment was sent, and when). An order brought across by Platform Migration is found by its ID on the platform it came from as well, and answers with its own `id`; what it delivered there is in its items' `deliveredKeys`, a line of it each, where that platform says.
|
|
13756
|
+
* One order with everything its page shows: its lines and what each delivered, its payments, the buyer, its timeline, where it came from, `refund`, which says which ways it can be refunded, and `requests`: what Shoply sent your servers about it, each try of each webhook about the order and each line's dynamic delivery, newest first, with the first 300 characters of what came back. `customPayment` is for an order paid with one of your custom payment methods, and null for any other: the method's name, `status` (`open`, `review` while it waits for you to approve or reject it, `paid` or `rejected`), the amount, and `proof`, what the buyer sent when they said they paid (the reference, whether a proof of payment was sent, and when). `held` says why an unpaid order is held for its payment, and is null for any other order. Such an order is not cancelled when its time runs out. `reason` is `unconfirmed` (the payment provider could not say whether it was paid, since `since`) or `pending` (the provider says the payment is on its way), `lines` is the same as sentences, `providers` is who to look for the payment with, `renewal`, for a subscription's renewal, is what cancelling it does: `again`, another is made, or `ends`, the subscription ends, `balance` is how much of the buyer's store balance it holds, which cancelling it releases, and `again`, for a renewal whose charge got no answer and can be sent again, is the `provider`, the `reference` to look for there, and `until` when, or null. It is cancelled, and its charge sent again, in the dashboard, by somebody who has looked, and not with a key. An order brought across by Platform Migration is found by its ID on the platform it came from as well, and answers with its own `id`; what it delivered there is in its items' `deliveredKeys`, a line of it each, where that platform says.
|
|
13715
13757
|
*
|
|
13716
13758
|
* Needs the `orders.read` permission (Read Orders).
|
|
13717
13759
|
*
|
|
@@ -13773,6 +13815,8 @@ export interface ShoplyResourcesOrders {
|
|
|
13773
13815
|
*
|
|
13774
13816
|
* One order is delivered again at most ten times an hour, whoever asks: after that the answer is 429.
|
|
13775
13817
|
*
|
|
13818
|
+
* Refused with `access_held` (409) while the buyer's access to the order is taken back: a dispute on it took its keys and files back, or the subscription it belongs to is paused or has ended.
|
|
13819
|
+
*
|
|
13776
13820
|
* Needs the `orders.fulfil` permission (Deliver Orders).
|
|
13777
13821
|
*
|
|
13778
13822
|
* @see https://docs.shoply.gg/api-reference/orders/deliver-an-order-again
|
|
@@ -13781,7 +13825,7 @@ export interface ShoplyResourcesOrders {
|
|
|
13781
13825
|
/**
|
|
13782
13826
|
* **Retry a dynamic delivery**
|
|
13783
13827
|
*
|
|
13784
|
-
* Asks your delivery endpoint again for the lines whose dynamic delivery failed. Nothing is revoked: those lines never delivered anything. A store may ask for 150 of these in ten minutes.
|
|
13828
|
+
* Asks your delivery endpoint again for the lines whose dynamic delivery failed. Nothing is revoked: those lines never delivered anything. A store may ask for 150 of these in ten minutes. Refused with `access_held` (409) while the buyer's access to the order is taken back, as Deliver an order again is; its lines are delivered once the access is given back.
|
|
13785
13829
|
*
|
|
13786
13830
|
* Needs the `orders.fulfil` permission (Deliver Orders).
|
|
13787
13831
|
*
|
|
@@ -13791,7 +13835,7 @@ export interface ShoplyResourcesOrders {
|
|
|
13791
13835
|
/**
|
|
13792
13836
|
* **Send an order's email again**
|
|
13793
13837
|
*
|
|
13794
|
-
* Sends the order's delivery email again, with what it delivered, to the order's own email address. One customer's order emails are sent again at most five times an hour at your store, across all their orders and whoever asks: after that the answer is 429.
|
|
13838
|
+
* Sends the order's delivery email again, with what it delivered, to the order's own email address. One customer's order emails are sent again at most five times an hour at your store, across all their orders and whoever asks: after that the answer is 429. Refused with `access_held` (409) while the buyer's access to the order is taken back, as Deliver an order again is.
|
|
13795
13839
|
*
|
|
13796
13840
|
* Needs the `orders.fulfil` permission (Deliver Orders). It sends an email, and is counted against a budget of its own: 60 in ten minutes for each key.
|
|
13797
13841
|
*
|
|
@@ -13844,7 +13888,7 @@ export interface ShoplyResourcesInvoices {
|
|
|
13844
13888
|
/**
|
|
13845
13889
|
* **List invoices**
|
|
13846
13890
|
*
|
|
13847
|
-
* The invoices the store has raised, a page at a time, newest first. An invoice is an order the store made for a buyer to pay: `orderId` is that order, and `payUrl` the page it is paid on. A payment link is listed with them (`kind` is `link`): an amount and what it is for (`title`), with no buyer on it (`email` is empty) until it is emailed to somebody or paid. One made in another currency than the store's says what the buyer is asked for in `charge`.
|
|
13891
|
+
* The invoices the store has raised, a page at a time, newest first. An invoice is an order the store made for a buyer to pay: `orderId` is that order, and `payUrl` the page it is paid on. A payment link is listed with them (`kind` is `link`): an amount and what it is for (`title`), with no buyer on it (`email` is empty) until it is emailed to somebody or paid. One made in another currency than the store's says what the buyer is asked for in `charge`. `overdue` is past its due date, so it can no longer be paid. `closed` is unpaid and past its due date with no payment keeping it open, so it is cancelled within minutes.
|
|
13848
13892
|
*
|
|
13849
13893
|
* Needs the `invoices.read` permission (Read Invoices).
|
|
13850
13894
|
*
|
|
@@ -14677,7 +14721,7 @@ export interface ShoplyResourcesCustomers {
|
|
|
14677
14721
|
/**
|
|
14678
14722
|
* **Get a customer**
|
|
14679
14723
|
*
|
|
14680
|
-
* One customer: their orders, what they have spent in the store's currency today (`totalSpend`, over `paidInCurrency` of their paid orders) and in any other (`otherSpend`), their balance and its history, their `tags`, whether they are blacklisted, and their affiliate figures if they are one.
|
|
14724
|
+
* One customer: their orders, what they have spent in the store's currency today (`totalSpend`, over `paidInCurrency` of their paid orders) and in any other (`otherSpend`), their balance and its history, what of it is on hold (`balanceHolds`: each order, how much, and why: `coming`, `unconfirmed` or `part_paid`), their `tags`, whether they are blacklisted, and their affiliate figures if they are one.
|
|
14681
14725
|
*
|
|
14682
14726
|
* Needs the `customers.read` permission (Read Customers).
|
|
14683
14727
|
*
|
|
@@ -14687,7 +14731,7 @@ export interface ShoplyResourcesCustomers {
|
|
|
14687
14731
|
/**
|
|
14688
14732
|
* **Change a customer's balance**
|
|
14689
14733
|
*
|
|
14690
|
-
* Adds to, takes from or sets the customer's balance at the store, which they can spend at checkout. Send an `Idempotency-Key` with this request, so that a retry does not credit twice. Answers the customer with the new balance and its history.
|
|
14734
|
+
* Adds to, takes from or sets the customer's balance at the store, which they can spend at checkout. Send an `Idempotency-Key` with this request, so that a retry does not credit twice. Answers the customer with the new balance and its history. What is on hold for their orders (`balanceHolds`) can't be taken: a change that would leave less than that is refused with `422`, under `errors.amount`.
|
|
14691
14735
|
*
|
|
14692
14736
|
* Needs the `customers.balance` permission (Change Balances).
|
|
14693
14737
|
*
|
|
@@ -15240,7 +15284,7 @@ export interface ShoplyResourcesResellers {
|
|
|
15240
15284
|
/**
|
|
15241
15285
|
* **Remove a reseller**
|
|
15242
15286
|
*
|
|
15243
|
-
* Removes a reseller from the store: their team can no longer sign in, and their API keys, delivery URLs and team invites are deleted. Their records are kept: their orders and top-ups stay in List reseller orders and List top-ups, and Get a reseller still answers them, with `removedAt` and their balance history. Refused with `reseller_has_balance` while they hold a balance: set it to zero first. A removed reseller is in no list of resellers, and does not count against the store's plan.
|
|
15287
|
+
* Removes a reseller from the store: their team can no longer sign in, and their API keys, delivery URLs and team invites are deleted. Their records are kept: their orders and top-ups stay in List reseller orders and List top-ups, and Get a reseller still answers them, with `removedAt` and their balance history. Refused with `reseller_has_balance` while they hold a balance: set it to zero first. Their top-ups not yet paid are cancelled, and while one is being paid the answer is `reseller_topup_paying` (409): ask again once it has its answer, so the money is on their balance first. A removed reseller is in no list of resellers, and does not count against the store's plan.
|
|
15244
15288
|
*
|
|
15245
15289
|
* Needs the `resellers.write` permission (Change Resellers).
|
|
15246
15290
|
*
|
|
@@ -15498,7 +15542,7 @@ export interface ShoplyResourcesResellerTopUps {
|
|
|
15498
15542
|
/**
|
|
15499
15543
|
* **List top-ups**
|
|
15500
15544
|
*
|
|
15501
|
-
* Money resellers put on their balance, paid on the store's checkout with its own payment methods, newest first, 25 a page. `state` is `paid`, `waiting` (for the reseller to pay), `checking` (paid with one of the store's custom methods, and waiting for the store), `expired` (not paid in the store's unpaid order time) or `taken_back` (its payment was taken back by the bank, and came off the balance). A top-up's `id` is the order it is paid with. `meta.counts` is how many in each state, and `meta.figures` the last 30 days'.
|
|
15545
|
+
* Money resellers put on their balance, paid on the store's checkout with its own payment methods, newest first, 25 a page. `state` is `paid`, `waiting` (for the reseller to pay), `checking` (paid with one of the store's custom methods, and waiting for the store), `expired` (not paid in the store's unpaid order time) or `taken_back` (its payment was taken back by the bank, and came off the balance). A top-up's `id` is the order it is paid with. `held` is why a `waiting` one is held for its payment and does not expire, or null: `reason`, `lines` and `providers`, as on an order. `meta.counts` is how many in each state, and `meta.figures` the last 30 days'.
|
|
15502
15546
|
*
|
|
15503
15547
|
* Needs the `resellers.read` permission (Read Resellers).
|
|
15504
15548
|
*
|
|
@@ -16744,6 +16788,8 @@ export interface ShoplyCustomerResources {
|
|
|
16744
16788
|
*
|
|
16745
16789
|
* Everything the customer panel's first page shows: the buyer's email, what they have spent, their store balance, their 200 newest orders, and the downloads, files and setup instructions their paid orders hand over.
|
|
16746
16790
|
*
|
|
16791
|
+
* `balance` is null where they hold none. `amount` is all of it and `available` what they can spend now. `holds` is what is on hold of the rest: each order with part of it, how much, and `why`: `coming` (the payment is on its way), `unconfirmed` (nobody can say yet whether it was paid) or `part_paid` (only part of the payment has arrived). It is used when the payment arrives, and released when the payment fails or the order is cancelled.
|
|
16792
|
+
*
|
|
16747
16793
|
* `downloads.files` and `downloads.instructions` are every paid order's together. `downloads.orders` is the same an order at a time, newest first, as the customer panel shows it: each with what it bought, its own files and its own instructions. The store's `buttons` and `general` notes go with every order.
|
|
16748
16794
|
*
|
|
16749
16795
|
* `affiliate` is null unless the store has an affiliate programme the buyer is in or may join, and `subscriptions` says whether they have ever had one. Keys are not listed here: Get an order has them.
|
package/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shoplygg/node",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.5",
|
|
4
4
|
"description": "Shoply's API from your own server: every route as a typed method, safe retries, pages, checking webhooks, and OAuth for apps.",
|
|
5
5
|
"keywords": ["shoply", "api", "sdk", "ecommerce", "webhooks", "digital-goods"],
|
|
6
6
|
"homepage": "https://docs.shoply.gg/api-reference/node",
|