shopeasy-sdk
v1.1.0
Published
SDK oficial para integração com a API ShopEasy
Downloads
722
Readme
ShopEasy SDK
SDK oficial para integração com a API ShopEasy.
Instalação
npm install shopeasy-sdkConfiguração
import { ShopEasySdk } from "shopeasy-sdk";
const sdk = new ShopEasySdk({
secretKey: "sua-chave-secreta",
baseUrl: "https://api.shopeasy.site", // opcional
});sdk.carts
| Método | Parâmetros | Retorno |
|--------|-----------|--------|
| draft.get | cardId: string | CartDraft | null |
| draft.set | cartId: string, update: CartDraft | Cart |
| draft.delete | cartId: string | void |
| create | args: CreateCartArgs | Cart |
| get | args: CartGetArgs | Cart | null |
| getById | cartId: string | Cart | null |
| getAllByGuild | guildId: string | Cart[] |
| update | args: CartUpdateArgs | Cart |
| expires | botClient: string | Cart[] |
| count | guildId: string | number |
| delete | cartId: string | void |
CartDraft
| Campo | Tipo | Obrigatório |
|-------|------|-------------|
| products | CartDraftProduct[] | Sim |
Cart
| Campo | Tipo | Obrigatório |
|-------|------|-------------|
| id | string | Sim |
| guildId | string | Sim |
| status | CartStatus | Sim |
| userId | string | Sim |
| message | string | Sim |
| products | CartProduct[] | Sim |
| createdAt | Date | Sim |
| updatedAt | Date | Sim |
| expireAt | Date | Não |
| orderId | string | Não |
| botClient | string | Sim |
| guild | Guild | null | Não |
CreateCartArgs
| Campo | Tipo | Obrigatório |
|-------|------|-------------|
| guildId | string | Sim |
| userId | string | Sim |
| expireAt | Date | Sim |
| botClient | string | Sim |
| message | string | Sim |
| status | CartStatus | Não |
| products | CreateCartProduct[] | Sim |
CartGetArgs
| Campo | Tipo | Obrigatório |
|-------|------|-------------|
| userId | string | Sim |
| guildId | string | Sim |
CartUpdateArgs
| Campo | Tipo | Obrigatório |
|-------|------|-------------|
| id | string | Sim |
| data | UpdateCartData | Sim |
Exemplo de uso:
import { ShopEasySdk } from "shopeasy-sdk";
const sdk = new ShopEasySdk({ secretKey: "sua-chave" });
const result = await sdk.carts.draft.get(/* args */);
const result = await sdk.carts.draft.set(/* args */);
const result = await sdk.carts.draft.delete(/* args */);sdk.catalogs
| Método | Parâmetros | Retorno |
|--------|-----------|--------|
| setDraft | args: CatalogDraftSetArgs | Catalog | null |
| getDraft | args: CatalogDraftGetArgs | Catalog | null |
| getByReference | reference: string, guildId: string | Catalog | null |
| getById | id: string | Catalog | null |
| create | args: CatalogCreateArgs | Catalog |
| getByCaching | id: string | Catalog | null |
| getAllByGuild | guildId: string | Array<Catalog> |
| update | args: CatalogUpdateArgs | Catalog |
| count | guildId: string | number |
| delete | id: string | Catalog |
CatalogDraftSetArgs
| Campo | Tipo | Obrigatório |
|-------|------|-------------|
| id | string | Sim |
| userId | string | Sim |
| data | CatalogUpdateArgs["data"] | Sim |
Catalog
| Campo | Tipo | Obrigatório |
|-------|------|-------------|
| id | string | Sim |
| guildId | string | Sim |
| reference | string | Sim |
| createBy | string | Sim |
| title | string | null | Sim |
| description | string | null | Sim |
| banners | JsonValue<string[]> | null | Sim |
| color | string | null | Sim |
| placeholder | string | null | Sim |
| status | CatalogStatus | Não |
| messages | JsonValue<string[]> | null | Sim |
| products | CatalogProduct[] | Não |
| guild | Guild | null | Não |
| createdAt | Date | Não |
| updatedAt | Date | Não |
CatalogDraftGetArgs
| Campo | Tipo | Obrigatório |
|-------|------|-------------|
| id | string | Sim |
| userId | string | Sim |
CatalogCreateArgs
| Campo | Tipo | Obrigatório |
|-------|------|-------------|
| guildId | string | Sim |
| createBy | string | Sim |
| reference | string | Sim |
| title | string | null | Não |
| description | string | null | Não |
| banners | JsonValue<Array<string>> | null | Não |
| color | string | null | Não |
| placeholder | string | null | Não |
| messages | JsonValue<string> | null | Não |
| productId | string | Não |
CatalogUpdateArgs
| Campo | Tipo | Obrigatório |
|-------|------|-------------|
| id | string | Sim |
| data | Omit<Partial<Catalog>, "id" | "reference" | "guild" | "products"> | Sim |
Exemplo de uso:
import { ShopEasySdk } from "shopeasy-sdk";
const sdk = new ShopEasySdk({ secretKey: "sua-chave" });
const result = await sdk.catalogs.setDraft(/* args */);
const result = await sdk.catalogs.getDraft(/* args */);
const result = await sdk.catalogs.getByReference(/* args */);sdk.configss
| Método | Parâmetros | Retorno |
|--------|-----------|--------|
| getByGuild | guildId: string | Config |
| setDraft | args: ConfigDraftSetArgs | Config | null |
| delDraft | args: ConfigDraftGetArgs | Config | null |
| getDraft | args: ConfigDraftGetArgs | Config | null |
| update | args: ConfigUpdateArgs | Config |
| getByCaching | _guildId: string | Config | null |
Config
| Campo | Tipo | Obrigatório |
|-------|------|-------------|
| guildId | string | Sim |
| antiFake | boolean | null | Sim |
| antiFakeDays | number | null | Sim |
| notifys | string[], | Sim |
| antiFakeRequiredRoleIds | string[] | null | Sim |
| antiFakeVerify | boolean | null | Sim |
| antiFakeVerifyMessage | string | null | Sim |
| colorHex | string | Sim |
| channelPublic | string | null | Sim |
| channelPrivate | string | null | Sim |
| channelCall | string | null | Sim |
| channelFeds | string | null | Sim |
| categoryCarts | string | null | Sim |
| categoryChats | string | null | Sim |
| staffRoles | RolePermissionsMap | null | Sim |
| staffUsers | JsonValue | null | Sim |
| clientRole | string | null | Sim |
| clientRolePremium | string | null | Sim |
| timeCart | number | null | Sim |
| timePayment | number | null | Sim |
| usersBanned | JsonValue<Array<string | null>> | null | Sim |
| terms | string | null | Sim |
| updatedAt | Date | Sim |
| guild | Guild | Não |
ConfigDraftSetArgs
| Campo | Tipo | Obrigatório |
|-------|------|-------------|
| userId | string | Sim |
| guildId | string | Sim |
| data | ConfigUpdateArgs["data"] | Sim |
ConfigDraftGetArgs
| Campo | Tipo | Obrigatório |
|-------|------|-------------|
| userId | string | Sim |
| guildId | string | Sim |
ConfigUpdateArgs
| Campo | Tipo | Obrigatório |
|-------|------|-------------|
| guildId | string | Sim |
| data | Omit<Partial<Config>, "id" | "guildId"> | Sim |
Exemplo de uso:
import { ShopEasySdk } from "shopeasy-sdk";
const sdk = new ShopEasySdk({ secretKey: "sua-chave" });
const result = await sdk.configss.getByGuild(/* args */);
const result = await sdk.configss.setDraft(/* args */);
const result = await sdk.configss.delDraft(/* args */);sdk.coupons
| Método | Parâmetros | Retorno |
|--------|-----------|--------|
| setDraft | args: CouponDraftSetArgs | Coupon | null |
| getDraft | args: CouponDraftGetArgs | Coupon | null |
| existsByCode | code: string | boolean |
| getById | id: string | Coupon | null |
| create | args: CouponCreateArgs | Coupon |
| getByCaching | id: string | Coupon | null |
| getAllByGuild | guildId: string | Coupon[] |
| update | args: CouponUpdateArgs | Coupon |
| count | guildId: string | number |
| delete | id: string | Coupon |
CouponDraftSetArgs
| Campo | Tipo | Obrigatório |
|-------|------|-------------|
| id | string | Sim |
| userId | string | Sim |
| data | CouponUpdateArgs["data"] | Sim |
Coupon
| Campo | Tipo | Obrigatório |
|-------|------|-------------|
| id | string | Sim |
| reference | string | Sim |
| guildId | string | Sim |
| createdBy | string | Sim |
| discount | number | null | Sim |
| valorMin | number | null | Sim |
| valorMax | number | null | Sim |
| amount | number | null | Sim |
| uses | number | null | Sim |
| status | CouponStatus | Não |
| guild | Guild | null | Não |
CouponDraftGetArgs
| Campo | Tipo | Obrigatório |
|-------|------|-------------|
| id | string | Sim |
| userId | string | Sim |
CouponCreateArgs
| Campo | Tipo | Obrigatório |
|-------|------|-------------|
| createdBy | string | Sim |
| reference | string | Sim |
| guildId | string | Sim |
| discount | number | Não |
| valorMin | number | Não |
| valorMax | number | Não |
| role | string | Não |
| amount | number | Não |
| uses | number | Não |
CouponUpdateArgs
| Campo | Tipo | Obrigatório |
|-------|------|-------------|
| id | string | Sim |
| data | Omit<Partial<Coupon>, "id" | "reference"> | Sim |
Exemplo de uso:
import { ShopEasySdk } from "shopeasy-sdk";
const sdk = new ShopEasySdk({ secretKey: "sua-chave" });
const result = await sdk.coupons.setDraft(/* args */);
const result = await sdk.coupons.getDraft(/* args */);
const result = await sdk.coupons.existsByCode(/* args */);sdk.customers
| Método | Parâmetros | Retorno |
|--------|-----------|--------|
| setDraft | args: CustomerDraftSetArgs | Customer | null |
| getDraft | args: CustomerDraftGetArgs | Customer | null |
| existsByReference | _reference: string | boolean |
| getById | id: string | Customer | null |
| getByReference | _reference: string | Customer | null |
| create | args: CustomerCreateArgs | Customer |
| getByCaching | id: string | Customer | null |
| getAllByGuild | guildId: string | Customer[] |
| update | args: CustomerUpdateArgs | Customer |
| count | guildId: string | number |
| delete | id: string | Customer |
CustomerDraftSetArgs
| Campo | Tipo | Obrigatório |
|-------|------|-------------|
| id | string | Sim |
| userId | string | Sim |
| data | CustomerUpdateArgs["data"] | Sim |
Customer
| Campo | Tipo | Obrigatório |
|-------|------|-------------|
| id | string | Sim |
| userId | string | Sim |
| guildId | string | Sim |
| balance | Decimal | Sim |
| notify | boolean | Sim |
| sales | Sale[] | Não |
| guild | Guild | null | Não |
| createdAt | Date | Não |
CustomerDraftGetArgs
| Campo | Tipo | Obrigatório |
|-------|------|-------------|
| id | string | Sim |
| userId | string | Sim |
CustomerCreateArgs
| Campo | Tipo | Obrigatório |
|-------|------|-------------|
| userId | string | Sim |
| guildId | string | Sim |
| balance | Decimal | Não |
| notify | boolean | Não |
CustomerUpdateArgs
| Campo | Tipo | Obrigatório |
|-------|------|-------------|
| id | string | Sim |
| data | Omit<Partial<Customer>, "id" | "userId" | "guildId"> | Sim |
Exemplo de uso:
import { ShopEasySdk } from "shopeasy-sdk";
const sdk = new ShopEasySdk({ secretKey: "sua-chave" });
const result = await sdk.customers.setDraft(/* args */);
const result = await sdk.customers.getDraft(/* args */);
const result = await sdk.customers.existsByReference(/* args */);sdk.images
| Método | Parâmetros | Retorno |
|--------|-----------|--------|
| getAll | guildId: string | Image[] |
| create | args: imageCreate | Image |
Image
| Campo | Tipo | Obrigatório |
|-------|------|-------------|
| id | string | Sim |
| guildId | string | Sim |
| url | string | Sim |
| reference | string | Sim |
| name | string | Sim |
| expiresIn | number | Sim |
Exemplo de uso:
import { ShopEasySdk } from "shopeasy-sdk";
const sdk = new ShopEasySdk({ secretKey: "sua-chave" });
const result = await sdk.images.getAll(/* args */);
const result = await sdk.images.create(/* args */);sdk.orders
| Método | Parâmetros | Retorno |
|--------|-----------|--------|
| create | args: OrderCreate | Order |
| get | orderId: string | Order | null |
| getPayment | orderId: string | OrderPayment | null |
| getApprovedUnprocessed | botClient: string, guildId?: string | Order[] |
| markAsReleased | id: string | Order |
| aprove | id: string | Order |
OrderCreate
| Campo | Tipo | Obrigatório |
|-------|------|-------------|
| guildId | string | Sim |
| amount | number | Sim |
| cartId | string | Sim |
| botClient | string | Sim |
| customer | OrderCustomer | Sim |
| products | OrderProduct[] | Sim |
Order
| Campo | Tipo | Obrigatório |
|-------|------|-------------|
| id | string | Sim |
| aproved | boolean | Sim |
| released | boolean | Sim |
| cartId | string | Não |
| planId | string | Não |
| paymentId | string | Não |
| guildId | string | Sim |
| customerId | string | Não |
| botClient | string | Não |
| paymentProvider | PaymentProvider | Não |
| automatic | boolean | Não |
| pixKey | string | Sim |
| expireAt | Date | Não |
| createdAt | Date | Sim |
| updatedAt | Date | Sim |
OrderPayment
| Campo | Tipo | Obrigatório |
|-------|------|-------------|
| id | string | Sim |
| aproved | boolean | Sim |
Exemplo de uso:
import { ShopEasySdk } from "shopeasy-sdk";
const sdk = new ShopEasySdk({ secretKey: "sua-chave" });
const result = await sdk.orders.create(/* args */);
const result = await sdk.orders.get(/* args */);
const result = await sdk.orders.getPayment(/* args */);sdk.paymentConfig
| Método | Parâmetros | Retorno |
|--------|-----------|--------|
| getOrCreate | guildId: string | PaymentConfig |
| update | args: UpdatePaymentConfigArgs | PaymentConfig |
| getByCaching | guildId: string | PaymentConfig | null |
PaymentConfig
| Campo | Tipo | Obrigatório |
|-------|------|-------------|
| guildId | string | Sim |
| provider | PaymentProvider | null | Não |
| mercadoPagoToken | string | null | Não |
| efiBankToken | string | null | Não |
| chavePix | string | null | Não |
| chavePixType | "CPF" | "EMAIL" | "ALEATORIA" | "NUMERO" | Não |
| chavePixName | string | Não |
| chavePixCity | string | Não |
| walletApiKey | string | Não |
| chavePixchavePixStaticQrCode | boolean | Sim |
UpdatePaymentConfigArgs
| Campo | Tipo | Obrigatório |
|-------|------|-------------|
| guildId | string | Sim |
| data | { | Sim |
| provider | PaymentProvider | null | Não |
| mercadoPagoToken | string | null | Não |
| walletApiKey | string | null | Não |
| efiBankToken | string | null | Não |
| chavePix | string | null | Não |
| chavePixType | "CPF" | "EMAIL" | "ALEATORIA" | "NUMERO" | Não |
| chavePixName | string | Não |
| chavePixCity | string | Não |
| chavePixchavePixStaticQrCode | boolean | Não |
Exemplo de uso:
import { ShopEasySdk } from "shopeasy-sdk";
const sdk = new ShopEasySdk({ secretKey: "sua-chave" });
const result = await sdk.paymentConfig.getOrCreate(/* args */);
const result = await sdk.paymentConfig.update(/* args */);
const result = await sdk.paymentConfig.getByCaching(/* args */);sdk.planss
| Método | Parâmetros | Retorno |
|--------|-----------|--------|
| getByGuild | guildId: string | Plan | null |
| havePlan | guildId: string | PlanType | null |
| create | args: Plan | Plan |
| getExpiring | days?: number | ExpiringPlan[] |
| getExpired | — | ExpiredPlansResponse |
| getPlansNeedingAlert | days?: number | PlansNeedingAlertResponse |
| markAlertSent | guildId: string, daysUntilExpire: number | MarkAlertResponse |
| checkExpirations | — | CheckExpirationsResponse |
| getExpirationStatus | guildId: string | PlanStatus |
| update | guildId: string, updates: Partial<Plan> | Plan |
| delete | guildId: string | void |
| createSubscription | args: PlanSubscriptionCreateArgs | EfiPixCreateResponse |
Plan
| Campo | Tipo | Obrigatório |
|-------|------|-------------|
| guildId | string | Sim |
| type | PlanType | Sim |
| expired | boolean | Sim |
| userId | string | Sim |
| createdAt | Date | null | Sim |
| expireAt | Date | null | Sim |
ExpiredPlansResponse
| Campo | Tipo | Obrigatório |
|-------|------|-------------|
| count | number | Sim |
| plans | Array<{ | Sim |
| guildId | string | Sim |
| userId | string | Sim |
| type | PlanType | Sim |
| expiredAt | Date | null | Sim |
| createdAt | Date | null | Sim |
PlansNeedingAlertResponse
| Campo | Tipo | Obrigatório |
|-------|------|-------------|
| count | number | Sim |
| plans | PlanNeedingAlert[] | Sim |
MarkAlertResponse
| Campo | Tipo | Obrigatório |
|-------|------|-------------|
| success | boolean | Sim |
| message | string | Sim |
CheckExpirationsResponse
| Campo | Tipo | Obrigatório |
|-------|------|-------------|
| expired | { | Sim |
| count | number | Sim |
| plans | Array<{ | Sim |
| guildId | string | Sim |
| userId | string | Sim |
| type | PlanType | Sim |
| expiredAt | Date | null | Sim |
| createdAt | Date | null | Sim |
PlanStatus
| Campo | Tipo | Obrigatório |
|-------|------|-------------|
| active | boolean | Sim |
| expired | boolean | Sim |
| expireAt | Date | Não |
| daysUntilExpire | number | Não |
PlanSubscriptionCreateArgs
| Campo | Tipo | Obrigatório |
|-------|------|-------------|
| guildId | string | Sim |
| userId | string | Sim |
| months | number | Sim |
| plan | "essential" | "complete" | Sim |
EfiPixCreateResponse
| Campo | Tipo | Obrigatório |
|-------|------|-------------|
| calendario | { | Sim |
| criacao | string | Sim |
| expiracao | number | Sim |
Exemplo de uso:
import { ShopEasySdk } from "shopeasy-sdk";
const sdk = new ShopEasySdk({ secretKey: "sua-chave" });
const result = await sdk.planss.getByGuild(/* args */);
const result = await sdk.planss.havePlan(/* args */);
const result = await sdk.planss.create(/* args */);sdk.products
| Método | Parâmetros | Retorno |
|--------|-----------|--------|
| setDraft | args: ProduductDraftSetArgs | Product | null |
| pushStock | {
product, amount, }: ProductStockPushArgs | string[] |
| getDraft | args: ProduductDraftGetArgs | Product | null |
| existsByReference | args: ProductGetByReference | Product | null |
| getById | id: string | Product | null |
| getByReference | reference: string, guildId: string | Product | null |
| create | args: ProductCreateArgs | Product |
| getByCaching | id: string | Product | null |
| getAllByGuild | guildId: string | Array<Product> |
| update | args: ProductUpdateArgs | Product |
| count | guildId: string | number |
| delete | id: string | void |
ProduductDraftSetArgs
| Campo | Tipo | Obrigatório |
|-------|------|-------------|
| id | string | Sim |
| userId | string | Sim |
| data | ProductUpdateArgs["data"] & { | Sim |
| catalogs | string[] | Não |
Product
| Campo | Tipo | Obrigatório |
|-------|------|-------------|
| id | string | Sim |
| reference | string | Sim |
| guildId | string | Sim |
| createdBy | string | Sim |
| status | ProductStatus | Sim |
| title | string | null | Não |
| banned | boolean | null | Sim |
| usersNotifyStock | JsonValue<Array<string>> | null | Sim |
| description | string | null | Sim |
| price | Decimal | Sim |
| discount | Decimal | null | Sim |
| banners | JsonValue<Array<string>> | null | Sim |
| messages | JsonValue<Array<string>> | null | Sim |
| stockMode | StockMode | Sim |
| stockItems | JsonValue<Array<string>> | null | Sim |
| stockText | string | null | Sim |
| stockProductMode | ProductMode | null | Sim |
| stockRepeat | number | null | Sim |
| stockCount | number | null | Sim |
| instructions | string | null | Sim |
| stockMin | number | Sim |
| stockMax | number | Sim |
| chat | boolean | null | Não |
| private | boolean | null | Não |
| deshighlight | boolean | null | Não |
| sell | boolean | null | Não |
| coupon | boolean | Não |
| colorHex | string | null | Não |
| guild | Guild | null | Não |
| sales | SaleProduct[] | Não |
| catalogs | string[] | Não |
ProductStockPushArgs
| Campo | Tipo | Obrigatório |
|-------|------|-------------|
| product | Product | Sim |
| amount | number | Sim |
ProduductDraftGetArgs
| Campo | Tipo | Obrigatório |
|-------|------|-------------|
| id | string | Sim |
| userId | string | Sim |
ProductGetByReference
| Campo | Tipo | Obrigatório |
|-------|------|-------------|
| reference | string | Sim |
| guildId | string | Sim |
ProductCreateArgs
| Campo | Tipo | Obrigatório |
|-------|------|-------------|
| createdBy | string | Sim |
| reference | string | Sim |
| guildId | string | Sim |
ProductUpdateArgs
| Campo | Tipo | Obrigatório |
|-------|------|-------------|
| id | string | Sim |
| data | Omit<Partial<Product>, "id" | "reference"> | Sim |
Exemplo de uso:
import { ShopEasySdk } from "shopeasy-sdk";
const sdk = new ShopEasySdk({ secretKey: "sua-chave" });
const result = await sdk.products.setDraft(/* args */);
const result = await sdk.products.pushStock(/* args */);
const result = await sdk.products.getDraft(/* args */);sdk.sales
| Método | Parâmetros | Retorno |
|--------|-----------|--------|
| create | args: SaleCreateArgs | Sale |
| getById | id: string | Sale | null |
| getAllByGuild | guildId: string | Sale[] |
| saleProductGet | id: string | SaleProduct | null |
| delete | id: string | void |
SaleCreateArgs
| Campo | Tipo | Obrigatório |
|-------|------|-------------|
| userId | string | Sim |
| guildId | string | Sim |
| totalValue | Decimal | Sim |
| products | SaleProductCreateArgs[] | Sim |
Sale
| Campo | Tipo | Obrigatório |
|-------|------|-------------|
| id | string | Sim |
| userId | string | Sim |
| guildId | string | Sim |
| totalValue | Decimal | Sim |
| createdAt | Date | null | Sim |
| guild | Guild | Não |
| customer | Customer | Não |
| saleProducts | SaleProduct[] | Não |
SaleProduct
| Campo | Tipo | Obrigatório |
|-------|------|-------------|
| id | string | Sim |
| saleId | string | Sim |
| productId | string | Sim |
| valueTotal | Decimal | Sim |
| quantity | number | Sim |
| product | Product | Não |
| sale | Sale | Não |
| deliveryStock | JsonValue<Array<string>> | null | Não |
| deliveryPedding | boolean | null | Não |
| deliveryPeddingAmount | number | null | Não |
Exemplo de uso:
import { ShopEasySdk } from "shopeasy-sdk";
const sdk = new ShopEasySdk({ secretKey: "sua-chave" });
const result = await sdk.sales.create(/* args */);
const result = await sdk.sales.getById(/* args */);
const result = await sdk.sales.getAllByGuild(/* args */);sdk.tokens
| Método | Parâmetros | Retorno |
|--------|-----------|--------|
| listUnused | — | Token[] | null |
| update | args: TokenUpdateArgs | Token |
Token
| Campo | Tipo | Obrigatório |
|-------|------|-------------|
| id | string | Sim |
| botId | string | Sim |
| used | boolean | Sim |
| token | string | Sim |
TokenUpdateArgs
| Campo | Tipo | Obrigatório |
|-------|------|-------------|
| id | string | Sim |
| data | Partial<Omit<Token, "id" | "botId">> | Sim |
Exemplo de uso:
import { ShopEasySdk } from "shopeasy-sdk";
const sdk = new ShopEasySdk({ secretKey: "sua-chave" });
const result = await sdk.tokens.listUnused();
const result = await sdk.tokens.update(/* args */);sdk.users
| Método | Parâmetros | Retorno |
|--------|-----------|--------|
| get | userId: string | User | null |
User
| Campo | Tipo | Obrigatório |
|-------|------|-------------|
| id | string | Sim |
| develop | boolean | Não |
Exemplo de uso:
import { ShopEasySdk } from "shopeasy-sdk";
const sdk = new ShopEasySdk({ secretKey: "sua-chave" });
const result = await sdk.users.get(/* args */);sdk.wallet
| Método | Parâmetros | Retorno |
|--------|-----------|--------|
| getOrCreate | userId: string | Wallet |
| getByUserId | userId: string | Wallet |
| getByApiKey | apiKey: string | Wallet |
| update | args: UpdateWalletArgs | Wallet |
| getByCaching | userId: string | Wallet | null |
Wallet
| Campo | Tipo | Obrigatório |
|-------|------|-------------|
| id | string | Sim |
| userId | string | Sim |
| apiKey | string | null | Não |
| balance | WalletBalance | Não |
| gatewayProvider | GatewayProvider | null | Não |
| gatewayConfig | Record<string, unknown> | null | Não |
| isActive | boolean | null | Não |
| createdAt | Date | Sim |
| updatedAt | Date | Sim |
UpdateWalletArgs
| Campo | Tipo | Obrigatório |
|-------|------|-------------|
| userId | string | Sim |
| data | { | Sim |
| apiKey | string | null | Não |
| gatewayProvider | GatewayProvider | null | Não |
| gatewayConfig | Record<string, unknown> | null | Não |
| isActive | boolean | null | Não |
Exemplo de uso:
import { ShopEasySdk } from "shopeasy-sdk";
const sdk = new ShopEasySdk({ secretKey: "sua-chave" });
const result = await sdk.wallet.getOrCreate(/* args */);
const result = await sdk.wallet.getByUserId(/* args */);
const result = await sdk.wallet.getByApiKey(/* args */);Documentação gerada automaticamente em 11/03/2026.
