@thorprovider/types 3.6.0 → 3.8.0
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/dist/index.d.mts +469 -5
- package/dist/index.d.ts +469 -5
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/admin/DropshippingAdmin.ts +636 -1
- package/src/index.ts +36 -5
package/dist/index.d.mts
CHANGED
|
@@ -2042,7 +2042,7 @@ interface PaymentMethodFeatures {
|
|
|
2042
2042
|
* }
|
|
2043
2043
|
* ```
|
|
2044
2044
|
*/
|
|
2045
|
-
interface PaymentMethod {
|
|
2045
|
+
interface PaymentMethod$1 {
|
|
2046
2046
|
/**
|
|
2047
2047
|
* Unique identifier from backend
|
|
2048
2048
|
*
|
|
@@ -2161,7 +2161,7 @@ interface CachedPaymentMethods {
|
|
|
2161
2161
|
/**
|
|
2162
2162
|
* Cached payment methods
|
|
2163
2163
|
*/
|
|
2164
|
-
methods: PaymentMethod[];
|
|
2164
|
+
methods: PaymentMethod$1[];
|
|
2165
2165
|
/**
|
|
2166
2166
|
* Timestamp when cached (milliseconds since epoch)
|
|
2167
2167
|
*/
|
|
@@ -2884,7 +2884,7 @@ interface CommerceProvider {
|
|
|
2884
2884
|
* @throws {Error} If backend request fails
|
|
2885
2885
|
* @throws {Error} If required options are missing (e.g., regionId for Medusa)
|
|
2886
2886
|
*/
|
|
2887
|
-
getPaymentMethods(options: PaymentMethodsOptions): Promise<PaymentMethod[]>;
|
|
2887
|
+
getPaymentMethods(options: PaymentMethodsOptions): Promise<PaymentMethod$1[]>;
|
|
2888
2888
|
/**
|
|
2889
2889
|
* Fetch stock locations, optionally filtered by sales channel.
|
|
2890
2890
|
* Returns empty array when admin config is not provided (graceful degradation).
|
|
@@ -3846,10 +3846,15 @@ interface DropshipperProductMarginItem {
|
|
|
3846
3846
|
locked: boolean;
|
|
3847
3847
|
variant_overrides?: DropshipperVariantMarginOverride[];
|
|
3848
3848
|
}
|
|
3849
|
+
/** Individual price item in a price update */
|
|
3850
|
+
interface DropshipperPriceItem {
|
|
3851
|
+
variant_id: string;
|
|
3852
|
+
amount: number;
|
|
3853
|
+
}
|
|
3849
3854
|
/** Body for `PUT /admin/thor/dropshipper/prices` */
|
|
3850
3855
|
interface UpdateDropshipperPricesBody {
|
|
3851
3856
|
currency_code: string;
|
|
3852
|
-
|
|
3857
|
+
prices: DropshipperPriceItem[];
|
|
3853
3858
|
}
|
|
3854
3859
|
/** Response for `PUT /admin/thor/dropshipper/prices` */
|
|
3855
3860
|
interface UpdateDropshipperPricesResponse {
|
|
@@ -3915,6 +3920,10 @@ interface DropshipperShippingOption {
|
|
|
3915
3920
|
interface GetDropshipperShippingOptionsParams {
|
|
3916
3921
|
currency_code: string;
|
|
3917
3922
|
country_code?: string;
|
|
3923
|
+
/** Province/state code for granular geo‑zone filtering */
|
|
3924
|
+
province?: string;
|
|
3925
|
+
/** City for granular geo‑zone filtering */
|
|
3926
|
+
city?: string;
|
|
3918
3927
|
}
|
|
3919
3928
|
/** Response for `GET /admin/thor/dropshipper/orders/shipping-options` */
|
|
3920
3929
|
interface GetDropshipperShippingOptionsResponse {
|
|
@@ -4628,5 +4637,460 @@ interface GetDropshipperAddressesResponse {
|
|
|
4628
4637
|
interface GetStorefrontDropshipperCategoriesResponse {
|
|
4629
4638
|
categories: DropshipperCategory[];
|
|
4630
4639
|
}
|
|
4640
|
+
/** Settlement status values for orders */
|
|
4641
|
+
type SettlementStatus = 'pending' | 'partial' | 'settled' | 'guaranteed' | 'refund_pending' | 'compensated' | 'recovery_pending' | 'en_garantia' | 'refunded';
|
|
4642
|
+
/** Financial movement types */
|
|
4643
|
+
type FinancialMovementType = 'cobro' | 'pago' | 'ajuste' | 'compensacion' | 'devolucion' | 'reverso' | 'garantia';
|
|
4644
|
+
/** Financial movement statuses */
|
|
4645
|
+
type FinancialMovementStatus = 'pendiente' | 'confirmado' | 'revertido' | 'anulado';
|
|
4646
|
+
/** Impact direction of a financial movement */
|
|
4647
|
+
type Impact = 'ds_debe_mas' | 'ds_debe_menos' | 'thor_debe_mas' | 'thor_debe_menos' | 'neutro';
|
|
4648
|
+
/** Ajuste subtype values */
|
|
4649
|
+
type AjusteSubtype = 'bonificacion_comercial' | 'penalizacion_general' | 'credito_manual' | 'debito_manual' | 'correccion_saldo_inicial' | 'error_migracion' | 'compensacion_administrativa' | 'aumento_comision' | 'disminucion_comision' | 'aumento_costo' | 'disminucion_costo' | 'diferencia_precio' | 'penalizacion_orden' | 'descuento_orden' | 'ajuste_garantia' | 'ajuste_devolucion' | 'otro';
|
|
4650
|
+
/** Balance snapshot used in before/after projections */
|
|
4651
|
+
interface BalanceSnapshot {
|
|
4652
|
+
ds_debe: number;
|
|
4653
|
+
thor_debe: number;
|
|
4654
|
+
retenidos_total: number;
|
|
4655
|
+
retenidos_thor: number;
|
|
4656
|
+
retenidos_ds: number;
|
|
4657
|
+
balance_neto: number;
|
|
4658
|
+
}
|
|
4659
|
+
/** An order applied to a financial movement */
|
|
4660
|
+
interface OrderAppliedEntry {
|
|
4661
|
+
order_id: string;
|
|
4662
|
+
amount_applied: number;
|
|
4663
|
+
display_id?: number | null;
|
|
4664
|
+
}
|
|
4665
|
+
/** An account adjustment paid within a financial movement */
|
|
4666
|
+
interface AccountAdjustmentPaidEntry {
|
|
4667
|
+
adjustment_id: string;
|
|
4668
|
+
amount_applied: number;
|
|
4669
|
+
side?: 'ds' | 'thor';
|
|
4670
|
+
}
|
|
4671
|
+
/** A full financial movement record */
|
|
4672
|
+
interface FinancialMovement {
|
|
4673
|
+
id: string;
|
|
4674
|
+
reference: string;
|
|
4675
|
+
type: FinancialMovementType;
|
|
4676
|
+
subtype: string | null;
|
|
4677
|
+
amount: number;
|
|
4678
|
+
currency_code: string;
|
|
4679
|
+
impact: Impact;
|
|
4680
|
+
status: FinancialMovementStatus;
|
|
4681
|
+
payment_method: string | null;
|
|
4682
|
+
payment_reference: string | null;
|
|
4683
|
+
orders_applied: OrderAppliedEntry[];
|
|
4684
|
+
orders_applied_count: number;
|
|
4685
|
+
account_adjustments_paid: AccountAdjustmentPaidEntry[];
|
|
4686
|
+
adjustment_paid_amount: number;
|
|
4687
|
+
adjustment_payment_status: string | null;
|
|
4688
|
+
balance_before: BalanceSnapshot | null;
|
|
4689
|
+
balance_after: BalanceSnapshot | null;
|
|
4690
|
+
reason: string;
|
|
4691
|
+
note: string | null;
|
|
4692
|
+
created_by_admin_name: string;
|
|
4693
|
+
confirmed_by_admin_name: string | null;
|
|
4694
|
+
confirmed_at: string | null;
|
|
4695
|
+
created_at: string;
|
|
4696
|
+
}
|
|
4697
|
+
/** An order entry in a compensation request */
|
|
4698
|
+
interface CompensacionOrderEntry {
|
|
4699
|
+
order_id: string;
|
|
4700
|
+
amount_to_compensate: number;
|
|
4701
|
+
}
|
|
4702
|
+
/** An adjustment entry in a compensation request */
|
|
4703
|
+
interface CompensacionAdjustmentEntry {
|
|
4704
|
+
adjustment_id: string;
|
|
4705
|
+
amount_to_compensate: number;
|
|
4706
|
+
}
|
|
4707
|
+
/** Balance breakdown for the authenticated dropshipper */
|
|
4708
|
+
interface DropshipperAccountBalance {
|
|
4709
|
+
ds_debe: number;
|
|
4710
|
+
ds_debe_orders_count: number;
|
|
4711
|
+
thor_debe: number;
|
|
4712
|
+
thor_debe_orders_count: number;
|
|
4713
|
+
retenidos_total: number;
|
|
4714
|
+
retenidos_thor: number;
|
|
4715
|
+
retenidos_ds: number;
|
|
4716
|
+
retenidos_orders_count: number;
|
|
4717
|
+
balance_neto: number;
|
|
4718
|
+
balance_direction: 'ds_debe' | 'thor_debe' | 'equilibrado';
|
|
4719
|
+
currency_code: string;
|
|
4720
|
+
}
|
|
4721
|
+
/** Response for `GET /admin/thor/dropshipper/account/balance` */
|
|
4722
|
+
interface GetDropshipperAccountBalanceResponse {
|
|
4723
|
+
balance: DropshipperAccountBalance;
|
|
4724
|
+
account: {
|
|
4725
|
+
id: string;
|
|
4726
|
+
provider_name: string;
|
|
4727
|
+
payment_terms_days: number;
|
|
4728
|
+
};
|
|
4729
|
+
}
|
|
4730
|
+
/** A financial order row in the dropshipper's own view */
|
|
4731
|
+
interface DropshipperFinancialOrder {
|
|
4732
|
+
id: string;
|
|
4733
|
+
display_id: number;
|
|
4734
|
+
created_at: string;
|
|
4735
|
+
customer_name: string | null;
|
|
4736
|
+
quien_cobro: 'dropshipper' | 'provider' | null;
|
|
4737
|
+
sale_total: number;
|
|
4738
|
+
cost_total: number;
|
|
4739
|
+
commission: number;
|
|
4740
|
+
base_amount: number;
|
|
4741
|
+
settled_amount: number;
|
|
4742
|
+
pending_amount: number;
|
|
4743
|
+
settlement_status: SettlementStatus;
|
|
4744
|
+
retained_by: string | null;
|
|
4745
|
+
due_date: string;
|
|
4746
|
+
days_overdue: number;
|
|
4747
|
+
is_overdue: boolean;
|
|
4748
|
+
currency_code: string;
|
|
4749
|
+
}
|
|
4750
|
+
/** Options for `GET /admin/thor/dropshipper/account/orders` */
|
|
4751
|
+
interface GetDropshipperAccountOrdersOptions {
|
|
4752
|
+
tab?: 'all' | 'thor_cobro' | 'ds_cobro' | 'garantias';
|
|
4753
|
+
status?: SettlementStatus;
|
|
4754
|
+
limit?: number;
|
|
4755
|
+
offset?: number;
|
|
4756
|
+
q?: string;
|
|
4757
|
+
}
|
|
4758
|
+
/** Response for `GET /admin/thor/dropshipper/account/orders` */
|
|
4759
|
+
interface GetDropshipperAccountOrdersResponse {
|
|
4760
|
+
orders: DropshipperFinancialOrder[];
|
|
4761
|
+
count: number;
|
|
4762
|
+
offset: number;
|
|
4763
|
+
limit: number;
|
|
4764
|
+
}
|
|
4765
|
+
/** A financial order row in the admin view (extends dropshipper view) */
|
|
4766
|
+
interface AdminDropshipperFinancialOrder extends DropshipperFinancialOrder {
|
|
4767
|
+
adjustment_applied_amount: number;
|
|
4768
|
+
recovery_type: string | null;
|
|
4769
|
+
recovery_amount: number;
|
|
4770
|
+
}
|
|
4771
|
+
/** Response for `GET /admin/thor/dropshipper/admin/accounts/:id/orders` */
|
|
4772
|
+
interface GetAdminDropshipperAccountOrdersResponse {
|
|
4773
|
+
orders: AdminDropshipperFinancialOrder[];
|
|
4774
|
+
count: number;
|
|
4775
|
+
offset: number;
|
|
4776
|
+
limit: number;
|
|
4777
|
+
}
|
|
4778
|
+
/** Options for `GET /admin/thor/dropshipper/admin/accounts/:id/settlements` */
|
|
4779
|
+
interface GetAdminDropshipperAccountSettlementsOptions {
|
|
4780
|
+
type?: FinancialMovementType;
|
|
4781
|
+
status?: FinancialMovementStatus;
|
|
4782
|
+
limit?: number;
|
|
4783
|
+
offset?: number;
|
|
4784
|
+
}
|
|
4785
|
+
/** Response for `GET /admin/thor/dropshipper/admin/accounts/:id/settlements` */
|
|
4786
|
+
interface GetAdminDropshipperAccountSettlementsResponse {
|
|
4787
|
+
settlements: FinancialMovement[];
|
|
4788
|
+
count: number;
|
|
4789
|
+
offset: number;
|
|
4790
|
+
limit: number;
|
|
4791
|
+
}
|
|
4792
|
+
/** Body for `POST /admin/thor/dropshipper/admin/accounts/:id/guarantee/:order_id` */
|
|
4793
|
+
interface ResolveGuaranteeBody {
|
|
4794
|
+
resolution: 'close' | 'close_with_refund';
|
|
4795
|
+
amount?: number;
|
|
4796
|
+
reason: string;
|
|
4797
|
+
note?: string;
|
|
4798
|
+
}
|
|
4799
|
+
/** Response for `POST /admin/thor/dropshipper/admin/accounts/:id/guarantee/:order_id` */
|
|
4800
|
+
interface ResolveGuaranteeResponse {
|
|
4801
|
+
order_id: string;
|
|
4802
|
+
status: SettlementStatus;
|
|
4803
|
+
resolution: 'close' | 'close_with_refund';
|
|
4804
|
+
financial_movement?: {
|
|
4805
|
+
reference: string;
|
|
4806
|
+
amount: number;
|
|
4807
|
+
impact: Impact;
|
|
4808
|
+
type: FinancialMovementType;
|
|
4809
|
+
};
|
|
4810
|
+
message: string;
|
|
4811
|
+
}
|
|
4812
|
+
/** Body for `POST /admin/thor/dropshipper/admin/accounts/:id/settlements/compensacion` */
|
|
4813
|
+
interface CreateCompensacionBody {
|
|
4814
|
+
ds_orders: CompensacionOrderEntry[];
|
|
4815
|
+
thor_orders: CompensacionOrderEntry[];
|
|
4816
|
+
ds_adjustments?: CompensacionAdjustmentEntry[];
|
|
4817
|
+
thor_adjustments?: CompensacionAdjustmentEntry[];
|
|
4818
|
+
reason: string;
|
|
4819
|
+
note?: string;
|
|
4820
|
+
}
|
|
4821
|
+
/** Compensation preview in the response */
|
|
4822
|
+
interface CompensacionPreview {
|
|
4823
|
+
before: BalanceSnapshot;
|
|
4824
|
+
after: BalanceSnapshot;
|
|
4825
|
+
total_ds: number;
|
|
4826
|
+
total_thor: number;
|
|
4827
|
+
monto_compensar: number;
|
|
4828
|
+
compensation_type: 'total' | 'parcial';
|
|
4829
|
+
}
|
|
4830
|
+
/** Response for `POST /admin/thor/dropshipper/admin/accounts/:id/settlements/compensacion` */
|
|
4831
|
+
interface CreateCompensacionResponse {
|
|
4832
|
+
movement: {
|
|
4833
|
+
id: string;
|
|
4834
|
+
reference: string;
|
|
4835
|
+
type: 'compensacion';
|
|
4836
|
+
amount: number;
|
|
4837
|
+
currency_code: string;
|
|
4838
|
+
status: FinancialMovementStatus;
|
|
4839
|
+
orders_applied: OrderAppliedEntry[];
|
|
4840
|
+
reason: string;
|
|
4841
|
+
created_at: string;
|
|
4842
|
+
};
|
|
4843
|
+
preview: CompensacionPreview;
|
|
4844
|
+
}
|
|
4845
|
+
/** Body for `POST /admin/thor/dropshipper/admin/accounts/:id/settlements/ajuste` */
|
|
4846
|
+
interface CreateAjusteBody {
|
|
4847
|
+
subtype: AjusteSubtype;
|
|
4848
|
+
impact: Impact;
|
|
4849
|
+
amount: number;
|
|
4850
|
+
reason: string;
|
|
4851
|
+
note?: string;
|
|
4852
|
+
evidence?: string[];
|
|
4853
|
+
order_id?: string;
|
|
4854
|
+
}
|
|
4855
|
+
/** Response for `POST /admin/thor/dropshipper/admin/accounts/:id/settlements/ajuste` */
|
|
4856
|
+
interface CreateAjusteResponse {
|
|
4857
|
+
movement: {
|
|
4858
|
+
id: string;
|
|
4859
|
+
reference: string;
|
|
4860
|
+
type: 'ajuste';
|
|
4861
|
+
subtype: AjusteSubtype;
|
|
4862
|
+
impact: Impact;
|
|
4863
|
+
amount: number;
|
|
4864
|
+
currency_code: string;
|
|
4865
|
+
status: FinancialMovementStatus;
|
|
4866
|
+
order_id: string | null;
|
|
4867
|
+
reason: string;
|
|
4868
|
+
created_at: string;
|
|
4869
|
+
};
|
|
4870
|
+
balance_before: BalanceSnapshot;
|
|
4871
|
+
balance_after_projected: BalanceSnapshot;
|
|
4872
|
+
}
|
|
4873
|
+
/** Payment method for cobro/pago movements */
|
|
4874
|
+
type PaymentMethod = 'transferencia' | 'stripe' | 'cheque' | 'efectivo' | 'otro';
|
|
4875
|
+
/** Body for `POST /admin/thor/dropshipper/admin/accounts/:id/settlements/cobro` */
|
|
4876
|
+
interface CreateCobroBody {
|
|
4877
|
+
orders_applied: OrderAppliedEntry[];
|
|
4878
|
+
account_adjustments_paid?: AccountAdjustmentPaidEntry[];
|
|
4879
|
+
payment_method: PaymentMethod;
|
|
4880
|
+
payment_reference: string;
|
|
4881
|
+
reason: string;
|
|
4882
|
+
note?: string;
|
|
4883
|
+
evidence?: string[];
|
|
4884
|
+
}
|
|
4885
|
+
/** Response for `POST /admin/thor/dropshipper/admin/accounts/:id/settlements/cobro` */
|
|
4886
|
+
interface CreateCobroResponse {
|
|
4887
|
+
movement: FinancialMovement;
|
|
4888
|
+
balance_before: BalanceSnapshot;
|
|
4889
|
+
balance_after_projected: BalanceSnapshot;
|
|
4890
|
+
}
|
|
4891
|
+
/** Body for `POST /admin/thor/dropshipper/admin/accounts/:id/settlements/pago` */
|
|
4892
|
+
interface CreatePagoBody {
|
|
4893
|
+
orders_applied: OrderAppliedEntry[];
|
|
4894
|
+
account_adjustments_paid?: AccountAdjustmentPaidEntry[];
|
|
4895
|
+
payment_method: PaymentMethod;
|
|
4896
|
+
payment_reference: string;
|
|
4897
|
+
reason: string;
|
|
4898
|
+
note?: string;
|
|
4899
|
+
evidence?: string[];
|
|
4900
|
+
}
|
|
4901
|
+
/** Response for `POST /admin/thor/dropshipper/admin/accounts/:id/settlements/pago` */
|
|
4902
|
+
interface CreatePagoResponse {
|
|
4903
|
+
movement: FinancialMovement;
|
|
4904
|
+
balance_before: BalanceSnapshot;
|
|
4905
|
+
balance_after_projected: BalanceSnapshot;
|
|
4906
|
+
}
|
|
4907
|
+
/** Body for `POST /admin/thor/dropshipper/admin/accounts/:id/settlements/:mov_id/reverso` */
|
|
4908
|
+
interface CreateReversoBody {
|
|
4909
|
+
reversion_reason: string;
|
|
4910
|
+
note?: string;
|
|
4911
|
+
}
|
|
4912
|
+
/** Reversal movement summary */
|
|
4913
|
+
interface ReversoMovementSummary {
|
|
4914
|
+
id: string;
|
|
4915
|
+
reference: string;
|
|
4916
|
+
type: 'reverso';
|
|
4917
|
+
impact: Impact;
|
|
4918
|
+
amount: number;
|
|
4919
|
+
status: 'confirmado';
|
|
4920
|
+
reverts_movement_id: string;
|
|
4921
|
+
confirmed_at: string;
|
|
4922
|
+
}
|
|
4923
|
+
/** Original movement summary after reversal */
|
|
4924
|
+
interface OriginalMovementSummary {
|
|
4925
|
+
id: string;
|
|
4926
|
+
reference: string;
|
|
4927
|
+
type: FinancialMovementType;
|
|
4928
|
+
status: 'revertido';
|
|
4929
|
+
reverted_at: string;
|
|
4930
|
+
}
|
|
4931
|
+
/** Response for `POST /admin/thor/dropshipper/admin/accounts/:id/settlements/:mov_id/reverso` */
|
|
4932
|
+
interface CreateReversoResponse {
|
|
4933
|
+
reverso: ReversoMovementSummary;
|
|
4934
|
+
original: OriginalMovementSummary;
|
|
4935
|
+
balance_before: BalanceSnapshot;
|
|
4936
|
+
balance_after: BalanceSnapshot;
|
|
4937
|
+
}
|
|
4938
|
+
/** Body for `POST /admin/thor/dropshipper/admin/accounts/:id/settlements/:mov_id/confirm` */
|
|
4939
|
+
interface ConfirmMovementBody {
|
|
4940
|
+
note?: string;
|
|
4941
|
+
}
|
|
4942
|
+
/** Confirmed movement summary */
|
|
4943
|
+
interface ConfirmedMovementSummary {
|
|
4944
|
+
id: string;
|
|
4945
|
+
reference: string;
|
|
4946
|
+
type: FinancialMovementType;
|
|
4947
|
+
status: 'confirmado';
|
|
4948
|
+
confirmed_at: string;
|
|
4949
|
+
}
|
|
4950
|
+
/** Response for `POST /admin/thor/dropshipper/admin/accounts/:id/settlements/:mov_id/confirm` */
|
|
4951
|
+
interface ConfirmMovementResponse {
|
|
4952
|
+
movement: ConfirmedMovementSummary;
|
|
4953
|
+
balance_before: BalanceSnapshot;
|
|
4954
|
+
balance_after: BalanceSnapshot;
|
|
4955
|
+
}
|
|
4956
|
+
/** Body for `POST /admin/thor/dropshipper/admin/accounts/:id/settlements/:mov_id/cancel` */
|
|
4957
|
+
interface CancelMovementBody {
|
|
4958
|
+
reason: string;
|
|
4959
|
+
}
|
|
4960
|
+
/** Cancelled movement summary */
|
|
4961
|
+
interface CancelledMovementSummary {
|
|
4962
|
+
id: string;
|
|
4963
|
+
reference: string;
|
|
4964
|
+
type: FinancialMovementType;
|
|
4965
|
+
status: 'anulado';
|
|
4966
|
+
reason: string;
|
|
4967
|
+
}
|
|
4968
|
+
/** Response for `POST /admin/thor/dropshipper/admin/accounts/:id/settlements/:mov_id/cancel` */
|
|
4969
|
+
interface CancelMovementResponse {
|
|
4970
|
+
movement: CancelledMovementSummary;
|
|
4971
|
+
}
|
|
4972
|
+
/** A single item in the financial analysis breakdown */
|
|
4973
|
+
interface FinancialAnalysisItem {
|
|
4974
|
+
id: string;
|
|
4975
|
+
product_title: string;
|
|
4976
|
+
variant_title: string;
|
|
4977
|
+
variant_id: string;
|
|
4978
|
+
sku: string | null;
|
|
4979
|
+
quantity: number;
|
|
4980
|
+
sale_price: number;
|
|
4981
|
+
cost_thor: number;
|
|
4982
|
+
commission: number;
|
|
4983
|
+
margin: number;
|
|
4984
|
+
margin_percent: number;
|
|
4985
|
+
expected_cost_thor: number;
|
|
4986
|
+
current_cost_thor: number;
|
|
4987
|
+
expected_commission: number;
|
|
4988
|
+
current_commission: number;
|
|
4989
|
+
difference: number;
|
|
4990
|
+
validation: string;
|
|
4991
|
+
}
|
|
4992
|
+
/** A settlement movement applied to an order in financial analysis */
|
|
4993
|
+
interface FinancialAnalysisSettlementMovement {
|
|
4994
|
+
movement_id: string;
|
|
4995
|
+
reference: string;
|
|
4996
|
+
type: FinancialMovementType;
|
|
4997
|
+
impact: Impact;
|
|
4998
|
+
amount_applied: number;
|
|
4999
|
+
confirmed_at: string | null;
|
|
5000
|
+
confirmed_by: string | null;
|
|
5001
|
+
}
|
|
5002
|
+
/** Settlement details within financial analysis */
|
|
5003
|
+
interface FinancialAnalysisSettlementDetails {
|
|
5004
|
+
settled_amount: number;
|
|
5005
|
+
adjustment_applied_amount: number;
|
|
5006
|
+
base_amount: number;
|
|
5007
|
+
effective_settled: number;
|
|
5008
|
+
movements: FinancialAnalysisSettlementMovement[];
|
|
5009
|
+
}
|
|
5010
|
+
/** Financial summary for an order */
|
|
5011
|
+
interface FinancialAnalysisSummary {
|
|
5012
|
+
ds_owes_to_thor: number;
|
|
5013
|
+
thor_owes_to_ds: number;
|
|
5014
|
+
total_sale: number;
|
|
5015
|
+
total_cost_thor: number;
|
|
5016
|
+
total_commission_ds: number;
|
|
5017
|
+
total_margin: number;
|
|
5018
|
+
total_margin_percent: number;
|
|
5019
|
+
}
|
|
5020
|
+
/** Dropshipper info within financial analysis */
|
|
5021
|
+
interface FinancialAnalysisDropshipper {
|
|
5022
|
+
account_id: string;
|
|
5023
|
+
name: string;
|
|
5024
|
+
payment_terms_days: number;
|
|
5025
|
+
}
|
|
5026
|
+
/** Full financial analysis for a single order */
|
|
5027
|
+
interface FinancialAnalysis {
|
|
5028
|
+
order_id: string;
|
|
5029
|
+
display_id: number;
|
|
5030
|
+
currency_code: string;
|
|
5031
|
+
dropshipper: FinancialAnalysisDropshipper;
|
|
5032
|
+
payment_collected_by: string | null;
|
|
5033
|
+
settlement_status: SettlementStatus;
|
|
5034
|
+
settlement_id: null;
|
|
5035
|
+
summary: FinancialAnalysisSummary;
|
|
5036
|
+
items: FinancialAnalysisItem[];
|
|
5037
|
+
items_with_issues: number;
|
|
5038
|
+
items_total: number;
|
|
5039
|
+
settlement_details: FinancialAnalysisSettlementDetails;
|
|
5040
|
+
}
|
|
5041
|
+
/** Response for `GET /admin/thor/dropshipper/admin/orders/:id/financial-analysis` */
|
|
5042
|
+
interface GetFinancialAnalysisResponse {
|
|
5043
|
+
financial_analysis: FinancialAnalysis;
|
|
5044
|
+
}
|
|
5045
|
+
/** Body for `POST /admin/thor/dropshipper/orders/:id/payment` */
|
|
5046
|
+
interface RegisterPaymentBody {
|
|
5047
|
+
paid_amount: number;
|
|
5048
|
+
due_date?: string;
|
|
5049
|
+
payment_provider_id?: string;
|
|
5050
|
+
force_collector?: boolean;
|
|
5051
|
+
}
|
|
5052
|
+
/** Payment record in the register payment response */
|
|
5053
|
+
interface RegisterPaymentRecord {
|
|
5054
|
+
id: string;
|
|
5055
|
+
amount: number;
|
|
5056
|
+
provider_id: string;
|
|
5057
|
+
status: string;
|
|
5058
|
+
created_at: string;
|
|
5059
|
+
}
|
|
5060
|
+
/** Response for `POST /admin/thor/dropshipper/orders/:id/payment` */
|
|
5061
|
+
interface RegisterPaymentResponse {
|
|
5062
|
+
order_id: string;
|
|
5063
|
+
payment: RegisterPaymentRecord;
|
|
5064
|
+
paid_amount_total: number;
|
|
5065
|
+
remaining: number;
|
|
5066
|
+
payment_status: string;
|
|
5067
|
+
payment_collected_by: string | null;
|
|
5068
|
+
due_date: string | null;
|
|
5069
|
+
}
|
|
5070
|
+
/**
|
|
5071
|
+
* Flat boolean map telling the dropshipper dashboard which features
|
|
5072
|
+
* the backend currently supports. Consumed via
|
|
5073
|
+
* `GET /admin/thor/dropshipper/capabilities`.
|
|
5074
|
+
*/
|
|
5075
|
+
interface DropshipperDashboardCapabilities {
|
|
5076
|
+
/** Core navigation — always expected to be true */
|
|
5077
|
+
dashboard: boolean;
|
|
5078
|
+
orders: boolean;
|
|
5079
|
+
products: boolean;
|
|
5080
|
+
prices: boolean;
|
|
5081
|
+
customers: boolean;
|
|
5082
|
+
configuration: boolean;
|
|
5083
|
+
/** Feature modules (may be disabled per-tenant or in development) */
|
|
5084
|
+
financialSettlements: boolean;
|
|
5085
|
+
promotions: boolean;
|
|
5086
|
+
shipping: boolean;
|
|
5087
|
+
reports: boolean;
|
|
5088
|
+
/** Settings sub-pages (may be disabled per-tenant or in development) */
|
|
5089
|
+
paymentSettings: boolean;
|
|
5090
|
+
notifications: boolean;
|
|
5091
|
+
security: boolean;
|
|
5092
|
+
integrations: boolean;
|
|
5093
|
+
team: boolean;
|
|
5094
|
+
}
|
|
4631
5095
|
|
|
4632
|
-
export { type AccountDropdownConfig, type AccountMenuItem, type ActiveFilter, type AddOrderEditItemBody, type AddOrderEditItemResponse, type Address, type AdminApiKey, type AdminChannelCategory, type AdminChannelCustomer, type AdminDropshipperAccount, type AdminDropshipperBalance, type AdminProduct, type AdminProductVariant, type AdminSalesChannelRef, type AdminSiteConfig, type AdminSiteConfigHistoryEntry, type AdminSiteConfigHistoryEntryFull, type AdminStorefrontConfig, type AdminStorefrontSeoDefaults, type AdminUser, type AdvancedSearchProductsOptions, type AssignCategoriesToChannelsBody, type AssignCategoriesToChannelsResponse, type AssignCollectionsToChannelsBody, type AssignCollectionsToChannelsResponse, type AuditLog, type AuditLogAdapter, type AuthConfig, type AuthMethod, type AuthProvider, type AuthResponse, type AuthStorage, type AuthorConfig, type BackendCapabilities, type BatchVariantCostItem, type BatchVariantCostsBody, type BatchVariantCostsResponse, type BrandConfig, type CachedPaymentMethods, type CancelDropshipperOrderResponse, type CancelSettlementBody, type Cart, type CartCost, type CartItem, type CartLineInput, type CartLineUpdate, type CartProduct, type CategoryMapping, type ChartDataPoint, type Collection, type CollectionProductsOptions, type CommerceProvider, type CompareProduct, type ConfigHistoryEntry, type ConfirmOrderEditResponse, type ConfirmSettlementBody, type Connection, type Country, type CreateAddressData, type CreateCategoryMappingBody, type CreateCategoryMappingResponse, type CreateDropshipperCategoryBody, type CreateDropshipperCustomerBody, type CreateDropshipperCustomerResponse, type CreateDropshipperOrderBody, type CreateDropshipperOrderResponse, type CreateDropshipperPromotionBody, type CreateOrderEditBody, type CreateOrderEditResponse, type CreateOrderItem, type CreateOrderNoteBody, type CreateSettlementBody, type CreateSettlementResponse, type CreateVariantCostBody, type CreateVariantCostResponse, type Customer, type DashboardChanges, type DashboardConfig, type DashboardMetrics, type DashboardMetricsAdapter, type DashboardOrdersAdapter, type DashboardPeriodMetrics, type DashboardProductsAdapter, type DashboardStats, type DashboardTopProduct, type DeleteCategoryMappingResponse, type DeleteDropshipperCategoryResponse, type DeleteDropshipperPromotionResponse, type DeleteOrderNoteResponse, type DeleteVariantCostResponse, type DesignerConfig, type DesignerHistoryEntry, type DesignerNavItem, type DesignerThemeConfig, type DesignerThemePreset, type DiscountCode, type DropshipperAccount, type DropshipperAccountRef, type DropshipperAddressBody, type DropshipperAddressResponse, type DropshipperBalance, type DropshipperCategory, type DropshipperCustomer, type DropshipperCustomerDetail, type DropshipperCustomerOrderRef, type DropshipperCustomerStats, type DropshipperOrder, type DropshipperOrderCustomer, type DropshipperOrderDetail, type DropshipperOrderItem, type DropshipperOrderShippingAddress, type DropshipperOrderTimelineEvent, type DropshipperOrderTotals, type DropshipperPayableOrder, type DropshipperPaymentMethodConfig, type DropshipperPendingOrders, type DropshipperProduct, type DropshipperProductMarginItem, type DropshipperPromotion, type DropshipperReceivableOrder, type DropshipperShippingOption, type DropshipperVariant, type DropshipperVariantMarginOverride, type DynamicSource, type Edge, type ExtendedCreateDropshipperOrderBody, type ExtendedCreateDropshipperOrderResponse, type FilterConfig, type FilterOption, type FilterSection, type FulfillmentOption, type FulfillmentSet, type FulfillmentStatus, type GetAdminAccountBalanceResponse, type GetAdminDropshipperAccountsResponse, type GetAdminPriceListsResponse, type GetAdminSiteConfigHistoryOptions, type GetAdminSiteConfigHistoryResponse, type GetAdminSiteConfigResponse, type GetAdminStorefrontConfigResponse, type GetCategoriesCallback, type GetCategoriesOptions, type GetCategoryMappingsOptions, type GetCategoryMappingsResponse, type GetCategorySalesChannelsResponse, type GetChannelApiKeysResponse, type GetChannelCategoriesOptions, type GetChannelCategoriesResponse, type GetChannelCustomersOptions, type GetChannelCustomersResponse, type GetCollectionSalesChannelsResponse, type GetCollectionsOptions, type GetCustomersCallback, type GetCustomersOptions, type GetDashboardStatsOptions, type GetDashboardStatsResponse, type GetDropshipperAccountResponse, type GetDropshipperAddressesResponse, type GetDropshipperCategoriesOptions, type GetDropshipperCategoriesResponse, type GetDropshipperCustomerDetailResponse, type GetDropshipperCustomersOptions, type GetDropshipperCustomersResponse, type GetDropshipperOrderDetailResponse, type GetDropshipperOrdersOptions, type GetDropshipperOrdersResponse, type GetDropshipperPayableResponse, type GetDropshipperProductsOptions, type GetDropshipperProductsResponse, type GetDropshipperPromotionsOptions, type GetDropshipperPromotionsResponse, type GetDropshipperReceivableResponse, type GetDropshipperShippingOptionsParams, type GetDropshipperShippingOptionsResponse, type GetOrderNotesResponse, type GetOrdersCallback, type GetOrdersOptions, type GetProductsOptions, type GetProviderCategoriesResponse, type GetSettlementDetailResponse, type GetSettlementsOptions, type GetSettlementsResponse, type GetStorefrontDropshipperCategoriesResponse, type GetUserChannelResponse, type GetVariantCostsOptions, type GetVariantCostsResponse, type HeaderLinkItem, type HeaderNavigationConfig, type IconConfig, type Image, type InventoryLevel, type LinkCustomerToChannelResponse, type LoginCredentials, type ModulesConfig, type Money, type NavigationCalloutItem, type NavigationItem, type NavigationLinkItem, type OnboardDropshipperBody, type OnboardDropshipperResponse, type Order, type OrderItem, type OrderNote, type OrderStatus, type OrdersMetrics, PROVIDER_METADATA, type PaginationOptions, type PasswordResetConfirm, type PasswordResetRequest, type PaymentMethod, type PaymentMethodFeatures, type PaymentMethodType, type PaymentMethodsOptions, type PaymentStatus, type PriceRange, type Product, type ProductCategory, type ProductOption, type ProductPreview, type ProductVariant, type ProductsMetrics, type PromotionRule, type ProviderCategory, type ProviderConfig, type ProviderTypeString, type Region, type RegisterData, type RestoreSiteConfigResponse, type Review, type SEO, type SalesMetrics, type SearchBarConfig, type SearchResultMeta, type SelectedOption, type SetPaymentCollectorBody, type SetPaymentCollectorResponse, type SettlementRecord, type ShippingMethod, type SiteConfig, type SiteConfigLabels, type SiteConfigMetadata, type SocialConfig, type SortOption, type SortOptions, type StockLocation, type StockStatus, type StockValidation, type StorefrontConfig, StorefrontConfigError, type StorefrontContext, type StorefrontPlatformType, type StorefrontSeoDefaults, SupportedProviderType, type UnassignCategoriesFromChannelsBody, type UnassignCategoriesFromChannelsResponse, type UnassignCollectionsFromChannelsBody, type UnassignCollectionsFromChannelsResponse, type UpdateCustomerData, type UpdateDropshipperCategoryBody, type UpdateDropshipperPricesBody, type UpdateDropshipperPricesResponse, type UpdateDropshipperProductStatusBody, type UpdateDropshipperProductStatusResponse, type UpdateDropshipperPromotionBody, type UpdateSettlementStatusResponse, type UpdateSiteConfigBody, type UpdateSiteConfigResponse, type UpdateStorefrontConfigBody, type UpdateStorefrontConfigResponse, type VariantCost, getProviderMetadata, isSupportedProviderType };
|
|
5096
|
+
export { type AccountDropdownConfig, type AccountMenuItem, type ActiveFilter, type AddOrderEditItemBody, type AddOrderEditItemResponse, type Address, type AdminApiKey, type AdminChannelCategory, type AdminChannelCustomer, type AdminDropshipperAccount, type AdminDropshipperBalance, type AdminProduct, type AdminProductVariant, type AdminSalesChannelRef, type AdminSiteConfig, type AdminSiteConfigHistoryEntry, type AdminSiteConfigHistoryEntryFull, type AdminStorefrontConfig, type AdminStorefrontSeoDefaults, type AdminUser, type AdvancedSearchProductsOptions, type AssignCategoriesToChannelsBody, type AssignCategoriesToChannelsResponse, type AssignCollectionsToChannelsBody, type AssignCollectionsToChannelsResponse, type AuditLog, type AuditLogAdapter, type AuthConfig, type AuthMethod, type AuthProvider, type AuthResponse, type AuthStorage, type AuthorConfig, type BackendCapabilities, type BatchVariantCostItem, type BatchVariantCostsBody, type BatchVariantCostsResponse, type BrandConfig, type CachedPaymentMethods, type CancelDropshipperOrderResponse, type CancelMovementBody, type CancelMovementResponse, type CancelSettlementBody, type Cart, type CartCost, type CartItem, type CartLineInput, type CartLineUpdate, type CartProduct, type CategoryMapping, type ChartDataPoint, type Collection, type CollectionProductsOptions, type CommerceProvider, type CompareProduct, type ConfigHistoryEntry, type ConfirmMovementBody, type ConfirmMovementResponse, type ConfirmOrderEditResponse, type ConfirmSettlementBody, type Connection, type Country, type CreateAddressData, type CreateAjusteBody, type CreateAjusteResponse, type CreateCategoryMappingBody, type CreateCategoryMappingResponse, type CreateCobroBody, type CreateCobroResponse, type CreateCompensacionBody, type CreateCompensacionResponse, type CreateDropshipperCategoryBody, type CreateDropshipperCustomerBody, type CreateDropshipperCustomerResponse, type CreateDropshipperOrderBody, type CreateDropshipperOrderResponse, type CreateDropshipperPromotionBody, type CreateOrderEditBody, type CreateOrderEditResponse, type CreateOrderItem, type CreateOrderNoteBody, type CreatePagoBody, type CreatePagoResponse, type CreateReversoBody, type CreateReversoResponse, type CreateSettlementBody, type CreateSettlementResponse, type CreateVariantCostBody, type CreateVariantCostResponse, type Customer, type DashboardChanges, type DashboardConfig, type DashboardMetrics, type DashboardMetricsAdapter, type DashboardOrdersAdapter, type DashboardPeriodMetrics, type DashboardProductsAdapter, type DashboardStats, type DashboardTopProduct, type DeleteCategoryMappingResponse, type DeleteDropshipperCategoryResponse, type DeleteDropshipperPromotionResponse, type DeleteOrderNoteResponse, type DeleteVariantCostResponse, type DesignerConfig, type DesignerHistoryEntry, type DesignerNavItem, type DesignerThemeConfig, type DesignerThemePreset, type DiscountCode, type DropshipperAccount, type DropshipperAccountRef, type DropshipperAddressBody, type DropshipperAddressResponse, type DropshipperBalance, type DropshipperCategory, type DropshipperCustomer, type DropshipperCustomerDetail, type DropshipperCustomerOrderRef, type DropshipperCustomerStats, type DropshipperDashboardCapabilities, type DropshipperOrder, type DropshipperOrderCustomer, type DropshipperOrderDetail, type DropshipperOrderItem, type DropshipperOrderShippingAddress, type DropshipperOrderTimelineEvent, type DropshipperOrderTotals, type DropshipperPayableOrder, type DropshipperPaymentMethodConfig, type DropshipperPendingOrders, type DropshipperPriceItem, type DropshipperProduct, type DropshipperProductMarginItem, type DropshipperPromotion, type DropshipperReceivableOrder, type DropshipperShippingOption, type DropshipperVariant, type DropshipperVariantMarginOverride, type DynamicSource, type Edge, type ExtendedCreateDropshipperOrderBody, type ExtendedCreateDropshipperOrderResponse, type FilterConfig, type FilterOption, type FilterSection, type FulfillmentOption, type FulfillmentSet, type FulfillmentStatus, type GetAdminAccountBalanceResponse, type GetAdminDropshipperAccountOrdersResponse, type GetAdminDropshipperAccountSettlementsOptions, type GetAdminDropshipperAccountSettlementsResponse, type GetAdminDropshipperAccountsResponse, type GetAdminPriceListsResponse, type GetAdminSiteConfigHistoryOptions, type GetAdminSiteConfigHistoryResponse, type GetAdminSiteConfigResponse, type GetAdminStorefrontConfigResponse, type GetCategoriesCallback, type GetCategoriesOptions, type GetCategoryMappingsOptions, type GetCategoryMappingsResponse, type GetCategorySalesChannelsResponse, type GetChannelApiKeysResponse, type GetChannelCategoriesOptions, type GetChannelCategoriesResponse, type GetChannelCustomersOptions, type GetChannelCustomersResponse, type GetCollectionSalesChannelsResponse, type GetCollectionsOptions, type GetCustomersCallback, type GetCustomersOptions, type GetDashboardStatsOptions, type GetDashboardStatsResponse, type GetDropshipperAccountBalanceResponse, type GetDropshipperAccountOrdersOptions, type GetDropshipperAccountOrdersResponse, type GetDropshipperAccountResponse, type GetDropshipperAddressesResponse, type GetDropshipperCategoriesOptions, type GetDropshipperCategoriesResponse, type GetDropshipperCustomerDetailResponse, type GetDropshipperCustomersOptions, type GetDropshipperCustomersResponse, type GetDropshipperOrderDetailResponse, type GetDropshipperOrdersOptions, type GetDropshipperOrdersResponse, type GetDropshipperPayableResponse, type GetDropshipperProductsOptions, type GetDropshipperProductsResponse, type GetDropshipperPromotionsOptions, type GetDropshipperPromotionsResponse, type GetDropshipperReceivableResponse, type GetDropshipperShippingOptionsParams, type GetDropshipperShippingOptionsResponse, type GetFinancialAnalysisResponse, type GetOrderNotesResponse, type GetOrdersCallback, type GetOrdersOptions, type GetProductsOptions, type GetProviderCategoriesResponse, type GetSettlementDetailResponse, type GetSettlementsOptions, type GetSettlementsResponse, type GetStorefrontDropshipperCategoriesResponse, type GetUserChannelResponse, type GetVariantCostsOptions, type GetVariantCostsResponse, type HeaderLinkItem, type HeaderNavigationConfig, type IconConfig, type Image, type InventoryLevel, type LinkCustomerToChannelResponse, type LoginCredentials, type ModulesConfig, type Money, type NavigationCalloutItem, type NavigationItem, type NavigationLinkItem, type OnboardDropshipperBody, type OnboardDropshipperResponse, type Order, type OrderItem, type OrderNote, type OrderStatus, type OrdersMetrics, PROVIDER_METADATA, type PaginationOptions, type PasswordResetConfirm, type PasswordResetRequest, type PaymentMethod$1 as PaymentMethod, type PaymentMethodFeatures, type PaymentMethodType, type PaymentMethodsOptions, type PaymentStatus, type PriceRange, type Product, type ProductCategory, type ProductOption, type ProductPreview, type ProductVariant, type ProductsMetrics, type PromotionRule, type ProviderCategory, type ProviderConfig, type ProviderTypeString, type Region, type RegisterData, type RegisterPaymentBody, type RegisterPaymentResponse, type ResolveGuaranteeBody, type ResolveGuaranteeResponse, type RestoreSiteConfigResponse, type Review, type SEO, type SalesMetrics, type SearchBarConfig, type SearchResultMeta, type SelectedOption, type SetPaymentCollectorBody, type SetPaymentCollectorResponse, type SettlementRecord, type SettlementStatus, type ShippingMethod, type SiteConfig, type SiteConfigLabels, type SiteConfigMetadata, type SocialConfig, type SortOption, type SortOptions, type StockLocation, type StockStatus, type StockValidation, type StorefrontConfig, StorefrontConfigError, type StorefrontContext, type StorefrontPlatformType, type StorefrontSeoDefaults, SupportedProviderType, type UnassignCategoriesFromChannelsBody, type UnassignCategoriesFromChannelsResponse, type UnassignCollectionsFromChannelsBody, type UnassignCollectionsFromChannelsResponse, type UpdateCustomerData, type UpdateDropshipperCategoryBody, type UpdateDropshipperPricesBody, type UpdateDropshipperPricesResponse, type UpdateDropshipperProductStatusBody, type UpdateDropshipperProductStatusResponse, type UpdateDropshipperPromotionBody, type UpdateSettlementStatusResponse, type UpdateSiteConfigBody, type UpdateSiteConfigResponse, type UpdateStorefrontConfigBody, type UpdateStorefrontConfigResponse, type VariantCost, getProviderMetadata, isSupportedProviderType };
|